Skip to content

Commit

Permalink
Adjusted naming and deployment for new project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Mayer committed Aug 5, 2020
1 parent a4472f2 commit c4d7ec0
Show file tree
Hide file tree
Showing 30 changed files with 74 additions and 74 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
# adaptavist-hooks [ ![Download](https://api.bintray.com/packages/letsrokk/github/adaptavist-jira-parent/images/download.svg) ](https://bintray.com/letsrokk/github/adaptavist-jira-parent/_latestVersion)
# tm4j-hooks [ ![Download](https://api.bintray.com/packages/letsrokk/github/adaptavist-jira-parent/images/download.svg) ](https://bintray.com/letsrokk/github/adaptavist-jira-parent/_latestVersion)

Adapter for test execution results exports to Adaptavist Test Management for Jira Server.
API documentation: [Test Management for Jira Server API (v1)](https://docs.adaptavist.io/tm4j/server/api/v1/)
Adapter for test execution results exports to Test Management for Jira (TM4J) Server.
API documentation: [Test Management for Jira Server API (v1)](https://support.smartbear.com/tm4j-server/api-docs/v1/)

# TestNG 6.x and 7.x

`testng.xml`

```xml
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Adaptavist TM4J Test Suite" verbose="1" >
<suite name="TM4J Test Suite" verbose="1" >

<parameter name="tm4jProjectKey" value="AQA"/>

<listeners>
<listener class-name="com.github.letsrokk.adaptavist.testng.AdaptavistTestResultListerner"/>
<listener class-name="com.github.letsrokk.tm4j.testng.TM4JTestResultListerner"/>
</listeners>

<test name="Example Test" >
<classes>
<class name="com.github.letsrokk.adaptavist.tests.ConfigurationExampleTest" />
<class name="com.github.letsrokk.tm4j.tests.ConfigurationExampleTest" />
</classes>
</test>

</suite>
```

# Adaptavist Test Case ID annotations for tests
# TM4J Test Case ID annotations for tests

Test methods should be either annotated by `@TestCase("PROJECT-T1")` or `@TmsLink("PROJECT-T1")`
(provided by Allure Framework)

```java
package com.github.letsrokk.adaptavist.tests;
package com.github.letsrokk.tm4j.tests;

import com.github.letsrokk.adaptavist.annotation.TestCase;
import com.github.letsrokk.tm4j.annotation.TestCase;
import org.testng.annotations.Test;

@Test(singleThreaded = true)
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
<repository>
<id>bintray-letsrokk-github</id>
<name>letsrokk-github</name>
<url>https://api.bintray.com/maven/letsrokk/github/adaptavist-jira-parent/;publish=1;override=1</url>
<url>https://api.bintray.com/maven/letsrokk/github/tm4j-hooks-parent/;publish=1;override=1</url>
</repository>
</distributionManagement>

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.annotation;
package com.github.letsrokk.tm4j.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.client;
package com.github.letsrokk.tm4j.client;

import okhttp3.Credentials;
import okhttp3.Interceptor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.letsrokk.adaptavist.client;
package com.github.letsrokk.tm4j.client;

import com.github.letsrokk.adaptavist.client.model.Execution;
import com.github.letsrokk.adaptavist.client.model.TestRun;
import com.github.letsrokk.tm4j.client.model.Execution;
import com.github.letsrokk.tm4j.client.model.TestRun;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Body;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.github.letsrokk.adaptavist.client;
package com.github.letsrokk.tm4j.client;

import com.github.letsrokk.adaptavist.client.model.Execution;
import com.github.letsrokk.adaptavist.client.model.TestRun;
import com.github.letsrokk.tm4j.client.model.Execution;
import com.github.letsrokk.tm4j.client.model.TestRun;
import lombok.extern.log4j.Log4j2;

import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.client;
package com.github.letsrokk.tm4j.client;

import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.client.model;
package com.github.letsrokk.tm4j.client.model;

/**
* Created by JacksonGenerator on 2/26/20.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.client.model;
package com.github.letsrokk.tm4j.client.model;

public class ExecutionStatus {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.client.model;
package com.github.letsrokk.tm4j.client.model;

/**
* Created by JacksonGenerator on 2/26/20.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.client.model;
package com.github.letsrokk.tm4j.client.model;

/**
* Created by JacksonGenerator on 2/26/20.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.github.letsrokk.tm4j.client.model;

public class TestResultsContainer {



}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.client.model;
package com.github.letsrokk.tm4j.client.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.core;
package com.github.letsrokk.tm4j.core;

public class DefaultVersionDetector implements VersionDetector {
@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.core;
package com.github.letsrokk.tm4j.core;

public interface VersionDetector {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package com.github.letsrokk.adaptavist.testng;
package com.github.letsrokk.tm4j.testng;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.github.letsrokk.adaptavist.annotation.TestCase;
import com.github.letsrokk.adaptavist.client.TM4JClient;
import com.github.letsrokk.adaptavist.client.TM4JClientFactory;
import com.github.letsrokk.adaptavist.client.model.Execution;
import com.github.letsrokk.adaptavist.client.model.ExecutionStatus;
import com.github.letsrokk.adaptavist.client.model.TestRun;
import com.github.letsrokk.adaptavist.testng.container.CustomExecutionContainer;
import com.github.letsrokk.adaptavist.testng.container.CustomExecutionException;
import com.github.letsrokk.adaptavist.testng.container.CustomSuiteContainer;
import com.github.letsrokk.adaptavist.testng.container.CustomTestContainer;
import com.github.letsrokk.tm4j.annotation.TestCase;
import com.github.letsrokk.tm4j.client.TM4JClient;
import com.github.letsrokk.tm4j.client.TM4JClientFactory;
import com.github.letsrokk.tm4j.client.model.Execution;
import com.github.letsrokk.tm4j.client.model.ExecutionStatus;
import com.github.letsrokk.tm4j.client.model.TestRun;
import com.github.letsrokk.tm4j.testng.container.CustomExecutionContainer;
import com.github.letsrokk.tm4j.testng.container.CustomExecutionException;
import com.github.letsrokk.tm4j.testng.container.CustomSuiteContainer;
import com.github.letsrokk.tm4j.testng.container.CustomTestContainer;
import io.qameta.allure.TmsLink;
import lombok.AllArgsConstructor;
import lombok.Getter;
Expand All @@ -38,15 +38,15 @@
import java.util.stream.Collectors;

@Log4j2
public class AdaptavistTestResultListerner implements ISuiteListener, ITestListener {
public class TM4JTestResultListerner implements ISuiteListener, ITestListener {

private static TM4JClient tm4jClient;
private static CustomSuiteContainer suiteContainer;

@Getter
@AllArgsConstructor
private enum AnnotationType {
TestCase(com.github.letsrokk.adaptavist.annotation.TestCase.class.getCanonicalName()),
TestCase(com.github.letsrokk.tm4j.annotation.TestCase.class.getCanonicalName()),
TmsLink(io.qameta.allure.TmsLink.class.getCanonicalName()),
Unsupported("Unsupported");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.testng.container;
package com.github.letsrokk.tm4j.testng.container;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.testng.container;
package com.github.letsrokk.tm4j.testng.container;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.testng.container;
package com.github.letsrokk.tm4j.testng.container;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.testng.container;
package com.github.letsrokk.tm4j.testng.container;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
Expand Down
2 changes: 1 addition & 1 deletion tm4j-testng/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</Appenders>

<Loggers>
<Logger name="com.github.letsrokk.adaptavist.testng" level="INFO" additivity="false">
<Logger name="com.github.letsrokk.tm4j.testng" level="INFO" additivity="false">
<AppenderRef ref="STDOUT"/>
</Logger>
<Root level="error">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.letsrokk.adaptavist.tests;
package com.github.letsrokk.tm4j.tests;

import io.qameta.allure.TmsLink;
import org.testng.annotations.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.letsrokk.adaptavist.tests;
package com.github.letsrokk.tm4j.tests;

import com.github.letsrokk.adaptavist.annotation.TestCase;
import com.github.letsrokk.tm4j.annotation.TestCase;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.testng.internal.TestResult;
Expand Down Expand Up @@ -37,7 +37,7 @@ public void testExecutionDataProviderWithFailTest(boolean success) {
if(success) {
tm4jListener.onTestSuccess(testResult);
} else {
testResult.setThrowable(new ExampleException("Adaptavist Fail Example"));
testResult.setThrowable(new ExampleException("TM4J Fail Example"));
testResult.setStatus(TestResult.FAILURE);
tm4jListener.onTestFailure(testResult);
testResult.setThrowable(null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.letsrokk.adaptavist.tests;
package com.github.letsrokk.tm4j.tests;

import com.github.letsrokk.adaptavist.annotation.TestCase;
import com.github.letsrokk.tm4j.annotation.TestCase;
import org.testng.annotations.Test;
import org.testng.internal.TestResult;

Expand All @@ -18,7 +18,7 @@ public void sameTestCaseKeyPassTest() {
@Test
public void sameTestCaseKeyFailTest() {
tm4jListener.onTestStart(testResult);
testResult.setThrowable(new ExampleException("Adaptavist Fail Example"));
testResult.setThrowable(new ExampleException("TM4J Fail Example"));
testResult.setStatus(TestResult.FAILURE);
tm4jListener.onTestFailure(testResult);
testResult.setThrowable(null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.letsrokk.adaptavist.tests;
package com.github.letsrokk.tm4j.tests;

import com.github.letsrokk.adaptavist.annotation.TestCase;
import com.github.letsrokk.tm4j.annotation.TestCase;
import org.testng.annotations.Test;
import org.testng.internal.TestResult;

Expand All @@ -24,7 +24,7 @@ public void testExecutionWithPassStatusTest() {
@Test
public void testExecutionWithFailStatusTest() {
tm4jListener.onTestStart(testResult);
testResult.setThrowable(new ExampleException("Adaptavist Fail Example"));
testResult.setThrowable(new ExampleException("TM4J Fail Example"));
testResult.setStatus(TestResult.FAILURE);
tm4jListener.onTestFailure(testResult);
testResult.setThrowable(null);
Expand All @@ -42,7 +42,7 @@ public void sameTestCaseKeyPassTest() {
@Test
public void sameTestCaseKeyFailTest() {
tm4jListener.onTestStart(testResult);
testResult.setThrowable(new ExampleException("Adaptavist Fail Example"));
testResult.setThrowable(new ExampleException("TM4J Fail Example"));
testResult.setStatus(TestResult.FAILURE);
tm4jListener.onTestFailure(testResult);
testResult.setThrowable(null);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.github.letsrokk.adaptavist.tests;
package com.github.letsrokk.tm4j.tests;

import com.github.letsrokk.adaptavist.testng.AdaptavistTestResultListerner;
import com.github.letsrokk.tm4j.testng.TM4JTestResultListerner;
import org.testng.ISuite;
import org.testng.ITestContext;
import org.testng.ITestResult;
Expand All @@ -16,7 +16,7 @@ public class TestBase {

final static protected String TM4J_PROJECT_KEY = "AQA";
final static protected String TESTNG_PARAMETER_TM4J_PROJECT_KEY = "tm4jProjectKey";
static protected AdaptavistTestResultListerner tm4jListener;
static protected TM4JTestResultListerner tm4jListener;
static protected ISuite testSuite;
static protected ITestContext testContext;
static protected ITestResult testResult;
Expand All @@ -25,7 +25,7 @@ public class TestBase {
public void startSuite(ITestContext iTestContext) {
testSuite = iTestContext.getSuite();
testSuite.getXmlSuite().setParameters(Collections.singletonMap(TESTNG_PARAMETER_TM4J_PROJECT_KEY, TM4J_PROJECT_KEY));
tm4jListener = new AdaptavistTestResultListerner();
tm4jListener = new TM4JTestResultListerner();
tm4jListener.onStart(testSuite);
}

Expand Down
6 changes: 3 additions & 3 deletions tm4j-testng/src/test/resources/configuration-example.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Adaptavist TM4J Test Suite" verbose="1" >
<suite name="TM4J Test Suite" verbose="1" >

<parameter name="tm4jProjectKey" value="AQA"/>

<listeners>
<listener class-name="com.github.letsrokk.adaptavist.testng.AdaptavistTestResultListerner"/>
<listener class-name="com.github.letsrokk.tm4j.testng.TM4JTestResultListerner"/>
</listeners>

<test name="Example Test" >
<classes>
<class name="com.github.letsrokk.adaptavist.tests.ConfigurationExampleTest" />
<class name="com.github.letsrokk.tm4j.tests.ConfigurationExampleTest" />
</classes>
</test>

Expand Down
2 changes: 1 addition & 1 deletion tm4j-testng/src/test/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</Appenders>

<Loggers>
<Logger name="com.github.letsrokk.adaptavist.testng" level="DEBUG" additivity="false">
<Logger name="com.github.letsrokk.tm4j.testng" level="DEBUG" additivity="false">
<AppenderRef ref="STDOUT"/>
</Logger>
<Root level="error">
Expand Down
8 changes: 4 additions & 4 deletions tm4j-testng/src/test/resources/testng.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="Adaptavist TM4J Test Results Listener" verbose="1" >
<suite name="TM4J Test Results Listener" verbose="1" >

<test name="Export Results for Simple Tests" parallel="none" >
<classes>
<class name="com.github.letsrokk.adaptavist.tests.SimpleTestsTest" />
<class name="com.github.letsrokk.adaptavist.tests.RepeatableTestKeyTest" />
<class name="com.github.letsrokk.tm4j.tests.SimpleTestsTest" />
<class name="com.github.letsrokk.tm4j.tests.RepeatableTestKeyTest" />
</classes>
</test>

<test name="Export Results for DataProvider Tests" >
<classes>
<class name="com.github.letsrokk.adaptavist.tests.DataProviderTestsTest" />
<class name="com.github.letsrokk.tm4j.tests.DataProviderTestsTest" />
</classes>
</test>

Expand Down

0 comments on commit c4d7ec0

Please sign in to comment.