Package org.codehaus.loom.extension

Examples of org.codehaus.loom.extension.Specification


            "Implementation-Version: 1.0.2Alpha\n";
        final Specification[] specifications = getSpecifications(
            manifestString );

        assertEquals( "Count", 2, specifications.length );
        Specification dveSpecification;
        Specification fooSpecification;
        if( 3 == specifications[ 0 ].getSections().length )
        {
            dveSpecification = specifications[ 0 ];
            fooSpecification = specifications[ 1 ];
        }
        else
        {
            dveSpecification = specifications[ 1 ];
            fooSpecification = specifications[ 0 ];
        }

        final String[] sections = dveSpecification.getSections();
        assertEquals( "sections.length", 3, sections.length );
        assertEquals( "sections.length", 3, sections.length );
        final HashSet set = new HashSet();
        set.addAll( Arrays.asList( sections ) );
        assertTrue( "sections.contains(org/realityforge/dve)",
                    set.contains( "org/realityforge/dve" ) );
        assertTrue( "sections.contains(org/realityforge/dve/input)",
                    set.contains( "org/realityforge/dve/input" ) );
        assertTrue( "sections.contains(org/realityforge/dve/sim)",
                    set.contains( "org/realityforge/dve/sim" ) );
        assertEquals( "Name", "org.realityforge.dve",
                      dveSpecification.getSpecificationTitle() );
        assertEquals( "SpecVendor", "Peter Donald",
                      dveSpecification.getSpecificationVendor() );
        assertEquals( "SpecVersion", "1.0.2",
                      dveSpecification.getSpecificationVersion().toString() );
        assertEquals( "ImpVendor", "Peter Donald",
                      dveSpecification.getImplementationVendor() );
        assertEquals( "ImpTitle", "DVE vi OS3P",
                      dveSpecification.getImplementationTitle() );
        assertEquals( "ImpVersion", "1.0.2Alpha",
                      dveSpecification.getImplementationVersion().toString() );

        assertEquals( "sections.length",
                      1,
                      fooSpecification.getSections().length );
        assertEquals( "sections[0]",
                      "com/biz/foo",
                      fooSpecification.getSections()[ 0 ] );
        assertEquals( "Name", "com.biz.foo",
                      fooSpecification.getSpecificationTitle() );
        assertEquals( "SpecVendor", "Peter Donald",
                      fooSpecification.getSpecificationVendor() );
        assertEquals( "SpecVersion", "1.0.2",
                      fooSpecification.getSpecificationVersion().toString() );
        assertEquals( "ImpVendor", "Peter Donald",
                      fooSpecification.getImplementationVendor() );
        assertEquals( "ImpTitle", "DVE vi OS3P",
                      fooSpecification.getImplementationTitle() );
        assertEquals( "ImpVersion", "1.0.2Alpha",
                      fooSpecification.getImplementationVersion().toString() );
    }
View Full Code Here


        final String vendor = "Peter Donald";
        final String implTitle = "DVE vi OS3P";
        final String implVendor = "Peter Donald";
        final String implVersion = "1.0.2Alpha";

        final Specification req1 =
            new Specification( title, version, vendor,
                               implTitle, implVersion, implVendor );
        final Specification req2 =
            new Specification( title, version, vendor,
                               null, null, null );
        final Specification req3 =
            new Specification( title, "1.0.1", vendor,
                               null, null, null );
        final Specification req4 =
            new Specification( title, version, null,
                               null, null, null );
        final Specification req5 =
            new Specification( "another title", version, vendor,
                               implTitle, implVersion, implVendor );

        final Specification avail1 =
            new Specification( title, version, vendor,
                               implTitle, implVersion, implVendor );
        final Specification avail2 =
            new Specification( title, version, vendor,
                               implTitle, "another version", implVendor );
        final Specification avail3 =
            new Specification( title, version, vendor,
                               implTitle, implVersion, "another vendor" );

        assertTrue( "avail1.isCompatibleWith( req1 )",
                    avail1.isCompatibleWith( req1 ) );
        assertTrue( "avail1.isCompatibleWith( req2 )",
                    avail1.isCompatibleWith( req2 ) );
        assertTrue( "avail1.isCompatibleWith( req3 )",
                    avail1.isCompatibleWith( req3 ) );
        assertTrue( "avail1.isCompatibleWith( req4 )",
                    avail1.isCompatibleWith( req4 ) );
        assertTrue( "!avail1.isCompatibleWith( req5 )",
                    !avail1.isCompatibleWith( req5 ) );

        assertTrue( "!avail2.isCompatibleWith( req1 )",
                    !avail2.isCompatibleWith( req1 ) );
        assertTrue( "avail2.isCompatibleWith( req2 )",
                    avail2.isCompatibleWith( req2 ) );
        assertTrue( "avail2.isCompatibleWith( req3 )",
                    avail2.isCompatibleWith( req3 ) );
        assertTrue( "avail2.isCompatibleWith( req4 )",
                    avail2.isCompatibleWith( req4 ) );
        assertTrue( "!avail2.isCompatibleWith( req5 )",
                    !avail2.isCompatibleWith( req5 ) );

        assertTrue( "!avail3.isCompatibleWith( req1 )",
                    !avail3.isCompatibleWith( req1 ) );
        assertTrue( "avail3.isCompatibleWith( req2 )",
                    avail3.isCompatibleWith( req2 ) );
        assertTrue( "avail3.isCompatibleWith( req3 )",
                    avail3.isCompatibleWith( req3 ) );
        assertTrue( "avail3.isCompatibleWith( req4 )",
                    avail3.isCompatibleWith( req4 ) );
        assertTrue( "!avail3.isCompatibleWith( req5 )",
                    !avail3.isCompatibleWith( req5 ) );
    }
View Full Code Here

TOP

Related Classes of org.codehaus.loom.extension.Specification

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.