You need to add something like:
"-Dsolr.test.sys.prop1=xxx -Dsolr.test.sys.prop2=xxx" to the VM arguments in the Run panel.

It is kind of annoying they are required for all tests... ideally we would move the schema property testing to an independent test, but that has not happend yet.


Eric Pugh wrote:
I was wondering about that, but also, how do you handle the two system properties?

I added to   public TestHarness(String dataDirectory,
                     String confFile,
                     String schemaFile) {

these lines:

System.setProperty("solr.test.sys.prop1", "propone");
System.setProperty("solr.test.sys.prop2", "proptwo");

Otherwise I always got an error about a missing system property. Normally, via Ant, these are passed in via the JUnit test definition. Would this change be worth an issue in Jira and a patch file?

Also, mucking around with working-directories didn't work, so I added the path in Config.java. Attached is a patch file for these two changes.....

Eric




On Jun 27, 2007, at 2:29 PM, Yonik Seeley wrote:

I tell IntelliJ IDEA to set the working directory for all the tests to
F:\code\solr\src\test\test-files

-Yonik

On 6/27/07, Eric Pugh <[EMAIL PROTECTED]> wrote:
Hi all,

I always run into path issues when running the unit tests from inside
of Eclipse...

For example, when I run TestCSVLoader.java I get

java.lang.ExceptionInInitializerError
        at org.apache.solr.util.TestHarness.<init>(TestHarness.java:101)
        at org.apache.solr.util.AbstractSolrTestCase.setUp
(AbstractSolrTestCase.java:102)
at org.apache.solr.handler.TestCSVLoader.setUp(TestCSVLoader.java:43)
        at junit.framework.TestCase.runBare(TestCase.java:125)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run
(JUnit3TestReference.java:128)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run
(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests
(RemoteTestRunner.java:673)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run
(RemoteTestRunner.java:386)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main
(RemoteTestRunner.java:196)
Caused by: java.lang.RuntimeException: Error in solrconfig.xml
        at org.apache.solr.core.SolrConfig.<clinit>(SolrConfig.java:90)
        ... 16 more
Caused by: java.lang.RuntimeException: Can't find resource
'solrconfig.xml' in classpath or 'solr/conf/', cwd=/Users/eric/
Documents/code/oss/apache/solr/trunk
        at org.apache.solr.core.Config.openResource(Config.java:357)
at org.apache.solr.core.SolrConfig.initConfig(SolrConfig.java:79)
        at org.apache.solr.core.SolrConfig.<clinit>(SolrConfig.java:87)
        ... 16 more


I have a tweak that gives it an alternate path to look up the
file...  Would that be of interest to anyone as a patch file?   Is
there a specific way to config my Eclipse project to find the path?

Eric Pugh





-------------------------------------------------------
Principal
OpenSource Connections
Site: http://www.opensourceconnections.com
Blog: http://blog.opensourceconnections.com
Cell: 1-434-466-1467






-------------------------------------------------------
Principal
OpenSource Connections
Site: http://www.opensourceconnections.com
Blog: http://blog.opensourceconnections.com
Cell: 1-434-466-1467





Reply via email to