feature/jakrtaee10 #2
@ -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"
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
<!--
|
||||
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
|
||||
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>
|
||||
|
||||
<groupId>de.muehlencord.shared</groupId>
|
||||
@ -24,7 +24,7 @@ limitations under the License.
|
||||
<parent>
|
||||
<artifactId>shared</artifactId>
|
||||
<groupId>de.muehlencord</groupId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>shared-configuration</name>
|
||||
@ -36,7 +36,7 @@ limitations under the License.
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ limitations under the License.
|
||||
<parent>
|
||||
<artifactId>shared</artifactId>
|
||||
<groupId>de.muehlencord</groupId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<name>shared-db</name>
|
||||
@ -61,7 +61,7 @@ limitations under the License.
|
||||
<!-- Testing -->
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
@ -15,13 +15,12 @@ See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
-->
|
||||
|
||||
<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">
|
||||
<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>
|
||||
<parent>
|
||||
<artifactId>shared</artifactId>
|
||||
<groupId>de.muehlencord</groupId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<groupId>de.muehlencord.shared</groupId>
|
||||
|
||||
@ -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>
|
||||
@ -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">
|
||||
<artifactId>shared-network</artifactId>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
</build>
|
||||
<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.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<url>http://maven.apache.org</url>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>slf4j-jdk14</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<artifactId>shared-util</artifactId>
|
||||
<groupId>de.muehlencord.shared</groupId>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
@ -56,29 +62,17 @@ limitations under the License.
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Test -->
|
||||
<dependency>
|
||||
<artifactId>jaxws-api</artifactId>
|
||||
<groupId>javax.xml.ws</groupId>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<artifactId>slf4j-jdk14</artifactId>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<scope>test</scope>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
</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>
|
||||
|
||||
@ -22,17 +22,16 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
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)
|
||||
*/
|
||||
public class HttpLayerTest extends BaseTest {
|
||||
class HttpLayerTest extends BaseTest {
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testPostByMap() throws Exception {
|
||||
void testPostByMap() throws Exception {
|
||||
System.out.println("testPostByMap");
|
||||
Map<String, String[]> map = new HashMap<>();
|
||||
String[] value = { "Hello World!", "Hello World again" };
|
||||
@ -44,7 +43,7 @@ public class HttpLayerTest extends BaseTest {
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testPostByMapList() throws Exception {
|
||||
void testPostByMapList() throws Exception {
|
||||
System.out.println("testPostByMapList");
|
||||
List<Map<String, String[]>> list = new LinkedList<>();
|
||||
Map<String, String[]> map = new HashMap<>();
|
||||
@ -62,14 +61,14 @@ public class HttpLayerTest extends BaseTest {
|
||||
|
||||
@Test
|
||||
@Disabled
|
||||
public void testByValue() throws Exception {
|
||||
void testByValue() throws Exception {
|
||||
System.out.println("testByValue");
|
||||
HttpLayer httpLayer = new HttpLayer("http://localhost:8080/HttpPostListener/HttpPostListener");
|
||||
httpLayer.post("message", "Hello World by single parameter");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWithUnknownURL() throws MessageNotSendException {
|
||||
void testWithUnknownURL() throws MessageNotSendException {
|
||||
System.out.println("testWithUnknownURL");
|
||||
HttpLayer httpLayer = new HttpLayer("http://localhost/thisURLDoesNotExist");
|
||||
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
||||
@ -79,7 +78,7 @@ public class HttpLayerTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testInvalidURL() throws MessageNotSendException {
|
||||
void testInvalidURL() throws MessageNotSendException {
|
||||
System.out.println("testInvalidURL");
|
||||
HttpLayer httpLayer = new HttpLayer("joern@muehlencord.de");
|
||||
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
||||
@ -88,7 +87,7 @@ public class HttpLayerTest extends BaseTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnsupportedURL() throws MessageNotSendException {
|
||||
void testUnsupportedURL() throws MessageNotSendException {
|
||||
System.out.println("testUnsupportedURL");
|
||||
HttpLayer httpLayer = new HttpLayer("ftp://localhost");
|
||||
Assertions.assertThrows(MessageNotSendException.class, () -> {
|
||||
|
||||
@ -47,9 +47,9 @@ limitations under the License.
|
||||
<parent>
|
||||
<artifactId>shared</artifactId>
|
||||
<groupId>de.muehlencord</groupId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</project>
|
||||
|
||||
20
pom.xml
20
pom.xml
@ -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">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>de.muehlencord</groupId>
|
||||
<artifactId>shared</artifactId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
<name>shared</name>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
@ -54,17 +55,24 @@ limitations under the License.
|
||||
<url>https://jomu.timelord.de/git/jomu/shared/</url>
|
||||
</scm>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>gitea</id>
|
||||
<url>https://jomu.timelord.de/git/api/packages/jomu/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>ossrh</id>
|
||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
<id>jomu-gitea</id>
|
||||
<url>https://jomu.timelord.de/git/api/packages/jomu/maven</url>
|
||||
</repository>
|
||||
<snapshotRepository>
|
||||
<id>ossrh</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<id>jomu-gitea</id>
|
||||
<url>https://jomu.timelord.de/git/api/packages/jomu/maven</url>
|
||||
</snapshotRepository>
|
||||
</distributionManagement>
|
||||
<groupId>de.muehlencord</groupId>
|
||||
|
||||
|
||||
<issueManagement>
|
||||
<system>Gitea</system>
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
<!--
|
||||
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
|
||||
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>
|
||||
|
||||
<groupId>de.muehlencord.shared</groupId>
|
||||
@ -26,7 +26,7 @@ limitations under the License.
|
||||
<parent>
|
||||
<artifactId>shared</artifactId>
|
||||
<groupId>de.muehlencord</groupId>
|
||||
<version>2.0.0-SNAPSHOT</version>
|
||||
<version>2.0.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ limitations under the License.
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<artifactId>junit-jupiter-api</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@ -15,18 +15,19 @@
|
||||
*/
|
||||
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 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.Test;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Joern Muehlencord (joern@muehlencord.de)
|
||||
*/
|
||||
public class PasswordUtilTest {
|
||||
class PasswordUtilTest {
|
||||
|
||||
private static SecureRandom secureRandom;
|
||||
private static String systemSalt64Coded;
|
||||
@ -43,13 +44,13 @@ public class PasswordUtilTest {
|
||||
|
||||
|
||||
@Test
|
||||
public void testGetHash() {
|
||||
void testGetHash() {
|
||||
PasswordUtil pwUtil = new PasswordUtil(systemSalt64Coded);
|
||||
|
||||
String password1 = pwUtil.getHash("password");
|
||||
String password2 = pwUtil.getHash("password");
|
||||
|
||||
assertFalse (password1.equals(password2));
|
||||
assertNotEquals(password1, password2);
|
||||
assertTrue(pwUtil.matches("password", password1));
|
||||
assertFalse(pwUtil.matches("wrongpassword", password1));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user