Package org.apache.hivemind.impl

Examples of org.apache.hivemind.impl.RegistryAssemblyImpl


    protected ModuleDescriptor parse(String file) throws Exception
    {
        Resource location = getResource(file);
        DefaultErrorHandler eh = new DefaultErrorHandler();

        RegistryAssemblyImpl assembly = new RegistryAssemblyImpl(eh);

        DescriptorParser p = new DescriptorParser(eh, assembly);

        ModuleDescriptor result = p.parse(location, _resolver);

        assembly.performPostProcessing();

        return result;
    }
View Full Code Here


    protected ModuleDescriptor parse(String file) throws Exception
    {
        Resource location = getResource(file);
        DefaultErrorHandler eh = new DefaultErrorHandler();

        RegistryAssemblyImpl assembly = new RegistryAssemblyImpl(eh);

        DescriptorParser p = new DescriptorParser(eh, assembly);

        ModuleDescriptor result = p.parse(location, _resolver);

        assembly.performPostProcessing();

        return result;
    }
View Full Code Here

        }
    }

    public void testAddSchema()
    {
        RegistryAssemblyImpl ra = new RegistryAssemblyImpl(new DefaultErrorHandler());
        Schema s = (Schema) newMock(Schema.class);

        replayControls();

        ra.addSchema("foo.manchu", s);

        assertSame(s, ra.getSchema("foo.manchu"));

        verifyControls();
    }
View Full Code Here

        verifyControls();
    }

    public void testAddDupeSchema() throws Exception
    {
        RegistryAssemblyImpl ra = new RegistryAssemblyImpl(new DefaultErrorHandler());
        MockControl c1 = newControl(Schema.class);
        MockControl c2 = newControl(Schema.class);

        Schema s1 = (Schema) c1.getMock();
        Schema s2 = (Schema) c2.getMock();

        Resource r = new ClasspathResource(new DefaultClassResolver(), "/foo/bar");
        Location l1 = new LocationImpl(r, 20);
        Location l2 = new LocationImpl(r, 97);

        interceptLogging(ra.getClass().getName());

        s1.getLocation();
        c1.setReturnValue(l1);

        s2.getLocation();
        c2.setReturnValue(l2);

        replayControls();

        ra.addSchema("foo.bar", s1);
        ra.addSchema("foo.bar", s2);

        assertLoggedMessagePattern("Schema foo.bar conflicts with existing schema at classpath:/foo/bar, line 20\\.");

        assertSame(s1, ra.getSchema("foo.bar"));

        verifyControls();
    }
View Full Code Here

        verifyControls();
    }

    public void testAddPostProcessor()
    {
        RegistryAssemblyImpl ra = new RegistryAssemblyImpl(new DefaultErrorHandler());

        TestRunnable r = new TestRunnable();

        assertEquals(false, r.didRun);

        ra.addPostProcessor(r);

        ra.performPostProcessing();

        assertEquals(true, r.didRun);
    }
View Full Code Here

    {
        Resource location = getResource("MissingSubModule.xml");

        ErrorHandler eh = new ErrorHandlerFixture();

        RegistryAssemblyImpl assembly = new RegistryAssemblyImpl(eh);

        DescriptorParser p = new DescriptorParser(eh, assembly);

        p.parse(location, _resolver);

        assembly.performPostProcessing();

        assertRegexp(
            "Sub-module .*?/DoesNotExist\\.xml does not exist\\.",
            _errorHandlerMessage);

View Full Code Here

        }
    }

    public void testAddPostProcessor()
    {
        RegistryAssemblyImpl ra = new RegistryAssemblyImpl();

        TestRunnable r = new TestRunnable();

        assertEquals(false, r.didRun);

        ra.addPostProcessor(r);

        ra.performPostProcessing();

        assertEquals(true, r.didRun);
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.impl.RegistryAssemblyImpl

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.