@Test public void parameters() { Mock desc = new Mock("testing/${var}", StringSupport.class); DriverScript script = desc.getDriverScript(); assertThat(script.getResourceName(), is(Constants.LOCAL_FILE_RESOURCE_NAME)); assertThat(script.getConfiguration(), hasEntry(FileProcess.FILE.key(), "testing/${var}")); assertThat(script.getConfiguration(), hasEntry(StreamProcess.STREAM_SUPPORT.key(), StringSupport.class.getName())); assertThat(script.getParameterNames(), containsInAnyOrder("var")); }
@Override public final DriverScript getDriverScript() { String descriptionClass = getClass().getName(); Class<?> modelType = getModelType(); String path = getPath(); Class<? extends DataModelStreamSupport<?>> supportClass = getStreamSupport(); FsDescriptionUtil.checkCommonConfig(descriptionClass, modelType, supportClass, path); Map<String, String> configuration = new HashMap<>(); configuration.put(FileProcess.FILE.key(), path); configuration.put(StreamProcess.STREAM_SUPPORT.key(), supportClass.getName()); Set<String> parameters = VariableTable.collectVariableNames(path); return new DriverScript(Constants.LOCAL_FILE_RESOURCE_NAME, configuration, parameters); }
FsExporterDescription extends WindGateExporterDescription { @Override public final DriverScript getDriverScript() { String descriptionClass = getClass().getName(); Class<?> modelType = getModelType(); String path = getPath(); Class<? extends DataModelStreamSupport<?>> supportClass = getStreamSupport(); FsDescriptionUtil.checkCommonConfig(descriptionClass, modelType, supportClass, path); Map<String, String> configuration = new HashMap<>(); configuration.put(FileProcess.FILE.key(), path); configuration.put(StreamProcess.STREAM_SUPPORT.key(), supportClass.getName()); Set<String> parameters = VariableTable.collectVariableNames(path); return new DriverScript(Constants.LOCAL_FILE_RESOURCE_NAME, configuration, parameters); } }
FsExporterDescription extends WindGateExporterDescription { @Override public final DriverScript getDriverScript() { String descriptionClass = getClass().getName(); Class<?> modelType = getModelType(); String path = getPath(); Class<? extends DataModelStreamSupport<?>> supportClass = getStreamSupport(); FsDescriptionUtil.checkCommonConfig(descriptionClass, modelType, supportClass, path); Map<String, String> configuration = new HashMap<>(); configuration.put(FileProcess.FILE.key(), path); configuration.put(StreamProcess.STREAM_SUPPORT.key(), supportClass.getName()); Set<String> parameters = VariableTable.collectVariableNames(path); return new DriverScript(Constants.LOCAL_FILE_RESOURCE_NAME, configuration, parameters); }  }
FsExporterDescription extends WindGateExporterDescription { @Override public final DriverScript getDriverScript() { String descriptionClass = getClass().getName(); Class<?> modelType = getModelType(); String path = getPath(); Class<? extends DataModelStreamSupport<?>> supportClass = getStreamSupport(); FsDescriptionUtil.checkCommonConfig(descriptionClass, modelType, supportClass, path); Map<String, String> configuration = new HashMap<>(); configuration.put(FileProcess.FILE.key(), path); configuration.put(StreamProcess.STREAM_SUPPORT.key(), supportClass.getName()); Set<String> parameters = VariableTable.collectVariableNames(path); return new DriverScript(Constants.LOCAL_FILE_RESOURCE_NAME, configuration, parameters); }  abstract String getPath(); abstract Class<? extends DataModelStreamSupport<?>> getStreamSupport(); @Override final DriverScript getDriverScript(); }
FsExporterDescription extends WindGateExporterDescription { @Override public final DriverScript getDriverScript() { String descriptionClass = getClass().getName(); Class<?> modelType = getModelType(); String path = getPath(); Class<? extends DataModelStreamSupport<?>> supportClass = getStreamSupport(); FsDescriptionUtil.checkCommonConfig(descriptionClass, modelType, supportClass, path); Map<String, String> configuration = new HashMap<>(); configuration.put(FileProcess.FILE.key(), path); configuration.put(StreamProcess.STREAM_SUPPORT.key(), supportClass.getName()); Set<String> parameters = VariableTable.collectVariableNames(path); return new DriverScript(Constants.LOCAL_FILE_RESOURCE_NAME, configuration, parameters); }  abstract String getPath(); abstract Class<? extends DataModelStreamSupport<?>> getStreamSupport(); @Override final DriverScript getDriverScript();  }