Package org.apache.hivemind.ant

Examples of org.apache.hivemind.ant.ConstructRegistry


    f.delete();
    }

    public void testBasic() throws Exception
    {
        ConstructRegistry cr = create();

        Path p = cr.createDescriptors();

        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/master.sdl")));
        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/Symbols.sdl")));

        File output = File.createTempFile("testBasic-", ".xml");

        // Delete the file, to force the task to re-create it.

        output.delete();

        cr.setOutput(output);

        cr.execute();

        compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testBasic.xml"));
       
    output.delete();
    }
View Full Code Here


    output.delete();
    }

  public void testSDL() throws Exception
  {
    ConstructRegistry cr = create();

    Path p = cr.createDescriptors();

    p.createPath().setLocation(
      new File(getFrameworkPath("src/test-data/TestConstructRegistry/master.sdl")));
    p.createPath().setLocation(
      new File(getFrameworkPath("src/test-data/TestConstructRegistry/Symbols.sdl")));

    File output = File.createTempFile("testSDL-", ".xml");

    // Delete the file, to force the task to re-create it.

    output.delete();

    cr.setOutput(output);

    cr.execute();

    compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testSDL.xml"));

    output.delete();
  }
View Full Code Here

    output.delete();
  }

    public void testLocalRefs() throws Exception
    {
        ConstructRegistry cr = create();

        Path p = cr.createDescriptors();

        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/LocalRefs.xml")));

        File output = File.createTempFile("testLocalRefs-", ".xml");

        // Delete the file, to force the task to re-create it.

        output.delete();

        cr.setOutput(output);

        cr.execute();

        compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testLocalRefs.xml"));
       
    output.delete();
    }
View Full Code Here

    output.delete();
    }

    public void testUptoDate() throws Exception
    {
        ConstructRegistry cr = create();

        Path p = cr.createDescriptors();

        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/master.sdl")));
        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/Symbols.sdl")));

        File output = File.createTempFile("testUptoDate-", ".xml");

        // Delete the file, to force the task to re-create it.

        output.delete();

        cr.setOutput(output);

        cr.execute();
       
        compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testUptoDate.xml"));
   
    long stamp = output.lastModified();
   
        cr.execute();

        assertEquals(stamp, output.lastModified());
       
    output.delete();
    }
View Full Code Here

    output.delete();
    }

    public void testJars() throws Exception
    {
        ConstructRegistry cr = create();

        Path p = cr.createDescriptors();

        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/master.sdl")));
        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/empty.jar")));
        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/module.jar")));

        File output = File.createTempFile("testJars-", ".xml");

        output.delete();

        cr.setOutput(output);

        cr.execute();

        compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testJars.xml"));
       
    output.delete();
    }
View Full Code Here

    protected ConstructRegistry create()
    {
        Target t = new Target();

        ConstructRegistry result = new ConstructRegistry();
        result.setProject(_project);
        result.setOwningTarget(t);
        result.setTaskName("constructRegistry");

        return result;
    }
View Full Code Here

        return result;
    }

    public void testNoFile() throws Exception
    {
        ConstructRegistry cr = create();

        try
        {
            cr.execute();
            unreachable();
        }
        catch (BuildException ex)
        {
            assertExceptionSubstring(ex, "You must specify an output file");
View Full Code Here

        }
    }

    public void testNoDescriptors() throws Exception
    {
        ConstructRegistry cr = create();

        File f = File.createTempFile("testNoDescriptors-", ".xml");

        cr.setOutput(f);

        assertSame(f, cr.getOutput());

        try
        {
            cr.execute();
            unreachable();
        }
        catch (BuildException ex)
        {
            assertExceptionSubstring(ex, "You must specify a set of module descriptors");
View Full Code Here

    public void testBasic() throws Exception
    {
        if (JDK1_3)
            return;

        ConstructRegistry cr = create();

        Path p = cr.createDescriptors();

        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/master.xml")));
        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/Symbols.xml")));

        File output = File.createTempFile("testBasic-", ".xml");

        // Delete the file, to force the task to re-create it.

        output.delete();

        cr.setOutput(output);

        cr.execute();

        compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testBasic.xml"));

        output.delete();
    }
View Full Code Here

    public void testLocalRefs() throws Exception
    {
        if (JDK1_3)
            return;

        ConstructRegistry cr = create();

        Path p = cr.createDescriptors();

        p.createPath().setLocation(
            new File(getFrameworkPath("src/test-data/TestConstructRegistry/LocalRefs.xml")));

        File output = File.createTempFile("testLocalRefs-", ".xml");

        // Delete the file, to force the task to re-create it.

        output.delete();

        cr.setOutput(output);

        cr.execute();

        compare(output, getFrameworkPath("src/test-data/TestConstructRegistry/testLocalRefs.xml"));

        output.delete();
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.ant.ConstructRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.