Package org.easymock.classextension

Examples of org.easymock.classextension.IMocksControl.replay()


        PrimitiveAssertion xpa = ctrl.createMock(PrimitiveAssertion.class);
        QName oqn = new QName("http://cxf.apache.org/test/assertions/blah", "OtherType");
        EasyMock.expect(xpa.getName()).andReturn(oqn);
        EasyMock.expect(xpa.getType()).andReturn(Constants.TYPE_ASSERTION);
       
        ctrl.replay();
        assertTrue(!assertion.equal(xpa));
        ctrl.verify();
           
        FooType odata = new FooType();
        odata.setName(data.getName());
View Full Code Here


        context.setApplication(mockApp);       
        ELResolver elResolver = mocksControl.createMock(ELResolver.class);
        expect(mockApp.getELResolver()).andReturn(elResolver);
        context.setELContext(new MockELContext());
        expect(elResolver.getValue(eq(context.getELContext()), isNull(), eq("xxx"))).andReturn("testValue");
        mocksControl.replay();
        assertEquals("testValue", variableResolver.resolveVariable(context, "xxx"));
    }

    private void assertGetResourceBundleWithLocale(final Locale expectedLocale)
    {
View Full Code Here

        expect(jspAppCtx.getExpressionFactory()).andReturn(expressionFactory);
        jspAppCtx.addELContextListener(isA(FacesELContextListener.class));
        expect(jspFactory.getJspApplicationContext(eq(context))).andReturn(jspAppCtx);
        jspAppCtx.addELResolver(isA(FacesCompositeELResolver.class));

        control.replay();
        initializer.initFaces(context);

        // In MYFACES-1222: The Jsp21FacesInitializer isn't practicable anymore.
        // The ServletContext-Mock won't return its WebXml instance, so Jsp21FacesInitializer will stop initializing.
        // This is why the next line is commented:
View Full Code Here

        expect(application.getMessageBundle()).andReturn("javax.faces.Messages");
        expect(application.getExpressionFactory()).andReturn(expressionFactory);
        String s = "xxx: Validation Error: Value is greater than allowable maximum of ''xyz''";
        expect(expressionFactory.createValueExpression(elContext,s,String.class)).andReturn(valueExpression);
        expect(valueExpression.getValue(elContext)).andReturn(s);
        mocksControl.replay();

        Assert.assertEquals(_MessageUtils.getErrorMessage(facesContext, "javax.faces.validator.DoubleRangeValidator.MAXIMUM",
                new Object[] { "xyz", "xxx" }).getDetail(),
                "xxx: Validation Error: Value is greater than allowable maximum of 'xyz'");
    }
View Full Code Here

        EasyMock.expect(visitContextMock.invokeVisitCallback(headerFacet, callback)).andReturn(VisitResult.ACCEPT);
        EasyMock.expect(visitContextMock.invokeVisitCallback(footerFacet, callback)).andReturn(VisitResult.ACCEPT);
        EasyMock.expect(visitContextMock.invokeVisitCallback(facetOfChild1, callback)).andReturn(VisitResult.ACCEPT);
        EasyMock.expect(visitContextMock.invokeVisitCallback(child1, callback)).andReturn(VisitResult.ACCEPT);
        EasyMock.expect(visitContextMock.invokeVisitCallback(childOfChild1, callback)).andReturn(VisitResult.ACCEPT).times(2);
        control.replay();
       
        uidata.visitTree(visitContextMock, callback);
       
        control.verify();
       
View Full Code Here

        expect(jspAppCtx.getExpressionFactory()).andReturn(expressionFactory);
        jspAppCtx.addELContextListener(isA(FacesELContextListener.class));
        expect(jspFactory.getJspApplicationContext(eq(context))).andReturn(jspAppCtx);
        jspAppCtx.addELResolver(isA(FacesCompositeELResolver.class));

        control.replay();
        initializer.initFaces(context);

        // In MYFACES-1222: The Jsp21FacesInitializer isn't practicable anymore.
        // The ServletContext-Mock won't return its WebXml instance, so Jsp21FacesInitializer will stop initializing.
        // This is why the next line is commented:
View Full Code Here

            }
        }

        EasyMock.expect(bus.getExtension(BindingFactoryManager.class)).andReturn(bindingFactoryManager);
        EasyMock.expect(bus.getExtension(DestinationFactoryManager.class)).andStubReturn(dfm);
        control.replay();

        ServiceInfo serviceInfo = wsdlServiceBuilder.buildServices(def, service).get(0);
        serviceInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null);
        serviceInfo.setProperty(WSDLServiceBuilder.WSDL_SERVICE, null);
        return serviceInfo;
View Full Code Here

        expect(application.getMessageBundle()).andReturn("javax.faces.Messages");
        expect(application.getExpressionFactory()).andReturn(expressionFactory);
        String s = "xxx: Validation Error: Value is greater than allowable maximum of ''xyz''";
        expect(expressionFactory.createValueExpression(elContext,s,String.class)).andReturn(valueExpression);
        expect(valueExpression.getValue(elContext)).andReturn(s);
        mocksControl.replay();

        assertEquals(_MessageUtils.getErrorMessage(facesContext, "javax.faces.validator.DoubleRangeValidator.MAXIMUM",
                new Object[] { "xyz", "xxx" }).getDetail(),
                "xxx: Validation Error: Value is greater than allowable maximum of 'xyz'");
    }
View Full Code Here

        });
       
        chain.add(new SOAPHandlerInterceptor(binding));
        message.setInterceptorChain(chain);
        control.replay();

        chain.doIntercept(message);
       
        control.verify();
View Full Code Here

       
        Node node = ((Element) headerInfo[1]).getChildNodes().item(0);
       
        message.getHeaders().add(new Header(new QName(node.getNamespaceURI(), node.getLocalName()), node));
       
        control.replay();

        SOAPHandlerInterceptor li = new SOAPHandlerInterceptor(binding);
        li.handleMessage(message);
        control.verify();
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.