Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Junit 5 #629

Merged
merged 3 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
166 changes: 86 additions & 80 deletions dmn-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,86 +37,92 @@
<name>jDMN: Core</name>
<packaging>jar</packaging>

<dependencies>
<dependency>
<groupId>com.goldmansachs.jdmn</groupId>
<artifactId>jdmn-runtime</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.31</version>
</dependency>

<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>${antlr4.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>

<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
</dependency>

<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-matchers</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fitnesse</groupId>
<artifactId>fitnesse</artifactId>
<version>20230503</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependencies>
<dependency>
<groupId>com.goldmansachs.jdmn</groupId>
<artifactId>jdmn-runtime</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.31</version>
</dependency>

<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>${antlr4.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>

<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>

<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
</dependency>

<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-matchers</artifactId>
<version>${xmlunit.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.fitnesse</groupId>
<artifactId>fitnesse</artifactId>
<version>20230503</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-jdk14</artifactId>
</exclusion>
</exclusions>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>commons-lang</groupId>
Expand Down
14 changes: 10 additions & 4 deletions dmn-core/src/main/resources/templates/aws/pomFile.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,16 @@
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.2</version>
<scope>test</scope>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.10.1</version>
<scope>test</scope>
</dependency>
</dependencies>

Expand Down
8 changes: 4 additions & 4 deletions dmn-core/src/test/java/com/gs/dmn/DMNModelRepositoryTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import com.gs.dmn.ast.*;
import com.gs.dmn.serialization.DMNSerializer;
import com.gs.dmn.serialization.xstream.XMLDMNSerializer;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import java.io.File;
import java.net.URI;
Expand All @@ -26,13 +26,13 @@
import java.util.Set;
import java.util.stream.Collectors;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class DMNModelRepositoryTest extends AbstractTest {
private DMNModelRepository dmnModelRepository;
private final DMNSerializer dmnSerializer = new XMLDMNSerializer(LOGGER, false);

@Before
@BeforeEach
public void setUp() {
String pathName = "tck/1.1/cl3/0004-lending/0004-lending.dmn";
this.dmnModelRepository = readDMN(pathName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
*/
package com.gs.dmn.ast;

import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TAssociationDirectionTest {
@Test
Expand All @@ -24,8 +25,10 @@ public void testFromValue() {
assertEquals(TAssociationDirection.BOTH, TAssociationDirection.fromValue("Both"));
}

@Test(expected = IllegalArgumentException.class)
@Test
public void testFromValueWhenIncorrectName() {
TAssociationDirection.fromValue("asd");
Assertions.assertThrows(IllegalArgumentException.class, () -> {
TAssociationDirection.fromValue("asd");
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
*/
package com.gs.dmn.ast;

import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TBuiltinAggregatorTest {
@Test
Expand All @@ -25,9 +26,11 @@ public void testFromValue() {
assertEquals(TBuiltinAggregator.SUM, TBuiltinAggregator.fromValue("SUM"));
}

@Test(expected = IllegalArgumentException.class)
@Test
public void testFromValueWhenIncorrectName() {
TBuiltinAggregator.fromValue("asd");
Assertions.assertThrows(IllegalArgumentException.class, () -> {
TBuiltinAggregator.fromValue("asd");
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
*/
package com.gs.dmn.ast;

import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TDecisionTableOrientationTest {
@Test
Expand All @@ -24,8 +25,10 @@ public void testFromValue() {
assertEquals(TDecisionTableOrientation.CROSS_TABLE, TDecisionTableOrientation.fromValue("CrossTable"));
}

@Test(expected = IllegalArgumentException.class)
@Test
public void testFromValueWhenIncorrectName() {
TDecisionTableOrientation.fromValue("asd");
Assertions.assertThrows(IllegalArgumentException.class, () -> {
TDecisionTableOrientation.fromValue("asd");
});
}
}
11 changes: 7 additions & 4 deletions dmn-core/src/test/java/com/gs/dmn/ast/TFunctionKindTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
*/
package com.gs.dmn.ast;

import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class TFunctionKindTest {
@Test
Expand All @@ -24,8 +25,10 @@ public void testFromValue() {
assertEquals(TFunctionKind.PMML, TFunctionKind.fromValue("PMML"));
}

@Test(expected = IllegalArgumentException.class)
@Test
public void testFromValueWhenIncorrectName() {
TFunctionKind.fromValue("asd");
Assertions.assertThrows(IllegalArgumentException.class, () -> {
TFunctionKind.fromValue("asd");
});
}
}
11 changes: 7 additions & 4 deletions dmn-core/src/test/java/com/gs/dmn/ast/THitPolicyTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
*/
package com.gs.dmn.ast;

import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class THitPolicyTest {
@Test
Expand All @@ -28,9 +29,11 @@ public void testFromValue() {
assertEquals(THitPolicy.OUTPUT_ORDER, THitPolicy.fromValue("OUTPUT ORDER"));
}

@Test(expected = IllegalArgumentException.class)
@Test
public void testFromValueWhenIncorrectName() {
THitPolicy.fromValue("asd");
Assertions.assertThrows(IllegalArgumentException.class, () -> {
THitPolicy.fromValue("asd");
});
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
*/
package com.gs.dmn.ast.dmndi;

import org.junit.Test;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

public class AlignmentKindTest {
@Test
Expand All @@ -24,8 +25,10 @@ public void testFromValue() {
assertEquals(AlignmentKind.CENTER, AlignmentKind.fromValue("center"));
}

@Test(expected = IllegalArgumentException.class)
@Test
public void testFromValueWhenIncorrectName() {
AlignmentKind.fromValue("asd");
Assertions.assertThrows(IllegalArgumentException.class, () -> {
AlignmentKind.fromValue("asd");
});
}
}
Loading