Package org.apache.hivemind.internal

Examples of org.apache.hivemind.internal.ServicePoint


    public void testRegistrationException() throws Exception
    {
        Registry registry = buildFrameworkRegistry("testMBeanRegistry.xml");
        List mBeanList = (List) registry.getConfiguration("hivemind.management.MBeans");

        ServicePoint sp1 = ((MBeanRegistrationContribution) mBeanList.get(0)).getServicePoint();
        ObjectName on1 = objectNameBuilder.createServiceObjectName(sp1);

        // Training
        server.registerMBean(null, null);
        serverControl.setThrowable(new MBeanRegistrationException(new Exception(
View Full Code Here


    private ServicePropertyFactoryParameter newParameters(WonkSource service, String propertyName)
    {
        ServicePropertyFactoryParameter p = new ServicePropertyFactoryParameter();

        final MockControl spControl = newControl( ServicePoint.class );
        final ServicePoint sp = ( ServicePoint )spControl.getMock();
       
        sp.getServiceInterface();
        spControl.setReturnValue( WonkSource.class );
        sp.getService( WonkSource.class );
        spControl.setReturnValue( service );
        p.setServicePoint(sp);
        p.setPropertyName(propertyName);
        p.setLocation(newLocation());
View Full Code Here

     * @since 1.1
     */
    public void testDoubleStartup()
    {
        MockControl spc = newControl( ServicePoint.class );
        ServicePoint sp = ( ServicePoint ) spc.getMock();
        Runnable service = ( Runnable ) newMock( Runnable.class );

        // Training
        sp.getExtensionPointId();
        spc.setReturnValue( "hivemind.Startup" );
        sp.getServiceInterfaceClassName();
        spc.setReturnValue( Runnable.class.getName() );
        sp.visibleToModule( null );
        spc.setReturnValue( true );
        sp.getService( Runnable.class );
        spc.setReturnValue( service );
        service.run();
        replayControls();
        RegistryInfrastructureImpl r = new RegistryInfrastructureImpl( null, null );
        r.addServicePoint( sp );
View Full Code Here

    public void testGetServiceNotVisibleToApplication()
    {
        RegistryInfrastructureImpl rf = new RegistryInfrastructureImpl(null, null);

        MockControl spc = newControl(ServicePoint.class);
        ServicePoint sp = (ServicePoint) spc.getMock();

        // Training

        sp.getExtensionPointId();
        spc.setReturnValue("foo.bar.Baz");

        sp.getServiceInterfaceClassName();
        spc.setReturnValue(Runnable.class.getName());

        sp.visibleToModule(null);
        spc.setReturnValue(false);

        replayControls();

        rf.addServicePoint(sp);
View Full Code Here

    public void testGetServiceNotVisibleToModule()
    {
        RegistryInfrastructureImpl rf = new RegistryInfrastructureImpl(null, null);

        MockControl spc = newControl(ServicePoint.class);
        ServicePoint sp = (ServicePoint) spc.getMock();

        ModuleImpl m = new ModuleImpl();
        m.setModuleId("zip.zap.Zoom");

        // Training

        sp.getExtensionPointId();
        spc.setReturnValue("foo.bar.Baz");

        sp.getServiceInterfaceClassName();
        spc.setReturnValue(Runnable.class.getName());

        sp.visibleToModule(m);
        spc.setReturnValue(false);

        replayControls();

        rf.addServicePoint(sp);
View Full Code Here

     * @since 1.1
     */
    public void testGetServiceMatchesPublicOnly()
    {
        MockControl spc1 = newControl(ServicePoint.class);
        ServicePoint sp1 = (ServicePoint) spc1.getMock();

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

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

        // Training

        sp1.getExtensionPointId();
        spc1.setReturnValue("foo.Private");

        sp1.getServiceInterfaceClassName();
        spc1.setReturnValue(ClassFactory.class.getName());

        sp2.getExtensionPointId();
        spc2.setReturnValue("foo.Public");

        sp2.getServiceInterfaceClassName();
        spc2.setReturnValue(ClassFactory.class.getName());

        sp1.visibleToModule(null);
        spc1.setReturnValue(false);

        sp2.visibleToModule(null);
        spc2.setReturnValue(true);

        sp2.getService(ClassFactory.class);
        spc2.setReturnValue(service);

        replayControls();

        RegistryInfrastructureImpl r = new RegistryInfrastructureImpl(null, null);
View Full Code Here

    public void testCreateClassServiceConstructorTwice()
    {
        Module m = newModule();

        ServicePoint sp = new ServicePointImpl(m, null);
       
        replayControls();

        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(),
                "java.util.HashMap");
View Full Code Here

    public void testCreateInstanceWithInitializer()
    {
        Module m = newModule();
       
        ServicePoint sp = new ServicePointImpl(m, null);

        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(),
                SimpleBean.class.getName() + ",value=HiveMind");

        ImplementationConstructionContext context = new ImplementationConstructionContextImpl(m, sp);
View Full Code Here

    public void testCreateClassServiceConstructorFailure()
    {
        Module m = newModule();
       
        ServicePoint sp = new ServicePointImpl(m, null);

        CreateClassServiceConstructor c = new CreateClassServiceConstructor(newLocation(),
                PrivateBean.class.getName());

        try
View Full Code Here

        return classFab.createClass();
    }

    private Class createInnerProxyClass(Class deferredProxyClass)
    {
        ServicePoint servicePoint = getServicePoint();

        Class serviceInterface = servicePoint.getServiceInterface();
       
        ProxyBuilder builder = new ProxyBuilder("InnerProxy", servicePoint.getModule(),
                serviceInterface, servicePoint.getDeclaredInterface(), false);

        ClassFab classFab = builder.getClassFab();

        classFab.addField("_deferredProxy", deferredProxyClass);
        classFab.addField("_service", serviceInterface);
View Full Code Here

TOP

Related Classes of org.apache.hivemind.internal.ServicePoint

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.