Package org.codehaus.loom.extension

Examples of org.codehaus.loom.extension.DeweyDecimal


    }

    private int compareSpecVersion( final Extension e1,
                                    final Extension e2 )
    {
        final DeweyDecimal specVersion1 = e1.getSpecificationVersion();
        final DeweyDecimal specVersion2 = e2.getSpecificationVersion();
        if( null == specVersion1 && null == specVersion2 )
        {
            return 0;
        }
        else if( null != specVersion1 && null == specVersion2 )
View Full Code Here


    }

    public void testLessThan()
        throws Exception
    {
        final DeweyDecimal dd1 = new DeweyDecimal( DD1 );
        final DeweyDecimal dd2 = new DeweyDecimal( DD2 );
        final DeweyDecimal dd3 = new DeweyDecimal( DD3 );
        final DeweyDecimal dd4 = new DeweyDecimal( DD4 );
        final DeweyDecimal dd5 = new DeweyDecimal( DD5 );
        assertTrue( "Bad: " + DD1 + " <= " + DD1, !dd1.isLessThan( dd1 ) );
        assertTrue( "Bad: " + DD1 + " <= " + DD2, dd1.isLessThan( dd2 ) );
        assertTrue( "Bad: " + DD1 + " <= " + DD3, dd1.isLessThan( dd3 ) );
        assertTrue( "Bad: " + DD1 + " >= " + DD4, !dd1.isLessThan( dd4 ) );
        assertTrue( "Bad: " + DD1 + " <= " + DD5, dd1.isLessThan( dd5 ) );
        assertTrue( "Bad: " + DD2 + " >= " + DD1, !dd2.isLessThan( dd1 ) );
        assertTrue( "Bad: " + DD2 + " <= " + DD2, !dd2.isLessThan( dd2 ) );
        assertTrue( "Bad: " + DD2 + " <= " + DD3, dd2.isLessThan( dd3 ) );
        assertTrue( "Bad: " + DD2 + " >= " + DD4, !dd2.isLessThan( dd4 ) );
        assertTrue( "Bad: " + DD2 + " <= " + DD5, dd2.isLessThan( dd5 ) );
        assertTrue( "Bad: " + DD3 + " >= " + DD1, !dd3.isLessThan( dd1 ) );
        assertTrue( "Bad: " + DD3 + " >= " + DD2, !dd3.isLessThan( dd2 ) );
        assertTrue( "Bad: " + DD3 + " <= " + DD3, !dd3.isLessThan( dd3 ) );
        assertTrue( "Bad: " + DD3 + " >= " + DD4, !dd3.isLessThan( dd4 ) );
        assertTrue( "Bad: " + DD3 + " <= " + DD5, dd3.isLessThan( dd5 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD1, dd4.isLessThan( dd1 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD2, dd4.isLessThan( dd2 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD3, dd4.isLessThan( dd3 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD4, !dd4.isLessThan( dd4 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD5, dd4.isLessThan( dd5 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD1, !dd5.isLessThan( dd1 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD2, !dd5.isLessThan( dd2 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD3, !dd5.isLessThan( dd3 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD4, !dd5.isLessThan( dd4 ) );
        assertTrue( "Bad: " + DD5 + " <= " + DD5, !dd5.isLessThan( dd5 ) );
    }
View Full Code Here

    }

    public void testLessThanOrEqual()
        throws Exception
    {
        final DeweyDecimal dd1 = new DeweyDecimal( DD1 );
        final DeweyDecimal dd2 = new DeweyDecimal( DD2 );
        final DeweyDecimal dd3 = new DeweyDecimal( DD3 );
        final DeweyDecimal dd4 = new DeweyDecimal( DD4 );
        final DeweyDecimal dd5 = new DeweyDecimal( DD5 );
        assertTrue( "Bad: " + DD1 + " >= " + DD1,
                    dd1.isLessThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD1 + " <= " + DD2,
                    dd1.isLessThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD1 + " <= " + DD3,
                    dd1.isLessThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD1 + " >= " + DD4,
                    !dd1.isLessThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD1 + " <= " + DD5,
                    dd1.isLessThanOrEqual( dd5 ) );
        assertTrue( "Bad: " + DD2 + " >= " + DD1,
                    !dd2.isLessThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD2 + " >= " + DD2,
                    dd2.isLessThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD2 + " <= " + DD3,
                    dd2.isLessThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD2 + " >= " + DD4,
                    !dd2.isLessThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD2 + " <= " + DD5,
                    dd2.isLessThanOrEqual( dd5 ) );
        assertTrue( "Bad: " + DD3 + " >= " + DD1,
                    !dd3.isLessThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD3 + " >= " + DD2,
                    !dd3.isLessThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD3 + " >= " + DD3,
                    dd3.isLessThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD3 + " >= " + DD4,
                    !dd3.isLessThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD3 + " <= " + DD5,
                    dd3.isLessThanOrEqual( dd5 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD1,
                    dd4.isLessThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD2,
                    dd4.isLessThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD3,
                    dd4.isLessThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD4 + " >= " + DD4,
                    dd4.isLessThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD4 + " <= " + DD5,
                    dd4.isLessThanOrEqual( dd5 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD1,
                    !dd5.isLessThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD2,
                    !dd5.isLessThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD3,
                    !dd5.isLessThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD4,
                    !dd5.isLessThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD5 + " >= " + DD5,
                    dd5.isLessThanOrEqual( dd5 ) );
    }
View Full Code Here

    private static final String DD8 = "9.";

    public void testParse()
        throws Exception
    {
        final DeweyDecimal dd1 = new DeweyDecimal( DD1 );
        final DeweyDecimal dd2 = new DeweyDecimal( DD2 );
        final DeweyDecimal dd3 = new DeweyDecimal( DD3 );
        final DeweyDecimal dd4 = new DeweyDecimal( DD4 );
        final DeweyDecimal dd5 = new DeweyDecimal( DD5 );
        assertEquals( "DeweyDecimal 1", DD1, dd1.toString() );
        assertEquals( "DeweyDecimal 2", DD2, dd2.toString() );
        assertEquals( "DeweyDecimal 3", DD3, dd3.toString() );
        assertEquals( "DeweyDecimal 4", DD4, dd4.toString() );
        assertEquals( "DeweyDecimal 5", DD5, dd5.toString() );
    }
View Full Code Here

    public void testMalParse()
        throws Exception
    {
        try
        {
            new DeweyDecimal( DD6 );
            fail( "DeweyDecimal 6 parsed!" );
        }
        catch( final NumberFormatException nfe )
        {
        }
        try
        {
            new DeweyDecimal( DD7 );
            fail( "DeweyDecimal 7 parsed!" );
        }
        catch( final NumberFormatException nfe )
        {
        }
        try
        {
            new DeweyDecimal( DD8 );
            fail( "DeweyDecimal 8 parsed!" );
        }
        catch( final NumberFormatException nfe )
        {
        }
View Full Code Here

    }

    public void testGreaterThan()
        throws Exception
    {
        final DeweyDecimal dd1 = new DeweyDecimal( DD1 );
        final DeweyDecimal dd2 = new DeweyDecimal( DD2 );
        final DeweyDecimal dd3 = new DeweyDecimal( DD3 );
        final DeweyDecimal dd4 = new DeweyDecimal( DD4 );
        final DeweyDecimal dd5 = new DeweyDecimal( DD5 );
        assertTrue( "Bad: " + DD1 + " > " + DD1, !dd1.isGreaterThan( dd1 ) );
        assertTrue( "Bad: " + DD1 + " > " + DD2, !dd1.isGreaterThan( dd2 ) );
        assertTrue( "Bad: " + DD1 + " > " + DD3, !dd1.isGreaterThan( dd3 ) );
        assertTrue( "Bad: " + DD1 + " < " + DD4, dd1.isGreaterThan( dd4 ) );
        assertTrue( "Bad: " + DD1 + " > " + DD5, !dd1.isGreaterThan( dd5 ) );
        assertTrue( "Bad: " + DD2 + " < " + DD1, dd2.isGreaterThan( dd1 ) );
        assertTrue( "Bad: " + DD2 + " > " + DD2, !dd2.isGreaterThan( dd2 ) );
        assertTrue( "Bad: " + DD2 + " > " + DD3, !dd2.isGreaterThan( dd3 ) );
        assertTrue( "Bad: " + DD2 + " < " + DD4, dd2.isGreaterThan( dd4 ) );
        assertTrue( "Bad: " + DD2 + " > " + DD5, !dd2.isGreaterThan( dd5 ) );
        assertTrue( "Bad: " + DD3 + " < " + DD1, dd3.isGreaterThan( dd1 ) );
        assertTrue( "Bad: " + DD3 + " < " + DD2, dd3.isGreaterThan( dd2 ) );
        assertTrue( "Bad: " + DD3 + " > " + DD3, !dd3.isGreaterThan( dd3 ) );
        assertTrue( "Bad: " + DD3 + " < " + DD4, dd3.isGreaterThan( dd4 ) );
        assertTrue( "Bad: " + DD3 + " > " + DD5, !dd3.isGreaterThan( dd5 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD1, !dd4.isGreaterThan( dd1 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD2, !dd4.isGreaterThan( dd2 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD3, !dd4.isGreaterThan( dd3 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD4, !dd4.isGreaterThan( dd4 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD5, !dd4.isGreaterThan( dd5 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD1, dd5.isGreaterThan( dd1 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD2, dd5.isGreaterThan( dd2 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD3, dd5.isGreaterThan( dd3 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD4, dd5.isGreaterThan( dd4 ) );
        assertTrue( "Bad: " + DD5 + " > " + DD5, !dd5.isGreaterThan( dd5 ) );
    }
View Full Code Here

    }

    public void testGreaterThanOrEqual()
        throws Exception
    {
        final DeweyDecimal dd1 = new DeweyDecimal( DD1 );
        final DeweyDecimal dd2 = new DeweyDecimal( DD2 );
        final DeweyDecimal dd3 = new DeweyDecimal( DD3 );
        final DeweyDecimal dd4 = new DeweyDecimal( DD4 );
        final DeweyDecimal dd5 = new DeweyDecimal( DD5 );
        assertTrue( "Bad: " + DD1 + " < " + DD1,
                    dd1.isGreaterThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD1 + " > " + DD2,
                    !dd1.isGreaterThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD1 + " > " + DD3,
                    !dd1.isGreaterThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD1 + " < " + DD4,
                    dd1.isGreaterThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD1 + " > " + DD5,
                    !dd1.isGreaterThanOrEqual( dd5 ) );
        assertTrue( "Bad: " + DD2 + " < " + DD1,
                    dd2.isGreaterThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD2 + " < " + DD2,
                    dd2.isGreaterThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD2 + " > " + DD3,
                    !dd2.isGreaterThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD2 + " < " + DD4,
                    dd2.isGreaterThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD2 + " > " + DD5,
                    !dd2.isGreaterThanOrEqual( dd5 ) );
        assertTrue( "Bad: " + DD3 + " < " + DD1,
                    dd3.isGreaterThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD3 + " < " + DD2,
                    dd3.isGreaterThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD3 + " < " + DD3,
                    dd3.isGreaterThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD3 + " < " + DD4,
                    dd3.isGreaterThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD3 + " > " + DD5,
                    !dd3.isGreaterThanOrEqual( dd5 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD1,
                    !dd4.isGreaterThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD2,
                    !dd4.isGreaterThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD3,
                    !dd4.isGreaterThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD4 + " < " + DD4,
                    dd4.isGreaterThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD4 + " > " + DD5,
                    !dd4.isGreaterThanOrEqual( dd5 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD1,
                    dd5.isGreaterThanOrEqual( dd1 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD2,
                    dd5.isGreaterThanOrEqual( dd2 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD3,
                    dd5.isGreaterThanOrEqual( dd3 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD4,
                    dd5.isGreaterThanOrEqual( dd4 ) );
        assertTrue( "Bad: " + DD5 + " < " + DD5,
                    dd5.isGreaterThanOrEqual( dd5 ) );
    }
View Full Code Here

TOP

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

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.