use of org.apache.jena.graph.GraphStatisticsHandler in project jena by apache.
the class GraphMem_CS method testHasStatistics.
@ContractTest
public void testHasStatistics() {
GraphStatisticsHandler h = graphProducer.newInstance().getStatisticsHandler();
assertNotNull(h);
}
use of org.apache.jena.graph.GraphStatisticsHandler in project jena by apache.
the class UnionTest method testUnion.
/**
* Asserts that the statistic obtained by probing the three-element union
* with statistics <code>av</code>, <code>bv</code>, and <code>cv</code> is
* <code>expected</code>.
*/
private void testUnion(int expected, int av, int bv, int cv) {
AnInteger a = new AnInteger(av), b = new AnInteger(bv), c = new AnInteger(cv);
Graph g1 = graphWithGivenStatistic(a);
Graph g2 = graphWithGivenStatistic(b);
Graph g3 = graphWithGivenStatistic(c);
Graph[] graphs = new Graph[] { g1, g2, g3 };
MultiUnion mu = new MultiUnion(graphs);
GraphStatisticsHandler gs = new MultiUnion.MultiUnionStatisticsHandler(mu);
assertEquals(expected, gs.getStatistic(Node.ANY, Node.ANY, Node.ANY));
}
use of org.apache.jena.graph.GraphStatisticsHandler in project jena by apache.
the class TestMultiUnion method testMultiUnionHasMultiUnionStatisticsHandler.
/**
A MultiUnion graph should have a MultiUnionStatisticsHandler, and that
handler should point right back to that graph.
*/
public void testMultiUnionHasMultiUnionStatisticsHandler() {
MultiUnion mu = new MultiUnion();
GraphStatisticsHandler sh = mu.getStatisticsHandler();
assertInstanceOf(MultiUnionStatisticsHandler.class, sh);
assertSame(mu, ((MultiUnionStatisticsHandler) sh).getUnion());
}
Aggregations