MCPcopy Create free account
hub / github.com/GateNLP/gate-core / testClassIndex

Method testClassIndex

src/test/java/gate/creole/TestCreole.java:312–334  ·  view source on GitHub ↗

Test resource indexing by class

()

Source from the content-addressed store, hash-verified

310
311 /** Test resource indexing by class */
312 public void testClassIndex() throws Exception {
313
314 ResourceData docRd = reg.get("gate.corpora.DocumentImpl");
315 assertNotNull("couldn't find document res data", docRd);
316 assertTrue(
317 "doc res data has wrong class name",
318 docRd.getClassName().equals("gate.corpora.DocumentImpl")
319 );
320 assertTrue(
321 "doc res data has wrong interface name",
322 docRd.getInterfaceName().equals("gate.Document")
323 );
324
325 Class<?> docClass = docRd.getResourceClass();
326 assertNotNull("couldn't get doc class", docClass);
327 LanguageResource docRes = (LanguageResource) docClass.newInstance();
328 assertTrue(
329 "instance of doc is wrong type",
330 docRes instanceof gate.Document
331 );
332
333 reg.clear();
334 } // testClassIndex()
335
336 /** Test type lists */
337 public void testTypeLists() throws Exception {

Callers

nothing calls this directly

Calls 6

getClassNameMethod · 0.95
getInterfaceNameMethod · 0.95
getResourceClassMethod · 0.95
getMethod · 0.65
equalsMethod · 0.65
clearMethod · 0.45

Tested by

no test coverage detected