Solr
  1. Solr
  2. SOLR-4317

SolrTestCaseJ4: Can't avoid "collection1" convention

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.0
    • Fix Version/s: 4.3, 6.0
    • Component/s: Tests
    • Labels:
      None

      Description

      There is still an issue after the SOLR-3826 patch was applied for 4.0 https://issues.apache.org/jira/browse/SOLR-3826 in September 2012. When TestHarness is called from SolrTestCase4J the only available constructors ignore coreName, set coreName = null, and initialize the default 'collection1.'

      1. SOLR-4317.patch
        8 kB
        Erick Erickson
      2. SOLR-4317.patch
        7 kB
        Erick Erickson
      3. SOLR-4317.patch
        6 kB
        Tricia Jenkins
      4. SOLR-4317.patch
        0.8 kB
        Tricia Jenkins

        Issue Links

          Activity

          Hide
          Tricia Jenkins added a comment -

          This is the patch from my description.

          Show
          Tricia Jenkins added a comment - This is the patch from my description.
          Hide
          Tricia Jenkins added a comment -

          Added test which uses multicore example. Also further modified TestHarness and SolrTestCase4J to use coreName in creating core. Didn't make any changes to ant scripts so the test isn't called during a normal build.

          Show
          Tricia Jenkins added a comment - Added test which uses multicore example. Also further modified TestHarness and SolrTestCase4J to use coreName in creating core. Didn't make any changes to ant scripts so the test isn't called during a normal build.
          Hide
          Tricia Jenkins added a comment - - edited

          There is still a problem with jars from a sharedLib directory defined in solr.xml outside of the coreName's dataDir not being available to coreName's TestHarness despite it being logged as added to classpath:
          1200 T11 oasc.SolrResourceLoader.replaceClassLoader Adding 'file:/C:/Development/workspace/peel-solr/src/solr.home/lib/my-solrplugins.jar' to classloader

          I'm getting: SEVERE Full Import failed:java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to load EntityProcessor implementation for entity:properties Processing Document # 1
          Caused by: java.lang.ClassNotFoundException: Unable to load PropertiesEntityProcessor or org.apache.solr.handler.dataimport.PropertiesEntityProcessor

          Workaround is to not use sharedLib.

          Show
          Tricia Jenkins added a comment - - edited There is still a problem with jars from a sharedLib directory defined in solr.xml outside of the coreName's dataDir not being available to coreName's TestHarness despite it being logged as added to classpath: 1200 T11 oasc.SolrResourceLoader.replaceClassLoader Adding 'file:/C:/Development/workspace/peel-solr/src/solr.home/lib/my-solrplugins.jar' to classloader I'm getting: SEVERE Full Import failed:java.lang.RuntimeException: org.apache.solr.handler.dataimport.DataImportHandlerException: Unable to load EntityProcessor implementation for entity:properties Processing Document # 1 Caused by: java.lang.ClassNotFoundException: Unable to load PropertiesEntityProcessor or org.apache.solr.handler.dataimport.PropertiesEntityProcessor Workaround is to not use sharedLib.
          Hide
          Erick Erickson added a comment -

          Tricia:

          I revised the patch a bit to fit better in the general scheme of things, see below.

          Does this still do what you intended? I haven't run all tests yet, just this one....

          1> puts the test case in the "usual" place so it's run with the rest of the unit tests.

          2> creates a temporary directory with the relevant files in it for a multicore setup

          3> adds a solr-multi.xml file to the test files so we have one available.

          This now runs either in an IDE or as a stand-alone test.

          Show
          Erick Erickson added a comment - Tricia: I revised the patch a bit to fit better in the general scheme of things, see below. Does this still do what you intended? I haven't run all tests yet, just this one.... 1> puts the test case in the "usual" place so it's run with the rest of the unit tests. 2> creates a temporary directory with the relevant files in it for a multicore setup 3> adds a solr-multi.xml file to the test files so we have one available. This now runs either in an IDE or as a stand-alone test.
          Hide
          Tricia Jenkins added a comment -

          Hi Erik. Your re-organized patch looks great! It applies cleanly for me and all tests pass.

          The patch I'm attaching has an added test for the sharedLib directory which I had complained about in my last comment. I don't see the 'sharedLib' tested anywhere else but it seems to work outside of the test-framework. The test fails proving my frustration. Should I make this a separate issue in JIRA?

          Show
          Tricia Jenkins added a comment - Hi Erik. Your re-organized patch looks great! It applies cleanly for me and all tests pass. The patch I'm attaching has an added test for the sharedLib directory which I had complained about in my last comment. I don't see the 'sharedLib' tested anywhere else but it seems to work outside of the test-framework. The test fails proving my frustration. Should I make this a separate issue in JIRA?
          Hide
          Mark Miller added a comment -

          Should I make this a separate issue in JIRA?

          +1

          Show
          Mark Miller added a comment - Should I make this a separate issue in JIRA? +1
          Hide
          Tricia Jenkins added a comment -

          Removed my failing test patch from SOLR-4317 and created new issue SOLR-4536.

          Show
          Tricia Jenkins added a comment - Removed my failing test patch from SOLR-4317 and created new issue SOLR-4536 .
          Hide
          Erick Erickson added a comment -

          Added CHANGES.txt entry.

          Show
          Erick Erickson added a comment - Added CHANGES.txt entry.
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Erick Erickson
          http://svn.apache.org/viewvc?view=revision&revision=1455196

          fix for SOLR-4317, don't requre 'collection1' in test harness. Thanks Tricia.

          Show
          Commit Tag Bot added a comment - [trunk commit] Erick Erickson http://svn.apache.org/viewvc?view=revision&revision=1455196 fix for SOLR-4317 , don't requre 'collection1' in test harness. Thanks Tricia.
          Hide
          Erick Erickson added a comment -

          Additional fix for problem with test harness this uncovered. I'll fold it in the 4x checkin

          trunk: r - 1455368

          Show
          Erick Erickson added a comment - Additional fix for problem with test harness this uncovered. I'll fold it in the 4x checkin trunk: r - 1455368
          Hide
          Erick Erickson added a comment -

          4x r: 1455395 (includes fix for test harness)

          Show
          Erick Erickson added a comment - 4x r: 1455395 (includes fix for test harness)
          Hide
          Commit Tag Bot added a comment -

          [branch_4x commit] Erick Erickson
          http://svn.apache.org/viewvc?view=revision&revision=1455395

          Fix for SOLR-4317, including fixup for test harness

          Show
          Commit Tag Bot added a comment - [branch_4x commit] Erick Erickson http://svn.apache.org/viewvc?view=revision&revision=1455395 Fix for SOLR-4317 , including fixup for test harness
          Hide
          Commit Tag Bot added a comment -

          [trunk commit] Erick Erickson
          http://svn.apache.org/viewvc?view=revision&revision=1455368

          Fix for assumption in the test harness uncovered by SOLR-4317

          Show
          Commit Tag Bot added a comment - [trunk commit] Erick Erickson http://svn.apache.org/viewvc?view=revision&revision=1455368 Fix for assumption in the test harness uncovered by SOLR-4317
          Hide
          Uwe Schindler added a comment -

          Closed after release.

          Show
          Uwe Schindler added a comment - Closed after release.

            People

            • Assignee:
              Erick Erickson
              Reporter:
              Tricia Jenkins
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development