use of fr.lirmm.graphik.graal.api.core.Ontology in project graal by graphik-team.
the class DefaultOntologyTest method testAddSameRuleTwice.
/**
* Test method for
* {@link fr.lirmm.graphik.graal.core.ruleset.DefaultOntology#add(Rule)}.
*/
@Test
public void testAddSameRuleTwice() {
// given
Ontology onto = new DefaultOntology();
// when
onto.add(same1);
onto.add(same1);
// then
Assert.assertEquals(1, onto.size());
}
use of fr.lirmm.graphik.graal.api.core.Ontology in project graal by graphik-team.
the class DefaultOntologyTest method testContains.
/**
* Test method for
* {@link fr.lirmm.graphik.graal.core.ruleset.DefaultOntology#contains(fr.lirmm.graphik.graal.api.core.Rule)}.
*/
@Test
public void testContains() {
// given
Ontology onto = new DefaultOntology();
onto.add(r1);
// when
boolean b = onto.contains(r1);
// then
Assert.assertTrue(b);
}
use of fr.lirmm.graphik.graal.api.core.Ontology in project graal by graphik-team.
the class DefaultOntologyTest method testRemove.
/**
* Test method for
* {@link fr.lirmm.graphik.graal.core.ruleset.DefaultOntology#remove(fr.lirmm.graphik.graal.api.core.Rule)}.
*/
@Test
public void testRemove() {
// given
Ontology onto = new DefaultOntology();
onto.add(r1);
onto.remove(r1);
// when
Set<String> ruleNames = onto.getRuleNames();
// then
Assert.assertTrue(ruleNames.isEmpty());
}
use of fr.lirmm.graphik.graal.api.core.Ontology in project graal by graphik-team.
the class DefaultOntologyTest method testIterator_empty.
/**
* Test method for
* {@link fr.lirmm.graphik.graal.core.ruleset.DefaultOntology#iterator()}.
*/
@Test
public void testIterator_empty() {
// given
Ontology onto = new DefaultOntology();
// when
Iterator<Rule> it = onto.iterator();
// then
Assert.assertFalse(it.hasNext());
}
use of fr.lirmm.graphik.graal.api.core.Ontology in project graal by graphik-team.
the class DefaultOntologyTest method testSize.
/**
* Test method for
* {@link fr.lirmm.graphik.graal.core.ruleset.DefaultOntology#size()}.
*/
@Test
public void testSize() {
// given
Ontology onto = new DefaultOntology();
onto.add(r1);
onto.add(noName);
onto.add(r1);
// when
int size = onto.size();
// then
Assert.assertEquals(2, size);
}
Aggregations