Package org.openengsb.core.test

Examples of org.openengsb.core.test.NullDomain


    @Test
    public void testConnectorFile_shouldBeInstalled() throws Exception {
        File connectorFile = createSampleConnectorFile();
        connectorDeployerService.install(connectorFile);

        NullDomain domainEndpoints = wiringService.getDomainEndpoint(NullDomain.class, "*");
        domainEndpoints.nullMethod(42);
        verify(createdService).nullMethod(42);
    }
View Full Code Here


        assertThat(finished, is(false));
    }

    @Test
    public void testResponseRule_shouldProcessEvent() throws Exception {
        NullDomain nullDomainImpl = mock(NullDomain.class);
        registerServiceViaId(nullDomainImpl, "test-connector", NullDomain.class, Domain.class);

        manager.addImport(NullDomain.class.getName());
        manager.add(new RuleBaseElementId(RuleBaseElementType.Rule, "response-test"), ""
                + "when\n"
View Full Code Here

        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);

        connectorManager.create(connectorDescription);

        NullDomain service = (NullDomain) serviceUtils.getService("(foo=bar)", 100L);
        service.nullMethod();
        verify(mockedConnector).nullMethod();
    }
View Full Code Here

        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);

        connectorManager.create(connectorDescription);

        NullDomain service = (NullDomain) serviceUtils.getService("(foo=bar)", 100L);
        DummyModel dummyModel = new DummyModel();
        dummyModel.setId("42");
        dummyModel.setValue("foo");

        NullModel nullModel = new NullModel();
        nullModel.setId(42);
        nullModel.setValue("foo");
        when(transformationEngine.performTransformation(
            any(ModelDescription.class), any(ModelDescription.class), eq(dummyModel)))
            .thenReturn(nullModel);

        service.commitModel(dummyModel);
        verify(mockedConnector).commitModel(nullModel);
    }
View Full Code Here

        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);
        String connectorId = UUID.randomUUID().toString();
        registrationManager.updateRegistration(connectorId, connectorDescription);

        Object service2 = serviceUtils.getService("(foo=bar)", 100L);
        NullDomain service = (NullDomain) service2;
        assertThat(service.getInstanceId(), is(connectorId.toString()));
    }
View Full Code Here

        String connectorId = UUID.randomUUID().toString();

        registrationManager.updateRegistration(connectorId, connectorDescription);
        connectorRegistry.create("foo");
        connectorRegistry.registerConnector(connectorId, "jms+json", "localhost");
        NullDomain service = (NullDomain) serviceUtils.getService("(foo=bar)", 100L);
        service.nullMethod();
        verify(callrouter).sendMethodCallWithResult(eq("jms+json"), eq("localhost"), any(MethodCall.class));
        assertThat(service.getInstanceId(), is(connectorId.toString()));
    }
View Full Code Here

        utils = new DefaultOsgiUtilsService(bundleContext);
    }

    @Test(expected = OsgiServiceNotAvailableException.class)
    public void testGetProxyForNonExistingservice_shouldThrowNotAvailableException() throws Exception {
        NullDomain osgiServiceProxy = utils.getOsgiServiceProxy(NullDomain.class, 1);
        osgiServiceProxy.getAliveState();
    }
View Full Code Here

    @Test
    public void testHandleParallelProxyCalls_shouldGetAnswersParallely() throws Exception {
        registerServiceViaId(new BlockingNullDomain(), "foo", NullDomain.class);

        final NullDomain service = utils.getOsgiServiceProxy(NullDomain.class);

        Callable<Object> normalCall = new Callable<Object>() {
            @Override
            public Object call() throws Exception {
                return service.nullMethod(42);
            }
        };

        Callable<Object> blockingCall = new Callable<Object>() {
            @Override
            public Object call() throws Exception {
                return service.nullMethod(42, "foo");
            }
        };

        FutureTask<Object> normalFuture = new FutureTask<Object>(normalCall);
        new Thread(normalFuture).start();
View Full Code Here

TOP

Related Classes of org.openengsb.core.test.NullDomain

Copyright © 2018 www.massapicom. 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.