[ 
https://issues.apache.org/jira/browse/SOLR-2666?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13068373#comment-13068373
 ] 

Steven Rowe commented on SOLR-2666:
-----------------------------------

Here's the patch to fix Solrj's {{test.classpath}}, applicable to both 
branch_3x and trunk:

{code:xml}
Index: solr/solrj/build.xml
===================================================================
--- solr/solrj/build.xml        (revision 1148740)
+++ solr/solrj/build.xml        (working copy)
@@ -20,6 +20,13 @@
 
   <import file="../common-build.xml"/>
 
+  <!-- Specialized common-solr.test.classpath, to remove the Solr core test 
output -->
+  <path id="test.classpath">
+    <pathelement 
path="${common-solr.dir}/build/solr-test-framework/classes/java"/>
+       <pathelement path="${tests.userdir}"/>
+       <path refid="test.base.classpath"/>
+  </path>
+
   <target name="compile-test" 
depends="compile-solr-test-framework,common.compile-test"/>
 
   <target name="test" 
depends="compile-test,junit-mkdir,junit-sequential,junit-parallel"/>
{code}

On branch_3x, this patch removes the Solr core test dependency:

{code:java}
Index: solr/solrj/src/test/org/apache/solr/common/util/TestNamedListCodec.java
===================================================================
--- solr/solrj/src/test/org/apache/solr/common/util/TestNamedListCodec.java    
(revision 1148740)
+++ solr/solrj/src/test/org/apache/solr/common/util/TestNamedListCodec.java    
(working copy)
@@ -17,9 +17,9 @@
 package org.apache.solr.common.util;
 
 import org.apache.lucene.util.LuceneTestCase;
+import org.apache.solr.BaseDistributedSearchTestCase;
 import org.apache.solr.common.SolrDocument;
 import org.apache.solr.common.SolrDocumentList;
-import org.apache.solr.TestDistributedSearch;
 
 import java.io.ByteArrayOutputStream;
 import java.io.ByteArrayInputStream;
@@ -246,7 +246,7 @@
       byte[] arr = baos.toByteArray();
       // System.out.println(arr.length);
       res = (NamedList) new JavaBinCodec().unmarshal(new 
ByteArrayInputStream(arr));
-      cmp = TestDistributedSearch.compare(nl,res, 0, null);
+      cmp = BaseDistributedSearchTestCase.compare(nl, res, 0, null);
 
       if (cmp != null) {
         System.out.println(nl);
{code}

Committing shortly.

> Solrj test.classpath should not include Solr core test compilation output
> -------------------------------------------------------------------------
>
>                 Key: SOLR-2666
>                 URL: https://issues.apache.org/jira/browse/SOLR-2666
>             Project: Solr
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 3.4, 4.0
>            Reporter: Steven Rowe
>            Assignee: Steven Rowe
>
> Under {{solr/solrj/}} on branch_3x, {{ant compile-test}} fails because of 
> incomplete backport of the SOLR-2452 changes: {{TestNamedListCodec}} still 
> depends on a Solr test class {{TestDistributedSearch}}.
> This problem is masked by the inclusion of Solr test compilation output in 
> Solrj's {{test.classpath}}, which is inherited from 
> {{solr/common-build.xml}}; when {{ant compile-test}} is run from {{solr/}}, 
> the Solr core tests are compiled first, thus allowing Solrj test compilation 
> to succeed.
> On trunk, {{ant compile-test}} under {{solr/solrj/}} does not fail, because 
> {{TestNamedListCodec}} depends on {{BaseDistributedSearchTestCase}}, located 
> in Solr's test-framework, instead of on {{TestDistributedSearch}}.  This 
> issue should nevertheless be addressed on trunk too, to surface future 
> inadvertent solrj test->solr core test dependencies.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to