dsmiley commented on code in PR #4147:
URL: https://github.com/apache/solr/pull/4147#discussion_r2830764383


##########
solr/solrj/src/test/org/apache/solr/client/solrj/SolrExampleTests.java:
##########
@@ -95,11 +99,22 @@
 public abstract class SolrExampleTests extends SolrExampleTestsBase {
   private static final Logger log = 
LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
+  @BeforeClass
+  public static void beforeTest() throws Exception {
+    EnvUtils.setProperty(
+        ALLOW_PATHS_SYSPROP, 
ExternalPaths.SERVER_HOME.toAbsolutePath().toString());
+    solrTestRule.startSolr(createTempDir());
+    solrTestRule
+        .newCollection(DEFAULT_TEST_COLLECTION_NAME)
+        .withConfigSet(ExternalPaths.TECHPRODUCTS_CONFIGSET)
+        .create();
+  }
+
   @Before
   public void emptyCollection() throws Exception {
     SolrClient client = getSolrClient();
     // delete everything!
-    client.deleteByQuery("*:*");
+    client.deleteByQuery(DEFAULT_TEST_COLLECTION_NAME, "*:*");
     client.commit();

Review Comment:
   for a given test, either embrace the default if you can (ideal), or 
thoroughly pass the collection/core with every SolrJ call (which is freaking 
annoying, granted -- I don't like our API).  Don't mix the two approaches!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to