Package org.jmock.cglib

Examples of org.jmock.cglib.Mock.proxy()


        if (initializer != null) {
            initializer.init(mock);
        }

        return name.cast(mock.proxy());
    }

    public static Object createMockObject(Class<?> name, Class<?>[] clsArgs, Object[] args) {
        return createMockObject(name, null, clsArgs, args);
    }
View Full Code Here


        Mock mock = new Mock( CommandLineFactory.class );

        mock.expects( new InvokeOnceMatcher() ).method( "createCommandLine" ).with( new IsEqual( "mvn" ) ).will(
            new ReturnStub( commandLineMock.proxy() ) );

        executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );

        executor.executeGoals( workingDirectory, "clean integration-test", false, null, new ReleaseResult() );

        assertTrue( true );
    }
View Full Code Here

        Mock mock = new Mock( CommandLineFactory.class );

        mock.expects( new InvokeOnceMatcher() ).method( "createCommandLine" ).with( new IsEqual( "mvn" ) ).will(
            new ReturnStub( commandLineMock.proxy() ) );

        executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );

        executor.executeGoals( workingDirectory, "clean integration-test", false, null, "my-pom.xml",
                               new ReleaseResult() );

        assertTrue( true );
View Full Code Here

        Mock mock = new Mock( CommandLineFactory.class );

        mock.expects( new InvokeOnceMatcher() ).method( "createCommandLine" ).with( new IsEqual( "mvn" ) ).will(
            new ReturnStub( commandLineMock.proxy() ) );

        executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );

        executor.executeGoals( workingDirectory, "clean integration-test", false, arguments, null );

        assertTrue( true );
    }
View Full Code Here

        Mock mock = new Mock( CommandLineFactory.class );

        mock.expects( new InvokeOnceMatcher() ).method( "createCommandLine" ).with( new IsEqual( "mvn" ) ).will(
            new ReturnStub( commandLineMock.proxy() ) );

        executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );

        try
        {
            executor.executeGoals( workingDirectory, "clean integration-test", false, null, new ReleaseResult() );
View Full Code Here

        Mock mock = new Mock( CommandLineFactory.class );

        mock.expects( new InvokeOnceMatcher() ).method( "createCommandLine" ).with( new IsEqual( "mvn" ) ).will(
            new ReturnStub( commandLineMock.proxy() ) );

        executor.setCommandLineFactory( (CommandLineFactory) mock.proxy() );

        try
        {
            executor.executeGoals( workingDirectory, "clean integration-test", false, null, new ReleaseResult() );
View Full Code Here

    private static Commandline.Argument createArgumentValueMock( String value )
    {
        Mock mock = new Mock( Commandline.Argument.class );
        mock.expects( new InvokeOnceMatcher() ).method( "setValue" ).with( new IsEqual( value ) );
        return (Commandline.Argument) mock.proxy();
    }

    private static Commandline.Argument createArgumentLineMock( String value )
    {
        Mock mock = new Mock( Commandline.Argument.class );
View Full Code Here

    private static Commandline.Argument createArgumentLineMock( String value )
    {
        Mock mock = new Mock( Commandline.Argument.class );
        mock.expects( new InvokeOnceMatcher() ).method( "setLine" ).with( new IsEqual( value ) );
        return (Commandline.Argument) mock.proxy();
    }

    private static Process createMockProcess( int exitCode )
    {
        Mock mockProcess = new Mock( Process.class );
View Full Code Here

        if ( exitCode != 0 )
        {
            mockProcess.expects( new InvokeOnceMatcher() ).method( "exitValue" ).will(
                new ReturnStub( new Integer( exitCode ) ) );
        }
        return (Process) mockProcess.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.