185186187188189190191
return result; } private Location getLocation() { return new LocationImpl(_resource, _locator.getLineNumber(), _locator.getColumnNumber()); }
46474849505152535455
} private Element forgeElement() { ElementImpl e = new ElementImpl(); Location l = new LocationImpl(getResource("TestEnumerationTranslator.class"), 50); e.setLocation(l); return e; }
4849505152535455565758
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();
7576777879808182838485
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();
343536373839404142434445
{ 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);
456457458459460461462
{ String path = "/" + getClass().getName().replace('.', '/'); Resource r = new ClasspathResource(new DefaultClassResolver(), path); return new LocationImpl(r, line); }
3334353637383940414243
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); }
424344454647484950
assertTrue(l.getColumnNumber() <= 0); } public void testToStringShort() { Location l = new LocationImpl(_location); assertEquals("classpath:/META-INF/foo.bar", l.toString()); }
49505152535455565758
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()); }
57585960616263646566
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()); }