Package org.apache.hivemind

Examples of org.apache.hivemind.Location


    public void testBadClass() throws Exception
    {
        InstanceTranslator t = new InstanceTranslator();
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestInstanceTranslator.class"), 50);
        e.setLocation(l);

        MockControl c = newControl(Module.class);
        Module m = (Module) c.getMock();
View Full Code Here


    public void testPrivateObject() throws Exception
    {
        InstanceTranslator t = new InstanceTranslator();
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestInstanceTranslator.class"), 50);
        e.setLocation(l);

        ModuleImpl m = new ModuleImpl();
        m.setClassResolver(getClassResolver());
View Full Code Here

    }

    private Element forgeElement()
    {
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestEnumerationTranslator.class"), 50);
        e.setLocation(l);

        return e;
    }
View Full Code Here

    public void testBadClass() throws Exception
    {
        ObjectTranslator t = new ObjectTranslator();
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestObjectTranslator.class"), 50);
        e.setLocation(l);

        MockControl c = newControl(Module.class);
        Module m = (Module) c.getMock();
View Full Code Here

    public void testPrivateObject() throws Exception
    {
        ObjectTranslator t = new ObjectTranslator();
        ElementImpl e = new ElementImpl();
        Location l = new LocationImpl(getResource("TestObjectTranslator.class"), 50);
        e.setLocation(l);

        MockControl c = newControl(Module.class);
        Module m = (Module) c.getMock();
View Full Code Here

    {
        ModuleDescriptor md = new ModuleDescriptor(getClassResolver(), new DefaultErrorHandler());
        md.setModuleId("foo");

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

        SchemaImpl s1 = new SchemaImpl("test");
        s1.setId("bar");
        s1.setLocation(l1);
View Full Code Here

    }

    public void testNoEditor()
    {
        Translator t = new SmartTranslator();
        Location l = fabricateLocation(22);

        try
        {
            t.translate(null, Registry.class, "fred", l);
View Full Code Here

        while (i.hasNext())
        {
            TranslatorContribution c = (TranslatorContribution) i.next();

            String name = c.getName();
            Location oldLocation = (Location) locations.get(name);

            if (oldLocation != null)
            {
                _errorHandler.error(LOG, XmlImplMessages.duplicateTranslatorName(name, oldLocation), c
                        .getLocation(), null);
View Full Code Here

        assertTrue(l.getColumnNumber() <= 0);
    }

    public void testToStringShort()
    {
        Location l = new LocationImpl(_location);

        assertEquals("classpath:/META-INF/foo.bar", l.toString());
    }
View Full Code Here

        assertEquals(15, l.getColumnNumber());
    }

    public void testToStringLong()
    {
        Location l = new LocationImpl(_location, 97, 3);

        assertEquals("classpath:/META-INF/foo.bar, line 97, column 3", l.toString());
    }
View Full Code Here

TOP

Related Classes of org.apache.hivemind.Location

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.