Examples of expectAndReturn()


Examples of org.easymock.MockControl.expectAndReturn()

        Bundle b = (Bundle) control.getMock();
        control.replay();

        MockControl controlContext = MockControl.createNiceControl(BundleContext.class);
        BundleContext c = (BundleContext) controlContext.getMock();
        controlContext.expectAndReturn(c.getBundle(), b);
        controlContext.replay();

        ServiceRegistry sr = new ServiceRegistry(new Logger(), null);
        class CombinedService implements ListenerHook, FindHook, EventHook, Runnable
        {
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

        Bundle b = (Bundle) control.getMock();
        control.replay();

        MockControl controlContext = MockControl.createNiceControl(BundleContext.class);
        BundleContext c = (BundleContext) controlContext.getMock();
        controlContext.expectAndReturn(c.getBundle(), b);
        controlContext.replay();

        ServiceRegistry sr = new ServiceRegistry(new Logger(), null);
        String svcObj = "hello";
        assertEquals("Precondition failed", 0, sr.getHooks(EventHook.class).size());
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

    // afterPropertiesSet
    repoCtrl.expectAndReturn(repo.login(null, null), session);
    sessionCtrl.expectAndReturn(session.getWorkspace(), ws);
    wsCtrl.expectAndReturn(ws.getNamespaceRegistry(), registry);

    nrCtrl.expectAndReturn(registry.getPrefixes(), new String[0]);

    registry.registerNamespace("foo", "bar");
    registry.registerNamespace("hocus", "pocus");

    nrCtrl.replay();
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

    wsCtrl.expectAndReturn(ws.getNamespaceRegistry(), registry);

    registry.registerNamespace("foo", "bar");
    registry.registerNamespace("hocus", "pocus");

    nrCtrl.expectAndReturn(registry.getPrefixes(), new String[0]);
    nrCtrl.replay();
    wsCtrl.replay();
    sessionCtrl.replay();
    repoCtrl.replay();
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

       
        nodeCtrl.expectAndReturn(node.getPath(), "path");
        nodeCtrl.expectAndReturn(node.getProperties(), iterator);
        iteratorCtrl.expectAndReturn(iterator.hasNext(), false);
        nodeCtrl.expectAndReturn(node.getNodes(), iter);
        iterCtrl.expectAndReturn(iter.hasNext(), false);
       
        sessionControl.expectAndReturn(session.getRootNode(), node);
       
        sessionControl.replay();
        sfControl.replay();
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

    // configuration.setUseSpringObjectFactory(false);

    MockControl factoryControl = MockControl.createControl(ObjectFactory.class);
    ObjectFactory mockFactory = (ObjectFactory) factoryControl.getMock();

    factoryControl.expectAndReturn(mockFactory.createObject(JbpmContext.DEFAULT_JBPM_CONTEXT_NAME),
        new JbpmContext(null, mockFactory), 2);
    factoryControl.replay();
    configuration.setObjectFactory(mockFactory);
    configuration.afterPropertiesSet();
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

        .isSerializableCacheElementRequired(), true);
    cacheProviderFacadeControl.replay();

    Serializable expected = "Leia";
    Object objectToStore = new Object();
    factoryControl.expectAndReturn(factory
        .makeSerializableIfNecessary(objectToStore), expected);
    factoryControl.replay();

    Object actual = cacheProviderFacade
        .makeSerializableIfNecessary(objectToStore);
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

    MockControl tCtrl = MockClassControl.createControl(JcrTemplate.class);
    JcrTemplate t = (JcrTemplate) tCtrl.getMock();

    RepositoryException ex = new RepositoryException();

    tCtrl.expectAndReturn(t.convertJcrAccessException(ex), null);
    dao.setTemplate(t);
    dao.convertJcrAccessException(ex);

  }
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

    // afterPropertiesSet
    repoCtrl.expectAndReturn(repo.login(null, null), session);
    sessionCtrl.expectAndReturn(session.getWorkspace(), ws);
    wsCtrl.expectAndReturn(ws.getNamespaceRegistry(), registry);
   
    nrCtrl.expectAndReturn(registry.getPrefixes(), new String[0]);

    // destroy
    registry.registerNamespace("foo", "bar");
    registry.registerNamespace("hocus", "pocus");
View Full Code Here

Examples of org.easymock.MockControl.expectAndReturn()

    wsCtrl.expectAndReturn(ws.getNamespaceRegistry(), registry);

    // registry record
    String[] prefixes = new String[] { foo };
    String oldURI = "old bar";
    nrCtrl.expectAndReturn(registry.getPrefixes(), prefixes);
    nrCtrl.expectAndReturn(registry.getURI(foo), oldURI);
    registry.unregisterNamespace(foo);

    registry.registerNamespace(foo, "bar");
    registry.registerNamespace("hocus", "pocus");
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.