@Test(expected = IllegalArgumentException.class) public void loadFrom_invalid_dataclass() { Properties p = new Properties(); p.setProperty(k("test", KEY_DATA_CLASS), "INVALID-DATA-CLASS"); p.setProperty(k("test", KEY_PROCESS_TYPE), "plain"); p.setProperty(k("test", PREFIX_SOURCE), "ts"); p.setProperty(k("test", PREFIX_DRAIN), "td"); GateScript.loadFrom("testing", p, getClass().getClassLoader()); }
public static GateScript loadFrom(String name, Properties properties, ClassLoader loader) { if (name == null) { throw new IllegalArgumentException("name must not be null"); } if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } if (loader == null) { throw new IllegalArgumentException("loader must not be null"); } LOG.debug("Restoring WindGate script"); Map<String, Map<String, String>> partitions = partitioning(properties); List<ProcessScript<?>> processes = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : partitions.entrySet()) { LOG.debug("Restoring WindGate process: {}", entry.getKey()); ProcessScript<?> process = loadProcess(entry.getKey(), entry.getValue(), loader); processes.add(process); } return new GateScript(name, processes); }
GateScript { public static GateScript loadFrom(String name, Properties properties, ClassLoader loader) { if (name == null) { throw new IllegalArgumentException("name must not be null"); } if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } if (loader == null) { throw new IllegalArgumentException("loader must not be null"); } LOG.debug("Restoring WindGate script"); Map<String, Map<String, String>> partitions = partitioning(properties); List<ProcessScript<?>> processes = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : partitions.entrySet()) { LOG.debug("Restoring WindGate process: {}", entry.getKey()); ProcessScript<?> process = loadProcess(entry.getKey(), entry.getValue(), loader); processes.add(process); } return new GateScript(name, processes); } }
GateScript { public static GateScript loadFrom(String name, Properties properties, ClassLoader loader) { if (name == null) { throw new IllegalArgumentException("name must not be null"); } if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } if (loader == null) { throw new IllegalArgumentException("loader must not be null"); } LOG.debug("Restoring WindGate script"); Map<String, Map<String, String>> partitions = partitioning(properties); List<ProcessScript<?>> processes = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : partitions.entrySet()) { LOG.debug("Restoring WindGate process: {}", entry.getKey()); ProcessScript<?> process = loadProcess(entry.getKey(), entry.getValue(), loader); processes.add(process); } return new GateScript(name, processes); } GateScript(String name, List<? extends ProcessScript<?>> processes); }
GateScript { public static GateScript loadFrom(String name, Properties properties, ClassLoader loader) { if (name == null) { throw new IllegalArgumentException("name must not be null"); } if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } if (loader == null) { throw new IllegalArgumentException("loader must not be null"); } LOG.debug("Restoring WindGate script"); Map<String, Map<String, String>> partitions = partitioning(properties); List<ProcessScript<?>> processes = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : partitions.entrySet()) { LOG.debug("Restoring WindGate process: {}", entry.getKey()); ProcessScript<?> process = loadProcess(entry.getKey(), entry.getValue(), loader); processes.add(process); } return new GateScript(name, processes); } GateScript(String name, List<? extends ProcessScript<?>> processes); String getName(); List<ProcessScript<?>> getProcesses(); static GateScript loadFrom(String name, Properties properties, ClassLoader loader); void storeTo(Properties properties); }
GateScript { public static GateScript loadFrom(String name, Properties properties, ClassLoader loader) { if (name == null) { throw new IllegalArgumentException("name must not be null"); } if (properties == null) { throw new IllegalArgumentException("properties must not be null"); } if (loader == null) { throw new IllegalArgumentException("loader must not be null"); } LOG.debug("Restoring WindGate script"); Map<String, Map<String, String>> partitions = partitioning(properties); List<ProcessScript<?>> processes = new ArrayList<>(); for (Map.Entry<String, Map<String, String>> entry : partitions.entrySet()) { LOG.debug("Restoring WindGate process: {}", entry.getKey()); ProcessScript<?> process = loadProcess(entry.getKey(), entry.getValue(), loader); processes.add(process); } return new GateScript(name, processes); } GateScript(String name, List<? extends ProcessScript<?>> processes); String getName(); List<ProcessScript<?>> getProcesses(); static GateScript loadFrom(String name, Properties properties, ClassLoader loader); void storeTo(Properties properties);  }