Package org.openengsb.core.api.descriptor

Examples of org.openengsb.core.api.descriptor.ServiceDescriptor


        when(
            bundleContext.getServiceReferences(Domain.class.getName(),
                String.format("(%s=%s)", org.osgi.framework.Constants.SERVICE_PID, "test")))
            .thenReturn(new ServiceReference[]{ ref });

        ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class);
        Mockito.when(serviceDescriptor.getId()).thenReturn("ManagerId");
        Mockito.when(serviceDescriptor.getName()).thenReturn(new PassThroughLocalizableString("ServiceName"));
        Mockito.when(serviceDescriptor.getDescription()).thenReturn(
            new PassThroughLocalizableString("ServiceDescription"));

        if (!serviceListExpanded) {
            expandServiceListTree();
        }
View Full Code Here


        Mockito.when(ref.getProperty("managerId")).thenReturn("ManagerId");
        Mockito.when(ref.getProperty("domain")).thenReturn(TestInterface.class.getName());
        when(bundleContext.getServiceReferences(Domain.class.getName(), String.format("(id=%s)", "test"))).thenReturn(
            new ServiceReference[]{ ref });

        ServiceDescriptor serviceDescriptor = Mockito.mock(ServiceDescriptor.class);
        Mockito.when(serviceDescriptor.getId()).thenReturn("ManagerId");
        Mockito.when(serviceDescriptor.getName()).thenReturn(new PassThroughLocalizableString("ServiceName"));
        Mockito.when(serviceDescriptor.getDescription()).thenReturn(
            new PassThroughLocalizableString("ServiceDescription"));

        if (!serviceListExpanded) {
            expandServiceListTree();
        }
View Full Code Here

    @Before
    public void setup() throws Exception {
        attrib1 =
            AttributeDefinition.builder(new PassThroughStringLocalizer()).id("a").defaultValue("a_default")
                .name("a_name").build();
        ServiceDescriptor d =
            ServiceDescriptor.builder(new PassThroughStringLocalizer()).implementationType(NullDomainImpl.class)
                .id("a").name("sn").description("sd").attribute(attrib1)
                .build();

        ConnectorProvider provider = createConnectorProviderMock("testconnector", "testdomain");
View Full Code Here

        properties.put("location.root", "domain/testdomain/default");
        serviceManager.createWithId("testdomain+testconnector+test-service",
            new ConnectorDescription("testdomain", "testconnector",
                attributes, properties));

        ServiceDescriptor serviceDescriptorMock = Mockito.mock(ServiceDescriptor.class);
        Mockito.when(serviceDescriptorMock.getName()).thenReturn(new PassThroughLocalizableString("service.name"));
        Mockito.when(serviceDescriptorMock.getDescription()).thenReturn(
            new PassThroughLocalizableString("service.description"));

        doThrow(new IllegalArgumentException()).when(testService).update(eq("fail"), anyString());
        setupTesterWithSpringMockContext();
    }
View Full Code Here

        Dictionary<String, Object> props = new Hashtable<String, Object>();
        props.put(org.openengsb.core.api.Constants.CONNECTOR_KEY, connectorType);
        props.put(org.openengsb.core.api.Constants.DOMAIN_KEY, domains);
        registerService(connectorProvider, props, ConnectorProvider.class);

        ServiceDescriptor descriptor = mock(ServiceDescriptor.class);
        when(descriptor.getId()).thenReturn(connectorType);
        LocalizableString name = mockLocalizeableString("service.name");
        when(descriptor.getName()).thenReturn(name);
        LocalizableString desc = mockLocalizeableString("service.description");
        when(descriptor.getDescription()).thenReturn(desc);
        when(connectorProvider.getDescriptor()).thenReturn(descriptor);
        return connectorProvider;
    }
View Full Code Here

                    };
                item.add(new ListView<ConnectorProvider>("services", connectorProviderModel) {

                    @Override
                    protected void populateItem(ListItem<ConnectorProvider> item) {
                        ServiceDescriptor desc = item.getModelObject().getDescriptor();
                        item.add(new Link<ConnectorProvider>("create.new", item.getModel()) {
                            @Override
                            public void onClick() {
                                setResponsePage(new ConnectorEditorPage(domainType, getModelObject().getId()));
                            }
                        });
                        item.add(new Label("service.name", new LocalizableStringModel(this, desc.getName())));
                        item.add(new Label("service.description", new LocalizableStringModel(this, desc
                            .getDescription())));
                    }
                });
            }
        };
View Full Code Here

            id = readUserInput();
        } else {
            id = attributes.get(org.osgi.framework.Constants.SERVICE_PID);
        }

        ServiceDescriptor descriptor = connectorProvider.getDescriptor();
        OutputStreamFormater.printValue(String.format("Please enter the attributes for %s, keep empty for default",
            descriptor.getName().getString(Locale.getDefault())));

        // get attributes for connector
        Map<String, String> attributeMap = getConnectorAttributes(descriptor.getAttributes(), attributes);
        Map<String, Object> properties = new HashMap<String, Object>();

        ConnectorDescription connectorDescription =
            new ConnectorDescription(domainProviderId, connectorProvider.getId(), attributeMap, properties);
        if (force) {
View Full Code Here

        OutputStreamFormater.printValue("Please select the connector you want to create: ");
        Collections.sort(connectorProviders, Comparators.forConnectorProvider());
        for (int i = 0; i < connectorProviders.size(); i++) {
            ConnectorProvider connectorProvider = connectorProviders.get(i);
            ServiceDescriptor descriptor = connectorProvider.getDescriptor();
            OutputStreamFormater.printTabbedValues(9, String.format("[%s] %s", i,
                descriptor.getName().getString(Locale.getDefault())),
                descriptor.getDescription().getString(Locale.getDefault()));
        }
        String positionString = readUserInput();
        int pos;
        try {
            pos = Integer.parseInt(positionString);
View Full Code Here

TOP

Related Classes of org.openengsb.core.api.descriptor.ServiceDescriptor

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.