Solr
  1. Solr
  2. SOLR-2061

Generate jar containing test classes.

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.2, 4.0-ALPHA
    • Component/s: Build
    • Labels:
      None

      Description

      Follow-on to LUCENE-2609 for the solr build – it would be useful to generate and deploy a jar contaiing the test classes so other projects could write unit tests using the framework in Solr.

      This may take care of SOLR-717 as well.

      1. SOLR-2061.patch
        54 kB
        Steve Rowe
      2. SOLR-2061.patch
        47 kB
        Steve Rowe
      3. SOLR-2061.patch
        50 kB
        Steve Rowe
      4. SOLR-2061.patch
        33 kB
        Robert Muir
      5. SOLR-2061.patch
        1 kB
        Drew Farris
      6. SOLR-2061.patch
        1 kB
        Drew Farris

        Issue Links

          Activity

          Drew Farris created issue -
          Hide
          Drew Farris added a comment -

          Here's the patch.

          Show
          Drew Farris added a comment - Here's the patch.
          Drew Farris made changes -
          Field Original Value New Value
          Attachment SOLR-2061.patch [ 12452734 ]
          Grant Ingersoll made changes -
          Link This issue is blocked by LUCENE-2609 [ LUCENE-2609 ]
          Hide
          Drew Farris added a comment -

          Updated patch for latest rev

          Show
          Drew Farris added a comment - Updated patch for latest rev
          Drew Farris made changes -
          Attachment SOLR-2061.patch [ 12469748 ]
          Robert Muir made changes -
          Assignee Robert Muir [ rcmuir ]
          Robert Muir made changes -
          Fix Version/s 3.2 [ 12316172 ]
          Fix Version/s 4.0 [ 12314992 ]
          Hide
          Robert Muir added a comment -

          attached is a patch that makes a test-framework like lucene's.

          The solr contribs now only depend on this, not all the concrete tests.

          This makes it easy for someone developing a plugin to put schema.xml/etc in their test classpath, extend SolrTestCaseJ4, etc.

          Before applying the patch, please do this:

          svn mkdir solr/src/test-framework
          svn mv --parents solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.java solr/src/test-framework/org/apache/solr/BaseDistributedSearchTestCase.java
          svn mv --parents solr/src/test/org/apache/solr/JSONTestUtil.java solr/src/test-framework/org/apache/solr/JSONTestUtil.java
          svn mv --parents solr/src/test/org/apache/solr/SolrTestCaseJ4.java solr/src/test-framework/org/apache/solr/SolrTestCaseJ4.java
          svn mv --parents solr/src/test/org/apache/solr/analysis/BaseTokenTestCase.java solr/src/test-framework/org/apache/solr/analysis/BaseTokenTestCase.java
          svn mv --parents solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java solr/src/test-framework/org/apache/solr/util/AbstractSolrTestCase.java
          svn mv --parents solr/src/java/org/apache/solr/util/TestHarness.java solr/src/test-framework/org/apache/solr/util/TestHarness.java
          
          Show
          Robert Muir added a comment - attached is a patch that makes a test-framework like lucene's. The solr contribs now only depend on this, not all the concrete tests. This makes it easy for someone developing a plugin to put schema.xml/etc in their test classpath, extend SolrTestCaseJ4, etc. Before applying the patch, please do this: svn mkdir solr/src/test-framework svn mv --parents solr/src/test/org/apache/solr/BaseDistributedSearchTestCase.java solr/src/test-framework/org/apache/solr/BaseDistributedSearchTestCase.java svn mv --parents solr/src/test/org/apache/solr/JSONTestUtil.java solr/src/test-framework/org/apache/solr/JSONTestUtil.java svn mv --parents solr/src/test/org/apache/solr/SolrTestCaseJ4.java solr/src/test-framework/org/apache/solr/SolrTestCaseJ4.java svn mv --parents solr/src/test/org/apache/solr/analysis/BaseTokenTestCase.java solr/src/test-framework/org/apache/solr/analysis/BaseTokenTestCase.java svn mv --parents solr/src/test/org/apache/solr/util/AbstractSolrTestCase.java solr/src/test-framework/org/apache/solr/util/AbstractSolrTestCase.java svn mv --parents solr/src/java/org/apache/solr/util/TestHarness.java solr/src/test-framework/org/apache/solr/util/TestHarness.java
          Robert Muir made changes -
          Attachment SOLR-2061.patch [ 12474252 ]
          Hide
          Steve Rowe added a comment -

          This version of the patch includes all of Robert's, and adds in Maven and IntelliJ support.

          The Solr test-framework binary, source, and javadoc jars are produced by ant generate-maven-artifacts and signed, along with their .pom file, by ant sign-artifacts.

          The Maven build works through the install phase, including the test phase, switching all modules to depend on the new Solr test framework jar instead of the jar produced from all Solr test sources.

          The IntelliJ build works, and all modules' test suites run and succeed.

          Show
          Steve Rowe added a comment - This version of the patch includes all of Robert's, and adds in Maven and IntelliJ support. The Solr test-framework binary, source, and javadoc jars are produced by ant generate-maven-artifacts and signed, along with their .pom file, by ant sign-artifacts . The Maven build works through the install phase, including the test phase, switching all modules to depend on the new Solr test framework jar instead of the jar produced from all Solr test sources. The IntelliJ build works, and all modules' test suites run and succeed.
          Steve Rowe made changes -
          Attachment SOLR-2061.patch [ 12474472 ]
          Hide
          Robert Muir added a comment -

          Thanks Steven, though one thing i screwed up here (or lucene is screwed up, dont know which), is the name of the jar file.

          i named this one apache-solr-test-framework-4.0-SNAPSHOT.jar, but the lucene one is named oddly: lucene-core-4.0-SNAPSHOT-tests.jar.

          I think its a bit confusing for the tests-framework to be named -tests in the lucene case... but either way we should at least be consistent here because to use the solr test framework, you need the lucene one too (it extends it)

          Show
          Robert Muir added a comment - Thanks Steven, though one thing i screwed up here (or lucene is screwed up, dont know which), is the name of the jar file. i named this one apache-solr-test-framework-4.0-SNAPSHOT.jar, but the lucene one is named oddly: lucene-core-4.0-SNAPSHOT-tests.jar. I think its a bit confusing for the tests-framework to be named -tests in the lucene case... but either way we should at least be consistent here because to use the solr test framework, you need the lucene one too (it extends it)
          Hide
          Robert Muir added a comment -

          I think this issue just needs the maven parts to be resynced to the fact that lucene's tests-framework jar was renamed?

          Show
          Robert Muir added a comment - I think this issue just needs the maven parts to be resynced to the fact that lucene's tests-framework jar was renamed?
          Steve Rowe made changes -
          Assignee Robert Muir [ rcmuir ] Steven Rowe [ steve_rowe ]
          Hide
          Steve Rowe added a comment -

          This patch brings the Maven aspects up to snuff.

          All tests pass under Ant and Maven. generate-maven-artifacts generates the test-frameword jars, and they are signed by sign-artifacts.

          Unless there are objections, I'll commit this tomorrow, then backport to branch_3x.

          Show
          Steve Rowe added a comment - This patch brings the Maven aspects up to snuff. All tests pass under Ant and Maven. generate-maven-artifacts generates the test-frameword jars, and they are signed by sign-artifacts . Unless there are objections, I'll commit this tomorrow, then backport to branch_3x.
          Steve Rowe made changes -
          Attachment SOLR-2061.patch [ 12475194 ]
          Hide
          Steve Rowe added a comment -

          This patch includes a new "Test Framework Javadoc" link from the Solr website's index.html.

          Committing shortly.

          Show
          Steve Rowe added a comment - This patch includes a new "Test Framework Javadoc" link from the Solr website's index.html. Committing shortly.
          Steve Rowe made changes -
          Attachment SOLR-2061.patch [ 12475226 ]
          sarowe committed 1087722 (69 files)
          Reviews: none

          SOLR-2061: Generate jar containing test classes

          Lucene trunk
          sarowe committed 1087723 (1 file)
          Reviews: none

          Added changes entry for SOLR-2061

          sarowe committed 1087833 (73 files)
          Reviews: none

          SOLR-2061: Generate jar containing test classes

          Lucene branch_3x
          sarowe committed 1087834 (1 file)
          Reviews: none

          SOLR-2061: Ignore pom.xml in this directory

          Hide
          Steve Rowe added a comment - - edited

          Committed:

          • trunk: r1087722, r1087723, r1087834
          • branch_3x: r1087833
          Show
          Steve Rowe added a comment - - edited Committed: trunk: r1087722, r1087723, r1087834 branch_3x: r1087833
          Steve Rowe made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Ingo Renner added a comment -

          Can we have the jar for 3.1.1, too please?

          Show
          Ingo Renner added a comment - Can we have the jar for 3.1.1, too please?
          Hide
          Steve Rowe added a comment -

          Hi Ingo,

          Can we have the jar for 3.1.1, too please?

          It's very unlikely that there will ever be a 3.1.1 release. 3.2.0, which has this jar, will be released very soon, most likely in less than a week.

          Show
          Steve Rowe added a comment - Hi Ingo, Can we have the jar for 3.1.1, too please? It's very unlikely that there will ever be a 3.1.1 release. 3.2.0, which has this jar, will be released very soon, most likely in less than a week.
          Hide
          Ingo Renner added a comment -

          Hi Steven,

          well that sounds fair enough. I just saw a 3.1.1 target and from the open issues for 3.2 it seemed still a bit away. So I'm fine with 3.2 if it's that close anyway

          Thanks!

          Show
          Ingo Renner added a comment - Hi Steven, well that sounds fair enough. I just saw a 3.1.1 target and from the open issues for 3.2 it seemed still a bit away. So I'm fine with 3.2 if it's that close anyway Thanks!
          Hide
          Robert Muir added a comment -

          Bulk close for 3.2

          Show
          Robert Muir added a comment - Bulk close for 3.2
          Robert Muir made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Steve Rowe
              Reporter:
              Drew Farris
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development