On Tue, May 17, 2011 at 3:24 PM, Gabriele Kahlout <gabri...@mysimpatico.com>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). > > <dependencies> > <dependency> > <groupId>junit</groupId> > <artifactId>junit</artifactId> > <version>4.8.2</version> > <scope>test</scope> > <type>jar</type> > > </dependency> > <dependency> > <groupId>org.apache.solr</groupId> > <artifactId>solr-core</artifactId> > <version>3.2-SNAPSHOT</version> > > </dependency> > <dependency> > <groupId>org.apache.solr</groupId> > <artifactId>solr-test-framework</artifactId> > <version>3.2-SNAPSHOT</version> > </dependency> > </dependencies> > > 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 <colin.vip...@shazamteam.com > > wrote: > >> I use the following: >> >> <dependency> >> <groupId>org.apache.solr</groupId> >> <artifactId>solr-core</artifactId> >> <version>3.1.0</version> >> </dependency> >> <dependency> >> <groupId>org.apache.solr</groupId> >> <artifactId>solr-solrj</artifactId> >> <version>3.1.0</version> >> </dependency> >> >> 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 >> here<http://blog.synyx.de/2011/01/integration-tests-for-your-solr-config/>which >> 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. >> >> <plugin> >> <groupId>org.apache.maven.plugins</groupId> >> <artifactId>maven-war-plugin</artifactId> >> <configuration> >> <warSourceDirectory>web</warSourceDirectory> >> <webXml>web/WEB-INF/web.xml</webXml> >> * <attachClasses>true</attachClasses>* >> </configuration> >> </plugin> >> >> 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) 0000 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 > > --- 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)).