Re: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-18 Thread Erick Erickson
You've probably seen this page: http://wiki.apache.org/solr/HowToContribute,
but here it is for reference

Go ahead and open a JIRA at https://issues.apache.org/jira/browse/SOLR
(you need to create an account) and attach your changes as a patch. That
gets it into the system and folks can start commenting on what they
think the implications are. One of the committers needs to pick it up,
but you can prompt ...

Yonik's law of patches reads:

A half-baked patch in Jira, with no documentation, no tests
and no backwards compatibility is better than no patch at all.

So don't worry about a completely polished patch for the first cut, it's often
helpful for people to see the early stages to help steer the effort.

Best
Erick

On Wed, May 18, 2011 at 5:41 AM, Gabriele Kahlout
 wrote:
> Thinking more about it, I can solve my immediate problem by just
> copy-pasting the classes I need into my own project packages (KISS
> like here
> ).
>
> I'd however suggest to refactor Solr code structure to be much more
> defaults-compliant making it easier for external developers to understand,
> and hopefully easier to maintain for committers (with fewer special-needs
> configurations). I've done some of those refactorings on my local copy of
> Solr and would be glad to contribute.
>
> For this particular problem the KISS solution would be to create yet one
> more module for Tests which depend on Solr Core and on the Test Framework.
> The org burden of that extra module, versus the ease of building
> configuration, I believe, outweights.
>
>
>
> On Tue, May 17, 2011 at 7:11 PM, Gabriele Kahlout
> wrote:
>
>>
>> http://stackoverflow.com/questions/6034513/can-i-avoid-a-dependency-cycle-with-one-edge-being-a-test-dependency
>>
>>
>> On Tue, May 17, 2011 at 6:49 PM, Gabriele Kahlout <
>> gabri...@mysimpatico.com> wrote:
>>
>>>
>>>
>>>
>>> On Tue, May 17, 2011 at 3:52 PM, Gabriele Kahlout <
>>> gabri...@mysimpatico.com> wrote:
>>>


 On Tue, May 17, 2011 at 3:44 PM, Steven A Rowe  wrote:

> Hi Gabriele,
>
> On 5/17/2011 at 9:34 AM, Gabriele Kahlout wrote:
> > Solr Core should declare a test dependency on Solr Test Framework.
>
> I agree:
>
> - Solr Core should have a test-scope dependency on Solr Test Framework.
> - Solr Test Framework should have a compile-scope dependency on Solr
> Core.
>
> But Maven views this as a circular dependency.
>

 I've seen, but adding it with  test  works. The logic:
 the src is compiled first and then re-used (I'm assuming maven does
 something smart about not including the full jar).

>>>
>>> Not quite. I've tried a demo and the reactor complains. I'll try to see if
>>> maven could become 'smarter', or if the 2-build phase solution will work.
>>>
>>> The projects in the reactor contain a cyclic reference: Edge between
>>> 'Vertex{label='com.mysimpatico:TestFramework:1.0-SNAPSHOT'}' and
>>> 'Vertex{label='org.apache:DummyCore:1.0-SNAPSHOT'}' introduces to cycle in
>>> the graph org.apache:DummyCore:1.0-SNAPSHOT -->
>>> com.mysimpatico:TestFramework:1.0-SNAPSHOT -->
>>> org.apache:DummyCore:1.0-SNAPSHOT -> [Help 1]
>>>
>>>
>>>




> The workaround: Solr Core includes the source of Solr Test Framework as
> part of its test source code.  It's not pretty, but it works.
>
> I'd be happy to entertain other (functional) approaches.
>

 In dp4j.com pom.xml I build in 2 phases to compile with the same
 annotations in the project itself (but i don't think we need that here)


>
> Steve
>
>


 --
 Regards,
 K. Gabriele

 --- unchanged since 20/9/10 ---
 P.S. If the subject contains "[LON]" or the addressee acknowledges the
 receipt within 48 hours then I don't resend the email.
 subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
 time(x) < Now + 48h) ⇒ ¬resend(I, this).

 If an email is sent by a sender that is not a trusted contact or the
 email does not contain a valid code then the email is not received. A valid
 code starts with a hyphen and ends with "X".
 ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
 L(-[a-z]+[0-9]X)).


>>>
>>>
>>> --
>>> Regards,
>>> K. Gabriele
>>>
>>> --- unchanged since 20/9/10 ---
>>> P.S. If the subject contains "[LON]" or the addressee acknowledges the
>>> receipt within 48 hours then I don't resend the email.
>>> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
>>> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>>>
>>> If an email is sent by a sender that is not a trusted contact or the email
>>> does not contain a valid code then the email is not received. A valid code
>>> starts with a hyphen and ends with "X".
>>> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
>>> L(-[a-z]+[0-9]X)).
>>>
>>>
>>
>>
>> --
>> Regar

Re: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-18 Thread Gabriele Kahlout
Thinking more about it, I can solve my immediate problem by just
copy-pasting the classes I need into my own project packages (KISS
like here
).

I'd however suggest to refactor Solr code structure to be much more
defaults-compliant making it easier for external developers to understand,
and hopefully easier to maintain for committers (with fewer special-needs
configurations). I've done some of those refactorings on my local copy of
Solr and would be glad to contribute.

For this particular problem the KISS solution would be to create yet one
more module for Tests which depend on Solr Core and on the Test Framework.
The org burden of that extra module, versus the ease of building
configuration, I believe, outweights.



On Tue, May 17, 2011 at 7:11 PM, Gabriele Kahlout
wrote:

>
> http://stackoverflow.com/questions/6034513/can-i-avoid-a-dependency-cycle-with-one-edge-being-a-test-dependency
>
>
> On Tue, May 17, 2011 at 6:49 PM, Gabriele Kahlout <
> gabri...@mysimpatico.com> wrote:
>
>>
>>
>>
>> On Tue, May 17, 2011 at 3:52 PM, Gabriele Kahlout <
>> gabri...@mysimpatico.com> wrote:
>>
>>>
>>>
>>> On Tue, May 17, 2011 at 3:44 PM, Steven A Rowe  wrote:
>>>
 Hi Gabriele,

 On 5/17/2011 at 9:34 AM, Gabriele Kahlout wrote:
 > Solr Core should declare a test dependency on Solr Test Framework.

 I agree:

 - Solr Core should have a test-scope dependency on Solr Test Framework.
 - Solr Test Framework should have a compile-scope dependency on Solr
 Core.

 But Maven views this as a circular dependency.

>>>
>>> I've seen, but adding it with  test  works. The logic:
>>> the src is compiled first and then re-used (I'm assuming maven does
>>> something smart about not including the full jar).
>>>
>>
>> Not quite. I've tried a demo and the reactor complains. I'll try to see if
>> maven could become 'smarter', or if the 2-build phase solution will work.
>>
>> The projects in the reactor contain a cyclic reference: Edge between
>> 'Vertex{label='com.mysimpatico:TestFramework:1.0-SNAPSHOT'}' and
>> 'Vertex{label='org.apache:DummyCore:1.0-SNAPSHOT'}' introduces to cycle in
>> the graph org.apache:DummyCore:1.0-SNAPSHOT -->
>> com.mysimpatico:TestFramework:1.0-SNAPSHOT -->
>> org.apache:DummyCore:1.0-SNAPSHOT -> [Help 1]
>>
>>
>>
>>>
>>>
>>>
>>>
 The workaround: Solr Core includes the source of Solr Test Framework as
 part of its test source code.  It's not pretty, but it works.

 I'd be happy to entertain other (functional) approaches.

>>>
>>> In dp4j.com pom.xml I build in 2 phases to compile with the same
>>> annotations in the project itself (but i don't think we need that here)
>>>
>>>

 Steve


>>>
>>>
>>> --
>>> Regards,
>>> K. Gabriele
>>>
>>> --- unchanged since 20/9/10 ---
>>> P.S. If the subject contains "[LON]" or the addressee acknowledges the
>>> receipt within 48 hours then I don't resend the email.
>>> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
>>> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>>>
>>> If an email is sent by a sender that is not a trusted contact or the
>>> email does not contain a valid code then the email is not received. A valid
>>> code starts with a hyphen and ends with "X".
>>> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
>>> L(-[a-z]+[0-9]X)).
>>>
>>>
>>
>>
>> --
>> Regards,
>> K. Gabriele
>>
>> --- unchanged since 20/9/10 ---
>> P.S. If the subject contains "[LON]" or the addressee acknowledges the
>> receipt within 48 hours then I don't resend the email.
>> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
>> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>>
>> If an email is sent by a sender that is not a trusted contact or the email
>> does not contain a valid code then the email is not received. A valid code
>> starts with a hyphen and ends with "X".
>> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
>> L(-[a-z]+[0-9]X)).
>>
>>
>
>
> --
> Regards,
> K. Gabriele
>
> --- unchanged since 20/9/10 ---
> P.S. If the subject contains "[LON]" or the addressee acknowledges the
> receipt within 48 hours then I don't resend the email.
> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>
> If an email is sent by a sender that is not a trusted contact or the email
> does not contain a valid code then the email is not received. A valid code
> starts with a hyphen and ends with "X".
> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
> L(-[a-z]+[0-9]X)).
>
>


-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains "[LON]" or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
< Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not

Re: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-17 Thread Gabriele Kahlout
http://stackoverflow.com/questions/6034513/can-i-avoid-a-dependency-cycle-with-one-edge-being-a-test-dependency

On Tue, May 17, 2011 at 6:49 PM, Gabriele Kahlout
wrote:

>
>
>
> On Tue, May 17, 2011 at 3:52 PM, Gabriele Kahlout <
> gabri...@mysimpatico.com> wrote:
>
>>
>>
>> On Tue, May 17, 2011 at 3:44 PM, Steven A Rowe  wrote:
>>
>>> Hi Gabriele,
>>>
>>> On 5/17/2011 at 9:34 AM, Gabriele Kahlout wrote:
>>> > Solr Core should declare a test dependency on Solr Test Framework.
>>>
>>> I agree:
>>>
>>> - Solr Core should have a test-scope dependency on Solr Test Framework.
>>> - Solr Test Framework should have a compile-scope dependency on Solr
>>> Core.
>>>
>>> But Maven views this as a circular dependency.
>>>
>>
>> I've seen, but adding it with  test  works. The logic: the
>> src is compiled first and then re-used (I'm assuming maven does something
>> smart about not including the full jar).
>>
>
> Not quite. I've tried a demo and the reactor complains. I'll try to see if
> maven could become 'smarter', or if the 2-build phase solution will work.
>
> The projects in the reactor contain a cyclic reference: Edge between
> 'Vertex{label='com.mysimpatico:TestFramework:1.0-SNAPSHOT'}' and
> 'Vertex{label='org.apache:DummyCore:1.0-SNAPSHOT'}' introduces to cycle in
> the graph org.apache:DummyCore:1.0-SNAPSHOT -->
> com.mysimpatico:TestFramework:1.0-SNAPSHOT -->
> org.apache:DummyCore:1.0-SNAPSHOT -> [Help 1]
>
>
>
>>
>>
>>
>>
>>> The workaround: Solr Core includes the source of Solr Test Framework as
>>> part of its test source code.  It's not pretty, but it works.
>>>
>>> I'd be happy to entertain other (functional) approaches.
>>>
>>
>> In dp4j.com pom.xml I build in 2 phases to compile with the same
>> annotations in the project itself (but i don't think we need that here)
>>
>>
>>>
>>> Steve
>>>
>>>
>>
>>
>> --
>> Regards,
>> K. Gabriele
>>
>> --- unchanged since 20/9/10 ---
>> P.S. If the subject contains "[LON]" or the addressee acknowledges the
>> receipt within 48 hours then I don't resend the email.
>> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
>> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>>
>> If an email is sent by a sender that is not a trusted contact or the email
>> does not contain a valid code then the email is not received. A valid code
>> starts with a hyphen and ends with "X".
>> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
>> L(-[a-z]+[0-9]X)).
>>
>>
>
>
> --
> Regards,
> K. Gabriele
>
> --- unchanged since 20/9/10 ---
> P.S. If the subject contains "[LON]" or the addressee acknowledges the
> receipt within 48 hours then I don't resend the email.
> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>
> If an email is sent by a sender that is not a trusted contact or the email
> does not contain a valid code then the email is not received. A valid code
> starts with a hyphen and ends with "X".
> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
> L(-[a-z]+[0-9]X)).
>
>


-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains "[LON]" or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
< Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with "X".
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).


Re: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-17 Thread Gabriele Kahlout
On Tue, May 17, 2011 at 3:52 PM, Gabriele Kahlout
wrote:

>
>
> On Tue, May 17, 2011 at 3:44 PM, Steven A Rowe  wrote:
>
>> Hi Gabriele,
>>
>> On 5/17/2011 at 9:34 AM, Gabriele Kahlout wrote:
>> > Solr Core should declare a test dependency on Solr Test Framework.
>>
>> I agree:
>>
>> - Solr Core should have a test-scope dependency on Solr Test Framework.
>> - Solr Test Framework should have a compile-scope dependency on Solr Core.
>>
>> But Maven views this as a circular dependency.
>>
>
> I've seen, but adding it with  test  works. The logic: the
> src is compiled first and then re-used (I'm assuming maven does something
> smart about not including the full jar).
>

Not quite. I've tried a demo and the reactor complains. I'll try to see if
maven could become 'smarter', or if the 2-build phase solution will work.

The projects in the reactor contain a cyclic reference: Edge between
'Vertex{label='com.mysimpatico:TestFramework:1.0-SNAPSHOT'}' and
'Vertex{label='org.apache:DummyCore:1.0-SNAPSHOT'}' introduces to cycle in
the graph org.apache:DummyCore:1.0-SNAPSHOT -->
com.mysimpatico:TestFramework:1.0-SNAPSHOT -->
org.apache:DummyCore:1.0-SNAPSHOT -> [Help 1]



>
>
>
>
>> The workaround: Solr Core includes the source of Solr Test Framework as
>> part of its test source code.  It's not pretty, but it works.
>>
>> I'd be happy to entertain other (functional) approaches.
>>
>
> In dp4j.com pom.xml I build in 2 phases to compile with the same
> annotations in the project itself (but i don't think we need that here)
>
>
>>
>> Steve
>>
>>
>
>
> --
> Regards,
> K. Gabriele
>
> --- unchanged since 20/9/10 ---
> P.S. If the subject contains "[LON]" or the addressee acknowledges the
> receipt within 48 hours then I don't resend the email.
> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧
> time(x) < Now + 48h) ⇒ ¬resend(I, this).
>
> If an email is sent by a sender that is not a trusted contact or the email
> does not contain a valid code then the email is not received. A valid code
> starts with a hyphen and ends with "X".
> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
> L(-[a-z]+[0-9]X)).
>
>


-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains "[LON]" or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
< Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with "X".
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).


Re: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-17 Thread Gabriele Kahlout
On Tue, May 17, 2011 at 3:44 PM, Steven A Rowe  wrote:

> Hi Gabriele,
>
> On 5/17/2011 at 9:34 AM, Gabriele Kahlout wrote:
> > Solr Core should declare a test dependency on Solr Test Framework.
>
> I agree:
>
> - Solr Core should have a test-scope dependency on Solr Test Framework.
> - Solr Test Framework should have a compile-scope dependency on Solr Core.
>
> But Maven views this as a circular dependency.
>

I've seen, but adding it with  test  works. The logic: the
src is compiled first and then re-used (I'm assuming maven does something
smart about not including the full jar).




> The workaround: Solr Core includes the source of Solr Test Framework as
> part of its test source code.  It's not pretty, but it works.
>
> I'd be happy to entertain other (functional) approaches.
>

In dp4j.com pom.xml I build in 2 phases to compile with the same annotations
in the project itself (but i don't think we need that here)


>
> Steve
>
>


-- 
Regards,
K. Gabriele

--- unchanged since 20/9/10 ---
P.S. If the subject contains "[LON]" or the addressee acknowledges the
receipt within 48 hours then I don't resend the email.
subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
< Now + 48h) ⇒ ¬resend(I, this).

If an email is sent by a sender that is not a trusted contact or the email
does not contain a valid code then the email is not received. A valid code
starts with a hyphen and ends with "X".
∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
L(-[a-z]+[0-9]X)).


RE: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-17 Thread Steven A Rowe
Hi Gabriele,

On 5/17/2011 at 9:34 AM, Gabriele Kahlout wrote:
> Solr Core should declare a test dependency on Solr Test Framework.

I agree:

- Solr Core should have a test-scope dependency on Solr Test Framework.
- Solr Test Framework should have a compile-scope dependency on Solr Core.

But Maven views this as a circular dependency.

The workaround: Solr Core includes the source of Solr Test Framework as part of 
its test source code.  It's not pretty, but it works.

I'd be happy to entertain other (functional) approaches.

Steve



Re: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-17 Thread Gabriele Kahlout
On Tue, May 17, 2011 at 3:24 PM, Gabriele Kahlout
wrote:

> thank you. I'd like to stick to the same version (i.e. 3.2-SNAPSHOT). It
> seems things have changed there.
>
> To reproduce (should we file this and add my test as a test to avoid this
> bumping up again?)
>
> $
> svn co -r 1104120
> http://svn.apache.org/repos/asf/lucene/dev/branches/branch_3x/ solr
> cd solr; ant get-maven-poms; mvn -N -Pbootstrap install; mvn -DskipTests
> install
>

err..I think my fault is in -*DskipTests! *Beside, Solr Core should declare
a test dependency on Solr Test Framework. Will report.



> wget http://dp4j.sf.net/debug/embeddedServerTest.zip
> unzip embeddedServerTest.zip
> cd embeddedServerTest; mvn -X test
>
> P.S. I realize the example is not SSCCE (but close, and i laready uplaoded
> it).
>
>  
> 
>   junit
>   junit
>   4.8.2
>   test
>   jar
>
> 
> 
>   org.apache.solr
>   solr-core
>   3.2-SNAPSHOT
>
> 
> 
>   org.apache.solr
>   solr-test-framework
>   3.2-SNAPSHOT
> 
>   
>
> import org.junit.Before;
> import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
> import org.apache.solr.util.AbstractSolrTestCase;
>
>
> public class SolrConfigTest extends AbstractSolrTestCase {
>
> public String getSchemaFile() {
> return "/conf/schema.xml";
> }
>
> public String getSolrConfigFile() {
> return "/conf/solrconfig.xml";
> }
>
> @Before
> @Override
> public void setUp() throws Exception {
> super.setUp();
> new EmbeddedSolrServer(h.getCoreContainer(),
> h.getCore().getName());
>
> }
>
> }
>
>
>
> On Tue, May 17, 2011 at 2:38 PM, Colin Vipurs  > wrote:
>
>>  I use the following:
>>
>> 
>> org.apache.solr
>> solr-core
>> 3.1.0
>> 
>> 
>> org.apache.solr
>> solr-solrj
>>  3.1.0
>> 
>>
>>  Hello,
>>
>> I'm starting to write tests of my Solr integration, and have unfortunately
>> spent a lot of time chasing updated documentation.
>>
>> Follows a test I found
>> herewhich
>> uses anEmbeddedSolrServerto communicate with the server and run some
>> queries.
>>
>> @Test
>> public void testThatNoResultsAreReturned() throws SolrServerException {
>> SolrParams params = new SolrQuery("text that is not found");
>> assertQ(TEST_SEED, null, tests);
>>
>> QueryResponse response = req(params);
>> assertEquals(0L, response.getResults().getNumFound());
>> }
>>
>> The issue is that I cannot add a dependency on Solr-3.2-SNAPSHOT since it's
>> packaged as a war. I've tried to attach the sources and make the dependency
>> of type classes but it still won't work.
>>
>> 
>> org.apache.maven.plugins
>> maven-war-plugin
>> 
>>   web
>>   web/WEB-INF/web.xml
>> *  true*
>> 
>>   
>>
>> How could you use EmbeddedSolrServer outside of Solr Webapp?
>>
>> I've see that org.apache.solr.client.solrj.embedded.TestSolrProperties does
>> that in Solr Core, but not through a dependency on Solr Webapp (and I'm not
>> figuring out where it comes from).
>>
>>
>> --
>> Regards,
>> K. Gabriele
>>
>> --- unchanged since 20/9/10 ---
>> P.S. If the subject contains "[LON]" or the addressee acknowledges the
>> receipt within 48 hours then I don't resend the email.
>> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
>> < Now + 48h) ⇒ ¬resend(I, this).
>>
>> If an email is sent by a sender that is not a trusted contact or the email
>> does not contain a valid code then the email is not received. A valid code
>> starts with a hyphen and ends with "X".
>> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
>> L(-[a-z]+[0-9]X)).
>>
>> __
>> This email has been scanned by the MessageLabs Email Security System.
>> For more information please visit http://www.messagelabs.com/email
>> __
>>
>>
>>   --
>>
>>
>> *Colin Vipurs*
>> *Server Team Lead*
>>
>> *Shazam Entertainment Ltd   *
>> *26-28 Hammersmith Grove, London W6 7HA*
>> m:   +44 (0)  000 000   t: +44 (0) 20 8742 6820
>> w:*www.shazam.com*
>>
>> Please consider the environment before printing this document
>>
>> This e-mail and its contents are strictly private and confidential. It
>> must not be disclosed, distributed or copied without our prior consent. If
>> you have received this transmission in error, please notify Shazam
>> Entertainment immediately on: +44 (0) 020 8742 6820 and then delete it from
>> your system. Please note that the information contained herein shall
>> additionally constitute Confidential Information for the purposes of any NDA
>> between the recipient/s and Shazam Entertainment. Shazam Entertainment
>> Limited is incorporated in England and Wales under comp

Re: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-17 Thread Gabriele Kahlout
thank you. I'd like to stick to the same version (i.e. 3.2-SNAPSHOT). It
seems things have changed there.

To reproduce (should we file this and add my test as a test to avoid this
bumping up again?)

$
svn co -r 1104120
http://svn.apache.org/repos/asf/lucene/dev/branches/branch_3x/ solr
cd solr; ant get-maven-poms; mvn -N -Pbootstrap install; mvn -DskipTests
install
wget http://dp4j.sf.net/debug/embeddedServerTest.zip
unzip embeddedServerTest.zip
cd embeddedServerTest; mvn -X test

P.S. I realize the example is not SSCCE (but close, and i laready uplaoded
it).

 

  junit
  junit
  4.8.2
  test
  jar


  org.apache.solr
  solr-core
  3.2-SNAPSHOT


  org.apache.solr
  solr-test-framework
  3.2-SNAPSHOT

  

import org.junit.Before;
import org.apache.solr.client.solrj.embedded.EmbeddedSolrServer;
import org.apache.solr.util.AbstractSolrTestCase;


public class SolrConfigTest extends AbstractSolrTestCase {

public String getSchemaFile() {
return "/conf/schema.xml";
}

public String getSolrConfigFile() {
return "/conf/solrconfig.xml";
}

@Before
@Override
public void setUp() throws Exception {
super.setUp();
new EmbeddedSolrServer(h.getCoreContainer(), h.getCore().getName());
}

}



On Tue, May 17, 2011 at 2:38 PM, Colin Vipurs
wrote:

>  I use the following:
>
> 
> org.apache.solr
> solr-core
> 3.1.0
> 
> 
> org.apache.solr
> solr-solrj
>  3.1.0
> 
>
>  Hello,
>
> I'm starting to write tests of my Solr integration, and have unfortunately
> spent a lot of time chasing updated documentation.
>
> Follows a test I found
> herewhich
> uses anEmbeddedSolrServerto communicate with the server and run some
> queries.
>
> @Test
> public void testThatNoResultsAreReturned() throws SolrServerException {
> SolrParams params = new SolrQuery("text that is not found");
> assertQ(TEST_SEED, null, tests);
>
> QueryResponse response = req(params);
> assertEquals(0L, response.getResults().getNumFound());
> }
>
> The issue is that I cannot add a dependency on Solr-3.2-SNAPSHOT since it's
> packaged as a war. I've tried to attach the sources and make the dependency
> of type classes but it still won't work.
>
> 
> org.apache.maven.plugins
> maven-war-plugin
> 
>   web
>   web/WEB-INF/web.xml
> *  true*
> 
>   
>
> How could you use EmbeddedSolrServer outside of Solr Webapp?
>
> I've see that org.apache.solr.client.solrj.embedded.TestSolrProperties does
> that in Solr Core, but not through a dependency on Solr Webapp (and I'm not
> figuring out where it comes from).
>
>
> --
> Regards,
> K. Gabriele
>
> --- unchanged since 20/9/10 ---
> P.S. If the subject contains "[LON]" or the addressee acknowledges the
> receipt within 48 hours then I don't resend the email.
> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
> < Now + 48h) ⇒ ¬resend(I, this).
>
> If an email is sent by a sender that is not a trusted contact or the email
> does not contain a valid code then the email is not received. A valid code
> starts with a hyphen and ends with "X".
> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
> L(-[a-z]+[0-9]X)).
>
> __
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> __
>
>
>   --
>
>
> *Colin Vipurs*
> *Server Team Lead*
>
> *Shazam Entertainment Ltd   *
> *26-28 Hammersmith Grove, London W6 7HA*
> m:   +44 (0)  000 000   t: +44 (0) 20 8742 6820
> w:*www.shazam.com*
>
> Please consider the environment before printing this document
>
> This e-mail and its contents are strictly private and confidential. It must
> not be disclosed, distributed or copied without our prior consent. If you
> have received this transmission in error, please notify Shazam Entertainment
> immediately on: +44 (0) 020 8742 6820 and then delete it from your system.
> Please note that the information contained herein shall additionally
> constitute Confidential Information for the purposes of any NDA between the
> recipient/s and Shazam Entertainment. Shazam Entertainment Limited is
> incorporated in England and Wales under company number 3998831 and its
> registered office is at 26-28 Hammersmith Grove, London W6 7HA.
>
>
>
> __
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email
> __
>



-- 
Regards,
K. Gabriele

--

Re: How to test Solr Integartion - how to get EmbeddedSolrServer?

2011-05-17 Thread Colin Vipurs
I use the following:


org.apache.solr
solr-core
3.1.0


org.apache.solr
solr-solrj
 3.1.0



> Hello,
> 
> I'm starting to write tests of my Solr integration, and have unfortunately
> spent a lot of time chasing updated documentation.
> 
> Follows a test I found
> herewhich
> uses anEmbeddedSolrServerto communicate with the server and run some
> queries.
> 
> @Test
> public void testThatNoResultsAreReturned() throws SolrServerException {
> SolrParams params = new SolrQuery("text that is not found");
> assertQ(TEST_SEED, null, tests);
> 
> QueryResponse response = req(params);
> assertEquals(0L, response.getResults().getNumFound());
> }
> 
> The issue is that I cannot add a dependency on Solr-3.2-SNAPSHOT since it's
> packaged as a war. I've tried to attach the sources and make the dependency
> of type classes but it still won't work.
> 
> 
> org.apache.maven.plugins
> maven-war-plugin
> 
>   web
>   web/WEB-INF/web.xml
> *  true*
> 
>   
> 
> How could you use EmbeddedSolrServer outside of Solr Webapp?
> 
> I've see that org.apache.solr.client.solrj.embedded.TestSolrProperties does
> that in Solr Core, but not through a dependency on Solr Webapp (and I'm not
> figuring out where it comes from).
> 
> 
> -- 
> Regards,
> K. Gabriele
> 
> --- unchanged since 20/9/10 ---
> P.S. If the subject contains "[LON]" or the addressee acknowledges the
> receipt within 48 hours then I don't resend the email.
> subject(this) ∈ L(LON*) ∨ ∃x. (x ∈ MyInbox ∧ Acknowledges(x, this) ∧ time(x)
> < Now + 48h) ⇒ ¬resend(I, this).
> 
> If an email is sent by a sender that is not a trusted contact or the email
> does not contain a valid code then the email is not received. A valid code
> starts with a hyphen and ends with "X".
> ∀x. x ∈ MyInbox ⇒ from(x) ∈ MySafeSenderList ∨ (∃y. y ∈ subject(x) ∧ y ∈
> L(-[a-z]+[0-9]X)).
> 
> __
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit http://www.messagelabs.com/email 
> __


-- 


Colin Vipurs
Server Team Lead

Shazam Entertainment Ltd   
26-28 Hammersmith Grove, London W6 7HA
m:   +44 (0)  000 000   t: +44 (0) 20 8742 6820
w:www.shazam.com

Please consider the environment before printing this document

This e-mail and its contents are strictly private and confidential. It
must not be disclosed, distributed or copied without our prior consent.
If you have received this transmission in error, please notify Shazam
Entertainment immediately on: +44 (0) 020 8742 6820 and then delete it
from your system. Please note that the information contained herein
shall additionally constitute Confidential Information for the purposes
of any NDA between the recipient/s and Shazam Entertainment. Shazam
Entertainment Limited is incorporated in England and Wales under company
number 3998831 and its registered office is at 26-28 Hammersmith Grove,
London W6 7HA. 




__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__