You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by cm...@apache.org on 2013/08/11 14:19:39 UTC
svn commit: r1512909 [36/38] - in /lucene/dev/branches/lucene4956: ./
dev-tools/ dev-tools/eclipse/ dev-tools/idea/.idea/libraries/
dev-tools/idea/lucene/suggest/ dev-tools/idea/solr/contrib/dataimporthandler/
dev-tools/idea/solr/core/src/test/ dev-too...
Modified: lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java (original)
+++ lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/SolrTestCaseJ4.java Sun Aug 11 12:19:13 2013
@@ -17,26 +17,36 @@
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.analysis.MockAnalyzer;
+import org.apache.lucene.index.IndexWriterConfig;
+import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.LuceneTestCase;
+import org.apache.lucene.util._TestUtil;
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.ConfigSolr;
+import org.apache.solr.core.ConfigSolrXmlOld;
import org.apache.solr.core.CoreContainer;
+import org.apache.solr.core.CoreDescriptor;
import org.apache.solr.core.SolrConfig;
import org.apache.solr.core.SolrCore;
+import org.apache.solr.core.SolrResourceLoader;
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 +54,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 +67,24 @@ 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.Properties;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.regex.Pattern;
+
+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
@@ -69,7 +97,7 @@ import com.carrotsearch.randomizedtestin
QuickPatchThreadsFilter.class
})
public abstract class SolrTestCaseJ4 extends LuceneTestCase {
- private static String coreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
+ private static String coreName = ConfigSolrXmlOld.DEFAULT_DEFAULT_CORE_NAME;
public static int DEFAULT_CONNECTION_TIMEOUT = 15000; // default socket connection timeout in ms
@@ -86,11 +114,14 @@ public abstract class SolrTestCaseJ4 ext
@SuppressWarnings("unused")
private static void beforeClass() {
System.setProperty("jetty.testMode", "true");
+ System.setProperty("enable.update.log", usually() ? "true" : "false");
System.setProperty("tests.shardhandler.randomSeed", Long.toString(random().nextLong()));
+ System.setProperty("solr.clustering.enabled", "false");
setupLogging();
startTrackingSearchers();
startTrackingZkClients();
ignoreException("ignore_exception");
+ newRandomConfig();
}
@AfterClass
@@ -101,9 +132,11 @@ public abstract class SolrTestCaseJ4 ext
endTrackingSearchers();
endTrackingZkClients();
resetFactory();
- coreName = CoreContainer.DEFAULT_DEFAULT_CORE_NAME;
+ coreName = ConfigSolrXmlOld.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;
@@ -132,6 +165,47 @@ public abstract class SolrTestCaseJ4 ext
}
}
+ /**
+ * Call this from @BeforeClass to set up the test harness and update handler with no cores.
+ *
+ * @param solrHome The solr home directory.
+ * @param xmlStr - the text of an XML file to use. If null, use the what's the absolute minimal file.
+ * @throws Exception Lost of file-type things can go wrong.
+ */
+ public static void setupNoCoreTest(File solrHome, String xmlStr) throws Exception {
+
+ File tmpFile = new File(solrHome, ConfigSolr.SOLR_XML_FILE);
+ if (xmlStr == null) {
+ xmlStr = "<solr></solr>";
+ }
+ FileUtils.write(tmpFile, xmlStr, IOUtils.CHARSET_UTF_8.toString());
+
+ SolrResourceLoader loader = new SolrResourceLoader(solrHome.getAbsolutePath());
+ h = new TestHarness(loader, ConfigSolr.fromFile(loader, new File(solrHome, "solr.xml")));
+ lrf = h.getRequestFactory("standard", 0, 20, CommonParams.VERSION, "2.2");
+ }
+
+ /** sets system properties based on
+ * {@link #newIndexWriterConfig(org.apache.lucene.util.Version, org.apache.lucene.analysis.Analyzer)}
+ *
+ * configs can use these system properties to vary the indexwriter settings
+ */
+ public static void newRandomConfig() {
+ IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random()));
+
+ System.setProperty("useCompoundFile", String.valueOf(iwc.getUseCompoundFile()));
+
+ System.setProperty("solr.tests.maxBufferedDocs", String.valueOf(iwc.getMaxBufferedDocs()));
+ System.setProperty("solr.tests.ramBufferSizeMB", String.valueOf(iwc.getRAMBufferSizeMB()));
+ System.setProperty("solr.tests.mergeScheduler", iwc.getMergeScheduler().getClass().getName());
+
+ // don't ask iwc.getMaxThreadStates(), sometimes newIWC uses
+ // RandomDocumentsWriterPerThreadPool and all hell breaks loose
+ int maxIndexingThreads = rarely(random())
+ ? _TestUtil.nextInt(random(), 5, 20) // crazy value
+ : _TestUtil.nextInt(random(), 1, 4); // reasonable value
+ System.setProperty("solr.tests.maxIndexingThreads", String.valueOf(maxIndexingThreads));
+ }
@Override
public void setUp() throws Exception {
@@ -340,6 +414,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 +467,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.
*/
@@ -561,7 +671,7 @@ public abstract class SolrTestCaseJ4 ext
/**
* Validates a query matches some JSON test expressions and closes the
* query. The text expression is of the form path:JSON. To facilitate
- * easy embedding in Java strings, the JSON can have double quotes
+ * easy embedding in Java strings, the JSON tests can have double quotes
* replaced with single quotes.
* <p>
* Please use this with care: this makes it easy to match complete
@@ -596,7 +706,7 @@ public abstract class SolrTestCaseJ4 ext
for (String test : tests) {
if (test == null || test.length()==0) continue;
- String testJSON = test.replace('\'', '"');
+ String testJSON = json(test);
try {
failed = true;
@@ -630,23 +740,29 @@ public abstract class SolrTestCaseJ4 ext
/** Makes sure a query throws a SolrException with the listed response code */
public static void assertQEx(String message, SolrQueryRequest req, int code ) {
try {
+ ignoreException(".");
h.query(req);
fail( message );
} catch (SolrException sex) {
assertEquals( code, sex.code() );
} catch (Exception e2) {
throw new RuntimeException("Exception during query", e2);
+ } finally {
+ unIgnoreException(".");
}
}
public static void assertQEx(String message, SolrQueryRequest req, SolrException.ErrorCode code ) {
try {
+ ignoreException(".");
h.query(req);
fail( message );
} catch (SolrException e) {
assertEquals( code.code, e.code() );
} catch (Exception e2) {
throw new RuntimeException("Exception during query", e2);
+ } finally {
+ unIgnoreException(".");
}
}
@@ -853,6 +969,24 @@ public abstract class SolrTestCaseJ4 ext
return sd;
}
+ /** Converts "test JSON" and returns standard JSON.
+ * Currently this only consists of changing unescaped single quotes to double quotes,
+ * and escaped single quotes to single quotes.
+ *
+ * The primary purpose is to be able to easily embed JSON strings in a JAVA string
+ * with the best readability.
+ *
+ * This transformation is automatically applied to JSON test srings (like assertJQ).
+ */
+ public static String json(String testJSON) {
+ testJSON = nonEscapedSingleQuotePattern.matcher(testJSON).replaceAll("\"");
+ testJSON = escapedSingleQuotePattern.matcher(testJSON).replaceAll("'");
+ return testJSON;
+ }
+ private static Pattern nonEscapedSingleQuotePattern = Pattern.compile("(?<!\\\\)\'");
+ private static Pattern escapedSingleQuotePattern = Pattern.compile("\\\\\'");
+
+
/** Creates JSON from a SolrInputDocument. Doesn't currently handle boosts. */
public static String json(SolrInputDocument doc) {
CharArr out = new CharArr();
@@ -1444,12 +1578,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 +1599,56 @@ 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"));
+ }
+
+ public static CoreDescriptorBuilder buildCoreDescriptor(CoreContainer container, String name, String instancedir) {
+ return new CoreDescriptorBuilder(container, name, instancedir);
+ }
+
+ public static class CoreDescriptorBuilder {
+
+ final String name;
+ final String instanceDir;
+ final CoreContainer container;
+ final Properties properties = new Properties();
+
+ public CoreDescriptorBuilder(CoreContainer container, String name, String instancedir) {
+ this.name = name;
+ this.instanceDir = instancedir;
+ this.container = container;
+ }
+
+ public CoreDescriptorBuilder withSchema(String schema) {
+ properties.setProperty(CoreDescriptor.CORE_SCHEMA, schema);
+ return this;
+ }
+
+ public CoreDescriptorBuilder withConfig(String config) {
+ properties.setProperty(CoreDescriptor.CORE_CONFIG, config);
+ return this;
+ }
+
+ public CoreDescriptorBuilder withDataDir(String datadir) {
+ properties.setProperty(CoreDescriptor.CORE_DATADIR, datadir);
+ return this;
+ }
+
+ public CoreDescriptor build() {
+ return new CoreDescriptor(container, name, instanceDir, properties);
+ }
+
+ public CoreDescriptorBuilder isTransient(boolean isTransient) {
+ properties.setProperty(CoreDescriptor.CORE_TRANSIENT, Boolean.toString(isTransient));
+ return this;
+ }
+
+ public CoreDescriptorBuilder loadOnStartup(boolean loadOnStartup) {
+ properties.setProperty(CoreDescriptor.CORE_LOADONSTARTUP, Boolean.toString(loadOnStartup));
+ return this;
+ }
}
}
Modified: lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java (original)
+++ lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractDistribZkTestBase.java Sun Aug 11 12:19:13 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/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java (original)
+++ lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractFullDistribZkTestBase.java Sun Aug 11 12:19:13 2013
@@ -17,19 +17,6 @@ package org.apache.solr.cloud;
* limitations under the License.
*/
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicInteger;
-
import org.apache.http.params.CoreConnectionPNames;
import org.apache.lucene.util.LuceneTestCase.Slow;
import org.apache.solr.client.solrj.SolrQuery;
@@ -56,6 +43,7 @@ import org.apache.solr.common.cloud.ZkSt
import org.apache.solr.common.params.CollectionParams.CollectionAction;
import org.apache.solr.common.params.ModifiableSolrParams;
import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.common.util.StrUtils;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
@@ -63,6 +51,25 @@ import org.junit.BeforeClass;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.apache.solr.cloud.OverseerCollectionProcessor.CREATE_NODE_SET;
+import static org.apache.solr.cloud.OverseerCollectionProcessor.MAX_SHARDS_PER_NODE;
+import static org.apache.solr.cloud.OverseerCollectionProcessor.NUM_SLICES;
+import static org.apache.solr.cloud.OverseerCollectionProcessor.REPLICATION_FACTOR;
+import static org.apache.solr.cloud.OverseerCollectionProcessor.SHARDS_PROP;
+
/**
* TODO: we should still test this works as a custom update chain as well as
* what we test now - the default update chain
@@ -197,6 +204,7 @@ public abstract class AbstractFullDistri
@AfterClass
public static void afterClass() {
System.clearProperty("solrcloud.update.delay");
+ System.clearProperty("genericCoreNodeNames");
}
public AbstractFullDistribZkTestBase() {
@@ -211,6 +219,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 +242,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);
@@ -299,7 +311,9 @@ public abstract class AbstractFullDistri
cnt = 30;
while (reader.getClusterState().getSlices(collection).size() < slices) {
if (cnt == 0) {
- throw new RuntimeException("timeout waiting for collection shards to come up: collection="+collection + "nSlices="+slices);
+ throw new RuntimeException("timeout waiting for collection shards to come up: collection="+collection
+ + ", slices.expected="+slices+ " slices.actual= " + reader.getClusterState().getSlices(collection).size()
+ + " slices : "+ reader.getClusterState().getSlices(collection) );
}
cnt--;
Thread.sleep(500);
@@ -328,8 +342,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 +442,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 +519,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 +839,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 +980,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();
@@ -1370,16 +1501,22 @@ public abstract class AbstractFullDistri
protected void createCollection(String collectionName, int numShards, int numReplicas, int maxShardsPerNode) throws SolrServerException, IOException {
createCollection(null, collectionName, numShards, numReplicas, maxShardsPerNode, null, null);
}
-
- protected void createCollection(Map<String,List<Integer>> collectionInfos,
- String collectionName, int numShards, int numReplicas, int maxShardsPerNode, SolrServer client, String createNodeSetStr) throws SolrServerException, IOException {
+
+ protected void createCollection(Map<String,List<Integer>> collectionInfos, String collectionName, Map<String,Object> collectionProps, SolrServer client ) throws SolrServerException, IOException{
ModifiableSolrParams params = new ModifiableSolrParams();
params.set("action", CollectionAction.CREATE.toString());
-
- params.set(OverseerCollectionProcessor.NUM_SLICES, numShards);
- params.set(OverseerCollectionProcessor.REPLICATION_FACTOR, numReplicas);
- params.set(OverseerCollectionProcessor.MAX_SHARDS_PER_NODE, maxShardsPerNode);
- if (createNodeSetStr != null) params.set(OverseerCollectionProcessor.CREATE_NODE_SET, createNodeSetStr);
+ for (Map.Entry<String, Object> entry : collectionProps.entrySet()) {
+ if(entry.getValue() !=null) params.set(entry.getKey(), String.valueOf(entry.getValue()));
+ }
+ Integer numShards = (Integer) collectionProps.get(NUM_SLICES);
+ if(numShards==null){
+ String shardNames = (String) collectionProps.get(SHARDS_PROP);
+ numShards = StrUtils.splitSmart(shardNames,',').size();
+ }
+ Integer numReplicas = (Integer) collectionProps.get(REPLICATION_FACTOR);
+ if(numShards==null){
+ numShards = (Integer) OverseerCollectionProcessor.COLL_PROPS.get(REPLICATION_FACTOR);
+ }
int clientIndex = random().nextInt(2);
List<Integer> list = new ArrayList<Integer>();
@@ -1391,16 +1528,35 @@ public abstract class AbstractFullDistri
params.set("name", collectionName);
SolrRequest request = new QueryRequest(params);
request.setPath("/admin/collections");
-
+
if (client == null) {
final String baseUrl = getBaseUrl((HttpSolrServer) clients.get(clientIndex));
-
+
createNewSolrServer("", baseUrl).request(request);
} else {
client.request(request);
}
+
}
-
+
+ protected void runCollectionAdminCommand(ModifiableSolrParams params){
+
+ ;
+
+ }
+
+ protected void createCollection(Map<String,List<Integer>> collectionInfos,
+ String collectionName, int numShards, int numReplicas, int maxShardsPerNode, SolrServer client, String createNodeSetStr) throws SolrServerException, IOException {
+
+ createCollection(collectionInfos, collectionName,
+ OverseerCollectionProcessor.asMap(
+ NUM_SLICES, numShards,
+ REPLICATION_FACTOR, numReplicas,
+ CREATE_NODE_SET, createNodeSetStr,
+ MAX_SHARDS_PER_NODE, maxShardsPerNode),
+ client);
+ }
+
@Override
protected SolrServer createNewSolrServer(int port) {
try {
@@ -1464,7 +1620,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 +1661,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/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java (original)
+++ lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/cloud/AbstractZkTestCase.java Sun Aug 11 12:19:13 2013
@@ -105,6 +105,7 @@ public abstract class AbstractZkTestCase
putConfig(zkClient, solrhome, config, "solrconfig.xml");
putConfig(zkClient, solrhome, schema, "schema.xml");
+ putConfig(zkClient, solrhome, "solrconfig.snippet.randomindexconfig.xml");
putConfig(zkClient, solrhome, "stopwords.txt");
putConfig(zkClient, solrhome, "protwords.txt");
putConfig(zkClient, solrhome, "currency.xml");
Modified: lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/BaseTestHarness.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/BaseTestHarness.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/BaseTestHarness.java (original)
+++ lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/BaseTestHarness.java Sun Aug 11 12:19:13 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/lucene4956/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java (original)
+++ lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/ExternalPaths.java Sun Aug 11 12:19:13 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/lucene4956/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java (original)
+++ lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/RestTestBase.java Sun Aug 11 12:19:13 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
@@ -229,8 +229,7 @@ abstract public class RestTestBase exten
for (String test : tests) {
if (null == test || 0 == test.length()) continue;
- String testJSON = test.replaceAll("(?<!\\\\)\'", "\"");
- testJSON = testJSON.replaceAll("\\\\\'", "'");
+ String testJSON = json(test);
try {
failed = true;
@@ -311,8 +310,7 @@ abstract public class RestTestBase exten
for (String test : tests) {
if (null == test || 0 == test.length()) continue;
- String testJSON = test.replaceAll("(?<!\\\\)\'", "\"");
- testJSON = testJSON.replaceAll("\\\\\'", "'");
+ String testJSON = json(test);
try {
failed = true;
@@ -391,8 +389,7 @@ abstract public class RestTestBase exten
for (String test : tests) {
if (null == test || 0 == test.length()) continue;
- String testJSON = test.replaceAll("(?<!\\\\)\'", "\"");
- testJSON = testJSON.replaceAll("\\\\\'", "'");
+ String testJSON = json(test);
try {
failed = true;
Modified: lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java (original)
+++ lucene/dev/branches/lucene4956/solr/test-framework/src/java/org/apache/solr/util/TestHarness.java Sun Aug 11 12:19:13 2013
@@ -20,17 +20,14 @@ package org.apache.solr.util;
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.common.util.NamedList.NamedListEntry;
+import org.apache.solr.core.ConfigSolr;
import org.apache.solr.core.ConfigSolrXmlOld;
+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,20 +37,13 @@ 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;
import java.io.IOException;
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
* writing testcases.
@@ -89,10 +79,10 @@ public class TestHarness extends BaseTes
/**
* Creates a SolrConfig object for the
- * {@link CoreContainer#DEFAULT_DEFAULT_CORE_NAME} core using {@link #createConfig(String,String,String)}
+ * {@link ConfigSolrXmlOld#DEFAULT_DEFAULT_CORE_NAME} core using {@link #createConfig(String,String,String)}
*/
public static SolrConfig createConfig(String solrHome, String confFile) {
- return createConfig(solrHome, CoreContainer.DEFAULT_DEFAULT_CORE_NAME, confFile);
+ return createConfig(solrHome, ConfigSolrXmlOld.DEFAULT_DEFAULT_CORE_NAME, confFile);
}
/**
@@ -106,19 +96,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 +116,26 @@ public class TestHarness extends BaseTes
public TestHarness( String dataDirectory,
SolrConfig solrConfig,
IndexSchema indexSchema) {
- this(null, new Initializer(null, dataDirectory, solrConfig, indexSchema));
+ this(ConfigSolrXmlOld.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;
-
+ coreName = ConfigSolrXmlOld.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 +143,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.fromString(solrXml));
+ }
+
+ /**
+ * 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=\""
+ + ConfigSolrXmlOld.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(solrxml);
}
public CoreContainer getCoreContainer() {
@@ -451,4 +421,6 @@ public class TestHarness extends BaseTes
return new LocalSolrQueryRequest(TestHarness.this.getCore(), new NamedList(entries));
}
}
+
+
}
Modified: lucene/dev/branches/lucene4956/solr/webapp/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/build.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/build.xml (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/build.xml Sun Aug 11 12:19:13 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-*" />
@@ -47,12 +50,7 @@
<war destfile="${dist}/solr-${version}${solr.war.suffix}.war"
webxml="web/WEB-INF/web.xml"
manifest="${manifest.file}">
- <lib dir="${common-solr.dir}/core/lib" excludes="${exclude.from.war},${common.classpath.excludes}">
- <exclude name="*servlet-api*.jar" />
- <exclude name="easymock-*.jar" />
- <exclude name="cglib-nodep-*.jar" />
- <exclude name="objenesis-*.jar" />
- </lib>
+ <lib dir="${common-solr.dir}/core/lib" excludes="${exclude.from.war},${common.classpath.excludes}"/>
<lib dir="${common-solr.dir}/solrj/lib" excludes="${exclude.from.war},${common.classpath.excludes}"/>
<lib dir="${lucene-libs}" excludes="${exclude.from.war},${common.classpath.excludes}" />
<lib dir="${dist}" excludes="${exclude.from.war},${common.classpath.excludes}">
@@ -65,8 +63,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/lucene4956/solr/webapp/web/WEB-INF/weblogic.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/WEB-INF/weblogic.xml?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/WEB-INF/weblogic.xml (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/WEB-INF/weblogic.xml Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/admin.html
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/admin.html?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/admin.html (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/admin.html Sun Aug 11 12:19:13 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}">
@@ -112,7 +113,13 @@ limitations under the License.
</ul>
<div id="core-selector">
- <select data-placeholder="Core Selector"></select>
+ <div id="has-cores">
+ <select data-placeholder="Core Selector"></select>
+ </div>
+ <p id="has-no-cores"><a href="#/~cores">
+ No cores available
+ <span>Go and create one</span>
+ </a></p>
</div>
<div id="core-menu">
<ul></ul>
@@ -138,6 +145,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/lucene4956/solr/webapp/web/css/chosen.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/chosen.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/chosen.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/chosen.css Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/css/styles/analysis.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/analysis.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/analysis.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/analysis.css Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/css/styles/cloud.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/cloud.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/cloud.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/cloud.css Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/css/styles/common.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/common.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/common.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/common.css Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/css/styles/cores.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/cores.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/cores.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/cores.css Sun Aug 11 12:19:13 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;
@@ -14,6 +33,11 @@
width: 500px;
}
+#content #cores.empty .requires-core
+{
+ display: none;
+}
+
#content #cores #frame
{
float: right;
@@ -34,6 +58,7 @@
#content #cores #frame .actions
{
margin-bottom: 20px;
+ min-height: 30px;
}
#content #cores .actions div.action
@@ -46,9 +71,19 @@
display: none;
}
+#content #cores .actions form .directory-note
+{
+ background-image: url( ../../img/ico/information-white.png );
+ background-position: 22% 1px;
+ color: #c0c0c0;
+}
+
#content #cores .actions form .error
{
- color: #800;
+ background-image: url( ../../img/ico/cross-button.png );
+ background-position: 22% 1px;
+ color: #c00;
+ font-weight: bold;
display: none;
}
@@ -69,10 +104,16 @@
#content #cores .actions form input,
#content #cores .actions form select,
#content #cores .actions form .buttons,
-#content #cores .actions form .error span
+#content #cores .actions form .note span
{
float: right;
- width: 73%;
+ width: 71%;
+}
+
+#content #cores .actions form .note span
+{
+ padding-left: 3px;
+ padding-right: 3px;
}
#content #cores .actions form .buttons
@@ -151,7 +192,7 @@
display: none;
position: absolute;
left: -50px;
- top: 40;
+ top: 40px;
padding: 10px;
}
@@ -200,4 +241,4 @@
#content #cores #data li dd.ico span
{
display: none;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/dashboard.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/dashboard.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/dashboard.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/dashboard.css Sun Aug 11 12:19:13 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;
@@ -94,24 +113,25 @@
display: none;
}
-#content #dashboard #dataimport
+#content #dashboard #instance
{
float: right;
}
+#content #dashboard #instance .dir_impl
+{
+ margin-top: 10px;
+}
#content #dashboard #admin-extra
{
- float: right;
+ float: left;
}
-#content #dashboard #system h2 { background-image: url( ../../img/ico/server.png ); }
-#content #dashboard #statistics h2 { background-image: url( ../../img/ico/chart.png ); }
-#content #dashboard #replication h2 { background-image: url( ../../img/ico/node.png ); }
-#content #dashboard #replication.master h2 { background-image: url( ../../img/ico/node-master.png ); }
-#content #dashboard #replication.slave h2 { background-image: url( ../../img/ico/node-slave.png ); }
-#content #dashboard #dataimport h2 { background-image: url( ../../img/ico/document-import.png ); }
-#content #dashboard #admin-extra h2 { background-image: url( ../../img/ico/plus-button.png ); }
+#content #dashboard #healthcheck
+{
+ float: right;
+}
#content #dashboard #healthcheck .ico
{
@@ -125,3 +145,11 @@
{
background-image: url( ../../img/ico/tick.png );
}
+
+#content #dashboard #system h2 { background-image: url( ../../img/ico/server.png ); }
+#content #dashboard #statistics h2 { background-image: url( ../../img/ico/chart.png ); }
+#content #dashboard #replication h2 { background-image: url( ../../img/ico/node.png ); }
+#content #dashboard #replication.master h2 { background-image: url( ../../img/ico/node-master.png ); }
+#content #dashboard #replication.slave h2 { background-image: url( ../../img/ico/node-slave.png ); }
+#content #dashboard #instance h2 { background-image: url( ../../img/ico/server.png ); }
+#content #dashboard #admin-extra h2 { background-image: url( ../../img/ico/plus-button.png ); }
\ No newline at end of file
Modified: lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/dataimport.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/dataimport.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/dataimport.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/dataimport.css Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/css/styles/index.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/index.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/index.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/index.css Sun Aug 11 12:19:13 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;
@@ -128,8 +147,6 @@
#content #index #instance h2 { background-image: url( ../../img/ico/server.png ); }
#content #index #instance .start_time dt span { background-image: url( ../../img/ico/clock-select.png ); }
-#content #index #instance .host dt span { background-image: url( ../../img/ico/globe.png ); }
-#content #index #instance .dir dt span { background-image: url( ../../img/ico/folder.png ); }
#content #index #versions h2 { background-image: url( ../../img/ico/property.png ); }
#content #index #versions .solr span { background-image: url( ../../img/solr-ico.png ); }
@@ -187,4 +204,4 @@
#content #index #jvm-memory-bar
{
margin-top: 20px;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/java-properties.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/java-properties.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/java-properties.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/java-properties.css Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/css/styles/logging.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/logging.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/logging.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/logging.css Sun Aug 11 12:19:13 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%;
@@ -193,6 +212,13 @@
padding-right: 21px;
}
+#content #logging .jstree a span.name em
+{
+ color: #f00;
+ font-style: normal;
+ text-transform: uppercase;
+}
+
#content #logging .jstree a.trigger.set
{
font-weight: bold;
@@ -224,6 +250,7 @@
#content #logging .jstree li li li li li .selector-holder { left: 368px; }
#content #logging .jstree li li li li li li .selector-holder { left: 350px; }
#content #logging .jstree li li li li li li li .selector-holder { left: 332px; }
+#content #logging .jstree li li li li li li li li .selector-holder { left: 314px; }
#content #logging .jstree .selector
{
@@ -325,4 +352,4 @@
{
background-image: url( ../../img/ico/cross-1.png );
color: #800;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/menu.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/menu.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/menu.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/menu.css Sun Aug 11 12:19:13 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;
@@ -35,6 +54,22 @@
width: 100%;
}
+#core-selector #has-no-cores
+{
+ display: none;
+}
+
+#core-selector #has-no-cores a
+{
+ background-image: url( ../../img/ico/database--plus.png );
+}
+
+#core-selector #has-no-cores span
+{
+ color: #c0c0c0;
+ display: block;
+}
+
#menu-wrapper .active p
{
background-color: #fafafa;
@@ -239,6 +274,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 +320,4 @@
{
background-color: #e0e0e0;
font-weight: bold;
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/plugins.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/plugins.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/plugins.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/plugins.css Sun Aug 11 12:19:13 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%;
@@ -9,6 +28,7 @@
#content #plugins #navigation .highlighting a { background-image: url( ../../img/ico/highlighter-text.png ); }
#content #plugins #navigation .updatehandler a{ background-image: url( ../../img/ico/arrow-circle.png ); }
#content #plugins #navigation .queryhandler a { background-image: url( ../../img/ico/magnifier.png ); }
+#content #plugins #navigation .queryparser a { background-image: url( ../../img/ico/asterisk.png ); }
#content #plugins #navigation .PLUGINCHANGES { margin-top: 20px; }
#content #plugins #navigation .PLUGINCHANGES a { background-image: url( ../../img/ico/eye.png ); }
@@ -172,4 +192,4 @@
#recording button span
{
background-image: url( ../../img/ico/new-text.png );
-}
\ No newline at end of file
+}
Modified: lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/query.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/query.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/query.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/query.css Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/css/styles/replication.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/replication.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/replication.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/replication.css Sun Aug 11 12:19:13 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/lucene4956/solr/webapp/web/css/styles/schema-browser.css
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/schema-browser.css?rev=1512909&r1=1512908&r2=1512909&view=diff
==============================================================================
--- lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/schema-browser.css (original)
+++ lucene/dev/branches/lucene4956/solr/webapp/web/css/styles/schema-browser.css Sun Aug 11 12:19:13 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
+}