Package org.teiid.core.id

Examples of org.teiid.core.id.ParsedObjectID


    /*
     * @see TestCase#setUp()
     */
    protected void setUp() throws Exception {
        super.setUp();
        parsedID                        = new ParsedObjectID(PROTOCOL,REMAINDER);
        parsedIDWithNullProtocol        = new ParsedObjectID(null,REMAINDER);
        parsedIDWithNullRemainder       = new ParsedObjectID(PROTOCOL,null);
        parsedIDWithZeroLengthProtocol  = new ParsedObjectID(EMPTY_STRING,REMAINDER);
        parsedIDWithZeroLengthRemainder = new ParsedObjectID(PROTOCOL,EMPTY_STRING);
    }
View Full Code Here


    // =========================================================================
    //                      H E L P E R   M E T H O D S
    // =========================================================================

    public void helpTestParsable(final String str, final String expectedProtocol, boolean shouldSucceed ) {
        ParsedObjectID p = null;
        try {
            if ( expectedProtocol == null ) {
                p = ParsedObjectID.parsedStringifiedObjectID(str);
            } else {
                p = ParsedObjectID.parsedStringifiedObjectID(str,expectedProtocol);
            }
            if ( !shouldSucceed ) {
                fail("Unexpectedly succeeded in parsing string " + str); //$NON-NLS-1$
            }
        } catch (InvalidIDException e) {
            if ( shouldSucceed ) {
              throw new RuntimeException(e);
            }
        }

        // If shouldSucceed, then test for expected protocol ...
        if ( shouldSucceed && expectedProtocol != null ) {
            if ( !p.getProtocol().equals(expectedProtocol)) {
                fail("Result of getProtocol() on parsed string didn't match expected protocol " + expectedProtocol); //$NON-NLS-1$
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.teiid.core.id.ParsedObjectID

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.