diff --git a/proposal/myrmidon/src/test/org/apache/antlib/core/test/IfTestCase.java b/proposal/myrmidon/src/test/org/apache/antlib/core/test/IfTestCase.java deleted file mode 100644 index ce07846df..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/core/test/IfTestCase.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE.txt file. - */ -package org.apache.antlib.core.test; - -import java.io.File; -import org.apache.avalon.excalibur.i18n.Resources; -import org.apache.myrmidon.AbstractProjectTest; -import org.apache.myrmidon.LogMessageTracker; - -/** - * Test cases for the task. - * - * @author Adam Murdoch - * @version $Revision$ $Date$ - */ -public class IfTestCase - extends AbstractProjectTest -{ - private final static Resources REZ = getResourcesForTested( IfTestCase.class ); - - public IfTestCase( String name ) - { - super( name ); - } - - /** - * Test checking whether a property is set and not 'false'. - */ - public void testConditions() - throws Exception - { - final File projectFile = getTestResource( "if.ant" ); - - // Test when property is set to 'true' - LogMessageTracker listener = new LogMessageTracker(); - listener.addExpectedMessage( "true-prop", "test-prop is set" ); - executeTarget( projectFile, "true-prop", listener ); - - // Test when property is set to a value other than 'true' or 'false' - executeTargetExpectError( projectFile, "set-prop", new String[ 0 ] ); - - // Test when property is set to 'false' - listener = new LogMessageTracker(); - listener.addExpectedMessage( "false-prop", "test-prop is not set" ); - executeTarget( projectFile, "false-prop", listener ); - - // Test when property is not set - listener = new LogMessageTracker(); - listener.addExpectedMessage( "not-set-prop", "test-prop is not set" ); - executeTarget( projectFile, "not-set-prop", listener ); - } - - /** - * Test nested elements. - */ - public void testNestedConditions() - throws Exception - { - final File projectFile = getTestResource( "if.ant" ); - - // Test when property is set to 'true' - LogMessageTracker listener = new LogMessageTracker(); - listener.addExpectedMessage( "nested-conditions", "prop-true is set" ); - listener.addExpectedMessage( "nested-conditions", "prop-false is set" ); - listener.addExpectedMessage( "nested-conditions", "prop-true is true" ); - listener.addExpectedMessage( "nested-conditions", - "prop-true is true and prop-false is not true" ); - executeTarget( projectFile, "nested-conditions", listener ); - } - - /** - * Tests that the task can handle multiple nested tasks. - */ - public void testMultipleTasks() throws Exception - { - final File projectFile = getTestResource( "if.ant" ); - - // Test when property is not set - LogMessageTracker listener = new LogMessageTracker(); - listener.addExpectedMessage( "multiple-nested-tasks", "task 1" ); - listener.addExpectedMessage( "multiple-nested-tasks", "task 2" ); - listener.addExpectedMessage( "multiple-nested-tasks", "task 3" ); - listener.addExpectedMessage( "multiple-nested-tasks", "task 4" ); - executeTarget( projectFile, "multiple-nested-tasks", listener ); - } - - /** - * Tests validation. - */ - public void testValidation() throws Exception - { - final File projectFile = getTestResource( "if.ant" ); - - // Check for missing condition - String[] messages = { - null, - REZ.getString( "if.no-condition.error" ) - }; - executeTargetExpectError( projectFile, "no-condition", messages ); - - // Check for too many conditions - messages = new String[] - { - null, - null, - REZ.getString( "if.ifelse-duplicate.error" ) - }; - // 2 condition attributes. - executeTargetExpectError( projectFile, "too-many-conditions", messages ); - - // attribute condition + nested condition - executeTargetExpectError( projectFile, "attribute-plus-nested-condition", - messages ); - - // 2 nested conditions - executeTargetExpectError( projectFile, "2-nested-conditions", messages ); - } - -} diff --git a/proposal/myrmidon/src/test/org/apache/antlib/core/test/PropertyTestCase.java b/proposal/myrmidon/src/test/org/apache/antlib/core/test/PropertyTestCase.java deleted file mode 100644 index 03a2ce8f5..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/core/test/PropertyTestCase.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE.txt file. - */ -package org.apache.antlib.core.test; - -import java.io.File; -import org.apache.avalon.excalibur.i18n.ResourceManager; -import org.apache.avalon.excalibur.i18n.Resources; -import org.apache.myrmidon.AbstractProjectTest; -import org.apache.myrmidon.LogMessageTracker; -import org.apache.myrmidon.components.workspace.DefaultTaskContext; -import org.apache.myrmidon.components.store.DefaultPropertyStore; - -/** - * Test cases for task. - * - * @author Adam Murdoch - * @version $Revision$ $Date$ - */ -public class PropertyTestCase - extends AbstractProjectTest -{ - private final static Resources REZ = getResourcesForTested( PropertyTestCase.class ); - - public PropertyTestCase( final String name ) - { - super( name ); - } - - /** - * Tests setting a property, using an attribute, text content, and - * nested element. - */ - public void testSetProperty() - throws Exception - { - final File projectFile = getTestResource( "property.ant" ); - - // Set by attribute - LogMessageTracker tracker = new LogMessageTracker(); - tracker.addExpectedMessage( "set-attr", "test-prop = [some value]" ); - executeTarget( projectFile, "set-attr", tracker ); - - // Set by text content - tracker = new LogMessageTracker(); - tracker.addExpectedMessage( "set-content", "test-prop2 = [some value]" ); - executeTarget( projectFile, "set-content", tracker ); - - // Set by nested element - tracker = new LogMessageTracker(); - tracker.addExpectedMessage( "set-element", "test-prop3 = [value=[some value]]" ); - executeTarget( projectFile, "set-element", tracker ); - } - - /** - * Tests the validation performed by the propery task. - */ - public void testValidation() - throws Exception - { - final File projectFile = getTestResource( "property.ant" ); - - // Missing name - String[] messages = - { - null, - REZ.getString( "property.no-name.error" ) - }; - executeTargetExpectError( projectFile, "missing-name", messages ); - - // Missing value - messages = new String[] - { - null, - REZ.getString( "property.no-value.error" ) - }; - executeTargetExpectError( projectFile, "missing-value", messages ); - - // Too many values - messages = new String[] - { - null, - null, - REZ.getString( "property.multi-set.error" ) - }; - executeTargetExpectError( projectFile, "too-many-values1", messages ); - executeTargetExpectError( projectFile, "too-many-values2", messages ); - executeTargetExpectError( projectFile, "too-many-values3", messages ); - } - - /** - * Tests basic validation of property names. - */ - public void testNameValidation() throws Exception - { - final File projectFile = getTestResource( "property.ant" ); - - final Resources rez - = ResourceManager.getPackageResources( DefaultPropertyStore.class ); - - // Invalid names - String[] messages = new String[] - { - null, - rez.getString( "bad-property-name.error", "badname!" ) - }; - executeTargetExpectError( projectFile, "bad-prop-name1", messages ); - - messages = new String[] - { - null, - rez.getString( "bad-property-name.error", "bad name" ) - }; - executeTargetExpectError( projectFile, "bad-prop-name2", messages ); - - messages = new String[] - { - null, - rez.getString( "bad-property-name.error", "" ) - }; - executeTargetExpectError( projectFile, "bad-prop-name3", messages ); - } - -} diff --git a/proposal/myrmidon/src/test/org/apache/antlib/core/test/PropertyTestType.java b/proposal/myrmidon/src/test/org/apache/antlib/core/test/PropertyTestType.java deleted file mode 100644 index 27510eb79..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/core/test/PropertyTestType.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE.txt file. - */ -package org.apache.antlib.core.test; - -import org.apache.myrmidon.framework.DataType; - -/** - * A test data-type used by the property tests. - * - * @author Adam Murdoch - * @version $Revision$ $Date$ - * - * @ant.data-type name="property-test-type" - */ -public class PropertyTestType - implements DataType -{ - private String m_value; - - public void setValue( final String value ) - { - m_value = value; - } - - /** - * Used in the test project file to check the value has been set. - */ - public String toString() - { - return "value=[" + m_value + "]"; - } -} diff --git a/proposal/myrmidon/src/test/org/apache/antlib/core/test/if.ant b/proposal/myrmidon/src/test/org/apache/antlib/core/test/if.ant deleted file mode 100644 index 3dd4c3e08..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/core/test/if.ant +++ /dev/null @@ -1,137 +0,0 @@ - - - - - test-prop is set - - - test-prop is not set - - - - - - - test-prop is set - - - test-prop is not set - - - - - - test-prop is set - - - test-prop is not set - - - - - - - test-prop is set - - - test-prop is not set - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - task 1 - task 2 - task 3 - task 4 - - - - - - no go - - - - - - no go - - - - - - - - - - Double trouble. - - - - - - - - - - - - - 2 conditions not permitted. - - - - \ No newline at end of file diff --git a/proposal/myrmidon/src/test/org/apache/antlib/core/test/property.ant b/proposal/myrmidon/src/test/org/apache/antlib/core/test/property.ant deleted file mode 100644 index 03cad74a0..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/core/test/property.ant +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - test-prop = [${test-prop}] - - - - - some value - test-prop2 = [${test-prop2}] - - - - - - - - test-prop3 = [${test-prop3}] - - - - - - - - - - - - - - - another value - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/CopyFilesTaskTestCase.java b/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/CopyFilesTaskTestCase.java deleted file mode 100644 index ad84a0219..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/CopyFilesTaskTestCase.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) The Apache Software Foundation. All rights reserved. - * - * This software is published under the terms of the Apache Software License - * version 1.1, a copy of which has been included with this distribution in - * the LICENSE.txt file. - */ -package org.apache.antlib.vfile.test; - -import java.io.File; -import org.apache.myrmidon.AbstractProjectTest; - -/** - * Test cases for the task. - * - * @author Adam Murdoch - * @version $Revision$ $Date$ - */ -public class CopyFilesTaskTestCase - extends AbstractProjectTest -{ - public CopyFilesTaskTestCase( String name ) - { - super( name ); - } - - /** - * A simple smoke test. - */ - public void testCopy() throws Exception - { - final File projectFile = getTestResource( "copy.ant" ); - executeTarget( projectFile, "copy" ); - } -} diff --git a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/copy.ant b/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/copy.ant deleted file mode 100644 index 18ea5067c..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/copy.ant +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/src/emptyFile.txt b/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/src/emptyFile.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/src/file1.txt b/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/src/file1.txt deleted file mode 100644 index 9ad7b1b57..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/src/file1.txt +++ /dev/null @@ -1 +0,0 @@ -A test file. \ No newline at end of file diff --git a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/src/subdir1/someFile.html b/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/src/subdir1/someFile.html deleted file mode 100644 index c769030c0..000000000 --- a/proposal/myrmidon/src/test/org/apache/antlib/vfile/test/src/subdir1/someFile.html +++ /dev/null @@ -1,5 +0,0 @@ - - -

Yo!

- -