Package org.openengsb.core.api.model

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


        when(factory.getValidationErrors(any(Connector.class), anyMap())).thenReturn(errorMessages);

        Map<String, String> attributes = new HashMap<String, String>();
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);

        String connectorId = connectorManager.create(connectorDescription);
        serviceUtils.getService("(foo=bar)", 1L);

        connectorDescription.getProperties().put("foo", "42");
        connectorManager.forceUpdate(connectorId, connectorDescription);

        try {
            serviceUtils.getService("(foo=bar)", 1L);
            fail("Service is only available with the old attributes");
View Full Code Here


    @Test
    public void testDeleteService_shouldNotBeAvailableAnymore() throws Exception {
        Map<String, String> attributes = new HashMap<String, String>();
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);

        String connectorId = connectorManager.create(connectorDescription);

        connectorManager.delete(connectorId);
View Full Code Here

    public void testDeleteService_shouldNotExistAnymore() throws Exception {
        Map<String, String> attributes = new HashMap<String, String>();
        Map<String, Object> properties = new Hashtable<String, Object>();
        boolean connectorExists;
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);

        String connectorId = connectorManager.create(connectorDescription);

        connectorManager.delete(connectorId);
View Full Code Here

        attributes.put(Constants.SKIP_SET_DOMAIN_TYPE, "true");
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        NullDomainImpl mock2 = mock(NullDomainImpl.class);
        when(factory.createNewInstance(anyString())).thenReturn(mock2);
        ConnectorDescription connectorDescription = new ConnectorDescription("test", "testc", attributes, properties);
        connectorManager.create(connectorDescription);
        verify(mock2, never()).setDomainId(anyString());
        verify(mock2, never()).setConnectorId(anyString());
    }
View Full Code Here

        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);

        connectorManager.create(connectorDescription);

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

        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);

        connectorManager.create(connectorDescription);

        NullDomain service = (NullDomain) serviceUtils.getService("(foo=bar)", 100L);
        DummyModel dummyModel = new DummyModel();
View Full Code Here

        }
        try {
            SecurityContext.executeWithSystemPermissions(new Callable<Object>() {
                @Override
                public Object call() throws Exception {
                    ConnectorDescription connectorDescription =
                        new ConnectorDescription(configFile.getDomainType(), configFile.getConnectorType(),
                            attributes, properties);
                    try {
                        serviceManager.createWithId(name, connectorDescription);
                    } catch (IllegalArgumentException e) {
                        if (e.getMessage().contains("connector already exists")) {
View Full Code Here

    }

    private void doUpdate(File artifact) throws Exception {
        ConnectorFile connectorFile = oldConfigs.get(artifact);
        final String connectorId = connectorFile.getName();
        ConnectorDescription persistenceContent = serviceManager.getAttributeValues(connectorId);
        ChangeSet changes = connectorFile.getChanges(artifact);

        final ConnectorDescription newDescription;
        try {
            newDescription = applyChanges(persistenceContent, changes);
            connectorFile.update(artifact);
        } catch (MergeException e) {
            File backupFile = getBackupFile(artifact);
View Full Code Here

        Map<String, String> attributes = persistenceContent.getAttributes();

        Map<String, String> newAttributes = ConfigUtils.updateMap(attributes, changedAttributes);
        Map<String, Object> newProperties =
            ConfigUtils.updateMap(persistenceContent.getProperties(), changes.getChangedProperties());
        return new ConnectorDescription(changes.getDomainType(), changes.getConnectorType(), newAttributes,
            new Hashtable<String, Object>(newProperties));
    }
View Full Code Here

        attributes.put("watchfile", watchfile.getAbsolutePath());
        attributes.put("serializer", "org.openengsb.connector.virtual.filewatcher.internal.CSVParser");
        attributes.put("mixin.1", EventSupport.class.getName());
        attributes.put("modelType", "org.openengsb.domain.example.model.SourceModelA");
        Map<String, Object> properties = new HashMap<String, Object>();
        ConnectorDescription connectorDescription =
            new ConnectorDescription("example", "filewatcher", attributes, properties);
        connectorManager.create(connectorDescription);
        getOsgiService(ExampleDomain.class, 30000L);
        Thread.sleep(1500);
        FileUtils.write(watchfile, "\"foo\",\"bar\"");
        Thread.sleep(1500);
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.