diff --git a/build.gradle b/build.gradle
index 3fe8837..1e39ed9 100644
--- a/build.gradle
+++ b/build.gradle
@@ -44,7 +44,10 @@ dependencies {
implementation 'com.github.reportportal:plugin-api:a9a8b73'
annotationProcessor 'com.github.reportportal:plugin-api:a9a8b73'
}
- implementation 'org.hibernate:hibernate-core:6.5.2.Final'
+ implementation 'org.hibernate:hibernate-core:5.6.15.Final'
+
+ testImplementation 'org.junit.jupiter:junit-jupiter-api:5.7.2'
+ testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.7.2'
// add lombok support
compileOnly "org.projectlombok:lombok:${lombokVersion}"
@@ -54,6 +57,11 @@ dependencies {
}
+test {
+ useJUnitPlatform()
+ onlyIf { Boolean.getBoolean(testsEnabled) } // enable for debugging purposes only
+}
+
generatePomFileForShadowPublication { pom.packaging = "jar" }
jar {
@@ -64,7 +72,7 @@ jar {
"Plugin-Version": "${project.version}",
"Plugin-Provider": "Pavel Bortnik",
"Plugin-Class": "com.epam.reportportal.saucelabs.SaucelabsPlugin",
-// "Plugin-Dependencies": ""
+ // "Plugin-Dependencies": ""
)
}
}
@@ -73,9 +81,7 @@ shadowJar {
archiveClassifier.set(null)
zip64 true
dependencies {
-// include(dependency('com.saucelabs:saucerest:2.5.1'))
-
-
+ include(dependency('org.hibernate:hibernate-core:5.6.15.Final'))
}
}
diff --git a/gradle.properties b/gradle.properties
index 4c492f1..a901d0b 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,2 +1,3 @@
version=5.11.0
lombokVersion=1.18.34
+testsEnabled=false
diff --git a/src/main/java/com/epam/reportportal/saucelabs/MemoizingSupplier.java b/src/main/java/com/epam/reportportal/saucelabs/MemoizingSupplier.java
index 6036c3f..1281488 100644
--- a/src/main/java/com/epam/reportportal/saucelabs/MemoizingSupplier.java
+++ b/src/main/java/com/epam/reportportal/saucelabs/MemoizingSupplier.java
@@ -13,41 +13,42 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package com.epam.reportportal.saucelabs;
+import static com.google.common.base.Preconditions.checkNotNull;
+
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.function.Supplier;
-import static com.google.common.base.Preconditions.checkNotNull;
-
/**
* @author Ivan Budayeu
*/
public class MemoizingSupplier implements Supplier {
- private final Supplier delegate;
-
- private AtomicBoolean initialized = new AtomicBoolean(false);
-
- private T value;
-
- public MemoizingSupplier(Supplier delegate) {
- this.delegate = checkNotNull(delegate);
- }
-
- @Override
- public T get() {
- if (!initialized.get()) {
- synchronized (this) {
- if (!initialized.get()) {
- T t = delegate.get();
- value = t;
- initialized.set(true);
- return t;
- }
- }
- }
- return value;
- }
+ private final Supplier delegate;
+
+ private AtomicBoolean initialized = new AtomicBoolean(false);
+
+ private T value;
+
+ public MemoizingSupplier(Supplier delegate) {
+ this.delegate = checkNotNull(delegate);
+ }
+
+ @Override
+ public T get() {
+ if (!initialized.get()) {
+ synchronized (this) {
+ if (!initialized.get()) {
+ T t = delegate.get();
+ value = t;
+ initialized.set(true);
+ return t;
+ }
+ }
+ }
+ return value;
+ }
}
diff --git a/src/main/java/com/epam/reportportal/saucelabs/SaucelabsExtension.java b/src/main/java/com/epam/reportportal/saucelabs/SaucelabsExtension.java
index 7f4d043..fad47fd 100644
--- a/src/main/java/com/epam/reportportal/saucelabs/SaucelabsExtension.java
+++ b/src/main/java/com/epam/reportportal/saucelabs/SaucelabsExtension.java
@@ -16,6 +16,8 @@
package com.epam.reportportal.saucelabs;
+import static java.util.stream.Collectors.toList;
+
import com.epam.reportportal.extension.CommonPluginCommand;
import com.epam.reportportal.extension.PluginCommand;
import com.epam.reportportal.extension.ReportPortalExtensionPoint;
@@ -26,6 +28,7 @@
import com.epam.reportportal.saucelabs.command.GetRealDeviceJobCommand;
import com.epam.reportportal.saucelabs.command.GetVirtualDeviceJobCommand;
import com.epam.reportportal.saucelabs.command.TestConnectionCommand;
+import com.epam.reportportal.saucelabs.model.DataCenter;
import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.Arrays;
@@ -44,7 +47,6 @@ public class SaucelabsExtension implements ReportPortalExtensionPoint {
private static final String DOCUMENTATION_LINK_FIELD = "documentationLink";
private static final String DOCUMENTATION_LINK = "https://reportportal.io/docs/plugins/SauceLabs";
- static final String JOB_ID = "jobId";
private final Supplier