Package org.teiid.core.id

Examples of org.teiid.core.id.ObjectIDFactory


                              " but getDefaultFactory returned " + gen.getDefaultFactory() ); //$NON-NLS-1$
        }
    }

    public void helpTestGetFactory( final IDGenerator gen, final String protocol, final boolean shouldSucceed ) {
        final ObjectIDFactory factory = gen.getFactory(protocol);
        if ( factory == null && shouldSucceed ) {
            fail("Unable to find factory for protocol " + protocol); //$NON-NLS-1$
        }
        if ( factory != null && !shouldSucceed ) {
            fail("Unexpectedly found factory for protocol " + protocol); //$NON-NLS-1$
View Full Code Here


            fail("Unexpectedly found factory for protocol " + protocol); //$NON-NLS-1$
        }
    }

    public void helpTestGetDefaultFactory( final IDGenerator gen, final String protocolOrNull ) {
        final ObjectIDFactory factory = gen.getDefaultFactory();
        if ( factory == null && protocolOrNull != null ) {
            fail("Unable to find default factory"); //$NON-NLS-1$
        }
        if ( factory != null && protocolOrNull == null ) {
            fail("Unexpectedly found default factory"); //$NON-NLS-1$
        }
        if ( factory != null && !factory.getProtocol().equals(protocolOrNull) ) {
            fail("Default factory had protocol " + factory.getProtocol() + //$NON-NLS-1$
                              " but should have been " + protocolOrNull); //$NON-NLS-1$
        }
    }
View Full Code Here

        // Determine if the factory is really there ...
        boolean shouldFind = false;
        final Collection factories = gen.getFactories();
        final Iterator iter = factories.iterator();
        while (iter.hasNext()) {
            final ObjectIDFactory factory = (ObjectIDFactory)iter.next();
            if ( factory.getProtocol().equals(protocol) ) {
                shouldFind = true;
            }
        }

        final boolean actuallyRemoved = gen.removeFactory(protocol);
View Full Code Here

        helpTestRemoveFactory(generatorWithBuiltIns,"bogus id",false); //$NON-NLS-1$
    }

    public void testSettingDefaultFactoryByProtocol() {
        final IDGenerator gen = new IDGenerator();
        final ObjectIDFactory factory = new IntegerIDFactory();
        helpTestGetDefaultFactory(gen,DEFAULT_FACTORY_PROTOCOL);
        gen.addFactory(factory);
        helpTestGetDefaultFactory(gen,DEFAULT_FACTORY_PROTOCOL);
        gen.setDefaultFactory(IntegerID.PROTOCOL);
        helpTestGetDefaultFactory(gen,IntegerID.PROTOCOL);
View Full Code Here

        helpTestGetDefaultFactory(gen,IntegerID.PROTOCOL);
    }

    public void testSettingDefaultFactoryByReference() {
        final IDGenerator gen = new IDGenerator();
        final ObjectIDFactory factory = new IntegerIDFactory();
        helpTestGetDefaultFactory(gen,DEFAULT_FACTORY_PROTOCOL);
        gen.addFactory(factory);
        helpTestGetDefaultFactory(gen,DEFAULT_FACTORY_PROTOCOL);
        gen.setDefaultFactory(factory);
        helpTestGetDefaultFactory(gen,IntegerID.PROTOCOL);
View Full Code Here

TOP

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

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.