Skip to content

Commit

Permalink
Merge pull request #3 from lucas-nguyen-17/TestngListener
Browse files Browse the repository at this point in the history
refactor: change the way config listeners in testng
  • Loading branch information
rajatt95 committed Oct 19, 2021
2 parents fd81378 + d4787c1 commit 042acad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 24 deletions.
7 changes: 7 additions & 0 deletions src/test/java/com/spotify/oauth2/tests/_BaseTest.java
@@ -1,9 +1,16 @@
package com.spotify.oauth2.tests;

import com.spotify.oauth2.listeners.AnnotationTransformer;
import com.spotify.oauth2.listeners.ListenerClass;
import com.spotify.oauth2.listeners.MethodInterceptor;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Listeners;

import java.lang.reflect.Method;

@Listeners(value = {AnnotationTransformer.class,
ListenerClass.class,
MethodInterceptor.class})
public class _BaseTest {

/*
Expand Down
15 changes: 3 additions & 12 deletions testng_Jenkins.xml
Expand Up @@ -3,20 +3,11 @@
<suite name="Automation Test Suite for Spotify Playlist APIs"
data-provider-thread-count="3">

<listeners>
<listener
class-name="com.spotify.oauth2.listeners.AnnotationTransformer"></listener>
<listener
class-name="com.spotify.oauth2.listeners.ListenerClass"></listener>
<listener
class-name="com.spotify.oauth2.listeners.MethodInterceptor"></listener>
</listeners>

<!-- thread-count="2" parallel ="methods" -->
<!--These values are coming from Maven command (Configured in pom.xml) -->
<test name="Regression Tests execution for Spotify Playlist APIs">
<packages>
<package name="com.spotify.oauth2.tests"></package>
<package name="com.spotify.oauth2.tests"/>
</packages>
</test> <!-- Test -->
</suite> <!-- Suite -->
</test>
</suite>
15 changes: 3 additions & 12 deletions testng_Local.xml
Expand Up @@ -2,19 +2,10 @@
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Automation Test Suite for Spotify Playlist APIs"
data-provider-thread-count="3">

<listeners>
<listener
class-name="com.spotify.oauth2.listeners.AnnotationTransformer"></listener>
<listener
class-name="com.spotify.oauth2.listeners.ListenerClass"></listener>
<listener
class-name="com.spotify.oauth2.listeners.MethodInterceptor"></listener>
</listeners>
<test name="Regression Tests execution for Spotify Playlist APIs"
thread-count="10" parallel="methods">
<packages>
<package name="com.spotify.oauth2.tests"></package>
<package name="com.spotify.oauth2.tests"/>
</packages>
</test> <!-- Test -->
</suite> <!-- Suite -->
</test>
</suite>

0 comments on commit 042acad

Please sign in to comment.