Package org.apache.hivemind.service

Examples of org.apache.hivemind.service.ObjectProvider


*/
public class TestBeanFactoryObjectProvider extends HiveMindTestCase
{
    public void testNullInput()
    {
        ObjectProvider op = new BeanFactoryObjectProvider();

        assertNull(op.provideObject(null, null, null, null));
    }
View Full Code Here


        assertNull(op.provideObject(null, null, null, null));
    }

    public void testNoServiceId()
    {
        ObjectProvider op = new BeanFactoryObjectProvider();
        Location l = newLocation();

        try
        {
            op.provideObject(null, null, "foo", l);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals(
View Full Code Here

        }
    }

    public void testNoLocator()
    {
        ObjectProvider op = new BeanFactoryObjectProvider();
        Location l = newLocation();

        try
        {
            op.provideObject(null, null, "foo:", l);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals(
View Full Code Here

        factory.get("my-bean,initialized");
        factoryControl.setReturnValue(result);

        replayControls();

        ObjectProvider op = new BeanFactoryObjectProvider();

        assertSame(result, op.provideObject(module, null, "factory:my-bean,initialized", null));

        verifyControls();
    }
View Full Code Here

            return null;
        }

        String prefix = inputValue.substring(0, colonx);

        ObjectProvider provider = (ObjectProvider) _providers.get(prefix);

        if (provider == null)
        {
            _errorLog.error(ServiceMessages.unknownProviderPrefix(prefix), location, null);

            return null;
        }

        String locator = inputValue.substring(colonx + 1);

        try
        {
            return provider.provideObject(contributingModule, propertyType, locator, location);
        }
        catch (Exception ex)
        {
            throw new ApplicationRuntimeException(ex.getMessage(), location, ex);
        }
View Full Code Here

        ServicePoint sp1 = (ServicePoint) spc1.getMock();

        MockControl spc2 = newControl(ServicePoint.class);
        ServicePoint sp2 = (ServicePoint) spc2.getMock();

        ObjectProvider service = (ObjectProvider) newMock(ObjectProvider.class);

        // Training

        sp1.getExtensionPointId();
        spc1.setReturnValue("foo.Private");
View Full Code Here

            return null;
        }

        String prefix = inputValue.substring(0, colonx);

        ObjectProvider provider = (ObjectProvider) _providers.get(prefix);

        if (provider == null)
        {
            _errorHandler.error(
                _log,
                ServiceMessages.unknownProviderPrefix(prefix),
                location,
                null);

            return null;
        }

        String locator = inputValue.substring(colonx + 1);

        return provider.provideObject(contributingModule, propertyType, locator, location);

    }
View Full Code Here

*/
public class TestBeanFactoryObjectProvider extends HiveMindTestCase
{
    public void testNullInput()
    {
        ObjectProvider op = new BeanFactoryObjectProvider();

        assertNull(op.provideObject(null, null, null, null));
    }
View Full Code Here

        assertNull(op.provideObject(null, null, null, null));
    }

    public void testNoServiceId()
    {
        ObjectProvider op = new BeanFactoryObjectProvider();
        Location l = fabricateLocation(97);

        try
        {
            op.provideObject(null, null, "foo", l);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals(
View Full Code Here

        }
    }

    public void testNoLocator()
    {
        ObjectProvider op = new BeanFactoryObjectProvider();
        Location l = fabricateLocation(12);

        try
        {
            op.provideObject(null, null, "foo:", l);
            unreachable();
        }
        catch (ApplicationRuntimeException ex)
        {
            assertEquals(
View Full Code Here

TOP

Related Classes of org.apache.hivemind.service.ObjectProvider

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.