Skip to content

Commit

Permalink
chore: add testNG configurations #2672
Browse files Browse the repository at this point in the history
  • Loading branch information
jgomer2001 committed Oct 19, 2022
1 parent 55cc189 commit cf50167
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 0 deletions.
73 changes: 73 additions & 0 deletions agama/engine/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,46 @@
</repository>
</repositories>

<build>
<filters>
<filter>profiles/${cfg}/config-agama-test.properties</filter>
</filters>

<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>
</plugins>
</build>

<profiles>
<profile>
<id>set-configuration-name</id>
<activation>
<property>
<name>!cfg</name>
</property>
</activation>
<properties>
<cfg>default</cfg>
</properties>
</profile>
</profiles>

<dependencies>

<dependency>
Expand Down Expand Up @@ -146,12 +186,45 @@
<artifactId>commons-codec</artifactId>
</dependency>

<!-- SERIALIZATION -->
<dependency>
<groupId>com.esotericsoftware</groupId>
<artifactId>kryo</artifactId>
<version>5.3.0</version>
</dependency>

<!-- TESTS -->
<dependency>
<groupId>net.sourceforge.htmlunit</groupId>
<artifactId>htmlunit</artifactId>
<version>2.65.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jans</groupId>
<artifactId>agama-inbound</artifactId>
<version>${jans.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20220924</version>
<scope>test</scope>
</dependency>
<!-- Needed for htmlunit <-> log4j2 intergration -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
<version>2.19.0</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>
6 changes: 6 additions & 0 deletions agama/engine/profiles/default/config-agama-test.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#The URL of your Jans installation
server=https://jgomer2001-guiding-herring.gluu.info

clientId=1800.5e01b3bb-1f68-4847-b9ba-d5c999a05e33

custParamName=customParam1
21 changes: 21 additions & 0 deletions agama/engine/src/test/resources/log4j2-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?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="DEBUG" additivity="false">
<AppenderRef ref="Console"/>
</Logger>
<Logger name="com.gargoylesoftware.htmlunit" level="WARN" additivity="false">
<AppenderRef ref="Console"/>
</Logger>

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

</Configuration>
8 changes: 8 additions & 0 deletions agama/engine/src/test/resources/testng.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

authzEndpoint=${server}/jans-auth/restv1/authorize

redirectUri=${server}/admin-ui

clientId=${clientId}

custParamName=${custParamName}
43 changes: 43 additions & 0 deletions agama/engine/src/test/resources/testng.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<!-- Tests implemented should not be run in parallel -->
<suite name="agama-flows" parallel="false">

<parameter name="propertiesFile" value="target/test-classes/testng.properties" />

<test name="math" enabled="false">
<classes>
<class name="io.jans.agama.test.MathFlowTest" />
</classes>
</test>

<test name="uid" enabled="false">
<classes>
<class name="io.jans.agama.test.UidOnlyAuthTest" />
</classes>
</test>

<test name="say-something" enabled="false">
<classes>
<class name="io.jans.agama.test.SaySomethingFlowTest" />
</classes>
</test>

<test name="say-something-2" enabled="false">
<classes>
<class name="io.jans.agama.test.SaySomething2FlowTest" />
</classes>
</test>

<test name="say-something-3" enabled="false">
<classes>
<class name="io.jans.agama.test.SaySomething3FlowTest" />
</classes>
</test>

<test name="custom-config" enabled="false">
<classes>
<class name="io.jans.agama.test.CustomConfigsFlowTest" />
</classes>
</test>

</suite>

0 comments on commit cf50167

Please sign in to comment.