From 98475c72bcc8d6fd56f9154d6d5e68cccfb0e027 Mon Sep 17 00:00:00 2001 From: Dzmitry Sankouski Date: Sat, 12 Mar 2022 09:43:29 +0300 Subject: [PATCH] apply autostyle --- .../testng/internal/annotations/IDataProvidable.java | 2 +- .../java/org/testng/internal/DataProviderLoader.java | 6 ++++-- .../testng/internal/DataProviderMethodRemovable.java | 2 -- .../src/main/java/org/testng/internal/Parameters.java | 11 +++++------ 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/testng-core-api/src/main/java/org/testng/internal/annotations/IDataProvidable.java b/testng-core-api/src/main/java/org/testng/internal/annotations/IDataProvidable.java index 5b7ec8ae9e..075fd9cf3b 100644 --- a/testng-core-api/src/main/java/org/testng/internal/annotations/IDataProvidable.java +++ b/testng-core-api/src/main/java/org/testng/internal/annotations/IDataProvidable.java @@ -9,8 +9,8 @@ public interface IDataProvidable { Class getDataProviderClass(); void setDataProviderClass(Class v); + String getDataProviderDynamicClass(); void setDataProviderDynamicClass(String v); - } diff --git a/testng-core/src/main/java/org/testng/internal/DataProviderLoader.java b/testng-core/src/main/java/org/testng/internal/DataProviderLoader.java index fe73dde2c3..d0b9584175 100644 --- a/testng-core/src/main/java/org/testng/internal/DataProviderLoader.java +++ b/testng-core/src/main/java/org/testng/internal/DataProviderLoader.java @@ -21,8 +21,10 @@ public Class loadClazz(String path) throws ClassNotFoundException { private byte[] loadClassData(String className) throws ClassNotFoundException { // read class - InputStream in = this.getClass().getClassLoader() - .getResourceAsStream(className.replace(".", "/") + ".class"); + InputStream in = + this.getClass() + .getClassLoader() + .getResourceAsStream(className.replace(".", "/") + ".class"); if (in == null) { throw new ClassNotFoundException("Cannot load resource input stream: " + className); } diff --git a/testng-core/src/main/java/org/testng/internal/DataProviderMethodRemovable.java b/testng-core/src/main/java/org/testng/internal/DataProviderMethodRemovable.java index 752e4895a1..b4c1a98171 100644 --- a/testng-core/src/main/java/org/testng/internal/DataProviderMethodRemovable.java +++ b/testng-core/src/main/java/org/testng/internal/DataProviderMethodRemovable.java @@ -1,8 +1,6 @@ package org.testng.internal; import java.lang.reflect.Method; -import java.util.List; -import org.testng.IDataProviderMethod; import org.testng.annotations.IDataProviderAnnotation; /** Represents an @{@link org.testng.annotations.DataProvider} annotated method. */ diff --git a/testng-core/src/main/java/org/testng/internal/Parameters.java b/testng-core/src/main/java/org/testng/internal/Parameters.java index 37996d25e2..253a23df53 100644 --- a/testng-core/src/main/java/org/testng/internal/Parameters.java +++ b/testng-core/src/main/java/org/testng/internal/Parameters.java @@ -495,12 +495,11 @@ private static IDataProviderMethod findDataProvider( if (dp != null) { String dataProviderName = dp.getDataProvider(); Class dataProviderClass = dp.getDataProviderClass(); - boolean isDynamicDataProvider = dataProviderClass == null - && !dp.getDataProviderDynamicClass().isEmpty(); + boolean isDynamicDataProvider = + dataProviderClass == null && !dp.getDataProviderDynamicClass().isEmpty(); if (isDynamicDataProvider) { try { - dataProviderClass = new DataProviderLoader() - .loadClazz(dp.getDataProviderDynamicClass()); + dataProviderClass = new DataProviderLoader().loadClazz(dp.getDataProviderDynamicClass()); } catch (ClassNotFoundException e) { e.printStackTrace(); } @@ -865,8 +864,8 @@ public void remove() { } if (dataProviderMethod instanceof DataProviderMethodRemovable) { - ((DataProviderMethodRemovable) dataProviderMethod).setMethod(null); - ((DataProviderMethodRemovable) dataProviderMethod).setInstance(null); + ((DataProviderMethodRemovable) dataProviderMethod).setMethod(null); + ((DataProviderMethodRemovable) dataProviderMethod).setInstance(null); if (testMethod instanceof TestNGMethod) { ((TestNGMethod) testMethod).setDataProviderMethod(null); }