Examples of Mock


Examples of org.jmock.Mock

    protected void setUp()
        throws Exception
    {
        action = new CreateProjectsFromMetadataAction();
        action.enableLogging( new ConsoleLogger( Logger.LEVEL_DEBUG, "" ) );
        Mock projectBuilderManagerMock = mock( ContinuumProjectBuilderManager.class );
        Mock mavenSettingsBuilderMock = mock( MavenSettingsBuilder.class );
        action.setProjectBuilderManager( (ContinuumProjectBuilderManager) projectBuilderManagerMock.proxy() );
        action.setMavenSettingsBuilder( (MavenSettingsBuilder) mavenSettingsBuilderMock.proxy() );
        action.setUrlValidator( new ContinuumUrlValidator() );
        Mock projectBuilder = mock( ContinuumProjectBuilder.class );

        projectBuilderManagerMock.expects( once() ).method( "getProjectBuilder" ).will(
            returnValue( projectBuilder.proxy() ) );
        projectBuilder.expects( once() ).method( "buildProjectsFromMetadata" ).will(
            returnValue( new ContinuumProjectBuildingResult() ) );

        projectBuilder.expects( once() ).method( "getDefaultBuildDefinitionTemplate" ).will(
            returnValue( getDefaultBuildDefinitionTemplate() ) );

        mavenSettingsBuilderMock.expects( once() ).method( "buildSettings" ).will( returnValue( new Settings() ) );

    }
View Full Code Here

Examples of org.jmock.cglib.Mock

        return createMockObject(name, null);
    }

    public static <T> T createMockObject(Class<T> name, MockInitializer initializer) {
        String shortName = getShortName(name);
        Mock mock = new Mock(name, shortName);
        log.info("created a Mock for " + shortName);

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

        return name.cast(mock.proxy());
    }
View Full Code Here

Examples of org.jmock.cglib.Mock

    public static Object createMockObject(Class<?> name, MockInitializer initializer,
                                          Class<?>[] clsArgs, Object[] args) {
        String shortName = getShortName(name);
        CGLibCoreMockExt cglibMock = new CGLibCoreMockExt(name, shortName);
        Mock mock = new Mock(cglibMock);
        log.info("created a Mock for " + shortName);

        if (initializer != null) {
            initializer.init(mock);
        }
View Full Code Here

Examples of org.mockito.Mock

                                        try {
                                            f.setAccessible(true);
                                            final Object mockInstance = f.get(instance.getInstance());

                                            if (Mock.class.equals(annotation.annotationType())) {
                                                final Mock mock = (Mock) annotation;
                                                if (!"".equals(mock.name())) {
                                                    mockInstancesByName.put(mock.name(), mockInstance);
                                                } else {
                                                    mockInstancesByType.put(f.getType(), mockInstance);
                                                }
                                            } else {
                                                mockInstancesByType.put(f.getType(), mockInstance);
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.