Skip to content

Commit ec21b8e

Browse files
authored
Merge branch 'master' into update_appium_client_9_0_0
2 parents d2040e0 + af9a950 commit ec21b8e

File tree

9 files changed

+31
-36
lines changed

9 files changed

+31
-36
lines changed

jdi-eyes-demo/src/test/java/com/jdi/testng/TestNGListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Email: [email protected]; Skype: roman.iovlev
66
*/
77

8-
import com.jdiai.tools.Safe;
98
import org.testng.IInvokedMethod;
109
import org.testng.IInvokedMethodListener;
1110
import org.testng.ITestNGMethod;
@@ -22,7 +21,7 @@
2221
import static java.lang.System.currentTimeMillis;
2322

2423
public class TestNGListener implements IInvokedMethodListener {
25-
private Safe<Long> start = new Safe<>(0L);
24+
private Long start = currentTimeMillis();
2625

2726
@Override
2827
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
@@ -31,7 +30,7 @@ public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
3130
if (testMethod.getConstructorOrMethod().getMethod().isAnnotationPresent(Test.class)) {
3231
TEST_NAME.set( last(testMethod.getTestClass().getName().split("\\.")) +
3332
"." + testMethod.getMethodName());
34-
start.set(currentTimeMillis());
33+
start = currentTimeMillis();
3534
logger.step("== Test '%s' START ==", TEST_NAME.get());
3635
}
3736
}
@@ -43,7 +42,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult tr) {
4342
String result = getTestResult(tr);
4443
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
4544
new SimpleDateFormat("mm:ss.SS")
46-
.format(new Date(currentTimeMillis() - start.get())));
45+
.format(new Date(currentTimeMillis() - start)));
4746
if ("FAILED".equals(result)) {
4847
try {
4948
screenshotStep("On Fail Screenshot");

jdi-light-angular-tests-with-mocks/src/test/java/io/github/epam/testng/TestNGListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.github.epam.testng;
22

3-
import com.jdiai.tools.Safe;
43
import org.testng.IInvokedMethod;
54
import org.testng.IInvokedMethodListener;
65
import org.testng.ITestResult;
@@ -17,7 +16,7 @@
1716

1817
public class TestNGListener implements IInvokedMethodListener {
1918

20-
private Safe<Long> start = new Safe<>(0L);
19+
private Long start = currentTimeMillis();
2120

2221
@Override
2322
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
@@ -26,7 +25,7 @@ public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
2625
if (testMethod.isAnnotationPresent(Test.class)) {
2726
TEST_NAME.set(
2827
tr.getTestClass().getRealClass().getSimpleName() + "." + testMethod.getName());
29-
start.set(currentTimeMillis());
28+
start = currentTimeMillis();
3029
logger.step("== Test '%s' START ==", TEST_NAME.get());
3130
}
3231
}
@@ -38,7 +37,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult r) {
3837
String result = getTestResult(r);
3938
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
4039
new SimpleDateFormat("mm:ss.SS")
41-
.format(new Date(currentTimeMillis() - start.get())));
40+
.format(new Date(currentTimeMillis() - start)));
4241
if ("FAILED".equals(result)) {
4342
try {
4443
screenshotStep("On Fail Screenshot");

jdi-light-angular-tests/src/test/java/io/github/epam/testng/TestNGListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.github.epam.testng;
22

3-
import com.jdiai.tools.Safe;
43
import org.testng.IInvokedMethod;
54
import org.testng.IInvokedMethodListener;
65
import org.testng.ITestNGMethod;
@@ -17,7 +16,7 @@
1716
import static java.lang.System.currentTimeMillis;
1817

1918
public class TestNGListener implements IInvokedMethodListener {
20-
private Safe<Long> start = new Safe<>(0L);
19+
private Long start = currentTimeMillis();
2120

2221
@Override
2322
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
@@ -26,7 +25,7 @@ public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
2625
if (testMethod.getConstructorOrMethod().getMethod().isAnnotationPresent(Test.class)) {
2726
TEST_NAME.set( last(testMethod.getTestClass().getName().split("\\.")) +
2827
"." + testMethod.getMethodName());
29-
start.set(currentTimeMillis());
28+
start = currentTimeMillis();
3029
logger.step("== Test '%s' START ==", TEST_NAME.get());
3130
}
3231
}
@@ -38,7 +37,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult tr) {
3837
String result = getTestResult(tr);
3938
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
4039
new SimpleDateFormat("mm:ss.SS")
41-
.format(new Date(currentTimeMillis() - start.get())));
40+
.format(new Date(currentTimeMillis() - start)));
4241
if ("FAILED".equals(result)) {
4342
try {
4443
screenshotStep("On Fail Screenshot");

jdi-light-bootstrap-tests/src/test/java/io/github/epam/testng/TestNGListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Email: [email protected]; Skype: roman.iovlev
66
*/
77

8-
import com.jdiai.tools.Safe;
98
import org.testng.IInvokedMethod;
109
import org.testng.IInvokedMethodListener;
1110
import org.testng.ITestResult;
@@ -20,14 +19,14 @@
2019
import static java.lang.System.currentTimeMillis;
2120

2221
public class TestNGListener implements IInvokedMethodListener {
23-
private Safe<Long> start = new Safe<>(0L);
22+
private Long start = currentTimeMillis();
2423
@Override
2524
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
2625
if (m.isTestMethod()) {
2726
Method testMethod = m.getTestMethod().getConstructorOrMethod().getMethod();
2827
if (testMethod.isAnnotationPresent(Test.class)) {
2928
TEST_NAME.set(tr.getTestClass().getRealClass().getSimpleName()+"."+testMethod.getName());
30-
start.set(currentTimeMillis());
29+
start = currentTimeMillis();
3130
logger.step("== Test '%s' START ==", TEST_NAME.get());
3231
}
3332
}
@@ -38,7 +37,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult r) {
3837
if (method.isTestMethod()) {
3938
String result = getTestResult(r);
4039
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
41-
new SimpleDateFormat("mm:ss.SS").format(new Date(currentTimeMillis()-start.get())));
40+
new SimpleDateFormat("mm:ss.SS").format(new Date(currentTimeMillis() - start)));
4241
logger.step("");
4342
}
4443
}

jdi-light-material-ui-tests/src/test/java/io/github/epam/testng/TestNGListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.github.epam.testng;
22

3-
import com.jdiai.tools.Safe;
43
import org.testng.IInvokedMethod;
54
import org.testng.IInvokedMethodListener;
65
import org.testng.ITestNGMethod;
@@ -17,7 +16,7 @@
1716
import static java.lang.System.currentTimeMillis;
1817

1918
public class TestNGListener implements IInvokedMethodListener {
20-
private Safe<Long> start = new Safe<>(0L);
19+
private Long start = currentTimeMillis();
2120

2221
@Override
2322
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
@@ -26,7 +25,7 @@ public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
2625
if (testMethod.getConstructorOrMethod().getMethod().isAnnotationPresent(Test.class)) {
2726
TEST_NAME.set(last(testMethod.getTestClass().getName().split("\\."))
2827
+ "." + testMethod.getMethodName());
29-
start.set(currentTimeMillis());
28+
start = currentTimeMillis();
3029
logger.step("== Test '%s' START ==", TEST_NAME.get());
3130
}
3231
}
@@ -38,7 +37,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult tr) {
3837
String result = getTestResult(tr);
3938
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
4039
new SimpleDateFormat("mm:ss.SS")
41-
.format(new Date(currentTimeMillis() - start.get())));
40+
.format(new Date(currentTimeMillis() - start)));
4241
if ("FAILED".equals(result)) {
4342
try {
4443
takeScreen();

jdi-light-vuetify-tests/src/test/java/io/github/epam/testng/TestNGListener.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package io.github.epam.testng;
22

3-
import com.jdiai.tools.Safe;
43
import org.testng.IInvokedMethod;
54
import org.testng.IInvokedMethodListener;
65
import org.testng.ITestNGMethod;
@@ -17,7 +16,7 @@
1716
import static java.lang.System.currentTimeMillis;
1817

1918
public class TestNGListener implements IInvokedMethodListener {
20-
private Safe<Long> start = new Safe<>(0L);
19+
private Long start = currentTimeMillis();
2120

2221
@Override
2322
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
@@ -26,7 +25,7 @@ public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
2625
if (testMethod.getConstructorOrMethod().getMethod().isAnnotationPresent(Test.class)) {
2726
TEST_NAME.set( last(testMethod.getTestClass().getName().split("\\.")) +
2827
"." + testMethod.getMethodName());
29-
start.set(currentTimeMillis());
28+
start = currentTimeMillis();
3029
logger.step("== Test '%s' START ==", TEST_NAME.get());
3130
}
3231
}
@@ -38,7 +37,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult tr) {
3837
String result = getTestResult(tr);
3938
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
4039
new SimpleDateFormat("mm:ss.SS")
41-
.format(new Date(currentTimeMillis() - start.get())));
40+
.format(new Date(currentTimeMillis() - start)));
4241
if ("FAILED".equals(result)) {
4342
try {
4443
takeScreen();

test-examples/jdi-light-examples/src/test/java/io/github/epam/testng/TestNGListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Email: [email protected]; Skype: roman.iovlev
66
*/
77

8-
import com.jdiai.tools.Safe;
98
import org.testng.IInvokedMethod;
109
import org.testng.IInvokedMethodListener;
1110
import org.testng.ITestNGMethod;
@@ -21,7 +20,8 @@
2120
import static com.jdiai.tools.LinqUtils.last;
2221
import static java.lang.System.currentTimeMillis;
2322

24-
public class TestNGListener implements IInvokedMethodListener { private Safe<Long> start = new Safe<>(0L);
23+
public class TestNGListener implements IInvokedMethodListener {
24+
private Long start = currentTimeMillis();
2525

2626
@Override
2727
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
@@ -30,7 +30,7 @@ public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
3030
if (testMethod.getConstructorOrMethod().getMethod().isAnnotationPresent(Test.class)) {
3131
TEST_NAME.set( last(testMethod.getTestClass().getName().split("\\.")) +
3232
"." + testMethod.getMethodName());
33-
start.set(currentTimeMillis());
33+
start = currentTimeMillis();
3434
logger.step("== Test '%s' START ==", TEST_NAME.get());
3535
}
3636
}
@@ -42,7 +42,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult tr) {
4242
String result = getTestResult(tr);
4343
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
4444
new SimpleDateFormat("mm:ss.SS")
45-
.format(new Date(currentTimeMillis() - start.get())));
45+
.format(new Date(currentTimeMillis() - start)));
4646
if ("FAILED".equals(result)) {
4747
try {
4848
screenshotStep("On Fail Screenshot");

test-examples/jdi-performance/src/test/java/org/mytests/tests/testng/TestNGListener.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Email: [email protected]; Skype: roman.iovlev
66
*/
77

8-
import com.jdiai.tools.Safe;
98
import org.testng.IInvokedMethod;
109
import org.testng.IInvokedMethodListener;
1110
import org.testng.ITestNGMethod;
@@ -21,7 +20,9 @@
2120
import static com.jdiai.tools.LinqUtils.last;
2221
import static java.lang.System.currentTimeMillis;
2322

24-
public class TestNGListener implements IInvokedMethodListener { private Safe<Long> start = new Safe<>(0L);
23+
public class TestNGListener implements IInvokedMethodListener {
24+
25+
private Long start = 0L;
2526

2627
@Override
2728
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
@@ -30,7 +31,7 @@ public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
3031
if (testMethod.getConstructorOrMethod().getMethod().isAnnotationPresent(Test.class)) {
3132
TEST_NAME.set( last(testMethod.getTestClass().getName().split("\\.")) +
3233
"." + testMethod.getMethodName());
33-
start.set(currentTimeMillis());
34+
start = currentTimeMillis();
3435
logger.step("== Test '%s' START ==", TEST_NAME.get());
3536
}
3637
}
@@ -42,7 +43,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult tr) {
4243
String result = getTestResult(tr);
4344
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
4445
new SimpleDateFormat("mm:ss.SS")
45-
.format(new Date(currentTimeMillis() - start.get())));
46+
.format(new Date(currentTimeMillis() - start)));
4647
if ("FAILED".equals(result)) {
4748
try {
4849
screenshotStep("On Fail Screenshot");

test-templates/jdi-light-testng-template/src/test/java/org/mytests/tests/testng/TestNGListener.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* Email: [email protected]; Skype: roman.iovlev
66
*/
77

8-
import com.jdiai.tools.Safe;
98
import org.testng.IInvokedMethod;
109
import org.testng.IInvokedMethodListener;
1110
import org.testng.ITestNGMethod;
@@ -21,7 +20,8 @@
2120
import static com.jdiai.tools.LinqUtils.last;
2221
import static java.lang.System.currentTimeMillis;
2322

24-
public class TestNGListener implements IInvokedMethodListener { private Safe<Long> start = new Safe<>(0L);
23+
public class TestNGListener implements IInvokedMethodListener {
24+
private Long start = currentTimeMillis();
2525

2626
@Override
2727
public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
@@ -30,7 +30,7 @@ public void beforeInvocation(IInvokedMethod m, ITestResult tr) {
3030
if (testMethod.getConstructorOrMethod().getMethod().isAnnotationPresent(Test.class)) {
3131
TEST_NAME.set( last(testMethod.getTestClass().getName().split("\\.")) +
3232
"." + testMethod.getMethodName());
33-
start.set(currentTimeMillis());
33+
start = currentTimeMillis();
3434
logger.step("== Test '%s' START ==", TEST_NAME.get());
3535
}
3636
}
@@ -42,7 +42,7 @@ public void afterInvocation(IInvokedMethod method, ITestResult tr) {
4242
String result = getTestResult(tr);
4343
logger.step("=== Test '%s' %s [%s] ===", TEST_NAME.get(), result,
4444
new SimpleDateFormat("mm:ss.SS")
45-
.format(new Date(currentTimeMillis() - start.get())));
45+
.format(new Date(currentTimeMillis() - start)));
4646
if ("FAILED".equals(result)) {
4747
try {
4848
screenshotStep("On Fail Screenshot");

0 commit comments

Comments
 (0)