This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Fully working test at: https://github.com/njaiswal/logLineTester/blob/master/src/test/java/com/nj/Utils/UtilsTest.java | |
| @Test | |
| public void testUtilsLog() throws InterruptedException { | |
| Logger utilsLogger = (Logger) LoggerFactory.getLogger("com.nj.utils"); | |
| final Appender mockAppender = mock(Appender.class); | |
| when(mockAppender.getName()).thenReturn("MOCK"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <project> | |
| [...] | |
| <build> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.apache.maven.plugins</groupId> | |
| <artifactId>maven-failsafe-plugin</artifactId> | |
| <version>2.19.1</version> | |
| <executions> | |
| <execution> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <plugin> | |
| <artifactId>maven-antrun-plugin</artifactId> | |
| <version>1.8</version> | |
| <executions> | |
| <execution> | |
| <id>start-test-server</id> | |
| <phase>pre-integration-test</phase> | |
| <goals> | |
| <goal>run</goal> | |
| </goals> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //....code snippet..... | |
| // Filter out bad tests | |
| for (String c : conditions) { | |
| if(c.matches("some condition 1") || c.matches("some other condition")){ | |
| throw new org.testngSkipException(c); | |
| } | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ mvn test-compile failsafe:integration-test | |
| [INFO] Scanning for projects... | |
| [INFO] | |
| [INFO] ------------------------------------------------------------------------ | |
| [INFO] Building XXXX Webapp 1.0.5-SNAPSHOT | |
| [INFO] ------------------------------------------------------------------------ | |
| [INFO] | |
| ....blah blah blah.... | |
| ....blah blah blah.... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.clearqa.utils; | |
| import org.testng.ITestResult; | |
| import org.testng.TestListenerAdapter; | |
| public class TestNgCustomLogger extends TestListenerAdapter{ | |
| @Override | |
| public void onTestFailure(ITestResult tr) { | |
| logToStdOut(tr, "FAILED"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > | |
| <suite name="REST api Integration Tests" verbose="1" data-provider-thread-count="10"> | |
| <listeners> | |
| <listener class-name="com.clearqa.utils.TestNgCustomLogger" /> | |
| </listeners> | |
| <test name="Rest API - Json schema validation Tests" > | |
| <classes> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <build> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.jbehave</groupId> | |
| <artifactId>jbehave-maven-plugin</artifactId> | |
| <executions> | |
| <execution> | |
| <id>embeddable-stories</id> | |
| <phase>integration-test</phase> | |
| <configuration> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mvn test |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| schemas: | |
| - id: Customers List | |
| file: "/schemas/customers_list_schema.json" | |
| regex: "^.*/customers$" | |
| - id: Any particular customer | |
| file: "/schemas/customer_schema.json" | |
| regex: "^.*/customer/.+$" |
NewerOlder