You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2015/03/07 06:46:57 UTC

svn commit: r1664795 - in /lucene/dev/trunk/solr/core/src/test-files/runtimecode: ./ RuntimeLibReqHandler.java RuntimeLibResponseWriter.java RuntimeLibSearchComponent.java runtimelibs.jar runtimelibs_v2.jar

Author: noble
Date: Sat Mar  7 05:46:57 2015
New Revision: 1664795

URL: http://svn.apache.org/r1664795
Log:
SOLR-7073: test files required for the feature

Added:
    lucene/dev/trunk/solr/core/src/test-files/runtimecode/
    lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibReqHandler.java   (with props)
    lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibResponseWriter.java   (with props)
    lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibSearchComponent.java   (with props)
    lucene/dev/trunk/solr/core/src/test-files/runtimecode/runtimelibs.jar   (with props)
    lucene/dev/trunk/solr/core/src/test-files/runtimecode/runtimelibs_v2.jar   (with props)

Added: lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibReqHandler.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibReqHandler.java?rev=1664795&view=auto
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibReqHandler.java (added)
+++ lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibReqHandler.java Sat Mar  7 05:46:57 2015
@@ -0,0 +1,35 @@
+package runtimecode;
+
+/*
+ * 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.
+ */
+
+import java.io.IOException;
+
+import org.apache.solr.handler.DumpRequestHandler;
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.SolrQueryResponse;
+
+
+public class RuntimeLibReqHandler extends DumpRequestHandler {
+  @Override
+  public void handleRequestBody(SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
+    super.handleRequestBody(req, rsp);
+    rsp.add("class", this.getClass().getName());
+    rsp.add("loader",  getClass().getClassLoader().getClass().getName() );
+
+  }
+}

Added: lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibResponseWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibResponseWriter.java?rev=1664795&view=auto
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibResponseWriter.java (added)
+++ lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibResponseWriter.java Sat Mar  7 05:46:57 2015
@@ -0,0 +1,35 @@
+package runtimecode;
+
+/*
+ * 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.
+ */
+
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.solr.request.SolrQueryRequest;
+import org.apache.solr.response.JSONResponseWriter;
+import org.apache.solr.response.SolrQueryResponse;
+
+public class RuntimeLibResponseWriter extends JSONResponseWriter {
+  @Override
+  public void write(Writer writer, SolrQueryRequest req, SolrQueryResponse rsp) throws IOException {
+    rsp.add("wt", RuntimeLibResponseWriter.class.getName());
+    rsp.add("loader",  getClass().getClassLoader().getClass().getName() );
+
+    super.write(writer, req, rsp);
+  }
+}

Added: lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibSearchComponent.java
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibSearchComponent.java?rev=1664795&view=auto
==============================================================================
--- lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibSearchComponent.java (added)
+++ lucene/dev/trunk/solr/core/src/test-files/runtimecode/RuntimeLibSearchComponent.java Sat Mar  7 05:46:57 2015
@@ -0,0 +1,39 @@
+package runtimecode;
+
+/*
+ * 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.
+ */
+
+
+import java.io.IOException;
+
+import org.apache.solr.common.params.SolrParams;
+import org.apache.solr.handler.component.RealTimeGetComponent;
+import org.apache.solr.handler.component.ResponseBuilder;
+
+public class RuntimeLibSearchComponent extends RealTimeGetComponent {
+  @Override
+  public void prepare(ResponseBuilder rb) throws IOException {
+    SolrParams params = rb.req.getParams();
+
+    if (params.getBool(COMPONENT_NAME, true)) {
+      rb.rsp.add(COMPONENT_NAME, RuntimeLibSearchComponent.class.getName());
+      rb.rsp.add("loader",  getClass().getClassLoader().getClass().getName() );
+      rb.rsp.add("Version", "2" );
+    }
+    super.process(rb);
+  }
+}

Added: lucene/dev/trunk/solr/core/src/test-files/runtimecode/runtimelibs.jar
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/runtimecode/runtimelibs.jar?rev=1664795&view=auto
==============================================================================
Binary file - no diff available.

Added: lucene/dev/trunk/solr/core/src/test-files/runtimecode/runtimelibs_v2.jar
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/src/test-files/runtimecode/runtimelibs_v2.jar?rev=1664795&view=auto
==============================================================================
Binary file - no diff available.