You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2013/07/04 01:26:45 UTC
svn commit: r1499601 [19/20] - in /lucene/dev/branches/security: ./
dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/libraries/
dev-tools/idea/solr/core/src/test/ dev-tools/maven/ dev-tools/maven/lucene/
dev-tools/maven/lucene/analysis/stempel/ dev-t...
Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/impl/CloudSolrServerTest.java Wed Jul 3 23:26:32 2013
@@ -102,35 +102,39 @@ public class CloudSolrServerTest extends
indexr(id, 0, "a_t", "to come to the aid of their country.");
- // compare leaders list
CloudJettyRunner shard1Leader = shardToLeaderJetty.get("shard1");
CloudJettyRunner shard2Leader = shardToLeaderJetty.get("shard2");
- assertEquals(2, cloudClient.getLeaderUrlLists().get("collection1").size());
- HashSet<String> leaderUrlSet = new HashSet<String>();
- leaderUrlSet.addAll(cloudClient.getLeaderUrlLists().get("collection1"));
- assertTrue("fail check for leader:" + shard1Leader.url + " in "
- + leaderUrlSet, leaderUrlSet.contains(shard1Leader.url + "/"));
- assertTrue("fail check for leader:" + shard2Leader.url + " in "
- + leaderUrlSet, leaderUrlSet.contains(shard2Leader.url + "/"));
-
- // compare replicas list
- Set<String> replicas = new HashSet<String>();
- List<CloudJettyRunner> jetties = shardToJetty.get("shard1");
- for (CloudJettyRunner cjetty : jetties) {
- replicas.add(cjetty.url);
- }
- jetties = shardToJetty.get("shard2");
- for (CloudJettyRunner cjetty : jetties) {
- replicas.add(cjetty.url);
- }
- replicas.remove(shard1Leader.url);
- replicas.remove(shard2Leader.url);
-
- assertEquals(replicas.size(), cloudClient.getReplicasLists().get("collection1").size());
- for (String url : cloudClient.getReplicasLists().get("collection1")) {
- assertTrue("fail check for replica:" + url + " in " + replicas,
- replicas.contains(stripTrailingSlash(url)));
+ if (cloudClient.isUpdatesToLeaders()) {
+ // compare leaders list
+ assertEquals(2, cloudClient.getLeaderUrlLists().get("collection1").size());
+ HashSet<String> leaderUrlSet = new HashSet<String>();
+ leaderUrlSet.addAll(cloudClient.getLeaderUrlLists().get("collection1"));
+ assertTrue("fail check for leader:" + shard1Leader.url + " in "
+ + leaderUrlSet, leaderUrlSet.contains(shard1Leader.url + "/"));
+ assertTrue("fail check for leader:" + shard2Leader.url + " in "
+ + leaderUrlSet, leaderUrlSet.contains(shard2Leader.url + "/"));
+
+ // compare replicas list
+ Set<String> replicas = new HashSet<String>();
+ List<CloudJettyRunner> jetties = shardToJetty.get("shard1");
+ for (CloudJettyRunner cjetty : jetties) {
+ replicas.add(cjetty.url);
+ }
+ jetties = shardToJetty.get("shard2");
+ for (CloudJettyRunner cjetty : jetties) {
+ replicas.add(cjetty.url);
+ }
+ replicas.remove(shard1Leader.url);
+ replicas.remove(shard2Leader.url);
+
+ assertEquals(replicas.size(),
+ cloudClient.getReplicasLists().get("collection1").size());
+
+ for (String url : cloudClient.getReplicasLists().get("collection1")) {
+ assertTrue("fail check for replica:" + url + " in " + replicas,
+ replicas.contains(stripTrailingSlash(url)));
+ }
}
}
Modified: lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java (original)
+++ lucene/dev/branches/security/solr/solrj/src/test/org/apache/solr/client/solrj/request/TestCoreAdmin.java Wed Jul 3 23:26:32 2013
@@ -17,8 +17,8 @@
package org.apache.solr.client.solrj.request;
-import java.io.File;
-
+import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
+import org.apache.commons.io.FileUtils;
import org.apache.solr.SolrIgnoredThreadsFilter;
import org.apache.solr.client.solrj.SolrServer;
import org.apache.solr.client.solrj.embedded.AbstractEmbeddedSolrServerTestCase;
@@ -27,14 +27,13 @@ import org.apache.solr.common.SolrExcept
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.util.NamedList;
import org.apache.solr.core.SolrCore;
-import org.apache.commons.io.FileUtils;
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
+import java.io.File;
@ThreadLeakFilters(defaultFilters = true, filters = {SolrIgnoredThreadsFilter.class})
public class TestCoreAdmin extends AbstractEmbeddedSolrServerTestCase {
@@ -67,6 +66,8 @@ public class TestCoreAdmin extends Abstr
File tmp = new File(TEMP_DIR, "solrtest-" + getTestClass().getSimpleName() + "-" + System.currentTimeMillis());
tmp.mkdirs();
+
+ log.info("Creating cores underneath {}", tmp);
File dataDir = new File(tmp, this.getTestName()
+ System.currentTimeMillis() + "-" + "data");
@@ -103,7 +104,7 @@ public class TestCoreAdmin extends Abstr
File logDir;
try {
- logDir = core.getUpdateHandler().getUpdateLog().getLogDir();
+ logDir = new File(core.getUpdateHandler().getUpdateLog().getLogDir());
} finally {
coreProveIt.close();
core.close();
Modified: lucene/dev/branches/security/solr/test-framework/ivy.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/ivy.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/ivy.xml (original)
+++ lucene/dev/branches/security/solr/test-framework/ivy.xml Wed Jul 3 23:26:32 2013
@@ -16,7 +16,10 @@
specific language governing permissions and limitations
under the License.
-->
-<ivy-module version="2.0">
+<!DOCTYPE ivy-module [
+ <!ENTITY hadoop.version "2.0.5-alpha">
+]>
+<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="org.apache.solr" module="solr-test-framework"/>
<configurations>
@@ -31,10 +34,24 @@
<dependencies defaultconf="default">
<dependency org="org.apache.ant" name="ant" rev="1.8.2" transitive="false" />
- <dependency org="junit" name="junit" rev="4.10" transitive="false" conf="default->*;junit4-stdalone->*" />
+ <dependency org="junit" name="junit" rev="4.10" transitive="false" conf="default->*;junit4-stdalone->*">
+ <exclude org="org.hamcrest" module="hamcrest-core"/>
+ </dependency>
<dependency org="com.carrotsearch.randomizedtesting" name="junit4-ant" rev="2.0.10" transitive="false" conf="default->*;junit4-stdalone->*" />
<dependency org="com.carrotsearch.randomizedtesting" name="randomizedtesting-runner" rev="2.0.10" transitive="false" conf="default->*;junit4-stdalone->*" />
+ <!-- Hadoop DfsMiniCluster Dependencies-->
+ <dependency org="org.apache.hadoop" name="hadoop-common" transitive="false" rev="&hadoop.version;" conf="default->*;junit4-stdalone->*">
+ <artifact name="hadoop-common" type="tests" ext="jar" m:classifier="tests" />
+ </dependency>
+ <dependency org="org.apache.hadoop" name="hadoop-hdfs" transitive="false" rev="&hadoop.version;" conf="default->*;junit4-stdalone->*">
+ <artifact name="hadoop-hdfs" type="tests" ext="jar" m:classifier="tests" />
+ </dependency>
+ <dependency org="org.mortbay.jetty" name="jetty" rev="6.1.26" transitive="false"/>
+ <dependency org="org.mortbay.jetty" name="jetty-util" rev="6.1.26" transitive="false"/>
+ <dependency org="com.sun.jersey" name="jersey-core" rev="1.16" transitive="false"/>
+ <dependency org="commons-collections" name="commons-collections" rev="3.2.1" transitive="false"/>
+
<exclude org="*" ext="*" matcher="regexp" type="${ivy.exclude.types}"/>
</dependencies>
</ivy-module>
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/BaseDistributedSearchTestCase.java Wed Jul 3 23:26:32 2013
@@ -45,6 +45,7 @@ import org.apache.solr.client.solrj.impl
import org.apache.solr.client.solrj.request.UpdateRequest;
import org.apache.solr.client.solrj.response.QueryResponse;
import org.apache.solr.client.solrj.response.UpdateResponse;
+import org.apache.solr.client.solrj.SolrResponse;
import org.apache.solr.common.SolrDocument;
import org.apache.solr.common.SolrDocumentList;
import org.apache.solr.common.SolrInputDocument;
@@ -424,6 +425,9 @@ public abstract class BaseDistributedSea
indexDoc(doc);
}
+ /**
+ * Indexes the document in both the control client, and a randomly selected client
+ */
protected void indexDoc(SolrInputDocument doc) throws IOException, SolrServerException {
controlClient.add(doc);
@@ -432,6 +436,17 @@ public abstract class BaseDistributedSea
client.add(doc);
}
+ /**
+ * Indexes the document in both the control client and the specified client asserting
+ * that the respones are equivilent
+ */
+ protected UpdateResponse indexDoc(SolrServer server, SolrParams params, SolrInputDocument... sdocs) throws IOException, SolrServerException {
+ UpdateResponse controlRsp = add(controlClient, params, sdocs);
+ UpdateResponse specificRsp = add(server, params, sdocs);
+ compareSolrResponses(specificRsp, controlRsp);
+ return specificRsp;
+ }
+
protected UpdateResponse add(SolrServer server, SolrParams params, SolrInputDocument... sdocs) throws IOException, SolrServerException {
UpdateRequest ureq = new UpdateRequest();
ureq.setParams(new ModifiableSolrParams(params));
@@ -546,6 +561,9 @@ public abstract class BaseDistributedSea
}
public QueryResponse queryAndCompare(SolrParams params, SolrServer... servers) throws SolrServerException {
+ return queryAndCompare(params, Arrays.<SolrServer>asList(servers));
+ }
+ public QueryResponse queryAndCompare(SolrParams params, Iterable<SolrServer> servers) throws SolrServerException {
QueryResponse first = null;
for (SolrServer server : servers) {
QueryResponse rsp = server.query(new ModifiableSolrParams(params));
@@ -783,8 +801,14 @@ public abstract class BaseDistributedSea
return null;
}
+ protected void compareSolrResponses(SolrResponse a, SolrResponse b) {
+ String cmp = compare(a.getResponse(), b.getResponse(), flags, handle);
+ if (cmp != null) {
+ log.error("Mismatched responses:\n" + a + "\n" + b);
+ Assert.fail(cmp);
+ }
+ }
protected void compareResponses(QueryResponse a, QueryResponse b) {
- String cmp;
if (System.getProperty("remove.version.field") != null) {
// we don't care if one has a version and the other doesnt -
// control vs distrib
@@ -800,11 +824,7 @@ public abstract class BaseDistributedSea
}
}
}
- cmp = compare(a.getResponse(), b.getResponse(), flags, handle);
- if (cmp != null) {
- log.error("Mismatched responses:\n" + a + "\n" + b);
- Assert.fail(cmp);
- }
+ compareSolrResponses(a, b);
}
@Test
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/SolrJettyTestBase.java Wed Jul 3 23:26:32 2013
@@ -44,18 +44,32 @@ abstract public class SolrJettyTestBase
public String getSolrHome() { return ExternalPaths.EXAMPLE_HOME; }
private static boolean manageSslProps = true;
- private static final File TEST_KEYSTORE = new File(ExternalPaths.SOURCE_HOME,
- "example/etc/solrtest.keystore");
+ private static File TEST_KEYSTORE;
private static final Map<String,String> SSL_PROPS = new HashMap<String,String>();
static {
+ TEST_KEYSTORE = (null == ExternalPaths.SOURCE_HOME)
+ ? null : new File(ExternalPaths.SOURCE_HOME, "example/etc/solrtest.keystore");
+ String keystorePath = null == TEST_KEYSTORE ? null : TEST_KEYSTORE.getAbsolutePath();
+
SSL_PROPS.put("tests.jettySsl","false");
SSL_PROPS.put("tests.jettySsl.clientAuth","false");
- SSL_PROPS.put("javax.net.ssl.keyStore", TEST_KEYSTORE.getAbsolutePath());
+ SSL_PROPS.put("javax.net.ssl.keyStore", keystorePath);
SSL_PROPS.put("javax.net.ssl.keyStorePassword","secret");
- SSL_PROPS.put("javax.net.ssl.trustStore", TEST_KEYSTORE.getAbsolutePath());
+ SSL_PROPS.put("javax.net.ssl.trustStore", keystorePath);
SSL_PROPS.put("javax.net.ssl.trustStorePassword","secret");
}
+ /**
+ * Returns the File object for the example keystore used when this baseclass randomly
+ * uses SSL. May be null ifthis test does not appear to be running as part of the
+ * standard solr distribution and does not have access to the example configs.
+ *
+ * @lucene.internal
+ */
+ protected static File getExampleKeystoreFile() {
+ return TEST_KEYSTORE;
+ }
+
@BeforeClass
public static void beforeSolrJettyTestBase() throws Exception {
@@ -63,20 +77,27 @@ abstract public class SolrJettyTestBase
final boolean trySsl = random().nextBoolean();
final boolean trySslClientAuth = random().nextBoolean();
+ // only randomize SSL if we are a solr test with access to the example keystore
+ if (null == getExampleKeystoreFile()) {
+ log.info("Solr's example keystore not defined (not a solr test?) skipping SSL randomization");
+ manageSslProps = false;
+ return;
+ }
+
+ assertTrue("test keystore does not exist, randomized ssl testing broken: " +
+ getExampleKeystoreFile().getAbsolutePath(),
+ getExampleKeystoreFile().exists() );
+
// only randomize SSL if none of the SSL_PROPS are already set
final Map<Object,Object> sysprops = System.getProperties();
for (String prop : SSL_PROPS.keySet()) {
if (sysprops.containsKey(prop)) {
log.info("System property explicitly set, so skipping randomized ssl properties: " + prop);
manageSslProps = false;
- break;
+ return;
}
}
- assertTrue("test keystore does not exist, can't be used for randomized " +
- "ssl testing: " + TEST_KEYSTORE.getAbsolutePath(),
- TEST_KEYSTORE.exists() );
-
if (manageSslProps) {
log.info("Randomized ssl ({}) and clientAuth ({})", trySsl, trySslClientAuth);
for (String prop : SSL_PROPS.keySet()) {
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Wed Jul 3 23:26:32 2013
@@ -17,26 +17,28 @@
package org.apache.solr;
-import java.io.*;
-import java.util.*;
-import java.util.logging.*;
-
-import javax.xml.xpath.XPathExpressionException;
-
+import com.carrotsearch.randomizedtesting.RandomizedContext;
+import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
+import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
import org.apache.commons.io.FileUtils;
-import org.apache.lucene.util.Constants;
import org.apache.lucene.util.LuceneTestCase;
import org.apache.lucene.util.QuickPatchThreadsFilter;
import org.apache.solr.client.solrj.util.ClientUtils;
-import org.apache.solr.common.*;
+import org.apache.solr.common.SolrException;
+import org.apache.solr.common.SolrInputDocument;
+import org.apache.solr.common.SolrInputField;
import org.apache.solr.common.cloud.SolrZkClient;
-import org.apache.solr.common.params.*;
+import org.apache.solr.common.params.CommonParams;
+import org.apache.solr.common.params.ModifiableSolrParams;
+import org.apache.solr.common.params.SolrParams;
import org.apache.solr.common.util.XML;
import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
import org.apache.solr.handler.JsonUpdateRequestHandler;
-import org.apache.solr.request.*;
+import org.apache.solr.request.LocalSolrQueryRequest;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.request.SolrRequestHandler;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.SchemaField;
import org.apache.solr.search.SolrIndexSearcher;
@@ -44,7 +46,10 @@ import org.apache.solr.servlet.DirectSol
import org.apache.solr.util.AbstractSolrTestCase;
import org.apache.solr.util.RevertDefaultThreadHandlerRule;
import org.apache.solr.util.TestHarness;
-import org.junit.*;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import org.junit.Rule;
import org.junit.rules.RuleChain;
import org.junit.rules.TestRule;
import org.noggit.CharArr;
@@ -54,9 +59,22 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xml.sax.SAXException;
-import com.carrotsearch.randomizedtesting.RandomizedContext;
-import com.carrotsearch.randomizedtesting.annotations.ThreadLeakFilters;
-import com.carrotsearch.randomizedtesting.rules.SystemPropertiesRestoreRule;
+import javax.xml.xpath.XPathExpressionException;
+import java.io.File;
+import java.io.IOException;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+
+import static com.google.common.base.Preconditions.checkNotNull;
/**
* A junit4 Solr test harness that extends LuceneTestCaseJ4. To change which core is used when loading the schema and solrconfig.xml, simply
@@ -86,6 +104,9 @@ public abstract class SolrTestCaseJ4 ext
@SuppressWarnings("unused")
private static void beforeClass() {
System.setProperty("jetty.testMode", "true");
+
+ System.setProperty("useCompoundFile", Boolean.toString(random().nextBoolean()));
+ System.setProperty("enable.update.log", usually() ? "true" : "false");
System.setProperty("tests.shardhandler.randomSeed", Long.toString(random().nextLong()));
setupLogging();
startTrackingSearchers();
@@ -104,6 +125,8 @@ public abstract class SolrTestCaseJ4 ext
coreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
System.clearProperty("jetty.testMode");
System.clearProperty("tests.shardhandler.randomSeed");
+ System.clearProperty("enable.update.log");
+ System.clearProperty("useCompoundFile");
}
private static boolean changedFactory = false;
@@ -340,6 +363,9 @@ public abstract class SolrTestCaseJ4 ext
* The directory used to story the index managed by the TestHarness h
*/
protected static File dataDir;
+
+ // hack due to File dataDir
+ protected static String hdfsDataDir;
/**
* Initializes things your test might need
@@ -390,14 +416,47 @@ public abstract class SolrTestCaseJ4 ext
public static void createCore() {
assertNotNull(testSolrHome);
solrConfig = TestHarness.createConfig(testSolrHome, coreName, getSolrConfigFile());
- h = new TestHarness( coreName,
- dataDir.getAbsolutePath(),
+ h = new TestHarness( coreName, hdfsDataDir == null ? dataDir.getAbsolutePath() : hdfsDataDir,
solrConfig,
getSchemaFile());
lrf = h.getRequestFactory
("standard",0,20,CommonParams.VERSION,"2.2");
}
+ public static CoreContainer createCoreContainer(String solrHome, String solrXML) {
+ testSolrHome = checkNotNull(solrHome);
+ if (dataDir == null)
+ createTempDir();
+ h = new TestHarness(solrHome, solrXML);
+ lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
+ return h.getCoreContainer();
+ }
+
+ public static CoreContainer createDefaultCoreContainer(String solrHome) {
+ testSolrHome = checkNotNull(solrHome);
+ if (dataDir == null)
+ createTempDir();
+ h = new TestHarness("collection1", dataDir.getAbsolutePath(), "solrconfig.xml", "schema.xml");
+ lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
+ return h.getCoreContainer();
+ }
+
+ public static boolean hasInitException(String message) {
+ for (Map.Entry<String, Exception> entry : h.getCoreContainer().getCoreInitFailures().entrySet()) {
+ if (entry.getValue().getMessage().indexOf(message) != -1)
+ return true;
+ }
+ return false;
+ }
+
+ public static boolean hasInitException(Class<? extends Exception> exceptionType) {
+ for (Map.Entry<String, Exception> entry : h.getCoreContainer().getCoreInitFailures().entrySet()) {
+ if (exceptionType.isAssignableFrom(entry.getValue().getClass()))
+ return true;
+ }
+ return false;
+ }
+
/** Subclasses that override setUp can optionally call this method
* to log the fact that their setUp process has ended.
*/
@@ -1444,12 +1503,12 @@ public abstract class SolrTestCaseJ4 ext
return result;
}
- public void assertXmlFile(final File file, String... xpath)
+ public static void assertXmlFile(final File file, String... xpath)
throws IOException, SAXException {
try {
String xml = FileUtils.readFileToString(file, "UTF-8");
- String results = h.validateXPath(xml, xpath);
+ String results = TestHarness.validateXPath(xml, xpath);
if (null != results) {
String msg = "File XPath failure: file=" + file.getPath() + " xpath="
+ results + "\n\nxml was: " + xml;
@@ -1465,8 +1524,9 @@ public abstract class SolrTestCaseJ4 ext
File subHome = new File(dstRoot, "conf");
assertTrue("Failed to make subdirectory ", dstRoot.mkdirs());
String top = SolrTestCaseJ4.TEST_HOME() + "/collection1/conf";
- FileUtils.copyFile(new File(top, "schema-tiny.xml"), new File(subHome, "schema-tiny.xml"));
- FileUtils.copyFile(new File(top, "solrconfig-minimal.xml"), new File(subHome, "solrconfig-minimal.xml"));
+ FileUtils.copyFile(new File(top, "schema-tiny.xml"), new File(subHome, "schema.xml"));
+ FileUtils.copyFile(new File(top, "solrconfig-minimal.xml"), new File(subHome, "solrconfig.xml"));
+ FileUtils.copyFile(new File(top, "solrconfig.snippet.randomindexconfig.xml"), new File(subHome, "solrconfig.snippet.randomindexconfig.xml"));
}
}
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java Wed Jul 3 23:26:32 2013
@@ -128,7 +128,7 @@ public abstract class AbstractDistribZkT
protected void waitForRecoveriesToFinish(String collection, ZkStateReader zkStateReader, boolean verbose, boolean failOnTimeout)
throws Exception {
- waitForRecoveriesToFinish(collection, zkStateReader, verbose, failOnTimeout, 230);
+ waitForRecoveriesToFinish(collection, zkStateReader, verbose, failOnTimeout, 330);
}
protected void waitForRecoveriesToFinish(String collection,
@@ -151,8 +151,7 @@ public abstract class AbstractDistribZkT
if (verbose) System.out.println("rstate:"
+ shard.getValue().getStr(ZkStateReader.STATE_PROP)
+ " live:"
- + clusterState.liveNodesContain(shard.getValue().getStr(
- ZkStateReader.NODE_NAME_PROP)));
+ + clusterState.liveNodesContain(shard.getValue().getNodeName()));
String state = shard.getValue().getStr(ZkStateReader.STATE_PROP);
if ((state.equals(ZkStateReader.RECOVERING) || state
.equals(ZkStateReader.SYNC) || state.equals(ZkStateReader.DOWN))
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java Wed Jul 3 23:26:32 2013
@@ -197,6 +197,7 @@ public abstract class AbstractFullDistri
@AfterClass
public static void afterClass() {
System.clearProperty("solrcloud.update.delay");
+ System.clearProperty("genericCoreNodeNames");
}
public AbstractFullDistribZkTestBase() {
@@ -211,6 +212,10 @@ public abstract class AbstractFullDistri
useExplicitNodeNames = random().nextBoolean();
}
+ protected String getDataDir(String dataDir) throws IOException {
+ return dataDir;
+ }
+
protected void initCloud() throws Exception {
assert(cloudInit == false);
cloudInit = true;
@@ -230,7 +235,7 @@ public abstract class AbstractFullDistri
protected CloudSolrServer createCloudClient(String defaultCollection)
throws MalformedURLException {
- CloudSolrServer server = new CloudSolrServer(zkServer.getZkAddress());
+ CloudSolrServer server = new CloudSolrServer(zkServer.getZkAddress(), random().nextBoolean());
if (defaultCollection != null) server.setDefaultCollection(defaultCollection);
server.getLbServer().getHttpClient().getParams()
.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 5000);
@@ -328,8 +333,8 @@ public abstract class AbstractFullDistri
getClass().getName() + "-jetty" + cnt + "-" + System.currentTimeMillis());
jettyDir.mkdirs();
setupJettySolrHome(jettyDir);
- JettySolrRunner j = createJetty(jettyDir, testDir + "/jetty"
- + cnt, null, "solrconfig.xml", null);
+ JettySolrRunner j = createJetty(jettyDir, getDataDir(testDir + "/jetty"
+ + cnt), null, "solrconfig.xml", null);
jettys.add(j);
SolrServer client = createNewSolrServer(j.getLocalPort());
clients.add(client);
@@ -428,6 +433,28 @@ public abstract class AbstractFullDistri
return cnt;
}
+ public JettySolrRunner createJetty(String dataDir, String ulogDir, String shardList,
+ String solrConfigOverride) throws Exception {
+
+ JettySolrRunner jetty = new JettySolrRunner(getSolrHome(), context, 0,
+ solrConfigOverride, null, false, getExtraServlets());
+ jetty.setShards(shardList);
+ jetty.setDataDir(getDataDir(dataDir));
+ jetty.start();
+
+ return jetty;
+ }
+
+ public JettySolrRunner createJetty(File solrHome, String dataDir, String shardList, String solrConfigOverride, String schemaOverride) throws Exception {
+
+ JettySolrRunner jetty = new JettySolrRunner(solrHome.getAbsolutePath(), context, 0, solrConfigOverride, schemaOverride, false, getExtraServlets());
+ jetty.setShards(shardList);
+ jetty.setDataDir(getDataDir(dataDir));
+ jetty.start();
+
+ return jetty;
+ }
+
protected void updateMappingsFromZk(List<JettySolrRunner> jettys,
List<SolrServer> clients) throws Exception {
ZkStateReader zkStateReader = cloudClient.getZkStateReader();
@@ -483,7 +510,7 @@ public abstract class AbstractFullDistri
cjr.jetty = jetty;
cjr.info = replica;
cjr.nodeName = replica.getStr(ZkStateReader.NODE_NAME_PROP);
- cjr.coreNodeName = replica.getName();
+ cjr.coreNodeName = replica.getNodeName();
cjr.url = replica.getStr(ZkStateReader.BASE_URL_PROP) + "/" + replica.getStr(ZkStateReader.CORE_NAME_PROP);
cjr.client = findClientByPort(port, theClients);
list.add(cjr);
@@ -803,13 +830,68 @@ public abstract class AbstractFullDistri
}
}
+ /**
+ * Executes a query against each live and active replica of the specified shard
+ * and aserts that the results are identical.
+ *
+ * @see #queryAndCompare
+ */
+ public QueryResponse queryAndCompareReplicas(SolrParams params, String shard)
+ throws Exception {
+
+ ArrayList<SolrServer> shardClients = new ArrayList<SolrServer>(7);
+
+ updateMappingsFromZk(jettys, clients);
+ ZkStateReader zkStateReader = cloudClient.getZkStateReader();
+ List<CloudJettyRunner> solrJetties = shardToJetty.get(shard);
+ assertNotNull("no jetties found for shard: " + shard, solrJetties);
+
+
+ for (CloudJettyRunner cjetty : solrJetties) {
+ ZkNodeProps props = cjetty.info;
+ String nodeName = props.getStr(ZkStateReader.NODE_NAME_PROP);
+ boolean active = props.getStr(ZkStateReader.STATE_PROP).equals(ZkStateReader.ACTIVE);
+ boolean live = zkStateReader.getClusterState().liveNodesContain(nodeName);
+ if (active && live) {
+ shardClients.add(cjetty.client.solrClient);
+ }
+ }
+ return queryAndCompare(params, shardClients);
+ }
+
+ /**
+ * For each Shard, executes a query against each live and active replica of that shard
+ * and asserts that the results are identical for each replica of the same shard.
+ * Because results are not compared between replicas of different shards, this method
+ * should be safe for comparing the results of any query, even if it contains
+ * "distrib=false", because the replicas should all be identical.
+ *
+ * @see AbstractFullDistribZkTestBase#queryAndCompareReplicas(SolrParams, String)
+ */
+ public void queryAndCompareShards(SolrParams params) throws Exception {
+
+ updateMappingsFromZk(jettys, clients);
+ List<String> shards = new ArrayList<String>(shardToJetty.keySet());
+ for (String shard : shards) {
+ queryAndCompareReplicas(params, shard);
+ }
+ }
+
+ /**
+ * Returns a non-null string if replicas within the same shard do not have a
+ * consistent number of documents.
+ */
protected void checkShardConsistency(String shard) throws Exception {
checkShardConsistency(shard, false, false);
}
- /* Returns a non-null string if replicas within the same shard are not consistent.
- * If expectFailure==false, the exact differences found will be logged since this would be an unexpected failure.
- * verbose causes extra debugging into to be displayed, even if everything is consistent.
+ /**
+ * Returns a non-null string if replicas within the same shard do not have a
+ * consistent number of documents.
+ * If expectFailure==false, the exact differences found will be logged since
+ * this would be an unexpected failure.
+ * verbose causes extra debugging into to be displayed, even if everything is
+ * consistent.
*/
protected String checkShardConsistency(String shard, boolean expectFailure, boolean verbose)
throws Exception {
@@ -889,6 +971,46 @@ public abstract class AbstractFullDistri
}
+ public void showCounts() {
+ Set<String> theShards = shardToJetty.keySet();
+
+ for (String shard : theShards) {
+ List<CloudJettyRunner> solrJetties = shardToJetty.get(shard);
+
+ for (CloudJettyRunner cjetty : solrJetties) {
+ ZkNodeProps props = cjetty.info;
+ System.err.println("PROPS:" + props);
+
+ try {
+ SolrParams query = params("q", "*:*", "rows", "0", "distrib",
+ "false", "tests", "checkShardConsistency"); // "tests" is just a
+ // tag that won't do
+ // anything except be
+ // echoed in logs
+ long num = cjetty.client.solrClient.query(query).getResults()
+ .getNumFound();
+ System.err.println("DOCS:" + num);
+ } catch (SolrServerException e) {
+ System.err.println("error contacting client: " + e.getMessage()
+ + "\n");
+ continue;
+ } catch (SolrException e) {
+ System.err.println("error contacting client: " + e.getMessage()
+ + "\n");
+ continue;
+ }
+ boolean live = false;
+ String nodeName = props.getStr(ZkStateReader.NODE_NAME_PROP);
+ ZkStateReader zkStateReader = cloudClient.getZkStateReader();
+ if (zkStateReader.getClusterState().liveNodesContain(nodeName)) {
+ live = true;
+ }
+ System.err.println(" live:" + live);
+
+ }
+ }
+ }
+
private String toStr(SolrDocumentList lst, int maxSz) {
if (lst.size() <= maxSz) return lst.toString();
@@ -1464,7 +1586,7 @@ public abstract class AbstractFullDistri
for (String sliceName : slices.keySet()) {
for (Replica replica : slices.get(sliceName).getReplicas()) {
if (nodesAllowedToRunShards != null && !nodesAllowedToRunShards.contains(replica.getStr(ZkStateReader.NODE_NAME_PROP))) {
- return "Shard " + replica.getName() + " created on node " + replica.getStr(ZkStateReader.NODE_NAME_PROP) + " not allowed to run shards for the created collection " + collectionName;
+ return "Shard " + replica.getName() + " created on node " + replica.getNodeName() + " not allowed to run shards for the created collection " + collectionName;
}
}
totalShards += slices.get(sliceName).getReplicas().size();
@@ -1505,7 +1627,7 @@ public abstract class AbstractFullDistri
if (commondCloudSolrServer == null) {
synchronized(this) {
try {
- commondCloudSolrServer = new CloudSolrServer(zkServer.getZkAddress());
+ commondCloudSolrServer = new CloudSolrServer(zkServer.getZkAddress(), random().nextBoolean());
commondCloudSolrServer.setDefaultCollection(DEFAULT_COLLECTION);
commondCloudSolrServer.connect();
} catch (MalformedURLException e) {
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/BaseTestHarness.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/BaseTestHarness.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/BaseTestHarness.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/BaseTestHarness.java Wed Jul 3 23:26:32 2013
@@ -33,10 +33,10 @@ import java.io.StringWriter;
import java.io.UnsupportedEncodingException;
abstract public class BaseTestHarness {
- private final ThreadLocal<DocumentBuilder> builderTL = new ThreadLocal<DocumentBuilder>();
- private final ThreadLocal<XPath> xpathTL = new ThreadLocal<XPath>();
+ private static final ThreadLocal<DocumentBuilder> builderTL = new ThreadLocal<DocumentBuilder>();
+ private static final ThreadLocal<XPath> xpathTL = new ThreadLocal<XPath>();
- public DocumentBuilder getXmlDocumentBuilder() {
+ public static DocumentBuilder getXmlDocumentBuilder() {
try {
DocumentBuilder builder = builderTL.get();
if (builder == null) {
@@ -49,7 +49,7 @@ abstract public class BaseTestHarness {
}
}
- public XPath getXpath() {
+ public static XPath getXpath() {
try {
XPath xpath = xpathTL.get();
if (xpath == null) {
@@ -71,7 +71,7 @@ abstract public class BaseTestHarness {
* @param tests Array of XPath strings to test (in boolean mode) on the xml
* @return null if all good, otherwise the first test that fails.
*/
- public String validateXPath(String xml, String... tests)
+ public static String validateXPath(String xml, String... tests)
throws XPathExpressionException, SAXException {
if (tests==null || tests.length == 0) return null;
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java Wed Jul 3 23:26:32 2013
@@ -25,30 +25,55 @@ import java.io.File;
* @lucene.internal
*/
public class ExternalPaths {
+
+ /**
+ * <p>
+ * The main directory path for the solr source being built if it can be determined. If it
+ * can not be determined -- possily because the current context is a client code base
+ * using hte test frameowrk -- then this variable will be null.
+ * </p>
+ * <p>
+ * Note that all other static paths available in this class are derived from the source
+ * home, and if it is null, those paths will just be relative to 'null' and may not be
+ * meaningful.
+ */
public static final String SOURCE_HOME = determineSourceHome();
+ /* @see #SOURCE_HOME */
public static String WEBAPP_HOME = new File(SOURCE_HOME, "webapp/web").getAbsolutePath();
+ /* @see #SOURCE_HOME */
public static String EXAMPLE_HOME = new File(SOURCE_HOME, "example/solr").getAbsolutePath();
+ /* @see #SOURCE_HOME */
public static String EXAMPLE_MULTICORE_HOME = new File(SOURCE_HOME, "example/multicore").getAbsolutePath();
+ /* @see #SOURCE_HOME */
public static String EXAMPLE_SCHEMA=EXAMPLE_HOME+"/collection1/conf/schema.xml";
+ /* @see #SOURCE_HOME */
public static String EXAMPLE_CONFIG=EXAMPLE_HOME+"/collection1/conf/solrconfig.xml";
+ /**
+ * Ugly, ugly hack to determine the example home without depending on the CWD
+ * this is needed for example/multicore tests which reside outside the classpath.
+ * if the source home can't be determined, this method returns null.
+ */
static String determineSourceHome() {
- // ugly, ugly hack to determine the example home without depending on the CWD
- // this is needed for example/multicore tests which reside outside the classpath
- File file;
try {
- file = new File("solr/conf");
- if (!file.exists()) {
- file = new File(Thread.currentThread().getContextClassLoader().getResource("solr/conf").toURI());
+ File file;
+ try {
+ file = new File("solr/conf");
+ if (!file.exists()) {
+ file = new File(Thread.currentThread().getContextClassLoader().getResource("solr/conf").toURI());
+ }
+ } catch (Exception e) {
+ // If there is no "solr/conf" in the classpath, fall back to searching from the current directory.
+ file = new File(".");
}
- } catch (Exception e) {
- // If there is no "solr/conf" in the classpath, fall back to searching from the current directory.
- file = new File(".");
- }
- File base = file.getAbsoluteFile();
- while (!new File(base, "solr/CHANGES.txt").exists()) {
- base = base.getParentFile();
+ File base = file.getAbsoluteFile();
+ while (!(new File(base, "solr/CHANGES.txt").exists()) && null != base) {
+ base = base.getParentFile();
+ }
+ return (null == base) ? null : new File(base, "solr/").getAbsolutePath();
+ } catch (RuntimeException e) {
+ // all bets are off
+ return null;
}
- return new File(base, "solr/").getAbsolutePath();
}
}
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java Wed Jul 3 23:26:32 2013
@@ -127,7 +127,7 @@ abstract public class RestTestBase exten
}
*/
- String results = restTestHarness.validateXPath(response, tests);
+ String results = TestHarness.validateXPath(response, tests);
if (null != results) {
String msg = "REQUEST FAILED: xpath=" + results
Modified: lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java (original)
+++ lucene/dev/branches/security/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java Wed Jul 3 23:26:32 2013
@@ -17,20 +17,17 @@
package org.apache.solr.util;
+import com.google.common.base.Charsets;
import org.apache.solr.common.SolrException;
import org.apache.solr.common.params.CommonParams;
import org.apache.solr.common.util.NamedList;
-import org.apache.solr.core.Config;
-import org.apache.solr.core.ConfigSolrXmlOld;
+import org.apache.solr.common.util.NamedList.NamedListEntry;
+import org.apache.solr.core.ConfigSolr;
+import org.apache.solr.core.CoreContainer;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
-import org.apache.solr.core.CoreContainer;
-import org.apache.solr.core.CoreDescriptor;
import org.apache.solr.core.SolrResourceLoader;
import org.apache.solr.handler.UpdateRequestHandler;
-import org.apache.solr.logging.ListenerConfig;
-import org.apache.solr.logging.LogWatcher;
-import org.apache.solr.logging.jul.JulWatcher;
import org.apache.solr.request.LocalSolrQueryRequest;
import org.apache.solr.request.SolrQueryRequest;
import org.apache.solr.request.SolrRequestHandler;
@@ -40,9 +37,6 @@ import org.apache.solr.response.SolrQuer
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.IndexSchemaFactory;
import org.apache.solr.servlet.DirectSolrConnection;
-import org.apache.solr.common.util.NamedList.NamedListEntry;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
import java.io.ByteArrayInputStream;
import java.io.File;
@@ -51,8 +45,6 @@ import java.io.StringWriter;
import java.util.HashMap;
import java.util.Map;
-import javax.xml.parsers.ParserConfigurationException;
-
/**
* This class provides a simple harness that may be useful when
@@ -106,19 +98,8 @@ public class TestHarness extends BaseTes
SolrConfig solrConfig,
String schemaFile) {
this( coreName, dataDirectory, solrConfig, IndexSchemaFactory.buildIndexSchema(schemaFile, solrConfig));
- }
- /**
- * @param coreName to initialize
- * @param dataDirectory path for index data, will not be cleaned up
- * @param solrConfig solrconfig instance
- * @param indexSchema schema instance
- */
- public TestHarness( String coreName,
- String dataDirectory,
- SolrConfig solrConfig,
- IndexSchema indexSchema) {
- this(coreName, new Initializer(coreName, dataDirectory, solrConfig, indexSchema));
- }
+ }
+
/**
* @param dataDirectory path for index data, will not be cleaned up
* @param solrConfig solronfig instance
@@ -137,18 +118,26 @@ public class TestHarness extends BaseTes
public TestHarness( String dataDirectory,
SolrConfig solrConfig,
IndexSchema indexSchema) {
- this(null, new Initializer(null, dataDirectory, solrConfig, indexSchema));
+ this(CoreContainer.DEFAULT_DEFAULT_CORE_NAME, dataDirectory, solrConfig, indexSchema);
}
-
- public TestHarness(String coreName, CoreContainer.Initializer init) {
- try {
- container = init.initialize();
+ /**
+ * @param coreName to initialize
+ * @param dataDir path for index data, will not be cleaned up
+ * @param solrConfig solrconfig resource name
+ * @param indexSchema schema resource name
+ */
+ public TestHarness(String coreName, String dataDir, String solrConfig, String indexSchema) {
+ try {
if (coreName == null)
coreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
-
this.coreName = coreName;
+ SolrResourceLoader loader = new SolrResourceLoader(SolrResourceLoader.locateSolrHome());
+ ConfigSolr config = getTestHarnessConfig(coreName, dataDir, solrConfig, indexSchema);
+ container = new CoreContainer(loader, config);
+ container.load();
+
updater = new UpdateRequestHandler();
updater.init( null );
} catch (Exception e) {
@@ -156,67 +145,50 @@ public class TestHarness extends BaseTes
}
}
- // Creates a container based on infos needed to create one core
- static class Initializer extends CoreContainer.Initializer {
- String coreName;
- String dataDirectory;
- SolrConfig solrConfig;
- IndexSchema indexSchema;
- public Initializer(String coreName,
- String dataDirectory,
- SolrConfig solrConfig,
- IndexSchema indexSchema) {
- if (coreName == null)
- coreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
- this.coreName = coreName;
- this.dataDirectory = dataDirectory;
- this.solrConfig = solrConfig;
- this.indexSchema = indexSchema;
- }
- public String getCoreName() {
- return coreName;
- }
- @Override
- public CoreContainer initialize() {
- CoreContainer container;
- try {
- String solrHome = SolrResourceLoader.locateSolrHome();
- container = new CoreContainer(new SolrResourceLoader(solrHome)) {
- {
- String hostPort = System.getProperty("hostPort", "8983");
- String hostContext = System.getProperty("hostContext", "solr");
- defaultCoreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
- initShardHandler();
- zkSys.initZooKeeper(this, solrHome, System.getProperty("zkHost"), 30000, hostPort, hostContext, null, "30000", 30000, 30000);
- ByteArrayInputStream is = new ByteArrayInputStream(ConfigSolrXmlOld.DEF_SOLR_XML.getBytes("UTF-8"));
- Config config = new Config(loader, null, new InputSource(is), null, false);
- cfg = new ConfigSolrXmlOld(config, this);
- }
- };
- } catch (ParserConfigurationException e) {
- throw new RuntimeException(e);
- } catch (IOException e) {
- throw new RuntimeException(e);
- } catch (SAXException e) {
- throw new RuntimeException(e);
- }
- LogWatcher<?> logging = new JulWatcher("test");
- logging.registerListener(new ListenerConfig());
- container.setLogging(logging);
-
- CoreDescriptor dcore = new CoreDescriptor(container, coreName, solrConfig.getResourceLoader().getInstanceDir());
- dcore.setConfigName(solrConfig.getResourceName());
- dcore.setSchemaName(indexSchema.getResourceName());
- SolrCore core = new SolrCore(coreName, dataDirectory, solrConfig, indexSchema, dcore);
- container.register(coreName, core, false);
-
- // TODO: we should be exercising the *same* core container initialization code, not equivalent code!
- if (container.getZkController() == null && core.getUpdateHandler().getUpdateLog() != null) {
- // always kick off recovery if we are in standalone mode.
- core.getUpdateHandler().getUpdateLog().recoverFromLog();
- }
- return container;
- }
+ public TestHarness(String coreName, String dataDir, SolrConfig solrConfig, IndexSchema indexSchema) {
+ this(coreName, dataDir, solrConfig.getResourceName(), indexSchema.getResourceName());
+ }
+
+ /**
+ * Create a TestHarness using a specific solr home directory and solr xml
+ * @param solrHome the solr home directory
+ * @param solrXml a File pointing to a solr.xml configuration
+ */
+ public TestHarness(String solrHome, String solrXml) {
+ this(new SolrResourceLoader(solrHome),
+ ConfigSolr.fromInputStream(null, new ByteArrayInputStream(solrXml.getBytes(Charsets.UTF_8))));
+ }
+
+ /**
+ * Create a TestHarness using a specific resource loader and config
+ * @param loader the SolrResourceLoader to use
+ * @param config the ConfigSolr to use
+ */
+ public TestHarness(SolrResourceLoader loader, ConfigSolr config) {
+ container = new CoreContainer(loader, config);
+ container.load();
+ updater = new UpdateRequestHandler();
+ updater.init(null);
+ }
+
+ private static ConfigSolr getTestHarnessConfig(String coreName, String dataDir,
+ String solrConfig, String schema) {
+ String solrxml = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
+ + "<solr persistent=\"false\">\n"
+ + " <logging enabled=\"true\"/>\n"
+ + " <cores adminPath=\"/admin/cores\" defaultCoreName=\""
+ + CoreContainer.DEFAULT_DEFAULT_CORE_NAME
+ + "\""
+ + " host=\"${host:}\" hostPort=\"${hostPort:}\" hostContext=\"${hostContext:}\""
+ + " distribUpdateSoTimeout=\"30000\""
+ + " zkClientTimeout=\"${zkClientTimeout:30000}\" distribUpdateConnTimeout=\"30000\""
+ + ">\n"
+ + " <core name=\"" + coreName + "\" config=\"" + solrConfig
+ + "\" schema=\"" + schema + "\" dataDir=\"" + dataDir
+ + "\" transient=\"false\" loadOnStartup=\"true\""
+ + " shard=\"${shard:shard1}\" collection=\"${collection:collection1}\" instanceDir=\"" + coreName + "/\" />\n"
+ + " </cores>\n" + "</solr>";
+ return ConfigSolr.fromString(new SolrResourceLoader(dataDir), solrxml);
}
public CoreContainer getCoreContainer() {
Modified: lucene/dev/branches/security/solr/webapp/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/build.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/build.xml (original)
+++ lucene/dev/branches/security/solr/webapp/build.xml Wed Jul 3 23:26:32 2013
@@ -18,6 +18,9 @@
<project name="solr-webapp" default="default">
<description>Solr webapp</description>
+ <property name="rat.additional-includes" value="**"/>
+ <property name="rat.additional-excludes" value="web/img/**"/>
+
<import file="../common-build.xml"/>
<property name="exclude.from.war" value="*slf4j*,log4j-*" />
@@ -65,8 +68,9 @@
</war>
</target>
- <target name="dist-maven" depends="dist, filter-pom-templates, install-maven-tasks, m2-deploy-solr-parent-pom">
- <m2-deploy jar.file="${dist}/solr-${version}.war"
- pom.xml="${filtered.pom.templates.dir}/solr/webapp/pom.xml"/>
- </target>
+ <!-- nothing to do -->
+ <target name="dist-maven"/>
+
+ <!-- nothing to do -->
+ <target name="-validate-maven-dependencies"/>
</project>
Modified: lucene/dev/branches/security/solr/webapp/web/WEB-INF/weblogic.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/WEB-INF/weblogic.xml?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/WEB-INF/weblogic.xml (original)
+++ lucene/dev/branches/security/solr/webapp/web/WEB-INF/weblogic.xml Wed Jul 3 23:26:32 2013
@@ -1,4 +1,20 @@
<?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.
+-->
<weblogic-web-app
xmlns="http://www.bea.com/ns/weblogic/90"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
Modified: lucene/dev/branches/security/solr/webapp/web/admin.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/admin.html?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/admin.html (original)
+++ lucene/dev/branches/security/solr/webapp/web/admin.html Wed Jul 3 23:26:32 2013
@@ -35,6 +35,7 @@ limitations under the License.
<link rel="stylesheet" type="text/css" href="css/styles/logging.css?_=${version}">
<link rel="stylesheet" type="text/css" href="css/styles/menu.css?_=${version}">
<link rel="stylesheet" type="text/css" href="css/styles/plugins.css?_=${version}">
+ <link rel="stylesheet" type="text/css" href="css/styles/documents.css?_=${version}">
<link rel="stylesheet" type="text/css" href="css/styles/query.css?_=${version}">
<link rel="stylesheet" type="text/css" href="css/styles/replication.css?_=${version}">
<link rel="stylesheet" type="text/css" href="css/styles/schema-browser.css?_=${version}">
@@ -138,6 +139,12 @@ limitations under the License.
</div>
</div>
+
+ <div id="connection_status">
+
+ <span>Connection lost â¦</span>
+
+ </div>
<script type="text/javascript"> var require = { urlArgs: '_=${version}' }; </script>
<script src="js/require.js?_=${version}" data-main="js/main"></script>
Modified: lucene/dev/branches/security/solr/webapp/web/css/chosen.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/chosen.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/chosen.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/chosen.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,32 @@
+/*
+
+Chosen
+
+- by Patrick Filler for Harvest http://getharvest.com
+- Copyright (c) 2011-2013 by Harvest
+
+Available for use under the MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+*/
+
/* @group Base */
.chzn-container {
font-size: 13px;
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/analysis.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/analysis.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/analysis.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/analysis.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #analysis-holder
{
background-image: url( ../../img/div.gif );
@@ -289,4 +308,4 @@
}
#content #analysis #field-analysis h2 { background-image: url( ../../img/ico/receipt.png ); }
-#content #analysis .analysis-result h2 { background-image: url( ../../img/ico/receipt-invoice.png ); }
\ No newline at end of file
+#content #analysis .analysis-result h2 { background-image: url( ../../img/ico/receipt-invoice.png ); }
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/cloud.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/cloud.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/cloud.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/cloud.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #cloud
{
position: relative;
@@ -387,4 +406,4 @@
#content #graph-content .link.lvl-1
{
stroke: #fff;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/common.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/common.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/common.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/common.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
*
{
background-repeat: no-repeat;
@@ -605,4 +624,66 @@ pre.syntax .tex .formula
#content .tree a.jstree-search
{
color:aqua;
-}
\ No newline at end of file
+}
+
+#connection_status
+{
+ display: none;
+ padding: 30px;
+}
+
+#connection_status span
+{
+ background-image: url( ../../img/ico/network-status-busy.png );
+ background-position: 0 50%;
+ color: #800;
+ padding-left: 26px;
+}
+
+#connection_status.online span,
+#connection_status.online span a
+{
+ color: #080;
+}
+
+#connection_status.online span
+{
+ background-image: url( ../../img/ico/network-status.png );
+}
+
+#connection_status.online span a
+{
+ text-decoration: underline;
+}
+
+#connection_status.online span a:hover
+{
+ text-decoration: none;
+}
+
+#content .address-bar
+{
+ margin-bottom: 10px;
+ background-image: url( ../../img/ico/ui-address-bar.png );
+ background-position: 5px 50%;
+ border: 1px solid #f0f0f0;
+ box-shadow: 1px 1px 0 #f0f0f0;
+ -moz-box-shadow: 1px 1px 0 #f0f0f0;
+ -webkit-box-shadow: 1px 1px 0 #f0f0f0;
+ color: #c0c0c0;
+ display: block;
+ overflow: hidden;
+ padding: 5px;
+ padding-left: 26px;
+ white-space: nowrap;
+}
+
+#content .address-bar:focus,
+#content .address-bar:hover
+{
+ border-color: #c0c0c0;
+ box-shadow: 1px 1px 0 #d8d8d8;
+ -moz-box-shadow: 1px 1px 0 #d8d8d8;
+ -webkit-box-shadow: 1px 1px 0 #d8d8d8;
+ color: #333;
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/cores.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/cores.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/cores.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/cores.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #cores
{
position: relative;
@@ -200,4 +219,4 @@
#content #cores #data li dd.ico span
{
display: none;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/dashboard.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/dashboard.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/dashboard.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/dashboard.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #dashboard .block
{
background-image: none;
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/dataimport.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/dataimport.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/dataimport.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/dataimport.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #dataimport
{
background-image: url( ../../img/div.gif );
@@ -381,4 +400,4 @@
{
color: #c0c0c0;
font-style: normal;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/index.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/index.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/index.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/index.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #index .bar-desc
{
color: #c0c0c0;
@@ -187,4 +206,4 @@
#content #index #jvm-memory-bar
{
margin-top: 20px;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/java-properties.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/java-properties.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/java-properties.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/java-properties.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #java-properties .loader
{
background-position: 0 50%;
@@ -30,4 +49,4 @@
#content #java-properties li dd.odd
{
color: #999;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/logging.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/logging.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/logging.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/logging.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #logging .loader
{
background-position: 0 50%;
@@ -333,4 +352,4 @@
{
background-image: url( ../../img/ico/cross-1.png );
color: #800;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/menu.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/menu.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/menu.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/menu.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#menu-wrapper
{
position: fixed;
@@ -239,6 +258,7 @@
#core-menu .schema a { background-image: url( ../../img/ico/table.png ); }
#core-menu .config a { background-image: url( ../../img/ico/gear.png ); }
#core-menu .analysis a { background-image: url( ../../img/ico/funnel.png ); }
+#core-menu .documents a { background-image: url( ../../img/ico/documents-stack.png ); }
#core-menu .schema-browser a { background-image: url( ../../img/ico/book-open-text.png ); }
#core-menu .replication a { background-image: url( ../../img/ico/node.png ); }
#core-menu .distribution a { background-image: url( ../../img/ico/node-select.png ); }
@@ -284,4 +304,4 @@
{
background-color: #e0e0e0;
font-weight: bold;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/plugins.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/plugins.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/plugins.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/plugins.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #plugins #navigation
{
width: 20%;
@@ -172,4 +191,4 @@
#recording button span
{
background-image: url( ../../img/ico/new-text.png );
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/query.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/query.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/query.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/query.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #query
{
background-image: url( ../../img/div.gif );
@@ -32,6 +51,44 @@
width: 98%;
}
+#content #query #form .multiple input
+{
+ float: left;
+ width: 80%
+}
+
+#content #query #form .multiple .buttons
+{
+ float: right;
+ width: 16%;
+}
+
+
+#content #query #form .multiple a
+{
+ background-position: 50% 50%;
+ display: block;
+ height: 25px;
+ width: 49%;
+}
+
+#content #query #form .multiple a span
+{
+ display: none;
+}
+
+#content #query #form .multiple a.add
+{
+ background-image: url( ../../img/ico/plus-button.png );
+ float: right;
+}
+
+#content #query #form .multiple a.rem
+{
+ background-image: url( ../../img/ico/minus-button.png );
+ float: left;
+}
+
#content #query #form #start
{
float: left;
@@ -111,33 +168,6 @@
width: 77%;
}
-#content #query #result #url
-{
- margin-bottom: 10px;
- background-image: url( ../../img/ico/ui-address-bar.png );
- background-position: 5px 50%;
- border: 1px solid #f0f0f0;
- box-shadow: 1px 1px 0 #f0f0f0;
- -moz-box-shadow: 1px 1px 0 #f0f0f0;
- -webkit-box-shadow: 1px 1px 0 #f0f0f0;
- color: #c0c0c0;
- display: block;
- overflow: hidden;
- padding: 5px;
- padding-left: 26px;
- white-space: nowrap;
-}
-
-#content #query #result #url:focus,
-#content #query #result #url:hover
-{
- border-color: #c0c0c0;
- box-shadow: 1px 1px 0 #d8d8d8;
- -moz-box-shadow: 1px 1px 0 #d8d8d8;
- -webkit-box-shadow: 1px 1px 0 #d8d8d8;
- color: #333;
-}
-
#content #query #result #response
{
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/replication.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/replication.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/replication.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/replication.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #replication
{
background-image: url( ../../img/div.gif );
@@ -493,4 +512,4 @@
#content #replication #navigation .refresh-status span
{
background-image: url( ../../img/ico/arrow-circle.png );
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/schema-browser.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/schema-browser.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/schema-browser.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/schema-browser.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #schema-browser .loader
{
background-position: 0 50%;
@@ -556,4 +575,4 @@
#content #schema-browser #data #field .histogram-holder li:hover dt
{
color: #333;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/css/styles/threads.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/css/styles/threads.css?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/css/styles/threads.css (original)
+++ lucene/dev/branches/security/solr/webapp/web/css/styles/threads.css Wed Jul 3 23:26:32 2013
@@ -1,3 +1,22 @@
+/*
+
+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.
+
+*/
+
#content #threads .loader
{
background-position: 0 50%;
@@ -150,4 +169,4 @@
#content #threads.collapsed .controls .collapse
{
display: none;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/security/solr/webapp/web/js/lib/ZeroClipboard.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/js/lib/ZeroClipboard.js?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/js/lib/ZeroClipboard.js (original)
+++ lucene/dev/branches/security/solr/webapp/web/js/lib/ZeroClipboard.js Wed Jul 3 23:26:32 2013
@@ -1,3 +1,28 @@
+/*
+
+The MIT License (MIT)
+Copyright (c) 2012 Jon Rohan, James M. Greene,
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+*/
+
// Simple Set Clipboard System
// Author: Joseph Huckaby
Modified: lucene/dev/branches/security/solr/webapp/web/js/lib/chosen.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/js/lib/chosen.js?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/js/lib/chosen.js (original)
+++ lucene/dev/branches/security/solr/webapp/web/js/lib/chosen.js Wed Jul 3 23:26:32 2013
@@ -1,3 +1,32 @@
+/*
+
+Chosen
+
+- by Patrick Filler for Harvest http://getharvest.com
+- Copyright (c) 2011-2013 by Harvest
+
+Available for use under the MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+*/
+
// Chosen, a Select Box Enhancer for jQuery and Protoype
// by Patrick Filler for Harvest, http://getharvest.com
//
Modified: lucene/dev/branches/security/solr/webapp/web/js/lib/d3.js
URL: http://svn.apache.org/viewvc/lucene/dev/branches/security/solr/webapp/web/js/lib/d3.js?rev=1499601&r1=1499600&r2=1499601&view=diff
==============================================================================
--- lucene/dev/branches/security/solr/webapp/web/js/lib/d3.js (original)
+++ lucene/dev/branches/security/solr/webapp/web/js/lib/d3.js Wed Jul 3 23:26:32 2013
@@ -1,3 +1,34 @@
+/*
+
+Copyright (c) 2013, Michael Bostock
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* The name Michael Bostock may not be used to endorse or promote products
+ derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL MICHAEL BOSTOCK BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*/
+
(function(){if (!Date.now) Date.now = function() {
return +new Date;
};