Package org.easymock

Examples of org.easymock.IMocksControl.replay()


        display.showView(view2);
        manager.setState("test2");
        listener1.addExpectedNavigatorViewChange(event4);
        listener2.addExpectedNavigatorViewChange(event4);

        control.replay();

        // test navigator
        navigator.addProvider(provider);
        navigator.addViewChangeListener(listener1);
        navigator.addViewChangeListener(listener2);
View Full Code Here


        ViewDisplay display = control.createMock(ViewDisplay.class);

        display.showView(view);
        view.enter(EasyMock.anyObject(ViewChangeEvent.class));

        control.replay();

        NavigationStateManager manager = EasyMock
                .createNiceMock(NavigationStateManager.class);
        EasyMock.replay(manager);
View Full Code Here

        EasyMock.expect(bc.getBundles()).andReturn(new Bundle[] {b0}).anyTimes();
        EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
                andReturn(Collections.singleton("org.example.SomeService")).anyTimes();
       
        EasyMock.expect(bc.getService(sr)).andReturn(dst).anyTimes();
        control.replay();

        // create the local discovery service
        LocalDiscoveryService lds = new LocalDiscoveryService(bc);
       
        // it should be prepopulated with the info from bundle b0
View Full Code Here

            Dictionary<String, Object> d2 = new Hashtable<String, Object>();
            d2.put("blah", "3");
            d2.put("boo", "hello");
            EasyMock.expect(mockFilter.match(d2)).andReturn(true).anyTimes();
           
            control.replay();
   
            // create the local discovery service
            LocalDiscoveryService lds = new LocalDiscoveryService(bc);
           
            // it should be prepopulated with the info from bundle b0
View Full Code Here

            EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
                    andReturn(Collections.singleton("org.example.SomeService")).anyTimes();
            EasyMock.replay(sr);
           
            EasyMock.expect(bc.getService(sr)).andReturn(dst).anyTimes();
            control.replay();
   
            // create the local discovery service
            LocalDiscoveryService lds = new LocalDiscoveryService(bc);
           
            // it should be prepopulated with the info from bundle b0
View Full Code Here

            EasyMock.expect(bc.getBundles()).andReturn(new Bundle[] {b0, b1}).anyTimes();
            EasyMock.expect(sr.getProperty(DiscoveredServiceTracker.INTERFACE_MATCH_CRITERIA)).
                    andReturn(Collections.singleton("org.example.SomeService")).anyTimes();
           
            EasyMock.expect(bc.getService(sr)).andReturn(dst).anyTimes();
            control.replay();
   
            // create the local discovery service
            LocalDiscoveryService lds = new LocalDiscoveryService(bc);
           
            ServiceEndpointDescription sed3 = new ServiceEndpointDescriptionImpl(
View Full Code Here

                bundleListenerRegs.add("removeBundleListener");
                return null;
            }           
        });
       
        control.replay();
       
        assertEquals("Precondition failed", 0, bundleListenerRegs.size());
        LocalDiscoveryService lds = new LocalDiscoveryService(bc);
        assertEquals(1, bundleListenerRegs.size());
        assertEquals("addBundleListener", bundleListenerRegs.get(0));
View Full Code Here

        Binding binding = control.createMock(Binding.class);
        EasyMock.expect(endpoint.getBinding()).andReturn(binding);
        org.apache.cxf.message.Message cxfMessage = new org.apache.cxf.message.MessageImpl();
        EasyMock.expect(binding.createMessage()).andReturn(cxfMessage);
        cxfExchange.put(Endpoint.class, endpoint);
        control.replay();
       
        cxfBinding.populateCxfResponseFromExchange(exchange, cxfExchange);
       
        cxfMessage = cxfExchange.getOutMessage();
        assertNotNull(cxfMessage);
View Full Code Here

        ServiceRegistration sreg = control.createMock(ServiceRegistration.class);
        EasyMock.expect(sreg.getReference()).andReturn(sr);
       
        handler.createProxy(sr, dswContext, requestingContext, String.class, sd);
        EasyMock.expectLastCall().andReturn(myTestProxyObject);       
        control.replay();      
       
        ClientServiceFactory csf = new ClientServiceFactory(dswContext, String.class, sd, handler);
        assertSame(myTestProxyObject, csf.getService(requestingBundle, sreg));
    }
}
View Full Code Here

        Object service = "hi";

        ConfigurationTypeHandler handler = control.createMock(ConfigurationTypeHandler.class);
        handler.createServer(serviceReference, dswContext, callingContext, sd, String.class, service);
        EasyMock.expectLastCall().andReturn(srvr);
        control.replay();
       
        assertSame(srvr,
            ServiceHookUtils.createServer(handler, serviceReference, dswContext, callingContext, sd, service));       
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.