Package org.openengsb.core.api.model

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


    @Test
    public void testInstallService_shouldNotOverwriteExistingService() throws Exception {
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription =
            new ConnectorDescription("mydomain", "aconnector", null, properties);
        serviceManager.createWithId(testConnectorId, connectorDescription);

        File connectorFile = createSampleConnectorFile();
        connectorDeployerService.install(connectorFile);
View Full Code Here


    @Test
    public void testUpdateService_shouldNotOverrideOtherwiseModifedProperties() throws Exception {
        File connectorFile = createSampleConnectorFile();
        connectorDeployerService.install(connectorFile);
        ConnectorDescription attributeValues = serviceManager.getAttributeValues(testConnectorId);
        Map<String, Object> propertyValues = attributeValues.getProperties();
        propertyValues.put("foo", "bar");
        ConnectorDescription newDesc = new ConnectorDescription("mydomain", "aconnector",
            attributeValues.getAttributes(), propertyValues);
        serviceManager.update(testConnectorId, newDesc);

        FileUtils.writeStringToFile(connectorFile, testConnectorData + "\nproperty.foo=notbar");
        try {
View Full Code Here

    public void testUpdateServiceViaPersistence_shouldNotOverwriteProperties() throws Exception {
        File connectorFile = temporaryFolder.newFile(TEST_FILE_NAME);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=y"));
        connectorDeployerService.install(connectorFile);
        ConnectorDescription desc =
            serviceManager.getAttributeValues(testConnectorId);
        desc.getProperties().put("foo", "42");
        serviceManager.update(testConnectorId, desc);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=y", "property.x=y"));
        connectorDeployerService.update(connectorFile);
        assertThat(bundleContext.getServiceReferences(NullDomain.class.getName(), "(foo=42)"), not(nullValue()));
View Full Code Here

    public void testUpdateAttributeViaPersistence_shouldNotOverwrite() throws Exception {
        File connectorFile = temporaryFolder.newFile(TEST_FILE_NAME);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=y"));
        connectorDeployerService.install(connectorFile);
        ConnectorDescription desc = serviceManager.getAttributeValues(testConnectorId);
        ConnectorDescription newDesc = new ConnectorDescription("mydomain", "aconnector",
            ImmutableMap.of("x", "z"), desc.getProperties());
        serviceManager.update(testConnectorId, newDesc);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=y", "property.x=y"));
        connectorDeployerService.update(connectorFile);
        ConnectorDescription attributeValues = serviceManager.getAttributeValues(testConnectorId);
        assertThat(attributeValues.getAttributes().get("x"), is("z"));
    }
View Full Code Here

        File connectorFile = temporaryFolder.newFile(TEST_FILE_NAME);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=original-file-value"));
        connectorDeployerService.install(connectorFile);
        String id = testConnectorId;
        ConnectorDescription desc = serviceManager.getAttributeValues(id);

        Map<String, String> attributes = ImmutableMap.of("x", "new-persistence-value");
        ConnectorDescription newDesc = new ConnectorDescription("mydomain", "aconnector",
            attributes, desc.getProperties());

        serviceManager.update(id, newDesc);
        FileUtils.writeLines(connectorFile,
            Arrays.asList("property.foo=bar", "attribute.x=new-value-value"));
View Full Code Here

    public void testRemovePropertyOnBothEnds_shouldStayRemovedWithoutError() throws Exception {
        File connectorFile = temporaryFolder.newFile(TEST_FILE_NAME);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=original-file-value"));
        connectorDeployerService.install(connectorFile);
        ConnectorDescription desc = serviceManager.getAttributeValues(testConnectorId);
        Map<String, Object> properties = new Hashtable<String, Object>();
        ConnectorDescription newDesc = new ConnectorDescription("mydomain", "aconnector",
            desc.getAttributes(), properties);

        serviceManager.update(testConnectorId, newDesc);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "attribute.x=original-file-value"));
View Full Code Here

        File connectorFile = temporaryFolder.newFile(TEST_FILE_NAME);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=original-file-value"));
        connectorDeployerService.install(connectorFile);
        String id = testConnectorId;
        ConnectorDescription desc = serviceManager.getAttributeValues(id);

        Map<String, String> attributes = ImmutableMap.of("x", "new-persistence-value");
        ConnectorDescription newDesc = new ConnectorDescription("mydomain", "aconnector",
            attributes, desc.getProperties());

        serviceManager.update(id, newDesc);
        FileUtils.writeLines(connectorFile,
            Arrays.asList("property.foo=bar", "attribute.x=new-value-value"));
View Full Code Here

    @Test
    public void testInstallFailure_shouldLeaveFileAsIs() throws Exception {
        Map<String, Object> properties = new Hashtable<String, Object>();
        properties.put("foo", "bar");
        ConnectorDescription connectorDescription = new ConnectorDescription("mydomain", "aconnector",
            new HashMap<String, String>(), properties);
        serviceManager.createWithId(testConnectorId, connectorDescription);

        File connectorFile = createSampleConnectorFile();
        connectorDeployerService.install(connectorFile);
View Full Code Here

        File connectorFile = temporaryFolder.newFile(TEST_FILE_NAME);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=original-file-value"));
        connectorDeployerService.install(connectorFile);
        String id = testConnectorId;
        ConnectorDescription desc = serviceManager.getAttributeValues(id);

        Map<String, String> attributes = ImmutableMap.of("x", "new-persistence-value");
        ConnectorDescription newDesc = new ConnectorDescription("mydomain", "aconnector",
            attributes, desc.getProperties());

        serviceManager.update(id, newDesc);
        FileUtils.writeLines(connectorFile, Arrays.asList("domainType=mydomain", "connectorType=aconnector",
            "property.foo=bar", "attribute.x=new-value-value"));
View Full Code Here

        setGlobal(globTest);

        tester.clickLink("wiringForm:wireButton");

        tester.assertNoErrorMessage();
        ConnectorDescription description = serviceManager.getAttributeValues(testdomainConnectorId);
        assertThat(description.getProperties(), hasEntry("location.bar", (Object) globTest));
    }
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.