ie Test code for package foo is located in package foo.test * Migrated all the test data into the same hierarchy so that there is only one place where you have to look for test data. This required that resource retrieval be hackled a little because no longer in same package as tested code/ git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271870 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -5,10 +5,9 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.antlib.core; | |||||
| package org.apache.antlib.core.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.myrmidon.AbstractProjectTest; | import org.apache.myrmidon.AbstractProjectTest; | ||||
| import org.apache.myrmidon.LogMessageTracker; | import org.apache.myrmidon.LogMessageTracker; | ||||
| @@ -19,13 +18,12 @@ import org.apache.myrmidon.LogMessageTracker; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class IfTest | |||||
| public class IfTestCase | |||||
| extends AbstractProjectTest | extends AbstractProjectTest | ||||
| { | { | ||||
| private final static Resources REZ = | |||||
| ResourceManager.getPackageResources( IfTest.class ); | |||||
| private final static Resources REZ = getResourcesForTested( IfTestCase.class ); | |||||
| public IfTest( String name ) | |||||
| public IfTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.antlib.core; | |||||
| package org.apache.antlib.core.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
| @@ -20,13 +20,12 @@ import org.apache.myrmidon.components.workspace.DefaultTaskContext; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class PropertyTest | |||||
| public class PropertyTestCase | |||||
| extends AbstractProjectTest | extends AbstractProjectTest | ||||
| { | { | ||||
| private final static Resources REZ | |||||
| = ResourceManager.getPackageResources( PropertyTest.class ); | |||||
| private final static Resources REZ = getResourcesForTested( PropertyTestCase.class ); | |||||
| public PropertyTest( final String name ) | |||||
| public PropertyTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -66,10 +65,10 @@ public class PropertyTest | |||||
| // Missing name | // Missing name | ||||
| String[] messages = | String[] messages = | ||||
| { | |||||
| null, | |||||
| REZ.getString( "property.no-name.error" ) | |||||
| }; | |||||
| { | |||||
| null, | |||||
| REZ.getString( "property.no-name.error" ) | |||||
| }; | |||||
| executeTargetExpectError( projectFile, "missing-name", messages ); | executeTargetExpectError( projectFile, "missing-name", messages ); | ||||
| // Missing value | // Missing value | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.antlib.core; | |||||
| package org.apache.antlib.core.test; | |||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| @@ -0,0 +1,63 @@ | |||||
| <project version="2.0"> | |||||
| <target name="true-prop"> | |||||
| <property name="test-prop" value="true"/> | |||||
| <if test="test-prop"> | |||||
| <log>test-prop is set</log> | |||||
| </if> | |||||
| <if not-test="test-prop"> | |||||
| <log>test-prop is not set</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="set-prop"> | |||||
| <property name="test-prop" value="some value"/> | |||||
| <if test="test-prop"> | |||||
| <log>test-prop is set</log> | |||||
| </if> | |||||
| <if not-test="test-prop"> | |||||
| <log>test-prop is not set</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="not-set-prop"> | |||||
| <if test="test-prop"> | |||||
| <log>test-prop is set</log> | |||||
| </if> | |||||
| <if not-test="test-prop"> | |||||
| <log>test-prop is not set</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="false-prop"> | |||||
| <property name="test-prop" value="false"/> | |||||
| <if test="test-prop"> | |||||
| <log>test-prop is set</log> | |||||
| </if> | |||||
| <if not-test="test-prop"> | |||||
| <log>test-prop is not set</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="multiple-nested-tasks"> | |||||
| <property name="test-prop" value="true"/> | |||||
| <if test="test-prop"> | |||||
| <log>task 1</log> | |||||
| <log>task 2</log> | |||||
| <log>task 3</log> | |||||
| <log>task 4</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="no-condition"> | |||||
| <if> | |||||
| <log>no go</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="too-many-conditions"> | |||||
| <if test="test-prop" not-test="test-prop"> | |||||
| <log>no go</log> | |||||
| </if> | |||||
| </target> | |||||
| </project> | |||||
| @@ -0,0 +1,65 @@ | |||||
| <project version="2.0"> | |||||
| <!-- Test setting property via attribute --> | |||||
| <target name="set-attr"> | |||||
| <property name="test-prop" value="some value"/> | |||||
| <log>test-prop = [${test-prop}]</log> | |||||
| </target> | |||||
| <!-- Test setting property via content --> | |||||
| <target name="set-content"> | |||||
| <property name="test-prop2">some value</property> | |||||
| <log>test-prop2 = [${test-prop2}]</log> | |||||
| </target> | |||||
| <!-- Test setting property via a nested element --> | |||||
| <target name="set-element"> | |||||
| <property name="test-prop3"> | |||||
| <property-test-type value="some value"/> | |||||
| </property> | |||||
| <log>test-prop3 = [${test-prop3}]</log> | |||||
| </target> | |||||
| <!-- Test missing property name --> | |||||
| <target name="missing-name"> | |||||
| <property value="some value"/> | |||||
| </target> | |||||
| <!-- Test missing property value --> | |||||
| <target name="missing-value"> | |||||
| <property name="some-prop"/> | |||||
| </target> | |||||
| <!-- Test setting the value more than once --> | |||||
| <target name="too-many-values1"> | |||||
| <property name="some-prop" value="some value">another value</property> | |||||
| </target> | |||||
| <!-- Test setting the value more than once --> | |||||
| <target name="too-many-values2"> | |||||
| <property name="some-prop" value="some value"> | |||||
| <property-test-type value="value 2"/> | |||||
| </property> | |||||
| </target> | |||||
| <!-- Test setting the value more than once --> | |||||
| <target name="too-many-values3"> | |||||
| <property name="some-prop"> | |||||
| <property-test-type value="value 1"/> | |||||
| <property-test-type value="value 2"/> | |||||
| <property-test-type value="value 3"/> | |||||
| </property> | |||||
| </target> | |||||
| <!-- Test properties with invalid names --> | |||||
| <target name="bad-prop-name1"> | |||||
| <property name="badname!" value="value"/> | |||||
| </target> | |||||
| <target name="bad-prop-name2"> | |||||
| <property name="bad name" value="value"/> | |||||
| </target> | |||||
| <target name="bad-prop-name3"> | |||||
| <property name="" value="value"/> | |||||
| </target> | |||||
| </project> | |||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.antlib.vfile; | |||||
| package org.apache.antlib.vfile.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.myrmidon.AbstractProjectTest; | import org.apache.myrmidon.AbstractProjectTest; | ||||
| @@ -16,10 +16,10 @@ import org.apache.myrmidon.AbstractProjectTest; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class CopyFilesTaskTest | |||||
| public class CopyFilesTaskTestCase | |||||
| extends AbstractProjectTest | extends AbstractProjectTest | ||||
| { | { | ||||
| public CopyFilesTaskTest( String name ) | |||||
| public CopyFilesTaskTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -0,0 +1,8 @@ | |||||
| <project version="2.0"> | |||||
| <target name="copy"> | |||||
| <v-fileset id="src-files" dir="src"/> | |||||
| <v-copy destdir="dest"> | |||||
| <v-fileset-ref id="src-files"/> | |||||
| </v-copy> | |||||
| </target> | |||||
| </project> | |||||
| @@ -0,0 +1 @@ | |||||
| A test file. | |||||
| @@ -0,0 +1,5 @@ | |||||
| <html> | |||||
| <body> | |||||
| <p>Yo!</p> | |||||
| </body> | |||||
| </html> | |||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.bzip2; | |||||
| package org.apache.aut.bzip2.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.FileInputStream; | import java.io.FileInputStream; | ||||
| @@ -16,6 +16,8 @@ import java.io.OutputStream; | |||||
| import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
| import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
| import org.apache.avalon.excalibur.io.IOUtil; | import org.apache.avalon.excalibur.io.IOUtil; | ||||
| import org.apache.aut.bzip2.CBZip2OutputStream; | |||||
| import org.apache.aut.bzip2.CBZip2InputStream; | |||||
| /** | /** | ||||
| * A test the stress tested the BZip implementation to verify | * A test the stress tested the BZip implementation to verify | ||||
| @@ -24,12 +26,12 @@ import org.apache.avalon.excalibur.io.IOUtil; | |||||
| * @author <a href="mailto:peter@apache.org">Peter Donald</a> | * @author <a href="mailto:peter@apache.org">Peter Donald</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class BzipTest | |||||
| public class BzipTestCase | |||||
| extends TestCase | extends TestCase | ||||
| { | { | ||||
| private final static byte[] HEADER = new byte[]{(byte)'B', (byte)'Z'}; | private final static byte[] HEADER = new byte[]{(byte)'B', (byte)'Z'}; | ||||
| public BzipTest( final String name ) | |||||
| public BzipTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.vfs; | |||||
| package org.apache.aut.vfs.test; | |||||
| import java.io.ByteArrayOutputStream; | import java.io.ByteArrayOutputStream; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| @@ -16,6 +16,12 @@ import java.util.List; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| import org.apache.aut.vfs.impl.DefaultFileSystemManager; | import org.apache.aut.vfs.impl.DefaultFileSystemManager; | ||||
| import org.apache.aut.vfs.provider.AbstractFileObject; | import org.apache.aut.vfs.provider.AbstractFileObject; | ||||
| import org.apache.aut.vfs.FileObject; | |||||
| import org.apache.aut.vfs.FileType; | |||||
| import org.apache.aut.vfs.FileSystemException; | |||||
| import org.apache.aut.vfs.FileName; | |||||
| import org.apache.aut.vfs.NameScope; | |||||
| import org.apache.aut.vfs.FileContent; | |||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.myrmidon.AbstractMyrmidonTest; | import org.apache.myrmidon.AbstractMyrmidonTest; | ||||
| @@ -29,7 +35,7 @@ import org.apache.myrmidon.AbstractMyrmidonTest; | |||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public abstract class AbstractFileSystemTest | |||||
| public abstract class AbstractFileSystemTestCase | |||||
| extends AbstractMyrmidonTest | extends AbstractMyrmidonTest | ||||
| { | { | ||||
| private final static Resources REZ | private final static Resources REZ | ||||
| @@ -41,7 +47,7 @@ public abstract class AbstractFileSystemTest | |||||
| // Contents of "file1.txt" | // Contents of "file1.txt" | ||||
| private String m_charContent; | private String m_charContent; | ||||
| public AbstractFileSystemTest( String name ) | |||||
| public AbstractFileSystemTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,7 +5,9 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.vfs; | |||||
| package org.apache.aut.vfs.test; | |||||
| import org.apache.aut.vfs.test.AbstractFileSystemTestCase; | |||||
| /** | /** | ||||
| * File system tests which check that a read-only file system cannot be | * File system tests which check that a read-only file system cannot be | ||||
| @@ -13,9 +15,9 @@ package org.apache.aut.vfs; | |||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public abstract class AbstractReadOnlyFileSystemTest extends AbstractFileSystemTest | |||||
| public abstract class AbstractReadOnlyFileSystemTestCase extends AbstractFileSystemTestCase | |||||
| { | { | ||||
| public AbstractReadOnlyFileSystemTest( String name ) | |||||
| public AbstractReadOnlyFileSystemTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,21 +5,25 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.vfs; | |||||
| package org.apache.aut.vfs.test; | |||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.util.HashSet; | import java.util.HashSet; | ||||
| import java.util.Set; | import java.util.Set; | ||||
| import org.apache.aut.vfs.test.AbstractFileSystemTestCase; | |||||
| import org.apache.aut.vfs.FileObject; | |||||
| import org.apache.aut.vfs.FileType; | |||||
| import org.apache.aut.vfs.FileSystemException; | |||||
| /** | /** | ||||
| * File system test that check that a file system can be modified. | * File system test that check that a file system can be modified. | ||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public abstract class AbstractWritableFileSystemTest | |||||
| extends AbstractFileSystemTest | |||||
| public abstract class AbstractWritableFileSystemTestCase | |||||
| extends AbstractFileSystemTestCase | |||||
| { | { | ||||
| public AbstractWritableFileSystemTest( String name ) | |||||
| public AbstractWritableFileSystemTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,19 +5,21 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.vfs; | |||||
| package org.apache.aut.vfs.test; | |||||
| import org.apache.aut.vfs.provider.ftp.FtpFileSystemProvider; | import org.apache.aut.vfs.provider.ftp.FtpFileSystemProvider; | ||||
| import org.apache.aut.vfs.test.AbstractWritableFileSystemTestCase; | |||||
| import org.apache.aut.vfs.FileObject; | |||||
| /** | /** | ||||
| * Tests for FTP file systems. | * Tests for FTP file systems. | ||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class FtpFileSystemTest | |||||
| extends AbstractWritableFileSystemTest | |||||
| public class FtpFileSystemTestCase | |||||
| extends AbstractWritableFileSystemTestCase | |||||
| { | { | ||||
| public FtpFileSystemTest( String name ) | |||||
| public FtpFileSystemTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,18 +5,20 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.vfs; | |||||
| package org.apache.aut.vfs.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.aut.vfs.test.AbstractWritableFileSystemTestCase; | |||||
| import org.apache.aut.vfs.FileObject; | |||||
| /** | /** | ||||
| * Tests for the local file system. | * Tests for the local file system. | ||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class LocalFileSystemTest extends AbstractWritableFileSystemTest | |||||
| public class LocalFileSystemTestCase extends AbstractWritableFileSystemTestCase | |||||
| { | { | ||||
| public LocalFileSystemTest( String name ) | |||||
| public LocalFileSystemTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,19 +5,21 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.vfs; | |||||
| package org.apache.aut.vfs.test; | |||||
| import org.apache.aut.vfs.provider.zip.ZipFileSystemProvider; | import org.apache.aut.vfs.provider.zip.ZipFileSystemProvider; | ||||
| import org.apache.aut.vfs.test.AbstractReadOnlyFileSystemTestCase; | |||||
| import org.apache.aut.vfs.FileObject; | |||||
| /** | /** | ||||
| * Tests for the Zip file system, using a zip file nested inside another zip file. | * Tests for the Zip file system, using a zip file nested inside another zip file. | ||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class NestedZipFileSystemTest | |||||
| extends AbstractReadOnlyFileSystemTest | |||||
| public class NestedZipFileSystemTestCase | |||||
| extends AbstractReadOnlyFileSystemTestCase | |||||
| { | { | ||||
| public NestedZipFileSystemTest( String name ) | |||||
| public NestedZipFileSystemTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,18 +5,20 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.vfs; | |||||
| package org.apache.aut.vfs.test; | |||||
| import org.apache.aut.vfs.provider.smb.SmbFileSystemProvider; | import org.apache.aut.vfs.provider.smb.SmbFileSystemProvider; | ||||
| import org.apache.aut.vfs.test.AbstractWritableFileSystemTestCase; | |||||
| import org.apache.aut.vfs.FileObject; | |||||
| /** | /** | ||||
| * Tests for the SMB file system. | * Tests for the SMB file system. | ||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class SmbFileSystemTest extends AbstractWritableFileSystemTest | |||||
| public class SmbFileSystemTestCase extends AbstractWritableFileSystemTestCase | |||||
| { | { | ||||
| public SmbFileSystemTest( String name ) | |||||
| public SmbFileSystemTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,19 +5,21 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.vfs; | |||||
| package org.apache.aut.vfs.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.aut.vfs.provider.zip.ZipFileSystemProvider; | import org.apache.aut.vfs.provider.zip.ZipFileSystemProvider; | ||||
| import org.apache.aut.vfs.test.AbstractReadOnlyFileSystemTestCase; | |||||
| import org.apache.aut.vfs.FileObject; | |||||
| /** | /** | ||||
| * Tests for the Zip file system. | * Tests for the Zip file system. | ||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class ZipFileSystemTest extends AbstractReadOnlyFileSystemTest | |||||
| public class ZipFileSystemTestCase extends AbstractReadOnlyFileSystemTestCase | |||||
| { | { | ||||
| public ZipFileSystemTest( String name ) | |||||
| public ZipFileSystemTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,21 +5,23 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.zip; | |||||
| package org.apache.aut.zip.test; | |||||
| import java.util.zip.ZipException; | import java.util.zip.ZipException; | ||||
| import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
| import org.apache.aut.zip.UnixStat; | |||||
| import org.apache.aut.zip.AsiExtraField; | |||||
| /** | /** | ||||
| * JUnit testcases AsiExtraField. | * JUnit testcases AsiExtraField. | ||||
| * | * | ||||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | ||||
| */ | */ | ||||
| public class AsiExtraFieldTest | |||||
| public class AsiExtraFieldTestCase | |||||
| extends TestCase | extends TestCase | ||||
| implements UnixStat | implements UnixStat | ||||
| { | { | ||||
| public AsiExtraFieldTest( final String name ) | |||||
| public AsiExtraFieldTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,16 +5,22 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.zip; | |||||
| package org.apache.aut.zip.test; | |||||
| import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
| import org.apache.aut.zip.UnixStat; | |||||
| import org.apache.aut.zip.AsiExtraField; | |||||
| import org.apache.aut.zip.UnrecognizedExtraField; | |||||
| import org.apache.aut.zip.ZipShort; | |||||
| import org.apache.aut.zip.ZipExtraField; | |||||
| import org.apache.aut.zip.ExtraFieldUtils; | |||||
| /** | /** | ||||
| * JUnit testcases ExtraFieldUtils. | * JUnit testcases ExtraFieldUtils. | ||||
| * | * | ||||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | ||||
| */ | */ | ||||
| public class ExtraFieldUtilsTest | |||||
| public class ExtraFieldUtilsTestCase | |||||
| extends TestCase | extends TestCase | ||||
| implements UnixStat | implements UnixStat | ||||
| { | { | ||||
| @@ -23,7 +29,7 @@ public class ExtraFieldUtilsTest | |||||
| private byte[] m_data; | private byte[] m_data; | ||||
| private byte[] m_local; | private byte[] m_local; | ||||
| public ExtraFieldUtilsTest( final String name ) | |||||
| public ExtraFieldUtilsTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,20 +5,25 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.zip; | |||||
| package org.apache.aut.zip.test; | |||||
| import java.util.NoSuchElementException; | import java.util.NoSuchElementException; | ||||
| import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
| import org.apache.aut.zip.AsiExtraField; | |||||
| import org.apache.aut.zip.UnrecognizedExtraField; | |||||
| import org.apache.aut.zip.ZipEntry; | |||||
| import org.apache.aut.zip.ZipExtraField; | |||||
| import org.apache.aut.zip.ZipShort; | |||||
| /** | /** | ||||
| * JUnit testcases ZipEntry. | * JUnit testcases ZipEntry. | ||||
| * | * | ||||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | ||||
| */ | */ | ||||
| public class ZipEntryTest | |||||
| public class ZipEntryTestCase | |||||
| extends TestCase | extends TestCase | ||||
| { | { | ||||
| public ZipEntryTest( final String name ) | |||||
| public ZipEntryTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,20 +5,21 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.zip; | |||||
| package org.apache.aut.zip.test; | |||||
| import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
| import org.apache.aut.zip.ZipLong; | |||||
| /** | /** | ||||
| * JUnit 3 testcases for org.apache.tools.zip.ZipLong. | * JUnit 3 testcases for org.apache.tools.zip.ZipLong. | ||||
| * | * | ||||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | ||||
| */ | */ | ||||
| public class ZipLongTest | |||||
| public class ZipLongTestCase | |||||
| extends TestCase | extends TestCase | ||||
| { | { | ||||
| public ZipLongTest( final String name ) | |||||
| public ZipLongTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,19 +5,20 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.aut.zip; | |||||
| package org.apache.aut.zip.test; | |||||
| import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
| import org.apache.aut.zip.ZipShort; | |||||
| /** | /** | ||||
| * JUnit 3 testcases for org.apache.tools.zip.ZipShort. | * JUnit 3 testcases for org.apache.tools.zip.ZipShort. | ||||
| * | * | ||||
| * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a> | ||||
| */ | */ | ||||
| public class ZipShortTest | |||||
| public class ZipShortTestCase | |||||
| extends TestCase | extends TestCase | ||||
| { | { | ||||
| public ZipShortTest( String name ) | |||||
| public ZipShortTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -10,6 +10,8 @@ package org.apache.myrmidon; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import junit.framework.TestCase; | import junit.framework.TestCase; | ||||
| import org.apache.avalon.excalibur.i18n.Resources; | |||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| import org.apache.avalon.framework.ExceptionUtil; | import org.apache.avalon.framework.ExceptionUtil; | ||||
| import org.apache.avalon.framework.logger.Logger; | import org.apache.avalon.framework.logger.Logger; | ||||
| import org.apache.myrmidon.frontends.BasicLogger; | import org.apache.myrmidon.frontends.BasicLogger; | ||||
| @@ -27,6 +29,36 @@ public abstract class AbstractMyrmidonTest | |||||
| private final File m_baseDir; | private final File m_baseDir; | ||||
| private Logger m_logger; | private Logger m_logger; | ||||
| protected static final Resources getResourcesForTested( final Class clazz ) | |||||
| { | |||||
| final Package pkg = clazz.getPackage(); | |||||
| String baseName; | |||||
| if( null == pkg ) | |||||
| { | |||||
| final String name = clazz.getName(); | |||||
| if( -1 == name.lastIndexOf( "." ) ) | |||||
| { | |||||
| baseName = ""; | |||||
| } | |||||
| else | |||||
| { | |||||
| baseName = name.substring( 0, name.lastIndexOf( "." ) ); | |||||
| } | |||||
| } | |||||
| else | |||||
| { | |||||
| baseName = pkg.getName(); | |||||
| } | |||||
| if( baseName.endsWith( ".test" ) ) | |||||
| { | |||||
| baseName = baseName.substring( 0, baseName.length() - 5 ); | |||||
| } | |||||
| return ResourceManager.getBaseResources( baseName + ".Resources", AbstractMyrmidonTest.class.getClassLoader() ); | |||||
| } | |||||
| public AbstractMyrmidonTest( String name ) | public AbstractMyrmidonTest( String name ) | ||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| @@ -162,7 +194,7 @@ public abstract class AbstractMyrmidonTest | |||||
| */ | */ | ||||
| protected void assertSameMessage( final String message, final Throwable throwable ) | protected void assertSameMessage( final String message, final Throwable throwable ) | ||||
| { | { | ||||
| assertSameMessage( new String[] { message }, throwable ); | |||||
| assertSameMessage( new String[]{message}, throwable ); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.builder; | |||||
| package org.apache.myrmidon.components.builder.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.util.Arrays; | import java.util.Arrays; | ||||
| @@ -13,24 +13,25 @@ import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
| import org.apache.myrmidon.AbstractMyrmidonTest; | import org.apache.myrmidon.AbstractMyrmidonTest; | ||||
| import org.apache.myrmidon.components.builder.DefaultProjectBuilder; | |||||
| import org.apache.myrmidon.components.builder.DefaultProject; | |||||
| import org.apache.myrmidon.interfaces.builder.ProjectException; | import org.apache.myrmidon.interfaces.builder.ProjectException; | ||||
| import org.apache.myrmidon.interfaces.model.Project; | import org.apache.myrmidon.interfaces.model.Project; | ||||
| /** | /** | ||||
| * Test cases for {@link DefaultProjectBuilder}. | |||||
| * Test cases for {@link org.apache.myrmidon.components.builder.DefaultProjectBuilder}. | |||||
| * | * | ||||
| * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a> | * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class DefaultProjectBuilderTest | |||||
| public class DefaultProjectBuilderTestCase | |||||
| extends AbstractMyrmidonTest | extends AbstractMyrmidonTest | ||||
| { | { | ||||
| private final static Resources REZ | |||||
| = ResourceManager.getPackageResources( DefaultProjectBuilderTest.class ); | |||||
| private final static Resources REZ = getResourcesForTested( DefaultProjectBuilderTestCase.class ); | |||||
| private DefaultProjectBuilder m_builder; | private DefaultProjectBuilder m_builder; | ||||
| public DefaultProjectBuilderTest( String name ) | |||||
| public DefaultProjectBuilderTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -0,0 +1,4 @@ | |||||
| <!-- Project with an invalid name --> | |||||
| <project version="2.0" name="!badname"> | |||||
| <target name="main"/> | |||||
| </project> | |||||
| @@ -0,0 +1,5 @@ | |||||
| <!-- Target with an invalid name --> | |||||
| <project version="2.0" name="ok name"> | |||||
| <target name="main"/> | |||||
| <target name="bad ^ name"/> | |||||
| </project> | |||||
| @@ -0,0 +1,3 @@ | |||||
| <!-- Project with invalid version --> | |||||
| <project version="ant2"> | |||||
| </project> | |||||
| @@ -0,0 +1 @@ | |||||
| this ain't xml. | |||||
| @@ -0,0 +1,3 @@ | |||||
| <!-- Use all the defaults --> | |||||
| <project version="2.0"> | |||||
| </project> | |||||
| @@ -0,0 +1,3 @@ | |||||
| <!-- Project with mismatched version --> | |||||
| <project version="1.0.2"> | |||||
| </project> | |||||
| @@ -0,0 +1,3 @@ | |||||
| <!-- Project with no version attribute --> | |||||
| <project> | |||||
| </project> | |||||
| @@ -0,0 +1,3 @@ | |||||
| <!-- Project with a non-default base directory --> | |||||
| <project version="2.0" basedir="other-base-dir"> | |||||
| </project> | |||||
| @@ -0,0 +1,3 @@ | |||||
| <!-- Project with a non-default default target --> | |||||
| <project version="2.0" default="some-target"> | |||||
| </project> | |||||
| @@ -0,0 +1,3 @@ | |||||
| <!-- Project with non-default name --> | |||||
| <project name="some-project" version="2.0"> | |||||
| </project > | |||||
| @@ -5,14 +5,14 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer; | |||||
| package org.apache.myrmidon.components.configurer.test; | |||||
| import org.apache.avalon.framework.configuration.Configurable; | import org.apache.avalon.framework.configuration.Configurable; | ||||
| import org.apache.avalon.framework.configuration.Configuration; | import org.apache.avalon.framework.configuration.Configuration; | ||||
| import org.apache.avalon.framework.configuration.ConfigurationException; | import org.apache.avalon.framework.configuration.ConfigurationException; | ||||
| /** | /** | ||||
| * Simple class to test {@link Configurable}. | |||||
| * Simple class to test {@link org.apache.avalon.framework.configuration.Configurable}. | |||||
| * | * | ||||
| * @author <a href="mailto:peter@apache.org">Peter Donald</a> | * @author <a href="mailto:peter@apache.org">Peter Donald</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| @@ -5,40 +5,39 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer; | |||||
| package org.apache.myrmidon.components.configurer.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.antlib.core.StringToIntegerConverter; | import org.apache.antlib.core.StringToIntegerConverter; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.avalon.framework.ExceptionUtil; | import org.apache.avalon.framework.ExceptionUtil; | ||||
| import org.apache.avalon.framework.configuration.ConfigurationException; | import org.apache.avalon.framework.configuration.ConfigurationException; | ||||
| import org.apache.avalon.framework.configuration.DefaultConfiguration; | import org.apache.avalon.framework.configuration.DefaultConfiguration; | ||||
| import org.apache.myrmidon.api.TaskContext; | import org.apache.myrmidon.api.TaskContext; | ||||
| import org.apache.myrmidon.components.AbstractComponentTest; | import org.apache.myrmidon.components.AbstractComponentTest; | ||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestAttributeConvert; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestConfigAdder; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestContent; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestEmpty; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestIdResolve; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestIgnoreStringMethods; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestInterfaceAdder; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestMismatchedRefType; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestMultipleTypedAdder; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestNestedErrors; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestNonInterfaceAdder; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestPropResolution; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestReferenceAttribute; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestReferenceConversion; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestReferenceElement; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestSetAttribute; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestSetElement; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestTypedAdder; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestTypedAdderConversion; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestTypedAdderReference; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestTypedAdderRole; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestTypedConfigAdder; | |||||
| import org.apache.myrmidon.components.configurer.data.ConfigTestUnknownReference; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestAttributeConvert; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestConfigAdder; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestContent; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestEmpty; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestIdResolve; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestIgnoreStringMethods; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestInterfaceAdder; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestMismatchedRefType; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestMultipleTypedAdder; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestNestedErrors; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestNonInterfaceAdder; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestPropResolution; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestReferenceAttribute; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestReferenceConversion; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestReferenceElement; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestSetAttribute; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestSetElement; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestTypedAdder; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestTypedAdderConversion; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestTypedAdderReference; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestTypedAdderRole; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestTypedConfigAdder; | |||||
| import org.apache.myrmidon.components.configurer.test.data.ConfigTestUnknownReference; | |||||
| import org.apache.myrmidon.components.workspace.DefaultTaskContext; | import org.apache.myrmidon.components.workspace.DefaultTaskContext; | ||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.interfaces.configurer.Configurer; | import org.apache.myrmidon.interfaces.configurer.Configurer; | ||||
| @@ -49,16 +48,16 @@ import org.apache.myrmidon.interfaces.role.RoleInfo; | |||||
| * | * | ||||
| * @author Adam Murdoch | * @author Adam Murdoch | ||||
| */ | */ | ||||
| public class DefaultConfigurerTest | |||||
| public class DefaultConfigurerTestCase | |||||
| extends AbstractComponentTest | extends AbstractComponentTest | ||||
| { | { | ||||
| private final static Resources REZ = | private final static Resources REZ = | ||||
| ResourceManager.getPackageResources( DefaultConfigurerTest.class ); | |||||
| getResourcesForTested( DefaultConfigurerTestCase.class ); | |||||
| private Configurer m_configurer; | private Configurer m_configurer; | ||||
| private DefaultTaskContext m_context; | private DefaultTaskContext m_context; | ||||
| public DefaultConfigurerTest( String name ) | |||||
| public DefaultConfigurerTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer; | |||||
| package org.apache.myrmidon.components.configurer.test; | |||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| @@ -5,9 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer; | |||||
| package org.apache.myrmidon.components.configurer.test; | |||||
| import org.apache.myrmidon.AbstractMyrmidonTest; | import org.apache.myrmidon.AbstractMyrmidonTest; | ||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| /** | /** | ||||
| * Adapts an Object to MyRole | * Adapts an Object to MyRole | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer; | |||||
| package org.apache.myrmidon.components.configurer.test; | |||||
| /** | /** | ||||
| * A basic interface to test configurer. | * A basic interface to test configurer. | ||||
| @@ -5,7 +5,9 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer; | |||||
| package org.apache.myrmidon.components.configurer.test; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| /** | /** | ||||
| * A basic implementation of MyRole1 to test configurer. | * A basic implementation of MyRole1 to test configurer. | ||||
| @@ -5,7 +5,9 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer; | |||||
| package org.apache.myrmidon.components.configurer.test; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| /** | /** | ||||
| * A basic implementation of MyRole1 to test configurer. | * A basic implementation of MyRole1 to test configurer. | ||||
| @@ -5,10 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer; | |||||
| package org.apache.myrmidon.components.configurer.test; | |||||
| import org.apache.aut.converter.AbstractConverter; | import org.apache.aut.converter.AbstractConverter; | ||||
| import org.apache.aut.converter.ConverterException; | import org.apache.aut.converter.ConverterException; | ||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1Adaptor; | |||||
| /** | /** | ||||
| * Converts from Object to MyRole1. | * Converts from Object to MyRole1. | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import org.apache.myrmidon.components.AbstractComponentTest; | import org.apache.myrmidon.components.AbstractComponentTest; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.avalon.framework.configuration.Configuration; | import org.apache.avalon.framework.configuration.Configuration; | ||||
| @@ -5,12 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * A simple test class with string properties. | * A simple test class with string properties. | ||||
| @@ -25,7 +25,7 @@ public class ConfigTestContent | |||||
| public boolean equals( final Object obj ) | public boolean equals( final Object obj ) | ||||
| { | { | ||||
| final ConfigTestContent test = (ConfigTestContent)obj; | final ConfigTestContent test = (ConfigTestContent)obj; | ||||
| if( !DefaultConfigurerTest.equals( m_content, test.m_content ) ) | |||||
| if( !DefaultConfigurerTestCase.equals( m_content, test.m_content ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| @@ -5,12 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * A simple test class with string properties. | * A simple test class with string properties. | ||||
| @@ -25,7 +25,7 @@ public class ConfigTestIdResolve | |||||
| public boolean equals( final Object obj ) | public boolean equals( final Object obj ) | ||||
| { | { | ||||
| final ConfigTestIdResolve test = (ConfigTestIdResolve)obj; | final ConfigTestIdResolve test = (ConfigTestIdResolve)obj; | ||||
| if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) | |||||
| if( !DefaultConfigurerTestCase.equals( m_someProp, test.m_someProp ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -5,11 +5,11 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import junit.framework.AssertionFailedError; | import junit.framework.AssertionFailedError; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * A test class with multiple setters/adders/creators for a property. | * A test class with multiple setters/adders/creators for a property. | ||||
| @@ -24,7 +24,7 @@ public class ConfigTestIgnoreStringMethods | |||||
| public boolean equals( Object obj ) | public boolean equals( Object obj ) | ||||
| { | { | ||||
| ConfigTestIgnoreStringMethods test = (ConfigTestIgnoreStringMethods)obj; | ConfigTestIgnoreStringMethods test = (ConfigTestIgnoreStringMethods)obj; | ||||
| if( !DefaultConfigurerTest.equals( m_prop1, test.m_prop1 ) ) | |||||
| if( !DefaultConfigurerTestCase.equals( m_prop1, test.m_prop1 ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -5,10 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.myrmidon.components.configurer.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| /** | /** | ||||
| * A test class with an interface property. | * A test class with an interface property. | ||||
| @@ -5,12 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * A simple test class with string properties. | * A simple test class with string properties. | ||||
| @@ -5,10 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import org.apache.myrmidon.components.configurer.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.MyRole2; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole2; | |||||
| /** | /** | ||||
| * Simple class with more than one typed adder method. | * Simple class with more than one typed adder method. | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| /** | /** | ||||
| * A simple test class. | * A simple test class. | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| /** | /** | ||||
| * Simple class to test typed adder. | * Simple class to test typed adder. | ||||
| @@ -5,11 +5,11 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * Simple class to test typed adder. | * Simple class to test typed adder. | ||||
| @@ -24,7 +24,7 @@ public class ConfigTestPropResolution | |||||
| public boolean equals( final Object obj ) | public boolean equals( final Object obj ) | ||||
| { | { | ||||
| final ConfigTestPropResolution test = (ConfigTestPropResolution)obj; | final ConfigTestPropResolution test = (ConfigTestPropResolution)obj; | ||||
| if( !DefaultConfigurerTest.equals( m_prop, test.m_prop ) ) | |||||
| if( !DefaultConfigurerTestCase.equals( m_prop, test.m_prop ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -5,11 +5,11 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * Simple class to test typed adder. | * Simple class to test typed adder. | ||||
| @@ -24,7 +24,7 @@ public class ConfigTestReferenceAttribute | |||||
| public boolean equals( final Object obj ) | public boolean equals( final Object obj ) | ||||
| { | { | ||||
| final ConfigTestReferenceAttribute test = (ConfigTestReferenceAttribute)obj; | final ConfigTestReferenceAttribute test = (ConfigTestReferenceAttribute)obj; | ||||
| if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) | |||||
| if( !DefaultConfigurerTestCase.equals( m_someProp, test.m_someProp ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -5,10 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.myrmidon.components.configurer.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| /** | /** | ||||
| * A simple test class. | * A simple test class. | ||||
| @@ -5,11 +5,11 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * A simple test class. | * A simple test class. | ||||
| @@ -23,7 +23,7 @@ public class ConfigTestReferenceElement | |||||
| public boolean equals( Object obj ) | public boolean equals( Object obj ) | ||||
| { | { | ||||
| ConfigTestReferenceElement test = (ConfigTestReferenceElement)obj; | ConfigTestReferenceElement test = (ConfigTestReferenceElement)obj; | ||||
| if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) | |||||
| if( !DefaultConfigurerTestCase.equals( m_someProp, test.m_someProp ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -5,11 +5,11 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.List; | import java.util.List; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * Simple class to test typed adder. | * Simple class to test typed adder. | ||||
| @@ -25,7 +25,7 @@ public class ConfigTestSetAttribute | |||||
| public boolean equals( final Object obj ) | public boolean equals( final Object obj ) | ||||
| { | { | ||||
| final ConfigTestSetAttribute test = (ConfigTestSetAttribute)obj; | final ConfigTestSetAttribute test = (ConfigTestSetAttribute)obj; | ||||
| if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) | |||||
| if( !DefaultConfigurerTestCase.equals( m_someProp, test.m_someProp ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -5,11 +5,11 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * A simple test class. | * A simple test class. | ||||
| @@ -25,7 +25,7 @@ public class ConfigTestSetElement | |||||
| public boolean equals( Object obj ) | public boolean equals( Object obj ) | ||||
| { | { | ||||
| ConfigTestSetElement test = (ConfigTestSetElement)obj; | ConfigTestSetElement test = (ConfigTestSetElement)obj; | ||||
| if( !DefaultConfigurerTest.equals( m_prop, test.m_prop ) ) | |||||
| if( !DefaultConfigurerTestCase.equals( m_prop, test.m_prop ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -33,7 +33,7 @@ public class ConfigTestSetElement | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| else if( !DefaultConfigurerTest.equals( m_someProp, test.m_someProp ) ) | |||||
| else if( !DefaultConfigurerTestCase.equals( m_someProp, test.m_someProp ) ) | |||||
| { | { | ||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -5,11 +5,11 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.avalon.framework.configuration.Configuration; | import org.apache.avalon.framework.configuration.Configuration; | ||||
| import org.apache.myrmidon.components.configurer.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| /** | /** | ||||
| * Simple class to test adder for Configurations. | * Simple class to test adder for Configurations. | ||||
| @@ -5,10 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.myrmidon.components.configurer.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| /** | /** | ||||
| @@ -5,10 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.myrmidon.components.configurer.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| /** | /** | ||||
| * Simple class to test typed adder. | * Simple class to test typed adder. | ||||
| @@ -5,10 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.myrmidon.components.configurer.MyRole1; | |||||
| import org.apache.myrmidon.components.configurer.test.MyRole1; | |||||
| /** | /** | ||||
| * Simple class to test typed adder. | * Simple class to test typed adder. | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import org.apache.avalon.framework.configuration.Configuration; | import org.apache.avalon.framework.configuration.Configuration; | ||||
| @@ -5,12 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.configurer.data; | |||||
| package org.apache.myrmidon.components.configurer.test.data; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.List; | import java.util.List; | ||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.components.configurer.DefaultConfigurerTest; | |||||
| import org.apache.myrmidon.components.configurer.test.DefaultConfigurerTestCase; | |||||
| /** | /** | ||||
| * A simple test class with string properties. | * A simple test class with string properties. | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.deployer; | |||||
| package org.apache.myrmidon.components.deployer.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.aut.converter.Converter; | import org.apache.aut.converter.Converter; | ||||
| @@ -24,7 +24,7 @@ import org.apache.myrmidon.interfaces.type.TypeFactory; | |||||
| * | * | ||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| */ | */ | ||||
| public class DefaultDeployerTest | |||||
| public class DefaultDeployerTestCase | |||||
| extends AbstractComponentTest | extends AbstractComponentTest | ||||
| { | { | ||||
| private static final String TEST_TYPE1_NAME = "test-type1"; | private static final String TEST_TYPE1_NAME = "test-type1"; | ||||
| @@ -32,7 +32,7 @@ public class DefaultDeployerTest | |||||
| private Deployer m_deployer; | private Deployer m_deployer; | ||||
| private Converter m_converter; | private Converter m_converter; | ||||
| public DefaultDeployerTest( final String name ) | |||||
| public DefaultDeployerTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.deployer; | |||||
| package org.apache.myrmidon.components.deployer.test; | |||||
| import org.apache.aut.converter.Converter; | import org.apache.aut.converter.Converter; | ||||
| import org.apache.aut.converter.ConverterException; | import org.apache.aut.converter.ConverterException; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.deployer; | |||||
| package org.apache.myrmidon.components.deployer.test; | |||||
| /** | /** | ||||
| * A test role interface. | * A test role interface. | ||||
| @@ -5,9 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.deployer; | |||||
| package org.apache.myrmidon.components.deployer.test; | |||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| import org.apache.myrmidon.components.deployer.test.TestRole1; | |||||
| /** | /** | ||||
| * A test data-type. | * A test data-type. | ||||
| @@ -0,0 +1,18 @@ | |||||
| <ant-lib version="1.0"> | |||||
| <types> | |||||
| <!-- Register a data-type --> | |||||
| <data-type name="test-type1" | |||||
| classname="org.apache.myrmidon.components.deployer.test.TestType1"/> | |||||
| <!-- Register a custom role implementation --> | |||||
| <test-role1 name="test-type1" | |||||
| classname="org.apache.myrmidon.components.deployer.test.TestType1"/> | |||||
| <!-- Register a converter --> | |||||
| <converter classname="org.apache.myrmidon.components.deployer.test.TestConverter1" | |||||
| source="java.lang.String" | |||||
| destination="org.apache.myrmidon.components.deployer.test.TestType1"/> | |||||
| </types> | |||||
| </ant-lib> | |||||
| @@ -0,0 +1,4 @@ | |||||
| <roles version="1.0"> | |||||
| <!-- A custom role --> | |||||
| <role shorthand="test-role1" name="org.apache.myrmidon.components.deployer.test.TestRole1"/> | |||||
| </roles> | |||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.embeddor; | |||||
| package org.apache.myrmidon.components.embeddor.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.avalon.framework.parameters.Parameters; | import org.apache.avalon.framework.parameters.Parameters; | ||||
| @@ -0,0 +1,6 @@ | |||||
| <project version="2.0" name="test-project" default="main-target"> | |||||
| <property name="some-prop" value="some-value"/> | |||||
| <target name="main-target"> | |||||
| <log>A log message</log> | |||||
| </target> | |||||
| </project> | |||||
| @@ -5,11 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.property; | |||||
| package org.apache.myrmidon.components.property.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.util.Date; | import java.util.Date; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.avalon.framework.context.Context; | import org.apache.avalon.framework.context.Context; | ||||
| import org.apache.myrmidon.AbstractMyrmidonTest; | import org.apache.myrmidon.AbstractMyrmidonTest; | ||||
| @@ -23,16 +22,15 @@ import org.apache.myrmidon.interfaces.property.PropertyResolver; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public abstract class AbstractPropertyResolverTest | |||||
| public abstract class AbstractPropertyResolverTestCase | |||||
| extends AbstractMyrmidonTest | extends AbstractMyrmidonTest | ||||
| { | { | ||||
| protected final static Resources REZ | |||||
| = ResourceManager.getPackageResources( AbstractPropertyResolverTest.class ); | |||||
| protected final static Resources REZ = getResourcesForTested( AbstractPropertyResolverTestCase.class ); | |||||
| protected PropertyResolver m_resolver; | protected PropertyResolver m_resolver; | ||||
| protected DefaultTaskContext m_context; | protected DefaultTaskContext m_context; | ||||
| public AbstractPropertyResolverTest( String name ) | |||||
| public AbstractPropertyResolverTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,20 +5,22 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.property; | |||||
| package org.apache.myrmidon.components.property.test; | |||||
| import org.apache.myrmidon.interfaces.property.PropertyResolver; | import org.apache.myrmidon.interfaces.property.PropertyResolver; | ||||
| import org.apache.myrmidon.components.property.test.AbstractPropertyResolverTestCase; | |||||
| import org.apache.myrmidon.components.property.ClassicPropertyResolver; | |||||
| /** | /** | ||||
| * A test for {@link ClassicPropertyResolver}. | |||||
| * A test for {@link org.apache.myrmidon.components.property.ClassicPropertyResolver}. | |||||
| * | * | ||||
| * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a> | * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class ClassicPropertyResolverTest | |||||
| extends AbstractPropertyResolverTest | |||||
| public class ClassicPropertyResolverTestCase | |||||
| extends AbstractPropertyResolverTestCase | |||||
| { | { | ||||
| public ClassicPropertyResolverTest( String name ) | |||||
| public ClassicPropertyResolverTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,20 +5,22 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.property; | |||||
| package org.apache.myrmidon.components.property.test; | |||||
| import org.apache.myrmidon.interfaces.property.PropertyResolver; | import org.apache.myrmidon.interfaces.property.PropertyResolver; | ||||
| import org.apache.myrmidon.components.property.test.AbstractPropertyResolverTestCase; | |||||
| import org.apache.myrmidon.components.property.DefaultPropertyResolver; | |||||
| /** | /** | ||||
| * Functional tests for {@link DefaultPropertyResolver}. | |||||
| * Functional tests for {@link org.apache.myrmidon.components.property.DefaultPropertyResolver}. | |||||
| * | * | ||||
| * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a> | * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class DefaultPropertyResolverTest | |||||
| extends AbstractPropertyResolverTest | |||||
| public class DefaultPropertyResolverTestCase | |||||
| extends AbstractPropertyResolverTestCase | |||||
| { | { | ||||
| public DefaultPropertyResolverTest( String name ) | |||||
| public DefaultPropertyResolverTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,11 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.role; | |||||
| package org.apache.myrmidon.components.role.test; | |||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.myrmidon.AbstractMyrmidonTest; | import org.apache.myrmidon.AbstractMyrmidonTest; | ||||
| import org.apache.myrmidon.components.role.DefaultRoleManager; | |||||
| import org.apache.myrmidon.api.Task; | import org.apache.myrmidon.api.Task; | ||||
| import org.apache.myrmidon.interfaces.role.RoleException; | import org.apache.myrmidon.interfaces.role.RoleException; | ||||
| import org.apache.myrmidon.interfaces.role.RoleInfo; | import org.apache.myrmidon.interfaces.role.RoleInfo; | ||||
| @@ -21,15 +22,14 @@ import org.apache.myrmidon.interfaces.role.RoleManager; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class DefaultRoleManagerTest | |||||
| public class DefaultRoleManagerTestCase | |||||
| extends AbstractMyrmidonTest | extends AbstractMyrmidonTest | ||||
| { | { | ||||
| private final static Resources REZ | |||||
| = ResourceManager.getPackageResources( DefaultRoleManagerTest.class ); | |||||
| private final static Resources REZ = getResourcesForTested( DefaultRoleManagerTestCase.class ); | |||||
| private RoleManager m_roleManager; | private RoleManager m_roleManager; | ||||
| public DefaultRoleManagerTest( String name ) | |||||
| public DefaultRoleManagerTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -70,7 +70,7 @@ public class DefaultRoleManagerTest | |||||
| assertNull( unknownRole ); | assertNull( unknownRole ); | ||||
| // Lookup an unknown role | // Lookup an unknown role | ||||
| unknownRole = m_roleManager.getRoleByType( DefaultRoleManagerTest.class ); | |||||
| unknownRole = m_roleManager.getRoleByType( DefaultRoleManagerTestCase.class ); | |||||
| assertNull( unknownRole ); | assertNull( unknownRole ); | ||||
| } | } | ||||
| @@ -5,13 +5,14 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.service; | |||||
| package org.apache.myrmidon.components.service.test; | |||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.avalon.framework.parameters.Parameters; | import org.apache.avalon.framework.parameters.Parameters; | ||||
| import org.apache.avalon.framework.service.ServiceException; | import org.apache.avalon.framework.service.ServiceException; | ||||
| import org.apache.myrmidon.components.AbstractComponentTest; | import org.apache.myrmidon.components.AbstractComponentTest; | ||||
| import org.apache.myrmidon.components.service.InstantiatingServiceManager; | |||||
| import org.apache.myrmidon.interfaces.role.RoleInfo; | import org.apache.myrmidon.interfaces.role.RoleInfo; | ||||
| import org.apache.myrmidon.interfaces.role.RoleManager; | import org.apache.myrmidon.interfaces.role.RoleManager; | ||||
| import org.apache.myrmidon.interfaces.service.ServiceFactory; | import org.apache.myrmidon.interfaces.service.ServiceFactory; | ||||
| @@ -24,16 +25,15 @@ import org.apache.myrmidon.interfaces.type.TypeManager; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class InstantiatingServiceManagerTest | |||||
| public class InstantiatingServiceManagerTestCase | |||||
| extends AbstractComponentTest | extends AbstractComponentTest | ||||
| { | { | ||||
| private final static Resources REZ | |||||
| = ResourceManager.getPackageResources( InstantiatingServiceManagerTest.class ); | |||||
| private final static Resources REZ = getResourcesForTested( InstantiatingServiceManagerTestCase.class ); | |||||
| private InstantiatingServiceManager m_serviceManager; | private InstantiatingServiceManager m_serviceManager; | ||||
| private Parameters m_parameters = new Parameters(); | private Parameters m_parameters = new Parameters(); | ||||
| public InstantiatingServiceManagerTest( final String name ) | |||||
| public InstantiatingServiceManagerTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.service; | |||||
| package org.apache.myrmidon.components.service.test; | |||||
| import junit.framework.Assert; | import junit.framework.Assert; | ||||
| import org.apache.avalon.framework.activity.Initializable; | import org.apache.avalon.framework.activity.Initializable; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.service; | |||||
| package org.apache.myrmidon.components.service.test; | |||||
| /** | /** | ||||
| * A service interface. | * A service interface. | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.service; | |||||
| package org.apache.myrmidon.components.service.test; | |||||
| import org.apache.myrmidon.interfaces.service.AntServiceException; | import org.apache.myrmidon.interfaces.service.AntServiceException; | ||||
| import org.apache.myrmidon.interfaces.service.ServiceFactory; | import org.apache.myrmidon.interfaces.service.ServiceFactory; | ||||
| @@ -5,10 +5,11 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.service; | |||||
| package org.apache.myrmidon.components.service.test; | |||||
| import org.apache.myrmidon.interfaces.service.AntServiceException; | import org.apache.myrmidon.interfaces.service.AntServiceException; | ||||
| import org.apache.myrmidon.interfaces.service.ServiceFactory; | import org.apache.myrmidon.interfaces.service.ServiceFactory; | ||||
| import org.apache.myrmidon.components.service.test.LifecycleValidator; | |||||
| /** | /** | ||||
| * A test service factory, which asserts that the factory has been properly | * A test service factory, which asserts that the factory has been properly | ||||
| @@ -5,7 +5,9 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.service; | |||||
| package org.apache.myrmidon.components.service.test; | |||||
| import org.apache.myrmidon.components.service.test.TestService; | |||||
| /** | /** | ||||
| * A test service implementation. | * A test service implementation. | ||||
| @@ -5,7 +5,10 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.components.service; | |||||
| package org.apache.myrmidon.components.service.test; | |||||
| import org.apache.myrmidon.components.service.test.LifecycleValidator; | |||||
| import org.apache.myrmidon.components.service.test.TestService; | |||||
| /** | /** | ||||
| * A test service that asserts it has been set-up correctly. | * A test service that asserts it has been set-up correctly. | ||||
| @@ -5,22 +5,23 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.interfaces.model; | |||||
| package org.apache.myrmidon.interfaces.model.test; | |||||
| import org.apache.myrmidon.AbstractMyrmidonTest; | import org.apache.myrmidon.AbstractMyrmidonTest; | ||||
| import org.apache.myrmidon.interfaces.model.DefaultNameValidator; | |||||
| /** | /** | ||||
| * TestCases for {@link DefaultNameValidator}. | |||||
| * TestCases for {@link org.apache.myrmidon.interfaces.model.DefaultNameValidator}. | |||||
| * | * | ||||
| * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a> | * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class DefaultNameValidatorTest | |||||
| public class DefaultNameValidatorTestCase | |||||
| extends AbstractMyrmidonTest | extends AbstractMyrmidonTest | ||||
| { | { | ||||
| private DefaultNameValidator m_validator = new DefaultNameValidator(); | private DefaultNameValidator m_validator = new DefaultNameValidator(); | ||||
| public DefaultNameValidatorTest( String name ) | |||||
| public DefaultNameValidatorTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.interfaces.type; | |||||
| package org.apache.myrmidon.interfaces.type.test; | |||||
| /** | /** | ||||
| * A basic implementation of a type to test the type factory. | * A basic implementation of a type to test the type factory. | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.interfaces.type; | |||||
| package org.apache.myrmidon.interfaces.type.test; | |||||
| /** | /** | ||||
| * A basic implementation of a type to test the type factory. | * A basic implementation of a type to test the type factory. | ||||
| @@ -5,11 +5,14 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.interfaces.type; | |||||
| package org.apache.myrmidon.interfaces.type.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.net.URL; | import java.net.URL; | ||||
| import org.apache.myrmidon.AbstractMyrmidonTest; | import org.apache.myrmidon.AbstractMyrmidonTest; | ||||
| import org.apache.myrmidon.interfaces.type.DefaultTypeFactory; | |||||
| import org.apache.myrmidon.interfaces.type.ReloadingTypeFactory; | |||||
| import org.apache.myrmidon.interfaces.type.TypeException; | |||||
| /** | /** | ||||
| * These are unit tests that test the basic operation of TypeFactories. | * These are unit tests that test the basic operation of TypeFactories. | ||||
| @@ -17,7 +20,7 @@ import org.apache.myrmidon.AbstractMyrmidonTest; | |||||
| * @author <a href="mailto:peter@apache.org">Peter Donald</a> | * @author <a href="mailto:peter@apache.org">Peter Donald</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class TypeFactoryTest | |||||
| public class TypeFactoryTestCase | |||||
| extends AbstractMyrmidonTest | extends AbstractMyrmidonTest | ||||
| { | { | ||||
| private final static String TYPE_NAME1 = "my-type1"; | private final static String TYPE_NAME1 = "my-type1"; | ||||
| @@ -27,7 +30,7 @@ public class TypeFactoryTest | |||||
| private final static String TYPE_CLASSNAME1 = TYPE_CLASS1.getName(); | private final static String TYPE_CLASSNAME1 = TYPE_CLASS1.getName(); | ||||
| private final static String TYPE_CLASSNAME2 = TYPE_CLASS2.getName(); | private final static String TYPE_CLASSNAME2 = TYPE_CLASS2.getName(); | ||||
| public TypeFactoryTest( final String name ) | |||||
| public TypeFactoryTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -62,7 +65,6 @@ public class TypeFactoryTest | |||||
| throws Exception | throws Exception | ||||
| { | { | ||||
| final File file = getTestResource( "types.jar" ); | final File file = getTestResource( "types.jar" ); | ||||
| final URL[] classpath = new URL[]{file.toURL()}; | final URL[] classpath = new URL[]{file.toURL()}; | ||||
| final ReloadingTypeFactory factory = new ReloadingTypeFactory( classpath, null ); | final ReloadingTypeFactory factory = new ReloadingTypeFactory( classpath, null ); | ||||
| factory.addNameClassMapping( TYPE_NAME1, TYPE_CLASSNAME1 ); | factory.addNameClassMapping( TYPE_NAME1, TYPE_CLASSNAME1 ); | ||||
| @@ -5,10 +5,9 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.antlib.core; | |||||
| package org.apache.antlib.core.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.myrmidon.AbstractProjectTest; | import org.apache.myrmidon.AbstractProjectTest; | ||||
| import org.apache.myrmidon.LogMessageTracker; | import org.apache.myrmidon.LogMessageTracker; | ||||
| @@ -19,13 +18,12 @@ import org.apache.myrmidon.LogMessageTracker; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class IfTest | |||||
| public class IfTestCase | |||||
| extends AbstractProjectTest | extends AbstractProjectTest | ||||
| { | { | ||||
| private final static Resources REZ = | |||||
| ResourceManager.getPackageResources( IfTest.class ); | |||||
| private final static Resources REZ = getResourcesForTested( IfTestCase.class ); | |||||
| public IfTest( String name ) | |||||
| public IfTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.antlib.core; | |||||
| package org.apache.antlib.core.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
| @@ -20,13 +20,12 @@ import org.apache.myrmidon.components.workspace.DefaultTaskContext; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class PropertyTest | |||||
| public class PropertyTestCase | |||||
| extends AbstractProjectTest | extends AbstractProjectTest | ||||
| { | { | ||||
| private final static Resources REZ | |||||
| = ResourceManager.getPackageResources( PropertyTest.class ); | |||||
| private final static Resources REZ = getResourcesForTested( PropertyTestCase.class ); | |||||
| public PropertyTest( final String name ) | |||||
| public PropertyTestCase( final String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -66,10 +65,10 @@ public class PropertyTest | |||||
| // Missing name | // Missing name | ||||
| String[] messages = | String[] messages = | ||||
| { | |||||
| null, | |||||
| REZ.getString( "property.no-name.error" ) | |||||
| }; | |||||
| { | |||||
| null, | |||||
| REZ.getString( "property.no-name.error" ) | |||||
| }; | |||||
| executeTargetExpectError( projectFile, "missing-name", messages ); | executeTargetExpectError( projectFile, "missing-name", messages ); | ||||
| // Missing value | // Missing value | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.antlib.core; | |||||
| package org.apache.antlib.core.test; | |||||
| import org.apache.myrmidon.framework.DataType; | import org.apache.myrmidon.framework.DataType; | ||||
| @@ -0,0 +1,63 @@ | |||||
| <project version="2.0"> | |||||
| <target name="true-prop"> | |||||
| <property name="test-prop" value="true"/> | |||||
| <if test="test-prop"> | |||||
| <log>test-prop is set</log> | |||||
| </if> | |||||
| <if not-test="test-prop"> | |||||
| <log>test-prop is not set</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="set-prop"> | |||||
| <property name="test-prop" value="some value"/> | |||||
| <if test="test-prop"> | |||||
| <log>test-prop is set</log> | |||||
| </if> | |||||
| <if not-test="test-prop"> | |||||
| <log>test-prop is not set</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="not-set-prop"> | |||||
| <if test="test-prop"> | |||||
| <log>test-prop is set</log> | |||||
| </if> | |||||
| <if not-test="test-prop"> | |||||
| <log>test-prop is not set</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="false-prop"> | |||||
| <property name="test-prop" value="false"/> | |||||
| <if test="test-prop"> | |||||
| <log>test-prop is set</log> | |||||
| </if> | |||||
| <if not-test="test-prop"> | |||||
| <log>test-prop is not set</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="multiple-nested-tasks"> | |||||
| <property name="test-prop" value="true"/> | |||||
| <if test="test-prop"> | |||||
| <log>task 1</log> | |||||
| <log>task 2</log> | |||||
| <log>task 3</log> | |||||
| <log>task 4</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="no-condition"> | |||||
| <if> | |||||
| <log>no go</log> | |||||
| </if> | |||||
| </target> | |||||
| <target name="too-many-conditions"> | |||||
| <if test="test-prop" not-test="test-prop"> | |||||
| <log>no go</log> | |||||
| </if> | |||||
| </target> | |||||
| </project> | |||||
| @@ -0,0 +1,65 @@ | |||||
| <project version="2.0"> | |||||
| <!-- Test setting property via attribute --> | |||||
| <target name="set-attr"> | |||||
| <property name="test-prop" value="some value"/> | |||||
| <log>test-prop = [${test-prop}]</log> | |||||
| </target> | |||||
| <!-- Test setting property via content --> | |||||
| <target name="set-content"> | |||||
| <property name="test-prop2">some value</property> | |||||
| <log>test-prop2 = [${test-prop2}]</log> | |||||
| </target> | |||||
| <!-- Test setting property via a nested element --> | |||||
| <target name="set-element"> | |||||
| <property name="test-prop3"> | |||||
| <property-test-type value="some value"/> | |||||
| </property> | |||||
| <log>test-prop3 = [${test-prop3}]</log> | |||||
| </target> | |||||
| <!-- Test missing property name --> | |||||
| <target name="missing-name"> | |||||
| <property value="some value"/> | |||||
| </target> | |||||
| <!-- Test missing property value --> | |||||
| <target name="missing-value"> | |||||
| <property name="some-prop"/> | |||||
| </target> | |||||
| <!-- Test setting the value more than once --> | |||||
| <target name="too-many-values1"> | |||||
| <property name="some-prop" value="some value">another value</property> | |||||
| </target> | |||||
| <!-- Test setting the value more than once --> | |||||
| <target name="too-many-values2"> | |||||
| <property name="some-prop" value="some value"> | |||||
| <property-test-type value="value 2"/> | |||||
| </property> | |||||
| </target> | |||||
| <!-- Test setting the value more than once --> | |||||
| <target name="too-many-values3"> | |||||
| <property name="some-prop"> | |||||
| <property-test-type value="value 1"/> | |||||
| <property-test-type value="value 2"/> | |||||
| <property-test-type value="value 3"/> | |||||
| </property> | |||||
| </target> | |||||
| <!-- Test properties with invalid names --> | |||||
| <target name="bad-prop-name1"> | |||||
| <property name="badname!" value="value"/> | |||||
| </target> | |||||
| <target name="bad-prop-name2"> | |||||
| <property name="bad name" value="value"/> | |||||
| </target> | |||||
| <target name="bad-prop-name3"> | |||||
| <property name="" value="value"/> | |||||
| </target> | |||||
| </project> | |||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.antlib.vfile; | |||||
| package org.apache.antlib.vfile.test; | |||||
| import java.io.File; | import java.io.File; | ||||
| import org.apache.myrmidon.AbstractProjectTest; | import org.apache.myrmidon.AbstractProjectTest; | ||||
| @@ -16,10 +16,10 @@ import org.apache.myrmidon.AbstractProjectTest; | |||||
| * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a> | ||||
| * @version $Revision$ $Date$ | * @version $Revision$ $Date$ | ||||
| */ | */ | ||||
| public class CopyFilesTaskTest | |||||
| public class CopyFilesTaskTestCase | |||||
| extends AbstractProjectTest | extends AbstractProjectTest | ||||
| { | { | ||||
| public CopyFilesTaskTest( String name ) | |||||
| public CopyFilesTaskTestCase( String name ) | |||||
| { | { | ||||
| super( name ); | super( name ); | ||||
| } | } | ||||
| @@ -0,0 +1,8 @@ | |||||
| <project version="2.0"> | |||||
| <target name="copy"> | |||||
| <v-fileset id="src-files" dir="src"/> | |||||
| <v-copy destdir="dest"> | |||||
| <v-fileset-ref id="src-files"/> | |||||
| </v-copy> | |||||
| </target> | |||||
| </project> | |||||