TransformationTemplate implements TransformationUtilityList { @Override public final String addMultiple(TransformationOperation templateOperation, String... attributes) { return add(new MultipleOperations(templateOperation).setFiles(attributes)); } TransformationTemplate(); abstract Class<? extends Extension> getExtensionClass(); abstract String getDescription(); @Override final String add(TransformationUtility utility); @Override final String add(TransformationUtility utility, String utilityName); @Override final String addMultiple(TransformationOperation templateOperation, String... attributes); final String loop(TransformationUtility utility, int iterations); final String loop(TransformationUtility utility, String attribute); final String loop(TransformationUtility utility, UtilityCondition condition); @Deprecated @Override final void log(String logMessage); @Override final void info(String infoMessage); @Override final void debug(String debugMessage); @Override final void log(Level logLevel, String logMessage); @Deprecated @Override final void log(String logMessage, String... attributeNames); @Override final void info(String infoMessage, String... attributeNames); @Override final void debug(String debugMessage, String... attributeNames); @Override final void log(Level logLevel, String logMessage, String... attributeNames); @Override final List<TransformationUtility> getUtilities(); @Override List<TransformationUtility> getChildren(); @Override final String getName(); @Override final String toString(); String getApplicationType(); String getApplicationName(); void setBlank(boolean blank); boolean isBlank(); static final String BASELINE; }
@Test public void addMultipleTest() { TransformationTemplate transformationTemplate = getNewTestTransformationTemplate(); TransformationOperation<TransformationOperation> transformationOperation = getNewTestTransformationOperation(); assertEquals(transformationTemplate.addMultiple(transformationOperation), "NO_EXTENSION:AnonymousTransformationTemplate-1-MultipleOperations"); assertEquals(transformationTemplate.getUtilities().size(), 1); MultipleOperations multipleOperations = (MultipleOperations) transformationTemplate.getUtilities().get(0); assertEquals(multipleOperations.getTemplateOperation(), transformationOperation); assertEquals(multipleOperations.getFilesAttributes().length, 0); assertNotNull(multipleOperations.getChildren()); assertEquals(multipleOperations.getChildren().size(), 0); assertEquals(transformationTemplate.addMultiple(transformationOperation, "ATT"), "NO_EXTENSION:AnonymousTransformationTemplate-2-MultipleOperations"); assertEquals(transformationTemplate.getUtilities().size(), 2); MultipleOperations multipleOperations2 = (MultipleOperations) transformationTemplate.getUtilities().get(1); assertEquals(multipleOperations2.getTemplateOperation(), transformationOperation); assertEquals(multipleOperations2.getFilesAttributes().length, 1); assertNotNull(multipleOperations2.getChildren()); assertEquals(multipleOperations2.getChildren().size(), 0); }