Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated and re-activated test for LoadEmbeddedOntologies
- Loading branch information
Showing
2 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
src/test/java/uk/ac/manchester/cs/owl/semspreadsheets/ui/LoadEmbeddedOntologiesTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
package uk.ac.manchester.cs.owl.semspreadsheets.ui; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertTrue; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.semanticweb.owlapi.model.IRI; | ||
|
||
import uk.ac.manchester.cs.owl.semspreadsheets.DocumentsCatalogue; | ||
import uk.ac.manchester.cs.owl.semspreadsheets.DummyOntologyManagerListener; | ||
import uk.ac.manchester.cs.owl.semspreadsheets.model.OntologyManager; | ||
import uk.ac.manchester.cs.owl.semspreadsheets.model.WorkbookManager; | ||
|
||
public class LoadEmbeddedOntologiesTest { | ||
|
||
private OntologyManager ontologyManager; | ||
private DummyOntologyManagerListener testListener; | ||
private WorkbookManager workbookManager; | ||
|
||
@Before | ||
public void createOntologyManager() { | ||
workbookManager = new WorkbookManager(); | ||
ontologyManager = workbookManager.getOntologyManager(); | ||
testListener=new DummyOntologyManagerListener(); | ||
ontologyManager.addListener(testListener); | ||
} | ||
|
||
@Test | ||
public void testLoadEmbeddedOntologies() throws Exception { | ||
LoadEmbeddedTermsOntologies task = new LoadEmbeddedTermsOntologies(); | ||
workbookManager.loadWorkbook(DocumentsCatalogue.twoOntologiesWorkbookURI()); | ||
assertEquals(0, ontologyManager.getLoadedOntologies().size()); | ||
assertEquals(2,ontologyManager.getOntologyIRIs().size()); | ||
assertTrue(ontologyManager.getOntologyIRIs().contains(IRI.create("http://www.mygrid.org.uk/ontology/JERMOntology"))); | ||
assertTrue(ontologyManager.getOntologyIRIs().contains(IRI.create("http://mged.sourceforge.net/ontologies/MGEDOntology.owl"))); | ||
|
||
task.setup(new WorkbookFrame(workbookManager)); | ||
task.runTask(); | ||
assertEquals(2, ontologyManager.getLoadedOntologies().size()); | ||
assertEquals(3, ontologyManager.getAllOntologies().size()); | ||
|
||
//now with just properties over free text | ||
WorkbookManager manager = new WorkbookManager(); | ||
manager.loadWorkbook(DocumentsCatalogue.simpleWorkbookWithLiteralsOverRangeURI()); | ||
assertEquals(0, manager.getOntologyManager().getLoadedOntologies().size()); | ||
assertEquals(0, manager.getOntologyManager().getAllOntologies().size()); | ||
assertEquals(1,manager.getOntologyManager().getOntologyIRIs().size()); | ||
task = new LoadEmbeddedTermsOntologies(); | ||
|
||
task.setup(new WorkbookFrame(manager)); | ||
task.runTask(); | ||
|
||
assertEquals(1, manager.getOntologyManager().getLoadedOntologies().size()); | ||
assertEquals(1, manager.getOntologyManager().getAllOntologies().size()); | ||
|
||
|
||
} | ||
|
||
} |