public static Test suite() { final TestDirectJournal delegate = new TestDirectJournal(); // !!!! THIS CLASS !!!! /* * Use a proxy test suite and specify the delegate. */ ProxyTestSuite suite = new ProxyTestSuite(delegate, "Direct Journal Test Suite"); /* * List any non-proxied tests (typically bootstrapping tests). */ // tests defined by this class. suite.addTestSuite(TestDirectJournal.class); // test suite for the IRawStore api. suite.addTestSuite( TestRawStore.class ); // test suite for handling asynchronous close of the file channel. suite.addTestSuite( TestInterrupts.class ); // test suite for MROW correctness. suite.addTestSuite( TestMROW.class ); // test suite for MRMW correctness. suite.addTestSuite( TestMRMW.class ); /* * Pickup the basic journal test suite. This is a proxied test suite, so * all the tests will run with the configuration specified in this test * class and its optional .properties file. */ suite.addTest(TestJournalBasics.suite()); return suite; }
@Override public void addTest(final Test test) { for (final ProxyTestSuite s:subs) { s.addTest(cloneTest(s.getDelegate(),test)); } } }
/** * Creates an empty unnamed test suite. The <i>delegate </i> will be * assigned to tests added to this test suite that implement * {@link IProxyTest}. * * @param delegate * The delegate (non-null). */ public ProxyTestSuite( Test delegate ) { super(); checkDelegate( delegate ); m_delegate = delegate; }
/** * Create and populate a {@link ProxyTestSuite} with the unit tests that we * will run against any of the {@link IIndexManager} implementations. * * @param delegate * The delegate for the proxied unit tests. * @param name * The name of the test suite. * @return The {@link ProxyTestSuite} populated with the unit tests. */ protected static ProxyTestSuite proxySuite( AbstractIndexManagerTestCase<? extends IIndexManager> delegate, String name) { final ProxyTestSuite suite = new ProxyTestSuite(delegate, name); // sparse row store operations. suite.addTestSuite(TestSparseRowStore.class); return suite; }
ProxyTestSuite proxyTestSuite = new ProxyTestSuite ( m_delegate, testClass ); addTest( proxyTestSuite );
suite.addTestSuite(TestRWStoreTxBehaviors.class); suite.addTestSuite(TestBackupServlet.class); suite.addTest(TestProtocolAll.suite()); suite.addTestSuite(Test_REST_Structure.class); suite.addTestSuite(Test_REST_ASK.class); suite.addTestSuite(Test_REST_DESCRIBE.class); suite.addTestSuite(Test_REST_ESTCARD.class); if(BigdataStatics.runKnownBadTests) {// FIXME Restore for BLZG-1195 suite.addTestSuite(Test_REST_ESTCARD.ReadWriteTx.class); suite.addTestSuite(Test_REST_HASSTMT.class); if(BigdataStatics.runKnownBadTests) {// FIXME Restore for BLZG-1195 suite.addTestSuite(Test_REST_HASSTMT.ReadWriteTx.class); suite.addTestSuite(Test_REST_HASSTMT.TruthMaintenance.class); suite.addTestSuite(Test_Ticket_1207.class); // BLZG-1207 (GETSTMTS with includeInferred) suite.addTestSuite(TestSparqlUpdateSuppressTruthMaintenance.class); suite.addTestSuite(Test_REST_ServiceDescription.class); suite.addTestSuite(Test_REST_DELETE_BY_ACCESS_PATH.class); suite.addTestSuite(Test_REST_DELETE_WITH_BODY.class); suite.addTestSuite(TestNanoSparqlClient.class); suite.addTestSuite(TestMultiTenancyAPI.class); // Multi-tenancy API. suite.addTestSuite(TestDataLoaderServlet.class); // Data Loader Servlet
@Override public void addTest(Test test) { super.addTest(cloneTest(getDelegate(),test)); } }
static ProxyTestSuite createProxyTestSuite(final IIndexManager indexManager, final TestMode testMode) { final TestNanoSparqlServerWithProxyIndexManager<?> delegate = new TestNanoSparqlServerWithProxyIndexManager( null/* name */, indexManager, testMode); // !!!! THIS CLASS !!!! /* * Use a proxy test suite and specify the delegate. */ final ProxyTestSuite suite = new ProxyTestSuite(delegate, "NanoSparqlServer Proxied Test Suite: indexManager=" + indexManager.getClass().getSimpleName() + ", testMode=" + testMode + ", bufferMode=" + (indexManager instanceof Journal ? ((Journal) indexManager) .getBufferStrategy().getBufferMode() : "")); return suite; }
@SuppressWarnings("rawtypes") @Override public void addTestSuite(final Class clazz) { for (final ProxyTestSuite s:subs) { s.addTestSuite(clazz); } }
@SuppressWarnings("rawtypes") @Override protected void tearDown() throws Exception { ((TestNanoSparqlServerWithProxyIndexManager)suite2.getDelegate()).tearDownAfterSuite(); /* * Note: Do not clear. Will not leak unless the * QueryEngine objects are pinned. They will not be * pinned if you shutdown the Journal correctly for each * test; the call to tearDownAfterSuite above calls the destroy() method * on temporary journals, which appears to do the necessary thing. */ // QueryEngineFactory.clearStandAloneQECacheDuringTesting(); } });
checkDelegate( delegate ); flowDown(this); checkDelegate( delegate ); flowDown(this);
protected void flowDown(Test t) { if (m_delegate == null) { throw new AssertionError("delegate is not set."); } if ( t instanceof TestSuite ) { flowDown( (TestSuite) t ); } else if (t instanceof IProxyTest) { log.debug("Setting delegate on " + t.getClass() + " to " + m_delegate.getClass()); ((IProxyTest) t).setDelegate(m_delegate); } }
/** * Create and populate a {@link ProxyTestSuite} with the unit tests that we * will run against any of the {@link IIndexManager} implementations. * * @param delegate * The delegate for the proxied unit tests. * @param name * The name of the test suite. * @return The {@link ProxyTestSuite} populated with the unit tests. */ protected static ProxyTestSuite proxySuite( AbstractIndexManagerTestCase<? extends IIndexManager> delegate, String name) { final ProxyTestSuite suite = new ProxyTestSuite(delegate, name); // sparse row store operations. suite.addTestSuite(TestSparseRowStore.class); return suite; }
ProxyTestSuite proxyTestSuite = new ProxyTestSuite ( m_delegate, testClass ); addTest( proxyTestSuite );
suite.addTestSuite(TestRWStoreTxBehaviors.class); suite.addTestSuite(TestBackupServlet.class); suite.addTest(TestProtocolAll.suite()); suite.addTestSuite(Test_REST_Structure.class); suite.addTestSuite(Test_REST_ASK.class); suite.addTestSuite(Test_REST_DESCRIBE.class); suite.addTestSuite(Test_REST_ESTCARD.class); if(BigdataStatics.runKnownBadTests) {// FIXME Restore for BLZG-1195 suite.addTestSuite(Test_REST_ESTCARD.ReadWriteTx.class); suite.addTestSuite(Test_REST_HASSTMT.class); if(BigdataStatics.runKnownBadTests) {// FIXME Restore for BLZG-1195 suite.addTestSuite(Test_REST_HASSTMT.ReadWriteTx.class); suite.addTestSuite(Test_REST_HASSTMT.TruthMaintenance.class); suite.addTestSuite(Test_Ticket_1207.class); // BLZG-1207 (GETSTMTS with includeInferred) suite.addTestSuite(TestSparqlUpdateSuppressTruthMaintenance.class); suite.addTestSuite(Test_REST_ServiceDescription.class); suite.addTestSuite(Test_REST_DELETE_BY_ACCESS_PATH.class); suite.addTestSuite(Test_REST_DELETE_WITH_BODY.class); suite.addTestSuite(TestNanoSparqlClient.class); suite.addTestSuite(TestMultiTenancyAPI.class); // Multi-tenancy API. suite.addTestSuite(TestDataLoaderServlet.class); // Data Loader Servlet
@Override public void addTest(Test test) { super.addTest(cloneTest(getDelegate(),test)); } }
static ProxyTestSuite createProxyTestSuite(final IIndexManager indexManager, final TestMode testMode) { final TestNanoSparqlServerWithProxyIndexManager<?> delegate = new TestNanoSparqlServerWithProxyIndexManager( null/* name */, indexManager, testMode); // !!!! THIS CLASS !!!! /* * Use a proxy test suite and specify the delegate. */ final ProxyTestSuite suite = new ProxyTestSuite(delegate, "NanoSparqlServer Proxied Test Suite: indexManager=" + indexManager.getClass().getSimpleName() + ", testMode=" + testMode + ", bufferMode=" + (indexManager instanceof Journal ? ((Journal) indexManager) .getBufferStrategy().getBufferMode() : "")); return suite; }
@SuppressWarnings("rawtypes") @Override public void addTestSuite(final Class clazz) { for (final ProxyTestSuite s:subs) { s.addTestSuite(clazz); } }
@SuppressWarnings("rawtypes") @Override protected void tearDown() throws Exception { ((TestNanoSparqlServerWithProxyIndexManager)suite2.getDelegate()).tearDownAfterSuite(); /* * Note: Do not clear. Will not leak unless the * QueryEngine objects are pinned. They will not be * pinned if you shutdown the Journal correctly for each * test; the call to tearDownAfterSuite above calls the destroy() method * on temporary journals, which appears to do the necessary thing. */ // QueryEngineFactory.clearStandAloneQECacheDuringTesting(); } });
checkDelegate( delegate ); flowDown(this); checkDelegate( delegate ); flowDown(this);