Package org.rhq.core.db.ant.dbupgrade

Examples of org.rhq.core.db.ant.dbupgrade.SchemaVersion


public class SchemaVersionTest {
    /**
     * Tests valid and invalid schema versions.
     */
    public void testSchemaVersionParsing() {
        new SchemaVersion("1");
        new SchemaVersion("1.1");
        new SchemaVersion("1.1.1");
        new SchemaVersion("1.0.0");
        new SchemaVersion("1.2.3");
        new SchemaVersion("33.22.11");

        try {
            new SchemaVersion("1.0.x");
        } catch (IllegalArgumentException e) {
        }
    }
View Full Code Here


    /**
     * Tests checking between versions.
     */
    public void testBetween() {
        assert new SchemaVersion("2.115.1").between(new SchemaVersion("2.115"), new SchemaVersion("2.116"));
        assert new SchemaVersion("2").between(new SchemaVersion("1"), new SchemaVersion("3"));
        assert new SchemaVersion("222").between(new SchemaVersion("111"), new SchemaVersion("333"));
        assert new SchemaVersion("1.0.2").between(new SchemaVersion("1.0.0"), new SchemaVersion("1.0.3"));
        assert new SchemaVersion("1.0.2").between(new SchemaVersion("1.0"), new SchemaVersion("1.1"));
        assert new SchemaVersion("1.2.0").between(new SchemaVersion("1.1.0"), new SchemaVersion("1.2.0")); // end is inclusive

        assert !new SchemaVersion("1").between(new SchemaVersion("1"), new SchemaVersion("1.1")); // start is exclusive
    }
View Full Code Here

TOP

Related Classes of org.rhq.core.db.ant.dbupgrade.SchemaVersion

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.