Updated Branches: refs/heads/master 8ed0da6f3 -> 0d7ac84d4
BIGTOP-736. When Solr is integrated, we'll need some tests. Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/0d7ac84d Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/0d7ac84d Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/0d7ac84d Branch: refs/heads/master Commit: 0d7ac84d40711f70a06cd828133cc4811e1bbd58 Parents: bdad883 Author: Roman Shaposhnik <r...@apache.org> Authored: Fri Nov 2 15:29:12 2012 -0700 Committer: Roman Shaposhnik <r...@apache.org> Committed: Fri Nov 2 15:29:12 2012 -0700 ---------------------------------------------------------------------- bigtop-tests/test-artifacts/pom.xml | 1 + bigtop-tests/test-artifacts/solr/pom.xml | 46 +++++++ .../bigtop/itest/solr/smoke/SolrTestBase.groovy | 85 +++++++++++++ .../bigtop/itest/solr/smoke/TestIndexing.groovy | 40 ++++++ .../itest/solr/smoke/TestIndexingSolrJ.groovy | 94 ++++++++++++++ .../apache/bigtop/itest/solr/smoke/TestPing.groovy | 28 ++++ .../bigtop/itest/solr/smoke/TestSimple.groovy | 41 ++++++ .../bigtop/itest/solr/smoke/TestStatistics.groovy | 37 ++++++ bigtop-tests/test-execution/smokes/pom.xml | 1 + bigtop-tests/test-execution/smokes/solr/pom.xml | 96 +++++++++++++++ 10 files changed, 469 insertions(+), 0 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-artifacts/pom.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/pom.xml b/bigtop-tests/test-artifacts/pom.xml index 7d201c8..6e4f7b0 100644 --- a/bigtop-tests/test-artifacts/pom.xml +++ b/bigtop-tests/test-artifacts/pom.xml @@ -54,6 +54,7 @@ <hbase.version>0.92.1</hbase.version> <zookeeper.version>3.4.3</zookeeper.version> <giraph.version>0.2-SNAPSHOT</giraph.version> + <solr.version>4.0.0-BETA</solr.version> </properties> <dependencyManagement> http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-artifacts/solr/pom.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/solr/pom.xml b/bigtop-tests/test-artifacts/solr/pom.xml new file mode 100644 index 0000000..affa374 --- /dev/null +++ b/bigtop-tests/test-artifacts/solr/pom.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>bigtop-smokes</artifactId> + <version>0.5.0-incubating-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>solr-smoke</artifactId> + <version>0.5.0-incubating-SNAPSHOT</version> + + <name>solrsmoke</name> + + <dependencies> + <dependency> + <groupId>org.apache.solr</groupId> + <artifactId>solr-solrj</artifactId> + <version>${solr.version}</version> + </dependency> + + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-simple</artifactId> + <version>1.6.6</version> + </dependency> + </dependencies> +</project> http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/SolrTestBase.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/SolrTestBase.groovy b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/SolrTestBase.groovy new file mode 100644 index 0000000..a41883f --- /dev/null +++ b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/SolrTestBase.groovy @@ -0,0 +1,85 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.bigtop.itest.solr.smoke; + +import groovy.json.JsonSlurper +import org.junit.AfterClass +import org.junit.BeforeClass +import org.apache.commons.logging.Log +import org.apache.commons.logging.LogFactory + +public class SolrTestBase { + static private Log LOG = LogFactory.getLog(SolrTestBase.class); + static public final String _updatePathJSON = "/update/json?stream.body=" + static public final String _adminPath = "/admin" + + static public final String _baseURL = System.getProperty("org.apache.bigtop.itest.solr_url", "http://localhost:8983/"); + + @BeforeClass + static void before() { + // report bad citizens who left docs in the index. Shouldn't be possible, right? + // May be too aggressive a test. + // It's under discussion whether this should be on a class or test basis since multiple tests in the same + // may be order dependent. + + // The pattern should be to index everything in the local BeforeClass perhaps? + if (doReq("/select?q=*:*").response.numFound != 0) { + LOG.warn("There's a bad citizen in the tests"); + } + + deleteAllDocs() // guard against bad citizens + } + + @AfterClass + static void after() { + deleteAllDocs() // be a good citizen + } + + private static void deleteAllDocs() { + // Insure that the index is empty + doReq("/update?stream.body=<delete><query>*:*</query></delete>") + doReq("/update?stream.body=<commit/>") + // Best check to insure we're empty! + testEquals(doReq("/select?q=*:*"), "response.numFound", "0") + } + + static Object doReq(String url) { + String fullUrl = _baseURL + url + ((url.indexOf("?") >= 0) ? "&" : "?") + "wt=json" + URLConnection conn = new URL(fullUrl).openConnection() + BufferedReader res = new BufferedReader(new InputStreamReader( + conn.getInputStream())) + String inputLine; + StringBuilder sb = new StringBuilder() + while ((inputLine = res.readLine()) != null) { + sb.append(inputLine) + } + res.close(); + return new JsonSlurper().parseText(sb.toString()) + } + + static void testEquals(Object json, String xpath, String value) { + Object me = json + xpath.split("\\.").each { part -> + if (me) { + me = me[part] + } + } + assert (value.equals(me.toString())) + } + +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexing.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexing.groovy b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexing.groovy new file mode 100644 index 0000000..97f3edb --- /dev/null +++ b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexing.groovy @@ -0,0 +1,40 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.bigtop.itest.solr.smoke + +import org.junit.BeforeClass +import org.junit.Test + +class TestIndexing extends SolrTestBase { + @BeforeClass + static void before() { + // Index a couple of documents + def builder = new groovy.json.JsonBuilder() + builder([["id": "doc1", "name": URLEncoder.encode("first test document")], + ["id": "doc2", "name": URLEncoder.encode("second test document")]]) + doReq(_updatePathJSON + builder.toString() + "&commit=true") + } + + @Test + public void testSearch() { + testEquals(doReq("/select?q=*:*"), "response.numFound", "2") + testEquals(doReq("/select?q=name:first"), "response.numFound", "1") + testEquals(doReq("/select?q=name:document"), "response.numFound", "2") + testEquals(doReq("/select?q=none"), "response.numFound", "0") + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexingSolrJ.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexingSolrJ.groovy b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexingSolrJ.groovy new file mode 100644 index 0000000..b02c072 --- /dev/null +++ b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestIndexingSolrJ.groovy @@ -0,0 +1,94 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p/> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p/> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.bigtop.itest.solr.smoke + +import org.apache.solr.client.solrj.SolrQuery +import org.apache.solr.client.solrj.SolrRequest +import org.apache.solr.client.solrj.SolrServerException +import org.apache.solr.client.solrj.impl.HttpSolrServer +import org.apache.solr.client.solrj.response.QueryResponse +import org.apache.solr.common.SolrDocument +import org.apache.solr.common.SolrDocumentList +import org.apache.solr.common.SolrInputDocument +import org.junit.After +import org.junit.Before +import org.junit.Test + +import java.io.IOException +import java.net.MalformedURLException +import java.util.ArrayList +import java.util.List +import java.util.Map +import org.junit.Assert + +/** + * Trivial indexing test using SolrJ + */ +class TestIndexingSolrJ extends SolrTestBase { + + HttpSolrServer _server + + @Before + public void before2() { + _server = new HttpSolrServer(_baseURL) + } + + @After + public void after2() { + if (_server != null) { + _server.shutdown() + _server = null + } + } + + // Just add a couple of documents then search on them. + @Test + public void testIndexing() throws IOException, SolrServerException { + List<SolrInputDocument> docs = new ArrayList<SolrInputDocument>() + SolrInputDocument doc = new SolrInputDocument() + doc.addField("id", "one") + doc.addField("name", "Another document one") + docs.add(doc) + doc = new SolrInputDocument() + doc.addField("id", "two") + doc.addField("name", "Another document two") + docs.add(doc) + _server.add(docs) + _server.commit() + + doQuery("*:*", "one", "two") + // Now see if we can search them. + + } + + private void doQuery(String queryString, String... docIds) throws MalformedURLException, SolrServerException { + + SolrQuery query = new SolrQuery() + query.setQuery(queryString) + query.setRows(1000) + QueryResponse qr = _server.query(query, SolrRequest.METHOD.POST) + Object o = qr.getHeader().get("status") + Assert.assertEquals(qr.getHeader().get("status"), 0) + + SolrDocumentList sdl = qr.getResults() + Assert.assertEquals(sdl.size(), docIds.length) + for (SolrDocument doc : sdl) { + Assert.assertTrue(docIds.contains(doc.get("id"))) + } + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestPing.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestPing.groovy b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestPing.groovy new file mode 100644 index 0000000..f03f1d9 --- /dev/null +++ b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestPing.groovy @@ -0,0 +1,28 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.bigtop.itest.solr.smoke + +import org.junit.Test +/** + * Utterly trivial test to see if the server is running + */ +class TestPing extends SolrTestBase { + @Test + void testPing() { + testEquals(doReq("/admin/ping"), "status", "OK"); + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestSimple.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestSimple.groovy b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestSimple.groovy new file mode 100644 index 0000000..4448e76 --- /dev/null +++ b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestSimple.groovy @@ -0,0 +1,41 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.bigtop.itest.solr.smoke + +import org.junit.Test + +class TestSimple extends SolrTestBase { + static public final String _updatePathXML = "/update?commit=true&stream.body=" + + @Test + public void testSearch() { + // Index a couple of documents, move to beforeClass? + // NOTE: JSON update handler isn't enabled in this distro, should it be? + //def builder = new groovy.json.JsonBuilder() + //builder([["id": "doc1", "name": URLEncoder.encode("first test document")], + // ["id": "doc2", "name": URLEncoder.encode("second test document")]]) + //doReq(_updatePathJSON + builder.toString()) + StringBuilder sb = new StringBuilder() + sb.append("<add><doc><field name=\"id\">doc1</field><field name=\"name\">first test document"). + append("</field></doc><doc><field name=\"id\">doc2</field><field name=\"name\">second test document"). + append("</field></doc></add>") + doReq(_updatePathXML + URLEncoder.encode(sb.toString())) + testEquals(doReq("/select?q=*:*"), "response.numFound", "2") + testEquals(doReq("/select?q=name:\"first+test+document\""), "response.numFound", "1") + testEquals(doReq("/select?q=none"), "response.numFound", "0") + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestStatistics.groovy ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestStatistics.groovy b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestStatistics.groovy new file mode 100644 index 0000000..dff83dd --- /dev/null +++ b/bigtop-tests/test-artifacts/solr/src/main/groovy/org/apache/bigtop/itest/solr/smoke/TestStatistics.groovy @@ -0,0 +1,37 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.bigtop.itest.solr.smoke + +import org.junit.Test + +/** + * This is actually a pretty useless test as it stands, included as a template for making more "interesting" + * evaluations of the status of the Solr server. + */ +class TestStatistics extends SolrTestBase { + @Test + public void testCache() { + Object res = doReq(_adminPath + "/mbeans?stats=true") + ArrayList<Object> beans = res."solr-mbeans" + for (int idx = 0; idx < beans.size(); idx++) { + if (beans[idx] instanceof String && "CACHE".equals(beans[idx])) { // Next object is the stats data for caches. + Object hits = beans[idx + 1].filterCache.stats.hits + break; + } + } + } +} http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-execution/smokes/pom.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-execution/smokes/pom.xml b/bigtop-tests/test-execution/smokes/pom.xml index d93747e..8fe22f8 100644 --- a/bigtop-tests/test-execution/smokes/pom.xml +++ b/bigtop-tests/test-execution/smokes/pom.xml @@ -53,6 +53,7 @@ <giraph-smoke.version>0.5.0-incubating-SNAPSHOT</giraph-smoke.version> <hue-smoke.version>0.5.0-incubating-SNAPSHOT</hue-smoke.version> <package-smoke.version>0.5.0-incubating-SNAPSHOT</package-smoke.version> + <solr-smoke.version>0.5.0-incubating-SNAPSHOT</solr-smoke.version> <!-- End of BOM definitions --> http://git-wip-us.apache.org/repos/asf/bigtop/blob/0d7ac84d/bigtop-tests/test-execution/smokes/solr/pom.xml ---------------------------------------------------------------------- diff --git a/bigtop-tests/test-execution/smokes/solr/pom.xml b/bigtop-tests/test-execution/smokes/solr/pom.xml new file mode 100644 index 0000000..9afc330 --- /dev/null +++ b/bigtop-tests/test-execution/smokes/solr/pom.xml @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + <parent> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>smoke-tests</artifactId> + <version>0.5.0-incubating-SNAPSHOT</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <modelVersion>4.0.0</modelVersion> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>solr-smoke-test</artifactId> + <version>0.5.0-incubating-SNAPSHOT</version> + <name>Solr smoke test execution</name> + + <properties> + <SOLR_URL>${env.SOLR_URL}</SOLR_URL> + + <org.apache.maven-dependency-plugin.groupId>org.apache.bigtop.itest</org.apache.maven-dependency-plugin.groupId> + <org.apache.maven-dependency-plugin.artifactId>solr-smoke</org.apache.maven-dependency-plugin.artifactId> + <org.apache.maven-dependency-plugin.version>${solr-smoke.version}</org.apache.maven-dependency-plugin.version> + <org.apache.maven-dependency-plugin.type>jar</org.apache.maven-dependency-plugin.type> + </properties> + + <dependencies> + <dependency> + <groupId>org.apache.bigtop.itest</groupId> + <artifactId>solr-smoke</artifactId> + <version>${solr-smoke.version}</version> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-dependency-plugin</artifactId> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-failsafe-plugin</artifactId> + <version>2.11</version> + <configuration> + <systemPropertyVariables> + <org.apache.bigtop.itest.solr_url>${SOLR_URL}</org.apache.bigtop.itest.solr_url> + </systemPropertyVariables> + <forkMode>always</forkMode> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <id>enforce-property-solr</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireProperty> + <property>SOLR_URL</property> + <message>SOLR_URL env. variable has to be set</message> + </requireProperty> + </rules> + <fail>true</fail> + </configuration> + </execution> + </executions> + </plugin> + + </plugins> + </build> +</project>