Package org.apache.hivemind

Examples of org.apache.hivemind.ServiceImplementationFactory


        MockControl factoryPointControl = newControl(ServicePoint.class);
        ServicePoint factoryPoint = (ServicePoint) factoryPointControl.getMock();

        MockControl factoryControl = newControl(ServiceImplementationFactory.class);
        ServiceImplementationFactory factory = (ServiceImplementationFactory) factoryControl
                .getMock();

        MockControl pointControl = newControl(ServicePoint.class);
        ServicePoint point = (ServicePoint) pointControl.getMock();
       
        SchemaImpl schema = new SchemaImpl("module");
        schema.setRootElementClassName(ArrayList.class.getName());
       
        ModuleDefinition md = createModuleDefinition("test");
        XmlServicePointDefinitionImpl xmlSpd = new XmlServicePointDefinitionImpl(md);
        xmlSpd.setParametersCount(Occurances.REQUIRED);
        xmlSpd.setParametersSchema(schema);
       
        Location location = newLocation();
        InvokeFactoryServiceConstructor c = new InvokeFactoryServiceConstructor(location, "module");

        ErrorLog log = (ErrorLog) newMock(ErrorLog.class);

        // Training !
       
        point.getErrorLog();
        pointControl.setReturnValue(log);

        module.getServicePoint("foo.bar.Baz");
        moduleControl.setReturnValue(factoryPoint);
       
        module.resolveType(ArrayList.class.getName());
        moduleControl.setReturnValue(ArrayList.class);

        factoryPoint.getService(ServiceImplementationFactory.class);
        factoryPointControl.setReturnValue(factory);

        factoryPoint.getServicePointDefinition();
        factoryPointControl.setReturnValue(xmlSpd);
       
        factoryPoint.getModule();
        factoryPointControl.setReturnValue(module);

        String message = XmlImplMessages
                .wrongNumberOfParameters("foo.bar.Baz", 0, Occurances.REQUIRED);

        log.error(message, location, null);

        factory.createCoreServiceImplementation(new ServiceImplementationFactoryParametersImpl(
                point, module, Collections.EMPTY_LIST));
        factoryControl.setReturnValue("THE SERVICE");

        replayControls();
View Full Code Here


        DataItem d = (DataItem) l.get(0);

        assertEquals("builder", d.getName());
        assertEquals(5, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

        DataItem d = (DataItem) l.get(0);

        assertEquals("builder", d.getName());
        assertEquals(5, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

        DataItem d = (DataItem) l.get(0);

        assertEquals("underworld", d.getName());
        assertEquals(18, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

        DataItem d = (DataItem) l.get(0);

        assertEquals("lamb", d.getName());
        assertEquals(95, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

        DataItem d = (DataItem) l.get(0);

        assertEquals("wesley", d.getName());
        assertEquals(15, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

        DataItem d = (DataItem) l.get(0);

        assertEquals("builder", d.getName());
        assertEquals(5, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

        DataItem d = (DataItem) l.get(0);

        assertEquals("builder", d.getName());
        assertEquals(5, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

        DataItem d = (DataItem) l.get(0);

        assertEquals("underworld", d.getName());
        assertEquals(18, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

        DataItem d = (DataItem) l.get(0);

        assertEquals("lamb", d.getName());
        assertEquals(95, d.getCount());

        ServiceImplementationFactory builderFactory =
            (ServiceImplementationFactory) r.getService(
                "hivemind.BuilderFactory",
                ServiceImplementationFactory.class);

        assertSame(builderFactory, d.getFactory());
View Full Code Here

TOP

Related Classes of org.apache.hivemind.ServiceImplementationFactory

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.