Package org.apache.tuscany.sca.core

Examples of org.apache.tuscany.sca.core.DefaultExtensionPointRegistry


    private static StAXArtifactProcessor<Object> staxProcessor;
    private static CompositeBuilder compositeBuilder;

    @BeforeClass
    public static void setUp() throws Exception {
        DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
        inputFactory = XMLInputFactory.newInstance();
        outputFactory = XMLOutputFactory.newInstance();
        StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
       
        compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
    }
View Full Code Here


    public void testMultipleFactories() {
        // Create new factories
        FactoryWithOneInterface factory1 = new FactoryWithOneInterface();
        FactoryWithTwoInterfaces factory2 = new FactoryWithTwoInterfaces();

        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();

        // Register the factories
        DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
        ctxFactory.addFactory(factory1);
        ctxFactory.addFactory(factory2);
View Full Code Here

     * Tests passing in null to addFactory()
     */
    @Test
    public void testAddingNullFactory() {

        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
        try {
            ctxFactory.addFactory(null);
            Assert.fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException ex) {
View Full Code Here

    /**
     * Test passing in null to removeFactory()
     */
    @Test
    public void testRemovingNullFactory() {
        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
        try {
            ctxFactory.removeFactory(null);
            Assert.fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException ex) {
View Full Code Here

    /**
     * Test passing in null to getFactory()
     */
    @Test
    public void testGetNullFactory() {
        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);
        try {
            ctxFactory.getFactory(null);
            Assert.fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException ex) {
View Full Code Here

     *
     * @param factory The factory class to test
     * @param factoryInterfaces The list of interfaces implemented by the factory
     */
    private void addGetRemoveFactory(Object factory, Class<?>[] factoryInterfaces) {
        ExtensionPointRegistry registry = new DefaultExtensionPointRegistry();
        DefaultContextFactoryExtensionPoint ctxFactory = new DefaultContextFactoryExtensionPoint(registry);

        // Make sure factory not already present
        for (Class<?> iface : factoryInterfaces) {
            Assert.assertNull(ctxFactory.getFactory(iface));
View Full Code Here

    private static final QName wsBinding = new QName(scaNamespace, "binding.ws");
    private static final QName javaImpl = new QName(scaNamespace, "implementation.java");

    @Before
    public void setUp() throws Exception {
        DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
        resolver = new DefaultModelResolver();
        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
        // Create a monitor
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = new DefaultMonitorFactory();
        if (monitorFactory != null) {
            monitor = monitorFactory.createMonitor();
            utilities.addUtility(monitorFactory);
        }
        StAXArtifactProcessorExtensionPoint staxProcessors =
            extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, monitor);
        staxProcessors.addArtifactProcessor(new TestPolicyProcessor());

        URL url = getClass().getResource("test_definitions.xml");
        InputStream urlStream = url.openStream();
View Full Code Here

    private static StAXArtifactProcessor<Object> staxProcessor;
    private static CompositeBuilder compositeBuilder;

    @BeforeClass
    public static void setUp() throws Exception {
        DefaultExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();
        inputFactory = XMLInputFactory.newInstance();
        StAXArtifactProcessorExtensionPoint staxProcessors = new DefaultStAXArtifactProcessorExtensionPoint(extensionPoints);
        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, null, null);
        compositeBuilder = extensionPoints.getExtensionPoint(CompositeBuilderExtensionPoint.class).getCompositeBuilder("org.apache.tuscany.sca.assembly.builder.CompositeBuilder");
    }
View Full Code Here

    private static StAXArtifactProcessor<Object> staxProcessor;
    private static Monitor monitor;

    @BeforeClass
    public static void setUp() throws Exception {
        ExtensionPointRegistry extensionPoints = new DefaultExtensionPointRegistry();

        inputFactory = XMLInputFactory.newInstance();
        outputFactory = XMLOutputFactory.newInstance();

        // Create a monitor
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = new DefaultMonitorFactory();
        if (monitorFactory != null) {
            monitor = monitorFactory.createMonitor();
            utilities.addUtility(monitorFactory);
        }
        StAXArtifactProcessorExtensionPoint staxProcessors =
            extensionPoints.getExtensionPoint(StAXArtifactProcessorExtensionPoint.class);
        staxProcessor = new ExtensibleStAXArtifactProcessor(staxProcessors, inputFactory, outputFactory, null);
    }
View Full Code Here

    @BeforeClass
    public static void init() {
       
        // Create extension point registry
        extensionPoints = new DefaultExtensionPointRegistry();
       
        // Create a monitor
        UtilityExtensionPoint utilities = extensionPoints.getExtensionPoint(UtilityExtensionPoint.class);
        MonitorFactory monitorFactory = utilities.getUtility(MonitorFactory.class);
        monitor = monitorFactory.createMonitor();       
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.core.DefaultExtensionPointRegistry

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.