Examples of expect()


Examples of com.mockobjects.dynamic.Mock.expect()

      mockLogger.expect( "info", C.args( C.eq( acceptorCreatedMessage ) ) );
      mockLogger.expect( "info", C.args( C.eq( acceptorClosingMessage ) ) );
      mockLogger.expectAndReturn( "isDebugEnabled", C.NO_ARGS, false );
      mockLogger.expectAndReturn( "isDebugEnabled", C.NO_ARGS, true );
      mockLogger.expect( "debug", C.args( C.eq( serverSocketListening ) ) );
      mockLogger.expect( "warn", C.args( C.eq( errorAcceptingConnectionMessage ), C.eq( ioe ) ) );
      mockLogger.expect( "warn", C.args( C.eq( errorClosingServerSocketMessage ), C.eq( ioe ) ) );
      final Logger logger = (Logger) mockLogger.proxy();

      final AcceptorMonitor monitor = new AvalonAcceptorMonitor( logger );
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

      mockLogger.expect( "info", C.args( C.eq( acceptorCreatedMessage ) ) );
      mockLogger.expect( "info", C.args( C.eq( acceptorClosingMessage ) ) );
      mockLogger.expectAndReturn( "isDebugEnabled", C.NO_ARGS, false );
      mockLogger.expectAndReturn( "isDebugEnabled", C.NO_ARGS, true );
      mockLogger.expect( "debug", C.args( C.eq( serverSocketListening ) ) );
      mockLogger.expect( "warn", C.args( C.eq( errorAcceptingConnectionMessage ), C.eq( ioe ) ) );
      mockLogger.expect( "warn", C.args( C.eq( errorClosingServerSocketMessage ), C.eq( ioe ) ) );
      final Logger logger = (Logger) mockLogger.proxy();

      final AcceptorMonitor monitor = new AvalonAcceptorMonitor( logger );
      monitor.acceptorCreated( name, serverSocket );
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

      mockLogger.expect( "info", C.args( C.eq( acceptorClosingMessage ) ) );
      mockLogger.expectAndReturn( "isDebugEnabled", C.NO_ARGS, false );
      mockLogger.expectAndReturn( "isDebugEnabled", C.NO_ARGS, true );
      mockLogger.expect( "debug", C.args( C.eq( serverSocketListening ) ) );
      mockLogger.expect( "warn", C.args( C.eq( errorAcceptingConnectionMessage ), C.eq( ioe ) ) );
      mockLogger.expect( "warn", C.args( C.eq( errorClosingServerSocketMessage ), C.eq( ioe ) ) );
      final Logger logger = (Logger) mockLogger.proxy();

      final AcceptorMonitor monitor = new AvalonAcceptorMonitor( logger );
      monitor.acceptorCreated( name, serverSocket );
      monitor.acceptorClosing( name, serverSocket );
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

      throws Exception
   {
      final Mock mockHandler = new Mock( RequestHandler.class );
      final Socket socket = new Socket();
      final Long timeout = new Long( 23 );
      mockHandler.expect( "handleConnection", C.args( C.eq( socket ) ) );
      mockHandler.expect( "shutdown", C.args( C.eq( timeout ) ) );
      final RequestHandler handler = (RequestHandler) mockHandler.proxy();
      final DelegatingRequestHandler delegatingHandler =
         new DelegatingRequestHandler( handler );
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

   {
      final Mock mockHandler = new Mock( RequestHandler.class );
      final Socket socket = new Socket();
      final Long timeout = new Long( 23 );
      mockHandler.expect( "handleConnection", C.args( C.eq( socket ) ) );
      mockHandler.expect( "shutdown", C.args( C.eq( timeout ) ) );
      final RequestHandler handler = (RequestHandler) mockHandler.proxy();
      final DelegatingRequestHandler delegatingHandler =
         new DelegatingRequestHandler( handler );

      delegatingHandler.handleConnection( socket );
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

    public void testManagedRequestHandler()
        throws Exception
    {
        final Mock mockHandler = new Mock( RequestHandler.class );
        final Socket socket = new Socket();
        mockHandler.expect( "handleConnection", C.args( C.eq( socket ) ) );
        final RequestHandler handler = (RequestHandler)mockHandler.proxy();

        final Mock mockManager = new Mock( RequestManager.class );
        mockManager.expectAndReturn( "aquireHandler",
                                     C.args( C.isA( Socket.class ) ),
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

        final Mock mockManager = new Mock( RequestManager.class );
        mockManager.expectAndReturn( "aquireHandler",
                                     C.args( C.isA( Socket.class ) ),
                                     handler );
        mockManager.expect( "releaseHandler",
                            C.args( C.eq( handler ) ) );

        final RequestManager manager = (RequestManager)mockManager.proxy();

        final MockManagedRequestHandler managedHandler =
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

*/
public class DefaultValidatorFactoryTest extends TestCase {

    public void testParseValidators() {
        Mock mockValidatorFileParser = new Mock(ValidatorFileParser.class);
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("com/opensymphony/xwork2/validator/validators/default.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("validators.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("myOther-validators.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("my-validators.xml")));
        DefaultValidatorFactory factory = new DefaultValidatorFactory(null, (ValidatorFileParser) mockValidatorFileParser.proxy());
    }
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

public class DefaultValidatorFactoryTest extends TestCase {

    public void testParseValidators() {
        Mock mockValidatorFileParser = new Mock(ValidatorFileParser.class);
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("com/opensymphony/xwork2/validator/validators/default.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("validators.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("myOther-validators.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("my-validators.xml")));
        DefaultValidatorFactory factory = new DefaultValidatorFactory(null, (ValidatorFileParser) mockValidatorFileParser.proxy());
    }
}
View Full Code Here

Examples of com.mockobjects.dynamic.Mock.expect()

    public void testParseValidators() {
        Mock mockValidatorFileParser = new Mock(ValidatorFileParser.class);
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("com/opensymphony/xwork2/validator/validators/default.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("validators.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("myOther-validators.xml")));
        mockValidatorFileParser.expect("parseValidatorDefinitions", C.args(C.IS_NOT_NULL, C.IS_NOT_NULL, C.eq("my-validators.xml")));
        DefaultValidatorFactory factory = new DefaultValidatorFactory(null, (ValidatorFileParser) mockValidatorFileParser.proxy());
    }
}
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.