Package org.apache.hivemind.impl

Examples of org.apache.hivemind.impl.LocationImpl


        return result;
    }

    private Location getLocation()
    {
        return new LocationImpl(_resource, _locator.getLineNumber(), _locator.getColumnNumber());
    }
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

    {
        String path = "/" + getClass().getName().replace('.', '/');

        Resource r = new ClasspathResource(new DefaultClassResolver(), path);

        return new LocationImpl(r, line);
    }
View Full Code Here

    private Resource _location = new ClasspathResource(null, "/META-INF/foo.bar");

    public void testNoNumbers()
    {
        LocationImpl l = new LocationImpl(_location);

        assertSame(_location, l.getResource());
        assertTrue(l.getLineNumber() <= 0);
        assertTrue(l.getColumnNumber() <= 0);
    }
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("classpath:/META-INF/foo.bar", l.toString());
    }

    public void testWithLine()
    {
        LocationImpl l = new LocationImpl(_location, 22);

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

        assertEquals("classpath:/META-INF/foo.bar, line 22", l.toString());
    }

    public void testWithNumbers()
    {
        LocationImpl l = new LocationImpl(_location, 100, 15);

        assertEquals(100, l.getLineNumber());
        assertEquals(15, l.getColumnNumber());
    }
View Full Code Here

TOP

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

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.