Examples of checking()


Examples of org.jmock.Mockery.checking()

    public void testShouldAddRemoteAndRemoteHomeAnnotations() throws Exception {
        Mockery context = new Mockery();
        final IJDTFacade facade = context.mock(IJDTFacade.class);


        context.checking(new Expectations() {
            {
                one(facade).addClassAnnotation("org.superbiz.Store", Remote.class, null);

                Map<String, Object> remoteHomeProps = new HashMap<String, Object>();
                remoteHomeProps.put("value", "org.superbiz.StoreHome");
View Full Code Here

Examples of org.jmock.Mockery.checking()

        final States jdbcConn = context.states("jdbc").startsAs("down");
        final States broker = context.states("broker").startsAs("started");

        // simulate jdbc up between hasLock and checkpoint, so hasLock fails to verify
        context.checking(new Expectations() {{
            allowing(brokerService).isRestartAllowed();
            will(returnValue(false));
            allowing(brokerService).stopAllConnectors(with(any(ServiceStopper.class)));
            allowing(brokerService).getPersistenceAdapter();
            will(returnValue(jdbcPersistenceAdapter));
View Full Code Here

Examples of org.jmock.Mockery.checking()

        final Connection connection = context.mock(Connection.class);
        final PreparedStatement preparedStatement = context.mock(PreparedStatement.class);
        final ResultSet resultSet = context.mock(ResultSet.class);
        final Timestamp timestamp = context.mock(Timestamp.class);

        context.checking(new Expectations() {{
            allowing(jdbcPersistenceAdapter).getStatements();
            will(returnValue(statements));
            allowing(jdbcPersistenceAdapter);
            allowing(statements);
            allowing(connection).prepareStatement(with(any(String.class)));
View Full Code Here

Examples of org.jmock.integration.junit4.JUnit4Mockery.checking()

        final GradleInternal gradleMock = context.mock(GradleInternal.class);
        final StartParameter testStartParameter = new StartParameter();
        testStartParameter.addInitScript(new File("some init script"));
        testStartParameter.addInitScript(new File("/path/to/another init script"));

        context.checking(new Expectations() {{
            allowing(gradleMock).getStartParameter();
            will(returnValue(testStartParameter));
        }});

        List<ScriptSource> sourceList = new DefaultInitScriptFinder().findScripts(gradleMock);
View Full Code Here

Examples of org.jmock.integration.junit4.JUnit4Mockery.checking()

        final ScriptSource source2Mock = context.mock(ScriptSource.class, "source 2");
        final List<ScriptSource> testSources = new ArrayList<ScriptSource>();
        testSources.add(source1Mock);
        testSources.add(source2Mock);

        context.checking(new Expectations() {{
            one(finderMock).findScripts(gradleMock);
            will(returnValue(testSources));
            one(processorMock).process(source1Mock, gradleMock);
            one(processorMock).process(source2Mock, gradleMock);
        }});
View Full Code Here

Examples of org.jmock.integration.junit4.JUnit4Mockery.checking()

        PrivateAccessor.setField(servlet, "clusterViewService", clusterViewService);
        PrivateAccessor.setField(servlet, "announcementRegistry", announcementRegistry);

        Mockery context = new JUnit4Mockery();
        final HttpService httpService = context.mock(HttpService.class);
        context.checking(new Expectations() {
            {
                allowing(httpService).registerServlet(with(any(String.class)),
                        with(any(Servlet.class)),
                        with(any(Dictionary.class)),
                        with(any(HttpContext.class)));
View Full Code Here

Examples of org.jmock.integration.junit4.JUnit4Mockery.checking()

                .mock(ResourceResolverFactory.class);
        // final ResourceResolver resourceResolver = new MockResourceResolver();
        // final ResourceResolver resourceResolver = new
        // MockedResourceResolver();

        context.checking(new Expectations() {
            {
                allowing(resourceResolverFactory)
                        .getAdministrativeResourceResolver(null);
                will(new Action() {
View Full Code Here

Examples of org.jmock.integration.junit4.JUnit4Mockery.checking()

            final String slingId) {
        Mockery context = new JUnit4Mockery();

        final SlingSettingsService settingsService = context
                .mock(SlingSettingsService.class);
        context.checking(new Expectations() {
            {
                allowing(settingsService).getSlingId();
                will(returnValue(slingId));
            }
        });
View Full Code Here

Examples of org.jmock.integration.junit4.JUnit4Mockery.checking()

    }

    public static ComponentContext mockComponentContext() {
        Mockery context = new JUnit4Mockery();
        final BundleContext bc = context.mock(BundleContext.class);
        context.checking(new Expectations() {
            {
                allowing(bc).registerService(with(any(String.class)),
                        with(any(Object.class)), with(any(Dictionary.class)));
                will(VoidAction.INSTANCE);
            }
View Full Code Here

Examples of org.jmock.integration.junit4.JUnit4Mockery.checking()

                will(VoidAction.INSTANCE);
            }
        });

        final ComponentContext cc = context.mock(ComponentContext.class);
        context.checking(new Expectations() {
            {
                allowing(cc).getProperties();
                will(returnValue(new Properties()));

                allowing(cc).getBundleContext();
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.