Package org.openengsb.core.api.model

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


        }
    }

    @Override
    public void update(String id, ConnectorDescription connectorDescpription) {
        ConnectorDescription old = getOldConfig(id);
        try {
            registrationManager.updateRegistration(id, connectorDescpription);
        } catch (ConnectorValidationFailedException e) {
            throw new RuntimeException(e);
        }
View Full Code Here


        }
    }

    @Override
    public void forceUpdate(String id, ConnectorDescription connectorDescription) throws IllegalArgumentException {
        ConnectorDescription old = getOldConfig(id);
        registrationManager.forceUpdateRegistration(id, connectorDescription);
        applyConfigChanges(old, connectorDescription);
        try {
            configPersistence.persist(new ConnectorConfiguration(id, connectorDescription));
        } catch (PersistenceException e) {
View Full Code Here

    @Test
    public void createFileWatcherConnector_shouldRegisterService() throws Exception {
        File testconnectorFolder = new File(tmpFolder.getRoot(), "testconnector");
        File testfile = new File(testconnectorFolder, "testfile");
        ConnectorDescription desc = makeConnectorDescription(CSVParser.class, testfile);
        connectorManager.create(desc);

        ServiceReference<NullDomain> serviceReference = bundleContext.getServiceReference(NullDomain.class);
        assertThat(serviceReference, not(nullValue()));
    }
View Full Code Here

    @Test
    public void createFileWatcherConnector_shouldCreateWatchDir() throws Exception {
        File testconnectorFolder = new File(tmpFolder.getRoot(), "testconnector");
        File testfile = new File(testconnectorFolder, "testfile");
        ConnectorDescription desc = makeConnectorDescription(CSVParser.class, testfile);
        connectorManager.create(desc);
        assertThat(testconnectorFolder.exists(), is(true));
    }
View Full Code Here

    @Test
    public void datachangedEvent_shouldTriggerUpdate() throws Exception {
        File testconnectorFolder = new File(tmpFolder.getRoot(), "testconnector");
        File testFile = new File(testconnectorFolder, "testfile");
        ConnectorDescription desc = makeConnectorDescription(CSVParser.class, testFile);
        connectorManager.create(desc);

        ServiceReference<EventSupport> reference = bundleContext.getServiceReference(EventSupport.class);
        EventSupport service = bundleContext.getService(reference);
        service.onEvent(new Event());
View Full Code Here

        Map<String, String> attributes = new HashMap<String, String>();
        attributes.put("watchfile", testFile.getAbsolutePath());
        attributes.put("serializer", parserClass.getName());
        attributes.put("mixin.1", EventSupport.class.getName());
        attributes.put("modelType", TestModel.class.getName());
        return new ConnectorDescription("example", "filewatcher", attributes, new HashMap<String, Object>());
    }
View Full Code Here

    @Test
    public void modifyWatchedFile_shouldCallOnModified() throws Exception {
        File testconnectorFolder = new File(tmpFolder.getRoot(), "testconnector");
        File testfile = new File(testconnectorFolder, "testfile");
        ConnectorDescription desc = makeConnectorDescription(CSVParser.class, testfile);
        connectorManager.create(desc);
        FileUtils.write(testfile, "42,\"foo\",7");
        verify(persistenceService, timeout(2500)).commit(any(EKBCommit.class));
    }
View Full Code Here

    @Test
    public void modifyWatchedFile_shouldUpdateConnectedModels() throws Exception {
        File testconnectorFolder = new File(tmpFolder.getRoot(), "testconnector");
        File testfile = new File(testconnectorFolder, "testfile");
        ConnectorDescription desc = makeConnectorDescription(CSVParser.class, testfile);
        connectorManager.create(desc);

        File testconnectorFolder2 = new File(tmpFolder.getRoot(), "testconnector2");
        File testfile2 = new File(testconnectorFolder2, "testfile");
        ConnectorDescription desc2 = makeConnectorDescription(JSONParser.class, testfile2);
        desc2.getAttributes().put("modelType", TestModel.class.getName());
        connectorManager.create(desc2);
        FileUtils.write(testfile, "42,\"foo\",7");
        verify(persistenceService, timeout(2500)).commit(any(EKBCommit.class));
        Thread.sleep(2000);
        System.out.println("reading file back:\n" + FileUtils.readFileToString(testfile2));
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.