fail( msg+"Expected a null array." ); fail( msg+"Not expecting a null array." ); assertEquals(msg + "length differs.", expected.length, actual.length); assertEquals(expected[i], actual[i]); fail(msg + "values differ: index=" + i, ex);
/** * Verify that the iterator visits the expected {@link ISPO}s in any order * without duplicates. * * @param store * Used to resolve term identifiers for messages. * @param expected * @param actual */ static public void assertSameSPOsAnyOrder(AbstractTripleStore store, ISPO[] expected, IChunkedOrderedIterator<ISPO> actual) { assertSameSPOsAnyOrder(store, expected, actual, false); }
static public void assertSameStatements(Statement[] expected, BigdataStatementIterator actual) { assertSameStatements("", expected, actual); }
assertNotNull(encodedValue); fail("No entry in TERMS index: v=" + decodedValue + ", iv=" + iv); fail("IV: original=" + BytesUtil.toString(ivAsKey) + ", afterRoundTrip=" + BytesUtil.toString(encodedIV)); assertNotNull(v.stringValue(), iv); fail("No entry in TERMS index: v=" + v + ", iv=" + iv); fail("IV: original=" + iv + ", afterRoundTrip=" + decodedIV + " for value=" + v); final long rc2 = id2t.rangeCount(); assertEquals("lexicon range counts: t2id=" + rc1 + ", id2t=" + rc2, rc1, rc2);
/** * Properties for tests in this file and this proxy suite (if any). */ public Properties getProperties() { Properties properties = super.getProperties(); return properties; }
/** * Validates that the same statements are found in each of the statement * indices. */ static public void assertStatementIndicesConsistent( final AbstractTripleStore db, final int maxerrors) { if (log.isInfoEnabled()) log.info("Verifying statement indices"); final AtomicInteger nerrs = new AtomicInteger(0); final int from, to; if (db.getSPOKeyArity() == 3) { from = SPOKeyOrder.FIRST_TRIPLE_INDEX; to = SPOKeyOrder.LAST_TRIPLE_INDEX; } else { from = SPOKeyOrder.FIRST_QUAD_INDEX; to = SPOKeyOrder.LAST_QUAD_INDEX; } for (int i = from; i <= to; i++) { for (int j = from; j <= to; j++) { if (i <= j) { // Just compare the upper diagonal. continue; } assertSameStatements(db, SPOKeyOrder.valueOf(i), SPOKeyOrder.valueOf(j), nerrs, maxerrors); } } assertEquals(0, nerrs.get()); }
fail(msg + ": The iterator is willing to visit more than " + expected.length + " objects. The next " + v.size() + " objects would be: " + Arrays.toString(v.toArray())); fail(msg + ": Different objects at index=" + i + ": expected=" + expected[i] + ", actual=" + g); fail(msg + ": The iterator SHOULD have visited " + expected.length + " objects, but only visited " + i + " objects.");
log.warn("Not checking indices in scale-out : code is not efficient."); } else { assertLexiconIndicesConsistent(store); assertStatementIndicesConsistent(store, maxerrors);
public void assertEquals(String msg, SPO expected, SPO actual) { if(!expected.equals(actual)) { if( msg == null ) { msg = ""; } else { msg = msg + " : "; } fail(msg+"Expecting: "+expected+" not "+actual); } }
/** * Create a triple store instance using the delegate using the specified * properties (typically overriding one or more properties). */ protected AbstractTripleStore getStore(Properties properties) { return getOurDelegate().getStore(properties); }
public void assertEquals(SPO[] expected, SPO[] actual) { assertEquals(null,expected,actual); }
AbstractTestCase.assertSameSPOs(new SPO[] { new SPO(s, p, o, StatementEnum.Explicit), }, AbstractTestCase.assertSameSPOs(new SPO[] { new SPO(s, AbstractTestCase.assertSameSPOs(new SPO[] { // new SPO(s, rdfType, rdfsResource, StatementEnum.Inferred), new SPO(o, rdfType, rdfsResource, StatementEnum.Inferred),
assertNotNull(encodedValue); fail("No entry in TERMS index: v=" + decodedValue + ", iv=" + iv); fail("IV: original=" + BytesUtil.toString(ivAsKey) + ", afterRoundTrip=" + BytesUtil.toString(encodedIV)); assertNotNull(v.stringValue(), iv); fail("No entry in TERMS index: v=" + v + ", iv=" + iv); fail("IV: original=" + iv + ", afterRoundTrip=" + decodedIV + " for value=" + v); final long rc2 = id2t.rangeCount(); assertEquals("lexicon range counts: t2id=" + rc1 + ", id2t=" + rc2, rc1, rc2);
/** * Properties for tests in this file and this proxy suite (if any). */ public Properties getProperties() { Properties properties = super.getProperties(); return properties; }
/** * Validates that the same statements are found in each of the statement * indices. */ static public void assertStatementIndicesConsistent( final AbstractTripleStore db, final int maxerrors) { if (log.isInfoEnabled()) log.info("Verifying statement indices"); final AtomicInteger nerrs = new AtomicInteger(0); final int from, to; if (db.getSPOKeyArity() == 3) { from = SPOKeyOrder.FIRST_TRIPLE_INDEX; to = SPOKeyOrder.LAST_TRIPLE_INDEX; } else { from = SPOKeyOrder.FIRST_QUAD_INDEX; to = SPOKeyOrder.LAST_QUAD_INDEX; } for (int i = from; i <= to; i++) { for (int j = from; j <= to; j++) { if (i <= j) { // Just compare the upper diagonal. continue; } assertSameStatements(db, SPOKeyOrder.valueOf(i), SPOKeyOrder.valueOf(j), nerrs, maxerrors); } } assertEquals(0, nerrs.get()); }
fail(msg + ": The iterator is willing to visit more than " + expected.length + " objects. The next " + v.size() + " objects would be: " + Arrays.toString(v.toArray())); fail(msg + ": Different objects at index=" + i + ": expected=" + expected[i] + ", actual=" + g); fail(msg + ": The iterator SHOULD have visited " + expected.length + " objects, but only visited " + i + " objects.");
log.warn("Not checking indices in scale-out : code is not efficient."); } else { assertLexiconIndicesConsistent(store); assertStatementIndicesConsistent(store, maxerrors);
public void assertEquals(String msg, SPO expected, SPO actual) { if(!expected.equals(actual)) { if( msg == null ) { msg = ""; } else { msg = msg + " : "; } fail(msg+"Expecting: "+expected+" not "+actual); } }
/** * Create a triple store instance using the delegate using the specified * properties (typically overriding one or more properties). */ protected AbstractTripleStore getStore(Properties properties) { return getOurDelegate().getStore(properties); }
public void assertEquals(SPO expected, SPO actual) { assertEquals(null,expected,actual); }