5 Commits

Author SHA1 Message Date
e0fde434df Merge branch 'develop' into feature/jakrtaee10
# Conflicts:
#	configuration/pom.xml
#	db/pom.xml
#	jeeutil/pom.xml
#	network/pom.xml
#	poi-util/pom.xml
#	pom.xml
#	util/pom.xml
2024-02-16 00:05:01 +01:00
31aea194df [maven-release-plugin] prepare for next development iteration 2023-12-10 22:29:25 +01:00
782a736cdc [maven-release-plugin] prepare release v2.0.0 2023-12-10 22:29:22 +01:00
c4a5f12511 feature/jakrtaee10 (#1)
Co-authored-by: Joern Muehlencord <joern.muehlencord@vitroconnect.com>
Reviewed-on: https://jomu.timelord.de/git/jomu/shared/pulls/1
2023-12-10 21:24:45 +00:00
b9482de3b1 switched distribution management to gitea 2023-04-02 10:49:32 +02:00
11 changed files with 207 additions and 245 deletions

View File

@ -1,5 +0,0 @@
@ECHO OFF
setlocal
set BASEPATH=%~dp0%
cd %BASEPATH%\..
mvn release:clean release:prepare -Dmaven.test.skip=true -Darguments="-Dmaven.test.skip=true -DskipTests"

View File

@ -1,4 +1,3 @@
<!-- <!--
Copyright 2019 Joern Muehlencord (joern@muehlencord.de). Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
@ -14,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.muehlencord.shared</groupId> <groupId>de.muehlencord.shared</groupId>
@ -24,7 +24,7 @@ limitations under the License.
<parent> <parent>
<artifactId>shared</artifactId> <artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId> <groupId>de.muehlencord</groupId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.1-SNAPSHOT</version>
</parent> </parent>
<name>shared-configuration</name> <name>shared-configuration</name>
@ -36,7 +36,7 @@ limitations under the License.
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId> <artifactId>junit-jupiter-api</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>

View File

@ -26,7 +26,7 @@ limitations under the License.
<parent> <parent>
<artifactId>shared</artifactId> <artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId> <groupId>de.muehlencord</groupId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.1-SNAPSHOT</version>
</parent> </parent>
<name>shared-db</name> <name>shared-db</name>
@ -61,7 +61,7 @@ limitations under the License.
<!-- Testing --> <!-- Testing -->
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId> <artifactId>junit-jupiter-api</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>

View File

@ -15,13 +15,12 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<artifactId>shared</artifactId> <artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId> <groupId>de.muehlencord</groupId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.1-SNAPSHOT</version>
</parent> </parent>
<groupId>de.muehlencord.shared</groupId> <groupId>de.muehlencord.shared</groupId>

View File

@ -1,34 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
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.
-->
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.compile.on.save>all</netbeans.compile.on.save>
</properties>
</project-shared-configuration>

View File

@ -16,29 +16,35 @@ limitations under the License.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>shared-network</artifactId> <artifactId>shared-network</artifactId>
<build> <groupId>de.muehlencord.shared</groupId>
<finalName>${project.artifactId}</finalName> <modelVersion>4.0.0</modelVersion>
</build> <name>shared-network</name>
<packaging>jar</packaging>
<parent>
<artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId>
<version>2.0.1-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>http://maven.apache.org</url>
<dependencies> <dependencies>
<dependency>
<artifactId>junit-jupiter-engine</artifactId>
<groupId>org.junit.jupiter</groupId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<artifactId>slf4j-jdk14</artifactId>
<groupId>org.slf4j</groupId>
<scope>test</scope>
</dependency>
<dependency> <dependency>
<artifactId>shared-util</artifactId> <artifactId>shared-util</artifactId>
<groupId>de.muehlencord.shared</groupId> <groupId>de.muehlencord.shared</groupId>
<type>jar</type>
</dependency> </dependency>
<dependency> <dependency>
@ -56,29 +62,17 @@ limitations under the License.
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- Test -->
<dependency> <dependency>
<artifactId>jaxws-api</artifactId> <groupId>org.junit.jupiter</groupId>
<groupId>javax.xml.ws</groupId> <artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<artifactId>slf4j-jdk14</artifactId>
<groupId>org.slf4j</groupId>
<scope>test</scope> <scope>test</scope>
<version>2.3.1</version>
</dependency> </dependency>
</dependencies> </dependencies>
<groupId>de.muehlencord.shared</groupId>
<modelVersion>4.0.0</modelVersion>
<name>shared-network</name>
<packaging>jar</packaging>
<parent>
<artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId>
<version>2.0.0-SNAPSHOT</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<url>http://maven.apache.org</url>
<version>2.0.0-SNAPSHOT</version>
</project> </project>

View File

@ -22,17 +22,16 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;k
/** /**
*
* @author Joern Muehlencord (joern@muehlencord.de) * @author Joern Muehlencord (joern@muehlencord.de)
*/ */
public class HttpLayerTest extends BaseTest { class HttpLayerTest extends BaseTest {
@Test @Test
@Disabled @Disabled
public void testPostByMap() throws Exception { void testPostByMap() throws Exception {
System.out.println("testPostByMap"); System.out.println("testPostByMap");
Map<String, String[]> map = new HashMap<>(); Map<String, String[]> map = new HashMap<>();
String[] value = { "Hello World!", "Hello World again" }; String[] value = { "Hello World!", "Hello World again" };
@ -44,7 +43,7 @@ public class HttpLayerTest extends BaseTest {
@Test @Test
@Disabled @Disabled
public void testPostByMapList() throws Exception { void testPostByMapList() throws Exception {
System.out.println("testPostByMapList"); System.out.println("testPostByMapList");
List<Map<String, String[]>> list = new LinkedList<>(); List<Map<String, String[]>> list = new LinkedList<>();
Map<String, String[]> map = new HashMap<>(); Map<String, String[]> map = new HashMap<>();
@ -62,14 +61,14 @@ public class HttpLayerTest extends BaseTest {
@Test @Test
@Disabled @Disabled
public void testByValue() throws Exception { void testByValue() throws Exception {
System.out.println("testByValue"); System.out.println("testByValue");
HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener"); HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener");
httpLayer.post("message", "Hello World by single parameter"); httpLayer.post("message", "Hello World by single parameter");
} }
@Test @Test
public void testWithUnknownURL() throws MessageNotSendException { void testWithUnknownURL() throws MessageNotSendException {
System.out.println("testWithUnknownURL"); System.out.println("testWithUnknownURL");
HttpLayer httpLayer = new HttpLayer("http://localhost/thisURLDoesNotExist"); HttpLayer httpLayer = new HttpLayer("http://localhost/thisURLDoesNotExist");
Assertions.assertThrows(MessageNotSendException.class, () -> { Assertions.assertThrows(MessageNotSendException.class, () -> {
@ -79,7 +78,7 @@ public class HttpLayerTest extends BaseTest {
} }
@Test @Test
public void testInvalidURL() throws MessageNotSendException { void testInvalidURL() throws MessageNotSendException {
System.out.println("testInvalidURL"); System.out.println("testInvalidURL");
HttpLayer httpLayer = new HttpLayer("joern@muehlencord.de"); HttpLayer httpLayer = new HttpLayer("joern@muehlencord.de");
Assertions.assertThrows(MessageNotSendException.class, () -> { Assertions.assertThrows(MessageNotSendException.class, () -> {
@ -88,7 +87,7 @@ public class HttpLayerTest extends BaseTest {
} }
@Test @Test
public void testUnsupportedURL() throws MessageNotSendException { void testUnsupportedURL() throws MessageNotSendException {
System.out.println("testUnsupportedURL"); System.out.println("testUnsupportedURL");
HttpLayer httpLayer = new HttpLayer("ftp://localhost"); HttpLayer httpLayer = new HttpLayer("ftp://localhost");
Assertions.assertThrows(MessageNotSendException.class, () -> { Assertions.assertThrows(MessageNotSendException.class, () -> {

View File

@ -47,9 +47,9 @@ limitations under the License.
<parent> <parent>
<artifactId>shared</artifactId> <artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId> <groupId>de.muehlencord</groupId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.1-SNAPSHOT</version>
</parent> </parent>
<version>2.0.0-SNAPSHOT</version> <version>2.0.1-SNAPSHOT</version>
</project> </project>

20
pom.xml
View File

@ -18,8 +18,9 @@ limitations under the License.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.muehlencord</groupId>
<artifactId>shared</artifactId> <artifactId>shared</artifactId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.1-SNAPSHOT</version>
<name>shared</name> <name>shared</name>
<packaging>pom</packaging> <packaging>pom</packaging>
@ -54,17 +55,24 @@ limitations under the License.
<url>https://jomu.timelord.de/git/jomu/shared/</url> <url>https://jomu.timelord.de/git/jomu/shared/</url>
</scm> </scm>
<repositories>
<repository>
<id>gitea</id>
<url>https://jomu.timelord.de/git/api/packages/jomu/maven</url>
</repository>
</repositories>
<distributionManagement> <distributionManagement>
<repository> <repository>
<id>ossrh</id> <id>jomu-gitea</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> <url>https://jomu.timelord.de/git/api/packages/jomu/maven</url>
</repository> </repository>
<snapshotRepository> <snapshotRepository>
<id>ossrh</id> <id>jomu-gitea</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url> <url>https://jomu.timelord.de/git/api/packages/jomu/maven</url>
</snapshotRepository> </snapshotRepository>
</distributionManagement> </distributionManagement>
<groupId>de.muehlencord</groupId>
<issueManagement> <issueManagement>
<system>Gitea</system> <system>Gitea</system>

View File

@ -1,4 +1,3 @@
<!-- <!--
Copyright 2019 Joern Muehlencord (joern@muehlencord.de). Copyright 2019 Joern Muehlencord (joern@muehlencord.de).
@ -14,7 +13,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
--> -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>de.muehlencord.shared</groupId> <groupId>de.muehlencord.shared</groupId>
@ -26,7 +26,7 @@ limitations under the License.
<parent> <parent>
<artifactId>shared</artifactId> <artifactId>shared</artifactId>
<groupId>de.muehlencord</groupId> <groupId>de.muehlencord</groupId>
<version>2.0.0-SNAPSHOT</version> <version>2.0.1-SNAPSHOT</version>
</parent> </parent>
@ -38,7 +38,7 @@ limitations under the License.
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.junit.jupiter</groupId> <groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId> <artifactId>junit-jupiter-api</artifactId>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -15,18 +15,19 @@
*/ */
package de.muehlencord.shared.util; package de.muehlencord.shared.util;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.security.SecureRandom; import java.security.SecureRandom;
import org.bouncycastle.util.encoders.Base64; import org.bouncycastle.util.encoders.Base64;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
/** /**
*
* @author Joern Muehlencord (joern@muehlencord.de) * @author Joern Muehlencord (joern@muehlencord.de)
*/ */
public class PasswordUtilTest { class PasswordUtilTest {
private static SecureRandom secureRandom; private static SecureRandom secureRandom;
private static String systemSalt64Coded; private static String systemSalt64Coded;
@ -43,13 +44,13 @@ public class PasswordUtilTest {
@Test @Test
public void testGetHash() { void testGetHash() {
PasswordUtil pwUtil = new PasswordUtil(systemSalt64Coded); PasswordUtil pwUtil = new PasswordUtil(systemSalt64Coded);
String password1 = pwUtil.getHash("password"); String password1 = pwUtil.getHash("password");
String password2 = pwUtil.getHash("password"); String password2 = pwUtil.getHash("password");
assertFalse (password1.equals(password2)); assertNotEquals(password1, password2);
assertTrue(pwUtil.matches("password", password1)); assertTrue(pwUtil.matches("password", password1));
assertFalse(pwUtil.matches("wrongpassword", password1)); assertFalse(pwUtil.matches("wrongpassword", password1));