You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Amit Nithian (JIRA)" <ji...@apache.org> on 2012/09/11 19:46:07 UTC
[jira] [Created] (SOLR-3826) Allow unit test classes to specify
core name during setup
Amit Nithian created SOLR-3826:
----------------------------------
Summary: Allow unit test classes to specify core name during setup
Key: SOLR-3826
URL: https://issues.apache.org/jira/browse/SOLR-3826
Project: Solr
Issue Type: Improvement
Components: Build
Affects Versions: 4.0-BETA
Reporter: Amit Nithian
Priority: Minor
Fix For: 4.0
When creating a unit test extending SolrTestCaseJ4, the corename is forced to "collection1" which can be problematic if you want to do unit tests relying on schema/solrconfig specific to a core. Rather than hard-coding to "collection1" allow this to be specified in the initCore method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-3826) Allow unit test classes to specify
core name during setup
Posted by "Amit Nithian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455455#comment-13455455 ]
Amit Nithian commented on SOLR-3826:
------------------------------------
Sounds good! Let me get together a new patch for this and work on the documentation piece as a separate patch as per your suggestion.
> Allow unit test classes to specify core name during setup
> ---------------------------------------------------------
>
> Key: SOLR-3826
> URL: https://issues.apache.org/jira/browse/SOLR-3826
> Project: Solr
> Issue Type: Improvement
> Components: Build
> Affects Versions: 4.0-BETA
> Reporter: Amit Nithian
> Assignee: Hoss Man
> Priority: Minor
> Fix For: 4.0
>
> Attachments: SOLR-3826.patch
>
>
> When creating a unit test extending SolrTestCaseJ4, the corename is forced to "collection1" which can be problematic if you want to do unit tests relying on schema/solrconfig specific to a core. Rather than hard-coding to "collection1" allow this to be specified in the initCore method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Assigned] (SOLR-3826) Allow unit test classes to specify
core name during setup
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hoss Man reassigned SOLR-3826:
------------------------------
Assignee: Hoss Man
Concept looks sound, but i'd like to replace that test specific "collection1" constant with a refrence to the existing place where it's defined as the default collection name (in CoreContainer i believe) as well as add some javadocs to the test harness/baseclass about the assumption.
Amit: if you'd like to take a stab at those improvements before i get a chance, that would be awesome
> Allow unit test classes to specify core name during setup
> ---------------------------------------------------------
>
> Key: SOLR-3826
> URL: https://issues.apache.org/jira/browse/SOLR-3826
> Project: Solr
> Issue Type: Improvement
> Components: Build
> Affects Versions: 4.0-BETA
> Reporter: Amit Nithian
> Assignee: Hoss Man
> Priority: Minor
> Fix For: 4.0
>
> Attachments: SOLR-3826.patch
>
>
> When creating a unit test extending SolrTestCaseJ4, the corename is forced to "collection1" which can be problematic if you want to do unit tests relying on schema/solrconfig specific to a core. Rather than hard-coding to "collection1" allow this to be specified in the initCore method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-3826) Allow unit test classes to specify
core name during setup
Posted by "Amit Nithian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455428#comment-13455428 ]
Amit Nithian commented on SOLR-3826:
------------------------------------
HossMan: Sure I'll take a stab at this. I didn't know this was a constant so I'll give a shot to find it and reference it. Are there any existing docs about how to create tests with Solr? I found there was some discussion on the mailing list. I'm happy to take a first pass at this if you think it'd help.
> Allow unit test classes to specify core name during setup
> ---------------------------------------------------------
>
> Key: SOLR-3826
> URL: https://issues.apache.org/jira/browse/SOLR-3826
> Project: Solr
> Issue Type: Improvement
> Components: Build
> Affects Versions: 4.0-BETA
> Reporter: Amit Nithian
> Assignee: Hoss Man
> Priority: Minor
> Fix For: 4.0
>
> Attachments: SOLR-3826.patch
>
>
> When creating a unit test extending SolrTestCaseJ4, the corename is forced to "collection1" which can be problematic if you want to do unit tests relying on schema/solrconfig specific to a core. Rather than hard-coding to "collection1" allow this to be specified in the initCore method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (SOLR-3826) Allow unit test classes to specify
core name during setup
Posted by "Amit Nithian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amit Nithian updated SOLR-3826:
-------------------------------
Attachment: SOLR-3826_1.patch
Second pass on patch after HossMan's suggestions.
> Allow unit test classes to specify core name during setup
> ---------------------------------------------------------
>
> Key: SOLR-3826
> URL: https://issues.apache.org/jira/browse/SOLR-3826
> Project: Solr
> Issue Type: Improvement
> Components: Build
> Affects Versions: 4.0-BETA
> Reporter: Amit Nithian
> Assignee: Hoss Man
> Priority: Minor
> Fix For: 4.0
>
> Attachments: SOLR-3826_1.patch, SOLR-3826.patch
>
>
> When creating a unit test extending SolrTestCaseJ4, the corename is forced to "collection1" which can be problematic if you want to do unit tests relying on schema/solrconfig specific to a core. Rather than hard-coding to "collection1" allow this to be specified in the initCore method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Updated] (SOLR-3826) Allow unit test classes to specify
core name during setup
Posted by "Amit Nithian (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amit Nithian updated SOLR-3826:
-------------------------------
Attachment: SOLR-3826.patch
Simple patch demonstrating what I am talking about. Hopefully not too problematic :-)
> Allow unit test classes to specify core name during setup
> ---------------------------------------------------------
>
> Key: SOLR-3826
> URL: https://issues.apache.org/jira/browse/SOLR-3826
> Project: Solr
> Issue Type: Improvement
> Components: Build
> Affects Versions: 4.0-BETA
> Reporter: Amit Nithian
> Priority: Minor
> Fix For: 4.0
>
> Attachments: SOLR-3826.patch
>
>
> When creating a unit test extending SolrTestCaseJ4, the corename is forced to "collection1" which can be problematic if you want to do unit tests relying on schema/solrconfig specific to a core. Rather than hard-coding to "collection1" allow this to be specified in the initCore method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Commented] (SOLR-3826) Allow unit test classes to specify
core name during setup
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455449#comment-13455449 ]
Hoss Man commented on SOLR-3826:
--------------------------------
bq. I didn't know this was a constant so I'll give a shot to find it and reference it.
yeah, it dates back to the fact that solr will still work with "pre-multicore" solr home dirs that are really just single SolrCore instance dirs -- in which case it refers to the core as "collection1" ... the constant you want is CoreContainer.DEFAULT_DEFAULT_CORE_NAME (which this test code should have been using in the first place, but as long as we're touching it let's fix it)
bq. Are there any existing docs about how to create tests with Solr? I found there was some discussion on the mailing list. I'm happy to take a first pass at this if you think it'd help.
As far as i know the only docs are the javadocs in the base classes and test harness -- if you'd like to take a stab at adding useful content to solr/test-framework/src/java/overview.html that would be awesome! (but perhaps deal with thta in a separate jira/patch so it doesn't hold up this already useful fix?)
> Allow unit test classes to specify core name during setup
> ---------------------------------------------------------
>
> Key: SOLR-3826
> URL: https://issues.apache.org/jira/browse/SOLR-3826
> Project: Solr
> Issue Type: Improvement
> Components: Build
> Affects Versions: 4.0-BETA
> Reporter: Amit Nithian
> Assignee: Hoss Man
> Priority: Minor
> Fix For: 4.0
>
> Attachments: SOLR-3826.patch
>
>
> When creating a unit test extending SolrTestCaseJ4, the corename is forced to "collection1" which can be problematic if you want to do unit tests relying on schema/solrconfig specific to a core. Rather than hard-coding to "collection1" allow this to be specified in the initCore method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org
[jira] [Resolved] (SOLR-3826) Allow unit test classes to specify
core name during setup
Posted by "Hoss Man (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/SOLR-3826?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Hoss Man resolved SOLR-3826.
----------------------------
Resolution: Fixed
Thanks Amit!
I committed your patch along with a few more method level javadocs and fixed one more place where TestHarness was using a "collection1" literal.
Committed revision 1384872.
Committed revision 1384877. - 4x
> Allow unit test classes to specify core name during setup
> ---------------------------------------------------------
>
> Key: SOLR-3826
> URL: https://issues.apache.org/jira/browse/SOLR-3826
> Project: Solr
> Issue Type: Improvement
> Components: Build
> Affects Versions: 4.0-BETA
> Reporter: Amit Nithian
> Assignee: Hoss Man
> Priority: Minor
> Fix For: 4.0
>
> Attachments: SOLR-3826_1.patch, SOLR-3826.patch
>
>
> When creating a unit test extending SolrTestCaseJ4, the corename is forced to "collection1" which can be problematic if you want to do unit tests relying on schema/solrconfig specific to a core. Rather than hard-coding to "collection1" allow this to be specified in the initCore method.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org