configure unit testing for project
This commit is contained in:
parent
532d3ed89b
commit
41ebc47800
3 changed files with 40 additions and 1 deletions
22
pom.xml
22
pom.xml
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
<groupId>com.mykola2312</groupId>
|
||||
<artifactId>mptv</artifactId>
|
||||
<version>0.1.0</version>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
|
|
@ -12,4 +12,24 @@
|
|||
<maven.compiler.target>22</maven.compiler.target>
|
||||
<exec.mainClass>com.mykola2312.mptv.Main</exec.mainClass>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter-engine</artifactId>
|
||||
<version>5.10.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>mptv</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>3.2.5</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
17
src/test/java/com/mykola2312/mptv/TestI18n.java
Normal file
17
src/test/java/com/mykola2312/mptv/TestI18n.java
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
package com.mykola2312.mptv;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class TestI18n {
|
||||
@Test()
|
||||
public void testKeys() {
|
||||
assertEquals("Value1", I18n.get("Key1"));
|
||||
assertEquals("Value2", I18n.get("Key2"));
|
||||
}
|
||||
|
||||
@Test()
|
||||
public void testNotFound() {
|
||||
assertEquals("KeyNotFound", I18n.get("KeyNotFound"));
|
||||
}
|
||||
}
|
||||
2
src/test/resources/i18n_en_US.properties
Normal file
2
src/test/resources/i18n_en_US.properties
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
Key1=Value1
|
||||
Key2=Value2
|
||||
Loading…
Add table
Reference in a new issue