epugh commented on code in PR #5323:
URL: https://github.com/apache/solr/pull/5323#discussion_r4551624512


##########
solr/packaging/src/test/org/apache/solr/shell/CompressionTest.java:
##########
@@ -0,0 +1,88 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.solr.shell;
+
+import java.util.Map;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Port of {@code test_compression.bats}.
+ *
+ * <p>Kept close to the original, including the order of the tests and the 
text each asserts on.
+ * Where it differs:
+ *
+ * <ul>
+ *   <li>{@code curl -D -} becomes {@link #http}, so the header dump the 
original asserted on as
+ *       part of the body is asserted on as the response headers instead.
+ *   <li>{@code curl --compressed} becomes a request that asks for {@code 
Accept-Encoding}; the
+ *       harness decompresses the body the same way curl does.
+ *   <li>The original's {@code solr start -e films} is deliberately not used: 
on Windows {@code
+ *       RunExampleTool#startSolr} drops every {@code SOLR_*} variable from 
the spawned node's
+ *       environment, so the node cannot be discovered or stopped and the 
suite would be bash-only
+ *       for a reason unrelated to what it tests (see {@code SnapshotsTest}). 
These tests only need
+ *       a collection with enough documents that a response exceeds Jetty's 
2048-byte {@code
+ *       minGzipSize}, so a plain start, {@code solr create} and {@code solr 
post} of the example
+ *       docs stand in.
+ *   <li>The first two tests also assert the status, and the second and third 
that the negotiated
+ *       encoding really was gzip — the claim their names make.
+ * </ul>
+ */
+public class CompressionTest extends SolrShellTestCase {
+
+  private static final String COLLECTION = "compression_docs";

Review Comment:
   Yeah, it may totally be a taste thing.  I just don't like the indirection... 
  It makes copy/pasting harder, it's one more variable to keep in my mind that 
COLLECTION is `compression_docs`...     I often use the bats tests as ways to 
learn how solr works, (thinking of the rolling upgrade bats test as basically 
whre I learned how to do a rolling upgrade) and I liked how clear and simple it 
was.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to