From 57913c04ed7659ce94631e24b69ec2de684e93a6 Mon Sep 17 00:00:00 2001 From: bgrozev Date: Wed, 11 Dec 2024 10:25:32 -0600 Subject: [PATCH] ref: Split jicoco into -jetty, -mucclient and -health-checker. (#213) --- .../checkstyle.xml | 0 jicoco-health-checker/pom.xml | 119 ++++++++++ .../kotlin/org/jitsi/health/HealthChecker.kt | 0 jicoco-jetty/checkstyle.xml | 37 +++ {jicoco => jicoco-jetty}/pom.xml | 31 +-- .../java/org/jitsi/meet/ShutdownService.java | 0 .../src/main/java/org/jitsi/rest/Health.java | 0 .../src/main/java/org/jitsi/rest/Version.java | 0 .../jitsi/rest/JettyBundleActivatorConfig.kt | 0 .../kotlin/org/jitsi/rest/JettyHelpers.kt | 0 .../org/jitsi/shutdown/ShutdownServiceImpl.kt | 0 .../test/java/org/jitsi/rest/HealthTest.java | 0 .../test/java/org/jitsi/rest/VersionTest.java | 0 .../jitsi/shutdown/ShutdownServiceImplTest.kt | 0 jicoco-mucclient/checkstyle.xml | 37 +++ jicoco-mucclient/pom.xml | 223 ++++++++++++++++++ .../java/org/jitsi/retry/RetryStrategy.java | 0 .../main/java/org/jitsi/retry/RetryTask.java | 0 .../java/org/jitsi/retry/SimpleRetryTask.java | 0 .../jitsi/xmpp/TrustAllHostnameVerifier.java | 0 .../jitsi/xmpp/TrustAllX509TrustManager.java | 0 .../mucclient/ConnectionStateListener.java | 0 .../org/jitsi/xmpp/mucclient/IQListener.java | 0 .../org/jitsi/xmpp/mucclient/MucClient.java | 0 .../mucclient/MucClientConfiguration.java | 0 .../xmpp/mucclient/MucClientManager.java | 0 .../kotlin/org/jitsi/xmpp/util/ErrorUtil.kt | 0 .../org/jitsi/retry/RetryStrategyTest.java | 0 .../src/main/java/org/jitsi/cmd/CmdLine.java | 180 -------------- .../java/org/jitsi/cmd/ParseException.java | 34 --- .../java/org/jitsi/cmd/CmdLineArgsTest.java | 85 ------- pom.xml | 8 +- 32 files changed, 430 insertions(+), 324 deletions(-) rename {jicoco => jicoco-health-checker}/checkstyle.xml (100%) create mode 100644 jicoco-health-checker/pom.xml rename {jicoco => jicoco-health-checker}/src/main/kotlin/org/jitsi/health/HealthChecker.kt (100%) create mode 100644 jicoco-jetty/checkstyle.xml rename {jicoco => jicoco-jetty}/pom.xml (92%) rename {jicoco => jicoco-jetty}/src/main/java/org/jitsi/meet/ShutdownService.java (100%) rename {jicoco => jicoco-jetty}/src/main/java/org/jitsi/rest/Health.java (100%) rename {jicoco => jicoco-jetty}/src/main/java/org/jitsi/rest/Version.java (100%) rename {jicoco => jicoco-jetty}/src/main/kotlin/org/jitsi/rest/JettyBundleActivatorConfig.kt (100%) rename {jicoco => jicoco-jetty}/src/main/kotlin/org/jitsi/rest/JettyHelpers.kt (100%) rename {jicoco => jicoco-jetty}/src/main/kotlin/org/jitsi/shutdown/ShutdownServiceImpl.kt (100%) rename {jicoco => jicoco-jetty}/src/test/java/org/jitsi/rest/HealthTest.java (100%) rename {jicoco => jicoco-jetty}/src/test/java/org/jitsi/rest/VersionTest.java (100%) rename {jicoco => jicoco-jetty}/src/test/kotlin/org/jitsi/shutdown/ShutdownServiceImplTest.kt (100%) create mode 100644 jicoco-mucclient/checkstyle.xml create mode 100644 jicoco-mucclient/pom.xml rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/retry/RetryStrategy.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/retry/RetryTask.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/retry/SimpleRetryTask.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/xmpp/TrustAllHostnameVerifier.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/xmpp/TrustAllX509TrustManager.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/xmpp/mucclient/ConnectionStateListener.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/xmpp/mucclient/IQListener.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/xmpp/mucclient/MucClientConfiguration.java (100%) rename {jicoco => jicoco-mucclient}/src/main/java/org/jitsi/xmpp/mucclient/MucClientManager.java (100%) rename {jicoco => jicoco-mucclient}/src/main/kotlin/org/jitsi/xmpp/util/ErrorUtil.kt (100%) rename {jicoco => jicoco-mucclient}/src/test/java/org/jitsi/retry/RetryStrategyTest.java (100%) delete mode 100644 jicoco/src/main/java/org/jitsi/cmd/CmdLine.java delete mode 100644 jicoco/src/main/java/org/jitsi/cmd/ParseException.java delete mode 100644 jicoco/src/test/java/org/jitsi/cmd/CmdLineArgsTest.java diff --git a/jicoco/checkstyle.xml b/jicoco-health-checker/checkstyle.xml similarity index 100% rename from jicoco/checkstyle.xml rename to jicoco-health-checker/checkstyle.xml diff --git a/jicoco-health-checker/pom.xml b/jicoco-health-checker/pom.xml new file mode 100644 index 00000000..ee876a36 --- /dev/null +++ b/jicoco-health-checker/pom.xml @@ -0,0 +1,119 @@ + + + + + 4.0.0 + + + org.jitsi + jicoco-parent + 1.1-SNAPSHOT + + + jicoco-health-checker + 1.1-SNAPSHOT + jicoco-health-checker + Jitsi Common Components - Health Checker + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + + + + ${project.groupId} + jitsi-utils + + + + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + compile + + compile + + + + src/main/kotlin + + + + + test-compile + test-compile + + test-compile + + + + src/test/kotlin + src/test/java + + + + + + 11 + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + + default-compile + none + + + default-testCompile + none + + + java-compile + compile + + compile + + + + java-test-compile + test-compile + + testCompile + + + + + 11 + + -Xlint:all,-serial + + + + + + diff --git a/jicoco/src/main/kotlin/org/jitsi/health/HealthChecker.kt b/jicoco-health-checker/src/main/kotlin/org/jitsi/health/HealthChecker.kt similarity index 100% rename from jicoco/src/main/kotlin/org/jitsi/health/HealthChecker.kt rename to jicoco-health-checker/src/main/kotlin/org/jitsi/health/HealthChecker.kt diff --git a/jicoco-jetty/checkstyle.xml b/jicoco-jetty/checkstyle.xml new file mode 100644 index 00000000..8b1229c0 --- /dev/null +++ b/jicoco-jetty/checkstyle.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jicoco/pom.xml b/jicoco-jetty/pom.xml similarity index 92% rename from jicoco/pom.xml rename to jicoco-jetty/pom.xml index 2365e371..f32ff613 100644 --- a/jicoco/pom.xml +++ b/jicoco-jetty/pom.xml @@ -26,10 +26,10 @@ 1.1-SNAPSHOT - jicoco + jicoco-jetty 1.1-SNAPSHOT - jicoco - Jitsi Common Components + jicoco-jetty + Jitsi Common Components - Jetty Helpers and Wrappers @@ -66,26 +66,6 @@ jcl-core 2.8 - - org.igniterealtime.smack - smack-core - ${smack.version} - - - org.igniterealtime.smack - smack-extensions - ${smack.version} - - - org.igniterealtime.smack - smack-tcp - ${smack.version} - - - org.igniterealtime.smack - smack-xmlparser-stax - ${smack.version} - org.glassfish.jersey.containers jersey-container-jetty-http @@ -132,6 +112,11 @@ jicoco-config ${project.version} + + ${project.groupId} + jicoco-health-checker + ${project.version} + diff --git a/jicoco/src/main/java/org/jitsi/meet/ShutdownService.java b/jicoco-jetty/src/main/java/org/jitsi/meet/ShutdownService.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/meet/ShutdownService.java rename to jicoco-jetty/src/main/java/org/jitsi/meet/ShutdownService.java diff --git a/jicoco/src/main/java/org/jitsi/rest/Health.java b/jicoco-jetty/src/main/java/org/jitsi/rest/Health.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/rest/Health.java rename to jicoco-jetty/src/main/java/org/jitsi/rest/Health.java diff --git a/jicoco/src/main/java/org/jitsi/rest/Version.java b/jicoco-jetty/src/main/java/org/jitsi/rest/Version.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/rest/Version.java rename to jicoco-jetty/src/main/java/org/jitsi/rest/Version.java diff --git a/jicoco/src/main/kotlin/org/jitsi/rest/JettyBundleActivatorConfig.kt b/jicoco-jetty/src/main/kotlin/org/jitsi/rest/JettyBundleActivatorConfig.kt similarity index 100% rename from jicoco/src/main/kotlin/org/jitsi/rest/JettyBundleActivatorConfig.kt rename to jicoco-jetty/src/main/kotlin/org/jitsi/rest/JettyBundleActivatorConfig.kt diff --git a/jicoco/src/main/kotlin/org/jitsi/rest/JettyHelpers.kt b/jicoco-jetty/src/main/kotlin/org/jitsi/rest/JettyHelpers.kt similarity index 100% rename from jicoco/src/main/kotlin/org/jitsi/rest/JettyHelpers.kt rename to jicoco-jetty/src/main/kotlin/org/jitsi/rest/JettyHelpers.kt diff --git a/jicoco/src/main/kotlin/org/jitsi/shutdown/ShutdownServiceImpl.kt b/jicoco-jetty/src/main/kotlin/org/jitsi/shutdown/ShutdownServiceImpl.kt similarity index 100% rename from jicoco/src/main/kotlin/org/jitsi/shutdown/ShutdownServiceImpl.kt rename to jicoco-jetty/src/main/kotlin/org/jitsi/shutdown/ShutdownServiceImpl.kt diff --git a/jicoco/src/test/java/org/jitsi/rest/HealthTest.java b/jicoco-jetty/src/test/java/org/jitsi/rest/HealthTest.java similarity index 100% rename from jicoco/src/test/java/org/jitsi/rest/HealthTest.java rename to jicoco-jetty/src/test/java/org/jitsi/rest/HealthTest.java diff --git a/jicoco/src/test/java/org/jitsi/rest/VersionTest.java b/jicoco-jetty/src/test/java/org/jitsi/rest/VersionTest.java similarity index 100% rename from jicoco/src/test/java/org/jitsi/rest/VersionTest.java rename to jicoco-jetty/src/test/java/org/jitsi/rest/VersionTest.java diff --git a/jicoco/src/test/kotlin/org/jitsi/shutdown/ShutdownServiceImplTest.kt b/jicoco-jetty/src/test/kotlin/org/jitsi/shutdown/ShutdownServiceImplTest.kt similarity index 100% rename from jicoco/src/test/kotlin/org/jitsi/shutdown/ShutdownServiceImplTest.kt rename to jicoco-jetty/src/test/kotlin/org/jitsi/shutdown/ShutdownServiceImplTest.kt diff --git a/jicoco-mucclient/checkstyle.xml b/jicoco-mucclient/checkstyle.xml new file mode 100644 index 00000000..8b1229c0 --- /dev/null +++ b/jicoco-mucclient/checkstyle.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/jicoco-mucclient/pom.xml b/jicoco-mucclient/pom.xml new file mode 100644 index 00000000..b0be935e --- /dev/null +++ b/jicoco-mucclient/pom.xml @@ -0,0 +1,223 @@ + + + + + 4.0.0 + + + org.jitsi + jicoco-parent + 1.1-SNAPSHOT + + + jicoco-mucclient + 1.1-SNAPSHOT + jicoco-mucclient + Jitsi Common Components - MucClient + + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + + + org.igniterealtime.smack + smack-core + ${smack.version} + + + org.igniterealtime.smack + smack-extensions + ${smack.version} + + + org.igniterealtime.smack + smack-tcp + ${smack.version} + + + org.igniterealtime.smack + smack-xmlparser-stax + ${smack.version} + + + + ${project.groupId} + jitsi-utils + + + ${project.groupId} + jicoco-config + ${project.version} + + + + + org.junit.platform + junit-platform-launcher + 1.10.0 + test + + + org.junit.jupiter + junit-jupiter-api + ${junit.version} + test + + + org.junit.jupiter + junit-jupiter-engine + ${junit.version} + test + + + org.glassfish.jersey.test-framework + jersey-test-framework-core + ${jersey.version} + test + + + junit + junit + + + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-jetty + ${jersey.version} + test + + + junit + junit + + + + + org.glassfish.jersey.test-framework.providers + jersey-test-framework-provider-grizzly2 + ${jersey.version} + test + + + junit + junit + + + + + + + + org.jetbrains.kotlin + kotlin-maven-plugin + ${kotlin.version} + + + compile + compile + + compile + + + + src/main/kotlin + src/main/java + + + + + test-compile + test-compile + + test-compile + + + + src/test/kotlin + src/test/java + + + + + + 11 + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.10.1 + + + default-compile + none + + + default-testCompile + none + + + java-compile + compile + + compile + + + + java-test-compile + test-compile + + testCompile + + + + + 11 + + -Xlint:all,-serial + + + + + org.apache.maven.plugins + maven-checkstyle-plugin + 3.1.2 + + checkstyle.xml + + + + com.puppycrawl.tools + checkstyle + 10.1 + + + + + + check + + + + + + + diff --git a/jicoco/src/main/java/org/jitsi/retry/RetryStrategy.java b/jicoco-mucclient/src/main/java/org/jitsi/retry/RetryStrategy.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/retry/RetryStrategy.java rename to jicoco-mucclient/src/main/java/org/jitsi/retry/RetryStrategy.java diff --git a/jicoco/src/main/java/org/jitsi/retry/RetryTask.java b/jicoco-mucclient/src/main/java/org/jitsi/retry/RetryTask.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/retry/RetryTask.java rename to jicoco-mucclient/src/main/java/org/jitsi/retry/RetryTask.java diff --git a/jicoco/src/main/java/org/jitsi/retry/SimpleRetryTask.java b/jicoco-mucclient/src/main/java/org/jitsi/retry/SimpleRetryTask.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/retry/SimpleRetryTask.java rename to jicoco-mucclient/src/main/java/org/jitsi/retry/SimpleRetryTask.java diff --git a/jicoco/src/main/java/org/jitsi/xmpp/TrustAllHostnameVerifier.java b/jicoco-mucclient/src/main/java/org/jitsi/xmpp/TrustAllHostnameVerifier.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/xmpp/TrustAllHostnameVerifier.java rename to jicoco-mucclient/src/main/java/org/jitsi/xmpp/TrustAllHostnameVerifier.java diff --git a/jicoco/src/main/java/org/jitsi/xmpp/TrustAllX509TrustManager.java b/jicoco-mucclient/src/main/java/org/jitsi/xmpp/TrustAllX509TrustManager.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/xmpp/TrustAllX509TrustManager.java rename to jicoco-mucclient/src/main/java/org/jitsi/xmpp/TrustAllX509TrustManager.java diff --git a/jicoco/src/main/java/org/jitsi/xmpp/mucclient/ConnectionStateListener.java b/jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/ConnectionStateListener.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/xmpp/mucclient/ConnectionStateListener.java rename to jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/ConnectionStateListener.java diff --git a/jicoco/src/main/java/org/jitsi/xmpp/mucclient/IQListener.java b/jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/IQListener.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/xmpp/mucclient/IQListener.java rename to jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/IQListener.java diff --git a/jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java b/jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java rename to jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/MucClient.java diff --git a/jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClientConfiguration.java b/jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/MucClientConfiguration.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClientConfiguration.java rename to jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/MucClientConfiguration.java diff --git a/jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClientManager.java b/jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/MucClientManager.java similarity index 100% rename from jicoco/src/main/java/org/jitsi/xmpp/mucclient/MucClientManager.java rename to jicoco-mucclient/src/main/java/org/jitsi/xmpp/mucclient/MucClientManager.java diff --git a/jicoco/src/main/kotlin/org/jitsi/xmpp/util/ErrorUtil.kt b/jicoco-mucclient/src/main/kotlin/org/jitsi/xmpp/util/ErrorUtil.kt similarity index 100% rename from jicoco/src/main/kotlin/org/jitsi/xmpp/util/ErrorUtil.kt rename to jicoco-mucclient/src/main/kotlin/org/jitsi/xmpp/util/ErrorUtil.kt diff --git a/jicoco/src/test/java/org/jitsi/retry/RetryStrategyTest.java b/jicoco-mucclient/src/test/java/org/jitsi/retry/RetryStrategyTest.java similarity index 100% rename from jicoco/src/test/java/org/jitsi/retry/RetryStrategyTest.java rename to jicoco-mucclient/src/test/java/org/jitsi/retry/RetryStrategyTest.java diff --git a/jicoco/src/main/java/org/jitsi/cmd/CmdLine.java b/jicoco/src/main/java/org/jitsi/cmd/CmdLine.java deleted file mode 100644 index bb00a271..00000000 --- a/jicoco/src/main/java/org/jitsi/cmd/CmdLine.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright @ 2015 - present, 8x8 Inc - * - * Licensed 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.jitsi.cmd; - - -import org.jitsi.utils.logging.*; - -import java.util.*; - -/** - * Utility class for parsing command line arguments that take some value. - * Arguments can have one of the following formats: - *
    - *
  • "arg=value"
  • - *
  • "-arg=value"
  • - *
  • "--arg=value"
  • - *
- * It's also possible to specify required arguments. If any of required - * arguments is not found {@link ParseException} will be thrown by - * {@link #parse(String[])}. - * - * @author Pawel Domas - */ -public class CmdLine -{ - /** - * The logger - */ - private final static Logger logger = Logger.getLogger(CmdLine.class); - - /** - * Map of argument values. - */ - private Map argMap = new HashMap(); - - /** - * The list of required arguments. - */ - private List requiredArgs = new ArrayList(); - - /** - * Adds argument name to the list of required arguments. - * @param reqArg "arg", "-arg" or "--arg" argument name to be added. - */ - public void addRequiredArgument(String reqArg) - { - reqArg = cleanHyphens(reqArg); - - if (!requiredArgs.contains(reqArg)) - requiredArgs.add(reqArg); - } - - /** - * Removes given argument name from the list of required arguments. - * @param reqArg "arg", "-arg" or "--arg" argument name. - */ - public void removeRequiredArgument(String reqArg) - { - reqArg = cleanHyphens(reqArg); - - requiredArgs.remove(reqArg); - } - - /** - * Returns the list of required arguments. Names are stripped from hyphens. - */ - public List getRequiredArguments() - { - return Collections.unmodifiableList(requiredArgs); - } - - private String cleanHyphens(String arg) - { - if (arg.startsWith("--")) - return arg.substring(2); - else if (arg.startsWith("-")) - return arg.substring(1); - else - return arg; - } - - /** - * Parses the array of command line arguments. - * - * @param args String array which should come from the "main" method. - * - * @throws ParseException if any of required arguments has not been found - * in args. - */ - public void parse(String[] args) throws ParseException - { - for (String arg : args) - { - arg = cleanHyphens(arg); - - int eqIdx = arg.indexOf("="); - if (eqIdx <= 0) - { - logger.warn("Skipped invalid cmd line argument: " + arg); - continue; - } - else if (eqIdx == arg.length() - 1) - { - logger.warn("Skipped empty cmd line argument: " + arg); - continue; - } - - String key = arg.substring(0, eqIdx); - String val = arg.substring(eqIdx+1); - argMap.put(key, val); - } - - List leftReqArgs = new ArrayList(requiredArgs); - leftReqArgs.removeAll(argMap.keySet()); - if (!leftReqArgs.isEmpty()) - { - throw new ParseException( - "Some of required arguments were not specified: " - + leftReqArgs.toString()); - } - } - - /** - * Returns the value of cmd line argument for given name. null - * if there was no value or it was empty. - * @param opt the name of command line argument which value we want to get. - */ - public String getOptionValue(String opt) - { - return argMap.get(cleanHyphens(opt)); - } - - /** - * Returns the value of cmd line argument for given name. - * defaultValue if there was no value or it was empty. - * @param opt the name of command line argument which value we want to get. - * @param defaultValue the default value which should be returned if the - * argument value is missing. - */ - public String getOptionValue(String opt, String defaultValue) - { - String val = getOptionValue(opt); - return val != null ? val : defaultValue; - } - - /** - * Returns int value of cmd line argument for given name. - * defaultValue if there was no valid value for that argument. - * @param opt the name of command line argument which value we want to get. - * @param defaultValue the default value which should be returned if the - * argument value is missing. - */ - public int getIntOptionValue(String opt, int defaultValue) - { - String val = getOptionValue(opt); - if (val == null) - return defaultValue; - try - { - return Integer.parseInt(val); - } - catch (NumberFormatException fmt) - { - return defaultValue; - } - } -} diff --git a/jicoco/src/main/java/org/jitsi/cmd/ParseException.java b/jicoco/src/main/java/org/jitsi/cmd/ParseException.java deleted file mode 100644 index 3a5d0362..00000000 --- a/jicoco/src/main/java/org/jitsi/cmd/ParseException.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright @ 2015 - present, 8x8 Inc - * - * Licensed 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.jitsi.cmd; - -/** - * An exception thrown when unrecoverable parsing error occurs. - * - * @author Pawel Domas - */ -public class ParseException - extends Exception -{ - /** - * Creates new instance of ParseException. - * @param message parse exception message. - */ - public ParseException(String message) - { - super(message); - } -} diff --git a/jicoco/src/test/java/org/jitsi/cmd/CmdLineArgsTest.java b/jicoco/src/test/java/org/jitsi/cmd/CmdLineArgsTest.java deleted file mode 100644 index de3eeac9..00000000 --- a/jicoco/src/test/java/org/jitsi/cmd/CmdLineArgsTest.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright @ 2015 - present, 8x8 Inc - * - * Licensed 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.jitsi.cmd; - -import static org.junit.jupiter.api.Assertions.*; - -import org.junit.jupiter.api.*; - -public class CmdLineArgsTest -{ - /** - * A basic test for {@link CmdLine} class. - */ - @Test - public void testJvbArgs() - throws ParseException - { - String[] args = { - "--apis=xmpp,rest", - "-blablaarg=", - "--domain=example.com", - "-max-port=21000", - "secret=secretpass", - "--port=5275", - "somegarbagearg", - "-=dsf=" - }; - - // create the parser - CmdLine parser = new CmdLine(); - - // parse the command line arguments - parser.parse(args); - - assertEquals("example.com", parser.getOptionValue("domain")); - assertEquals(21000, parser.getIntOptionValue("max-port", 1)); - assertEquals("secretpass", parser.getOptionValue("secret")); - assertEquals(5275, parser.getIntOptionValue("port", 1)); - assertEquals("xmpp,rest", parser.getOptionValue("apis")); - - // Default value - assertEquals( - "localhost", parser.getOptionValue("host", "localhost")); - - // Parsed default value - assertEquals(10000, parser.getIntOptionValue("min-port", 10000)); - } - - @Test - public void testRequiredArg() - { - String[] args = { "--min-port=23423" }; - - CmdLine parser = new CmdLine(); - - parser.addRequiredArgument("-max-port"); - parser.addRequiredArgument("min-port"); - - try - { - parser.parse(args); - - fail("Missed required argument"); - } - catch (ParseException e) - { - assertEquals( - "Some of required arguments were not specified: [max-port]", - e.getMessage()); - } - } -} diff --git a/pom.xml b/pom.xml index c1acbe34..56b46cb0 100644 --- a/pom.xml +++ b/pom.xml @@ -199,11 +199,13 @@ - jicoco jicoco-config + jicoco-health-checker + jicoco-jetty jicoco-jwt jicoco-mediajson jicoco-metrics + jicoco-mucclient jicoco-test-kotlin @@ -235,11 +237,13 @@ - jicoco jicoco-config + jicoco-health-checker + jicoco-jetty jicoco-jwt jicoco-mediajson jicoco-metrics + jicoco-mucclient jicoco-test-kotlin