[a-zA-Z0-9\\-]+)?\"");
+ public static String hostname() {
+ try {
+ return executeCommand("hostname").output();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
public static String capture(InputStream is)
throws IOException
{
@@ -72,7 +80,7 @@ public static ProcessState executeCommand(String command) throws IOException
return new ProcessState(pr, inputState, errorState);
}
- static class ProcessState {
+ public static class ProcessState {
private final Process process;
private final InputStreamPumpState inputState;
@@ -85,7 +93,7 @@ static class ProcessState {
this.errorState = errorState;
}
- private String output() {
+ public String output() {
return inputState.buffer.toString();
}
@@ -189,17 +197,6 @@ public static void clearResourceAlarm(String source) throws IOException {
rabbitmqctl("eval 'rabbit_alarm:clear_alarm({resource_limit, " + source + ", node()}).'");
}
- public static ProcessState invokeMakeTarget(String command) throws IOException {
- File rabbitmqctl = new File(rabbitmqctlCommand());
- return executeCommand(makeCommand() +
- " -C \'" + rabbitmqDir() + "\'" +
- " RABBITMQCTL=\'" + rabbitmqctl.getAbsolutePath() + "\'" +
- " RABBITMQ_NODENAME=\'" + nodenameA() + "\'" +
- " RABBITMQ_NODE_PORT=" + node_portA() +
- " RABBITMQ_CONFIG_FILE=\'" + config_fileA() + "\'" +
- " " + command);
- }
-
public static void startRabbitOnNode() throws IOException {
rabbitmqctl("start_app");
tryConnectFor(10_000);
@@ -210,7 +207,7 @@ public static void stopRabbitOnNode() throws IOException {
}
public static void tryConnectFor(int timeoutInMs) throws IOException {
- tryConnectFor(timeoutInMs, node_portA() == null ? 5672 : Integer.valueOf(node_portA()));
+ tryConnectFor(timeoutInMs, 5672);
}
public static void tryConnectFor(int timeoutInMs, int port) throws IOException {
@@ -245,15 +242,6 @@ public static String nodenameA()
return System.getProperty("test-broker.A.nodename");
}
- public static String node_portA()
- {
- return System.getProperty("test-broker.A.node_port");
- }
-
- public static String config_fileA()
- {
- return System.getProperty("test-broker.A.config_file");
- }
public static String nodenameB()
{
@@ -265,16 +253,8 @@ public static String node_portB()
return System.getProperty("test-broker.B.node_port");
}
- public static String config_fileB()
- {
- return System.getProperty("test-broker.B.config_file");
- }
-
public static String rabbitmqctlCommand() {
- String rabbitmqCtl = System.getProperty("rabbitmqctl.bin");
- if (rabbitmqCtl == null) {
- throw new IllegalStateException("Please define the rabbitmqctl.bin system property");
- }
+ String rabbitmqCtl = rabbitmqctl();
if (rabbitmqCtl.startsWith(DOCKER_PREFIX)) {
String containerId = rabbitmqCtl.split(":")[1];
return "docker exec " + containerId + " rabbitmqctl";
@@ -283,17 +263,13 @@ public static String rabbitmqctlCommand() {
}
}
- public static boolean isOnDocker() {
- String rabbitmqCtl = System.getProperty("rabbitmqctl.bin");
- if (rabbitmqCtl == null) {
- throw new IllegalStateException("Please define the rabbitmqctl.bin system property");
- }
- return rabbitmqCtl.startsWith(DOCKER_PREFIX);
+ private static String rabbitmqctl() {
+ return System.getProperty("rabbitmqctl.bin", "DOCKER:rabbitmq");
}
- public static String rabbitmqDir()
- {
- return System.getProperty("rabbitmq.dir");
+ public static boolean isOnDocker() {
+ String rabbitmqCtl = rabbitmqctl();
+ return rabbitmqCtl.startsWith(DOCKER_PREFIX);
}
public static void closeConnection(String pid) throws IOException {
diff --git a/src/test/resources/config.properties b/src/test/resources/config.properties
deleted file mode 100644
index 6562e2f80e..0000000000
--- a/src/test/resources/config.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-broker.hostname=localhost
-broker.port=5672
-broker.sslport=5671
diff --git a/src/test/resources/hare@localhost.config b/src/test/resources/hare@localhost.config
deleted file mode 100644
index 41667a9c70..0000000000
--- a/src/test/resources/hare@localhost.config
+++ /dev/null
@@ -1,15 +0,0 @@
-% vim:ft=erlang:
-
-[
- {rabbit, [
- {ssl_listeners, [5670]},
- {ssl_options, [
- {cacertfile, "${test-tls-certs.dir}/testca/cacert.pem"},
- {certfile, "${test-tls-certs.dir}/server/cert.pem"},
- {keyfile, "${test-tls-certs.dir}/server/key.pem"},
- {verify, verify_peer},
- {fail_if_no_peer_cert, false},
- {honor_cipher_order, true}]},
- {auth_mechanisms, ['PLAIN', 'ANONYMOUS', 'AMQPLAIN', 'EXTERNAL', 'RABBIT-CR-DEMO']}
- ]}
-].
diff --git a/src/test/resources/log4j2-test.properties b/src/test/resources/log4j2-test.properties
deleted file mode 100644
index b7e0a68699..0000000000
--- a/src/test/resources/log4j2-test.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-status = error
-dest = err
-name = PropertiesConfig
-
-appender.console.type = Console
-appender.console.name = STDOUT
-appender.console.layout.type = PatternLayout
-appender.console.layout.pattern = %m%n
-
-logger.com.rabbitmq.level = info
-rootLogger.level = error
-rootLogger.appenderRef.stdout.ref = STDOUT
\ No newline at end of file
diff --git a/src/test/resources/rabbit@localhost.config b/src/test/resources/rabbit@localhost.config
deleted file mode 100644
index 9e3b77c94d..0000000000
--- a/src/test/resources/rabbit@localhost.config
+++ /dev/null
@@ -1,15 +0,0 @@
-% vim:ft=erlang:
-
-[
- {rabbit, [
- {ssl_listeners, [5671]},
- {ssl_options, [
- {cacertfile, "${test-tls-certs.dir}/testca/cacert.pem"},
- {certfile, "${test-tls-certs.dir}/server/cert.pem"},
- {keyfile, "${test-tls-certs.dir}/server/key.pem"},
- {verify, verify_peer},
- {fail_if_no_peer_cert, false},
- {honor_cipher_order, true}]},
- {auth_mechanisms, ['PLAIN', 'ANONYMOUS', 'AMQPLAIN', 'EXTERNAL', 'RABBIT-CR-DEMO']}
- ]}
-].
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy