com.bigdata.rdf.sparql.ast.TestSolutionSetStatserator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bigdata-rdf-test Show documentation
Show all versions of bigdata-rdf-test Show documentation
Blazegraph(TM) RDF Test Suites
package com.bigdata.rdf.sparql.ast;
import com.bigdata.bop.IBindingSet;
import com.bigdata.striterator.CloseableIteratorWrapper;
import cutthecrap.utils.striterators.SingleValueIterator;
/**
* Test suite for {@link SolutionSetStatserator}
*
* @author bryan
*/
public class TestSolutionSetStatserator extends
AbstractSolutionSetStatsTestCase {
public TestSolutionSetStatserator() {
}
public TestSolutionSetStatserator(String name) {
super(name);
}
@Override
protected ISolutionSetStats newFixture(final IBindingSet[] bindingSets) {
final SolutionSetStatserator itr = new SolutionSetStatserator(
new CloseableIteratorWrapper(
new SingleValueIterator(bindingSets)));
try {
while (itr.hasNext()) {
// statistics filter will observed each solution set[].
itr.next();
}
// Return the compiled statistics.
return itr.getStats();
} finally {
itr.close();
}
}
/**
* Correct rejection test for the constructor.
*/
public void test_001() {
try {
new SolutionSetStatserator(null);
fail("Expecting: " + IllegalArgumentException.class);
} catch (IllegalArgumentException ex) {
if (log.isInfoEnabled())
log.info("Ignoring expected exception: " + ex);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy