Package org.openengsb.core.api.model

Examples of org.openengsb.core.api.model.ConnectorDescription


        // make sure jms is up and running
        utilsService.getServiceWithId(OutgoingPort.class, "jms-json", 60000);

        SecureSampleConnector remoteConnector = new SecureSampleConnector(openwirePort);
        remoteConnector.start(new ExampleConnector(), new ConnectorDescription("example", "external-connector-proxy"));
        ExampleDomain osgiService = getOsgiService(ExampleDomain.class, "(service.pid=example-remote)", 31000);

        assertThat(getBundleContext().getServiceReferences(ExampleDomain.class.getName(),
            "(service.pid=example-remote)"), not(nullValue()));
        assertThat(osgiService, not(nullValue()));
View Full Code Here


        final AtomicReference<Event> eventRef = new AtomicReference<Event>();
        Map<String, String> attributes = new HashMap<String, String>();
        Map<String, Object> properties = new HashMap<String, Object>();
        attributes.put("mixin.1", EventSupport.class.getName());
        remoteConnector.start(new MyExampleConnector(eventRef),
                new ConnectorDescription("example", "external-connector-proxy", attributes, properties));
        WorkflowService workflowService = getOsgiService(WorkflowService.class);
        Event event = new Event("test");
        ContextHolder.get().setCurrentContextId("foo");
        authenticateAsAdmin();
        workflowService.processEvent(event);
View Full Code Here

    private String addTestService() {
        if (testServiceId != null) {
            return testServiceId;
        }
        ConnectorManager connectorManager = getOsgiService(ConnectorManager.class);
        ConnectorDescription connectorDescription = new ConnectorDescription("authentication", "composite-connector");
        Map<String, String> attributes =
            Maps.newHashMap(ImmutableMap.of("compositeStrategy", "authentication.provider", "queryString",
                "(foo=bar)"));
        connectorDescription.setAttributes(attributes);
        testServiceId = connectorManager.create(connectorDescription);
        return testServiceId;
    }
View Full Code Here

    public void testCreateService_shouldCreateInstanceWithFactory() throws Exception {
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("answer", "42");
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        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;
View Full Code Here

    public void testDeleteService_shouldUnregisterService() throws Exception {
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("answer", "42");
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);
        String connectorId = UUID.randomUUID().toString();
        registrationManager.updateRegistration(connectorId, connectorDescription);
        registrationManager.remove(connectorId);
        try {
            serviceUtils.getService("(foo=bar)", 100L);
View Full Code Here

    public void testUpdateProperties_shouldMatchNewFilter() throws Exception {
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("answer", "42");
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);
        String connectorId = UUID.randomUUID().toString();
        registrationManager.updateRegistration(connectorId, connectorDescription);
        ConnectorDescription updated = new ConnectorDescription("test", "testc");
        Map<String, Object> newProperties = new Hashtable<String, Object>();
        newProperties.put("foo", "xxx");
        updated.setProperties(newProperties);
        registrationManager.updateRegistration(connectorId, updated);

        serviceUtils.getService("(foo=xxx)", 100L);
        try {
            serviceUtils.getService("(foo=bar)", 100L);
View Full Code Here

    public void testUpdateAttributes_shouldChangeInstance() throws Exception {
        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("answer", "42");
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);
        String connectorId = UUID.randomUUID().toString();
        registrationManager.updateRegistration(connectorId, connectorDescription);
        ConnectorDescription updated = new ConnectorDescription("test", "testc");
        Map<String, String> newAttrs = new HashMap<String, String>();
        newAttrs.put("answer", "43");
        updated.setAttributes(newAttrs);
        updated.setProperties(properties);
        registrationManager.updateRegistration(connectorId, updated);

        serviceUtils.getService("(foo=bar)", 100L);
        Filter filter = FilterUtils.makeFilter(ConnectorInstanceFactory.class, "(connector=testc)");
        ConnectorInstanceFactory factory = (ConnectorInstanceFactory) serviceUtils.getService(filter);
View Full Code Here

        attributes.put("portId", "jms+json");
        attributes.put("destination", "localhost");
        attributes.put("serviceId", "foo");
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription =
            new ConnectorDescription("test", Constants.EXTERNAL_CONNECTOR_PROXY, attributes, properties);
        String connectorId = UUID.randomUUID().toString();

        registrationManager.updateRegistration(connectorId, connectorDescription);
        connectorRegistry.create("foo");
        connectorRegistry.registerConnector(connectorId, "jms+json", "localhost");
View Full Code Here

                    public Connector answer(InvocationOnMock invocation) throws Throwable {
                        return (Connector) invocation.getArguments()[0];
                    }
                });
        String connectorId = UUID.randomUUID().toString();
        connectorRegistrationManager.updateRegistration(connectorId, new ConnectorDescription("a", "a",
                new HashMap<String, String>(), new HashMap<String, Object>()));
        connectorRegistrationManager.remove(connectorId);
        connectorRegistrationManager.updateRegistration(connectorId,
                new ConnectorDescription("a", "a", new HashMap<String, String>(), new HashMap<String, Object>()));
    }
View Full Code Here

            public Class<? extends Domain> answer(InvocationOnMock invocation) throws Throwable {
                return NullDomainImpl.class;
            }
        });
        String connectorId = UUID.randomUUID().toString();
        connectorRegistrationManager.updateRegistration(connectorId, new ConnectorDescription("a", "a",
                new HashMap<String, String>(), new HashMap<String, Object>()));
    }
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.model.ConnectorDescription

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.