FileDocCategorySizeDatePackage
ManifestClassPathTest.javaAPI DocApache Ant 1.707033Wed Dec 13 06:16:20 GMT 2006org.apache.tools.ant.taskdefs

ManifestClassPathTest

public class ManifestClassPathTest extends org.apache.tools.ant.BuildFileTest
Tests <bm:manifestclasspath>.

Fields Summary
Constructors Summary
Methods Summary
public voidsetUp()

        configureProject("src/etc/testcases/taskdefs/manifestclasspath.xml");
    
public voidtestBadDirectory()

        expectBuildExceptionContaining("test-bad-directory", "bad-jar-dir",
                                       "Jar's directory not found:");
        assertPropertyUnset("jar.classpath");
    
public voidtestBadNoClassPath()

        expectBuildExceptionContaining("test-bad-no-classpath", "no-classpath",
                                       "Missing nested <classpath>!");
        assertPropertyUnset("jar.classpath");
    
public voidtestBadNoJarfile()

        expectBuildExceptionContaining("test-bad-no-jarfile", "no-jarfile",
                                       "Missing 'jarfile' attribute!");
        assertPropertyUnset("jar.classpath");
    
public voidtestBadNoProperty()

        expectBuildExceptionContaining("test-bad-no-property", "no-property",
                                       "Missing 'property' attribute!");
        assertPropertyUnset("jar.classpath");
    
public voidtestBadPropertyExists()

        expectBuildExceptionContaining("test-bad-property-exists",
            "property-exits", "Property 'jar.classpath' already set!");
        assertPropertyEquals("jar.classpath", "exists");
    
public voidtestInternationalGerman()

        if (!JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_1_4))
        {
            System.out.println("Test with international characters skipped under pre 1.4 jvm.");
            return;
        }
        executeTarget("international-german");
        expectLogContaining("run-two-jars", "beta alpha");
            
    
public voidtestInternationalHebrew()

        if (!JavaEnvUtils.isAtLeastJavaVersion(JavaEnvUtils.JAVA_1_4))        {
            System.out.println("Test with international characters skipped under pre 1.4 jvm.");
            return;
        }
        if (!Os.isFamily("windows")) {
            executeTarget("international-hebrew");
            expectLogContaining("run-two-jars", "beta alpha");
        } else {
            System.out.println("Test with hebrew path not attempted under Windows");
        }

    
public voidtestParentLevel1()

        executeTarget("test-parent-level1");

        assertPropertyEquals("jar.classpath", "dsp-core/ " +
                                              "dsp-pres/ " +
                                              "dsp-void/ " +
                                              "../generated/dsp-core/ " +
                                              "../generated/dsp-pres/ " +
                                              "../generated/dsp-void/ " +
                                              "../resources/dsp-core/ " +
                                              "../resources/dsp-pres/ " +
                                              "../resources/dsp-void/");
    
public voidtestParentLevel2()

        executeTarget("test-parent-level2");

        assertPropertyEquals("jar.classpath", "../dsp-core/ " +
                                              "../dsp-pres/ " +
                                              "../dsp-void/ " +
                                              "../../generated/dsp-core/ " +
                                              "../../generated/dsp-pres/ " +
                                              "../../generated/dsp-void/ " +
                                              "../../resources/dsp-core/ " +
                                              "../../resources/dsp-pres/ " +
                                              "../../resources/dsp-void/");
    
public voidtestParentLevel2TooDeep()

        expectBuildExceptionContaining("test-parent-level2-too-deep", "nopath",
                                       "No suitable relative path from ");
        assertPropertyUnset("jar.classpath");
    
public voidtestParentLevel2WithJars()

        executeTarget("test-parent-level2-with-jars");

        assertPropertyEquals("jar.classpath", "../../lib/acme-core.jar " +
                                              "../../lib/acme-pres.jar " +
                                              "../dsp-core/ " +
                                              "../dsp-pres/ " +
                                              "../dsp-void/ " +
                                              "../../generated/dsp-core/ " +
                                              "../../generated/dsp-pres/ " +
                                              "../../generated/dsp-void/ " +
                                              "../../resources/dsp-core/ " +
                                              "../../resources/dsp-pres/ " +
                                              "../../resources/dsp-void/");
    
public voidtestPseudoTahoeNested()

        executeTarget("test-pseudo-tahoe-nested");

        assertPropertyEquals("jar.classpath", "classes/dsp-core/ " +
                                              "classes/dsp-pres/ " +
                                              "classes/dsp-void/ " +
                                              "generated/dsp-core/ " +
                                              "resources/dsp-core/ " +
                                              "resources/dsp-pres/");
    
public voidtestPseudoTahoeRefid()

        executeTarget("test-pseudo-tahoe-refid");

        assertPropertyEquals("jar.classpath", "classes/dsp-core/ " +
                                              "classes/dsp-pres/ " +
                                              "classes/dsp-void/ " +
                                              "generated/dsp-core/ " +
                                              "resources/dsp-core/ " +
                                              "resources/dsp-pres/");