You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2022/05/16 19:41:07 UTC
[GitHub] [jackrabbit-oak] fabriziofortino commented on a diff in pull request #568: Oak 9686
fabriziofortino commented on code in PR #568:
URL: https://github.com/apache/jackrabbit-oak/pull/568#discussion_r874091647
##########
oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticTestServer.java:
##########
@@ -141,4 +142,20 @@ private void checkIfDockerClientAvailable() {
assumeNotNull(client);
}
+ /**
+ * Launches an Elasticsearch Test Server to re-use among several tests.
+ * @param args
+ */
+ public static void main(String[] args){
+ ElasticsearchContainer esContainer = ElasticTestServer.getESTestServer();
+ try {
+ System.out.println("Docker container with Elasticsearch launched at \""+esContainer.getHttpHostAddress()+
Review Comment:
```suggestion
System.out.println("Docker container with Elasticsearch launched at \"" + esContainer.getHttpHostAddress() +
```
##########
oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticTestServer.java:
##########
@@ -141,4 +142,20 @@ private void checkIfDockerClientAvailable() {
assumeNotNull(client);
}
+ /**
+ * Launches an Elasticsearch Test Server to re-use among several tests.
+ * @param args
Review Comment:
remove since no args are supported
```suggestion
```
##########
oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticTestServer.java:
##########
@@ -141,4 +142,20 @@ private void checkIfDockerClientAvailable() {
assumeNotNull(client);
}
+ /**
+ * Launches an Elasticsearch Test Server to re-use among several tests.
+ * @param args
+ */
+ public static void main(String[] args){
+ ElasticsearchContainer esContainer = ElasticTestServer.getESTestServer();
+ try {
+ System.out.println("Docker container with Elasticsearch launched at \""+esContainer.getHttpHostAddress()+
+ "\". Please PRESS ENTER to stop it...");
+ System.in.read();
+ esContainer.stop();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
Review Comment:
since you are just wrapping the exception in a RuntimeException, you could remove the try-catch block and add the throws in the method declaration
##########
oak-search-elastic/src/test/java/org/apache/jackrabbit/oak/plugins/index/elastic/ElasticTestServer.java:
##########
@@ -16,18 +16,19 @@
*/
package org.apache.jackrabbit.oak.plugins.index.elastic;
+import co.elastic.clients.transport.Version;
import com.github.dockerjava.api.DockerClient;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.jackrabbit.oak.commons.IOUtils;
-import org.elasticsearch.Version;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.DockerClientFactory;
import org.testcontainers.containers.Network;
import org.testcontainers.elasticsearch.ElasticsearchContainer;
+import org.testcontainers.shaded.org.bouncycastle.asn1.x509.qualified.ETSIQCObjectIdentifiers;
Review Comment:
unused
```suggestion
```
--
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: dev-unsubscribe@jackrabbit.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org