Rename 'Main' to 'HttpClientLauncher'
diff --git a/src/test/java/org/apache/sling/uca/impl/AgentIT.java b/src/test/java/org/apache/sling/uca/impl/AgentIT.java
index 3a343ba..59240cd 100644
--- a/src/test/java/org/apache/sling/uca/impl/AgentIT.java
+++ b/src/test/java/org/apache/sling/uca/impl/AgentIT.java
@@ -34,7 +34,7 @@
import java.util.concurrent.TimeUnit;
import org.apache.commons.httpclient.ConnectTimeoutException;
-import org.apache.sling.uca.impl.Main.ClientType;
+import org.apache.sling.uca.impl.HttpClientLauncher.ClientType;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.EnumSource;
@@ -71,7 +71,7 @@
* @throws IOException various I/O problems
*/
@ParameterizedTest
- @EnumSource(Main.ClientType.class)
+ @EnumSource(HttpClientLauncher.ClientType.class)
public void connectTimeout(ClientType clientType) throws IOException {
RecordedThrowable error = assertTimeout(ofSeconds(5), () -> runTest("http://repo1.maven.org:81", clientType));
@@ -107,7 +107,7 @@
* @throws IOException various I/O problems
*/
@ParameterizedTest
- @EnumSource(Main.ClientType.class)
+ @EnumSource(HttpClientLauncher.ClientType.class)
public void readTimeout(ClientType clientType, MisbehavingServerControl server) throws IOException {
RecordedThrowable error = assertTimeout(ofSeconds(5), () -> runTest("http://localhost:" + server.getLocalPort(), clientType));
@@ -165,7 +165,7 @@
"-javaagent:" + jar +"=" + TimeUnit.SECONDS.toMillis(connectTimeoutSeconds) +"," + TimeUnit.SECONDS.toMillis(readTimeoutSeconds)+",v",
"-cp",
classPath,
- "org.apache.sling.uca.impl.Main",
+ HttpClientLauncher.class.getName(),
url.toString(),
clientType.toString()
);
diff --git a/src/test/java/org/apache/sling/uca/impl/Main.java b/src/test/java/org/apache/sling/uca/impl/HttpClientLauncher.java
similarity index 95%
rename from src/test/java/org/apache/sling/uca/impl/Main.java
rename to src/test/java/org/apache/sling/uca/impl/HttpClientLauncher.java
index aee0725..9d8ca73 100644
--- a/src/test/java/org/apache/sling/uca/impl/Main.java
+++ b/src/test/java/org/apache/sling/uca/impl/HttpClientLauncher.java
@@ -40,7 +40,10 @@
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
-public class Main {
+/**
+ * CLI interface to run HTTP clients
+ */
+public class HttpClientLauncher {
// TODO - write help messages with the values from this enum
public enum ClientType {
@@ -50,7 +53,7 @@
public static void main(String[] args) throws MalformedURLException, IOException {
if ( args.length != 2 )
- throw new IllegalArgumentException("Usage: java -cp ... " + Main.class.getName() + " <URL> JavaNet|HC3|HC4");
+ throw new IllegalArgumentException("Usage: java -cp ... " + HttpClientLauncher.class.getName() + " <URL> JavaNet|HC3|HC4");
System.out.println(new Date() + " [WEB] Executing request via " + args[1]);
@@ -65,7 +68,7 @@
runUsingHttpClient4(args[0]);
break;
default:
- throw new IllegalArgumentException("Usage: java -cp ... " + Main.class.getName() + " <URL> JavaNet|HC3|HC4");
+ throw new IllegalArgumentException("Usage: java -cp ... " + HttpClientLauncher.class.getName() + " <URL> JavaNet|HC3|HC4");
}
}