Skip to content

Commit

Permalink
test: add requirements for test execution in transpiler project #2710
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 committed Oct 25, 2022
1 parent dd68b91 commit 12b0b0a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 1 deletion.
23 changes: 23 additions & 0 deletions agama/transpiler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,23 @@
</properties>

<build>
<testResources>
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<configuration>
<suiteXmlFiles>
<suiteXmlFile>target/test-classes/testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
</plugin>
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
Expand Down Expand Up @@ -77,6 +93,13 @@
<artifactId>jackson-annotations</artifactId>
</dependency>

<!-- TESTS -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,14 @@ public static TranspilationResult transpile(String flowQname, Set<String> flowQN
public static void runSyntaxCheck(String flowQname, String source)
throws SyntaxException, TranspilerException {

Transpiler tr = new Transpiler(flowQname, null);
Transpiler tr = new Transpiler(flowQname, null);
tr.validateName(tr.getFlowContext(source));
}

public static void runSyntaxCheck(String source) throws SyntaxException, TranspilerException {
Transpiler tr = new Transpiler("", null);
tr.getFlowContext(source);
}

public static void main(String... args) throws Exception {

Expand Down
18 changes: 18 additions & 0 deletions agama/transpiler/src/test/resources/log4j2-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout pattern="%d{HH:mm:ss} %-5p %F:%L - %m%n" />
</Console>
</Appenders>
<Loggers>
<Logger name="io.jans.agama" level="INFO" additivity="false">
<AppenderRef ref="Console"/>
</Logger>

<Root level="error">
<AppenderRef ref="Console" />
</Root>
</Loggers>

</Configuration>

0 comments on commit 12b0b0a

Please sign in to comment.