@Test public void invalid_support_missing() throws Exception { Map<String, String> conf = new HashMap<>(); conf.put(JdbcProcess.TABLE.key(), "PAIR"); conf.put(JdbcProcess.COLUMNS.key(), "KEY,VALUE"); ProcessScript<Pair> process = process(new DriverScript("jdbc", conf), dummy()); GateScript script = script(process); try (JdbcResourceMirror resource = new JdbcResourceMirror(profile(), new ParameterList())) { try { resource.prepare(script); fail(); } catch (IOException e) { } } }
@Override public void prepare(GateScript script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } LOG.debug("Preparing JDBC resource: {}", getName()); for (ProcessScript<?> process : script.getProcesses()) { if (process.getSourceScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.SOURCE); ProcessUtil.newDataModel(profile.getResourceName(), process); } if (process.getDrainScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.DRAIN); } } }
JdbcResourceMirror extends ResourceMirror { @Override public void prepare(GateScript script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } LOG.debug("Preparing JDBC resource: {}", getName()); for (ProcessScript<?> process : script.getProcesses()) { if (process.getSourceScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.SOURCE); ProcessUtil.newDataModel(profile.getResourceName(), process); } if (process.getDrainScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.DRAIN); } } } }
JdbcResourceMirror extends ResourceMirror { @Override public void prepare(GateScript script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } LOG.debug("Preparing JDBC resource: {}", getName()); for (ProcessScript<?> process : script.getProcesses()) { if (process.getSourceScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.SOURCE); ProcessUtil.newDataModel(profile.getResourceName(), process); } if (process.getDrainScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.DRAIN); } } } JdbcResourceMirror(JdbcProfile profile, ParameterList arguments); }
JdbcResourceMirror extends ResourceMirror { @Override public void prepare(GateScript script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } LOG.debug("Preparing JDBC resource: {}", getName()); for (ProcessScript<?> process : script.getProcesses()) { if (process.getSourceScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.SOURCE); ProcessUtil.newDataModel(profile.getResourceName(), process); } if (process.getDrainScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.DRAIN); } } } JdbcResourceMirror(JdbcProfile profile, ParameterList arguments); @Override String getName(); @Override void prepare(GateScript script); @Override SourceDriver<T> createSource(ProcessScript<T> script); @Override DrainDriver<T> createDrain(ProcessScript<T> script); @Override void close(); }
JdbcResourceMirror extends ResourceMirror { @Override public void prepare(GateScript script) throws IOException { if (script == null) { throw new IllegalArgumentException("script must not be null"); } LOG.debug("Preparing JDBC resource: {}", getName()); for (ProcessScript<?> process : script.getProcesses()) { if (process.getSourceScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.SOURCE); ProcessUtil.newDataModel(profile.getResourceName(), process); } if (process.getDrainScript().getResourceName().equals(getName())) { JdbcResourceUtil.convert(profile, process, arguments, DriverScript.Kind.DRAIN); } } } JdbcResourceMirror(JdbcProfile profile, ParameterList arguments); @Override String getName(); @Override void prepare(GateScript script); @Override SourceDriver<T> createSource(ProcessScript<T> script); @Override DrainDriver<T> createDrain(ProcessScript<T> script); @Override void close();  }