Skip to content

Commit

Permalink
apply autostyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzmitry Sankouski committed Mar 12, 2022
1 parent c5f5412 commit 98475c7
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ public interface IDataProvidable {
Class<?> getDataProviderClass();

void setDataProviderClass(Class<?> v);

String getDataProviderDynamicClass();

void setDataProviderDynamicClass(String v);

}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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. */
Expand Down
11 changes: 5 additions & 6 deletions testng-core/src/main/java/org/testng/internal/Parameters.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 98475c7

Please sign in to comment.