/** * 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)); }
/** 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() ); }
/** * 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)); }
/** 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 ) ); }
@Override protected GraphStatisticsHandler createStatisticsHandler() { return new MultiUnionStatisticsHandler( this ); }
@Override protected GraphStatisticsHandler createStatisticsHandler() { return new MultiUnionStatisticsHandler( this ); }
/** 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 ) ); }
/** 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() ); }