Test resource indexing by class
()
| 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 { |
nothing calls this directly
no test coverage detected