Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions testng-core/src/main/java/org/testng/TestClass.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,13 @@ private void initTestClassesAndInstances() {
}
}

@Deprecated
@Override
public Object[] getInstances(boolean create) {
return iClass.getInstances(create);
}

@Deprecated
@Override
public Object[] getInstances(boolean create, @Nullable String errorMsgPrefix) {
return iClass.getInstances(create, this.m_errorMsgPrefix);
Expand All @@ -163,11 +165,14 @@ public IObject.IdentifiableObject[] getObjects(boolean create, @Nullable String
return IObject.objects(iClass, create, errorMsgPrefix);
}

// Deprecated as IClass.getInstanceHashCodes(); the IObject method it also serves is current.
@Deprecated
@Override
public long[] getInstanceHashCodes() {
return IObject.instanceHashCodes(iClass);
}

@Deprecated
@Override
public void addInstance(Object instance) {
iClass.addInstance(instance);
Expand Down
10 changes: 8 additions & 2 deletions testng-core/src/main/java/org/testng/TestNG.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public class TestNG {
/** The default name of the result's output directory (keep public, used by Eclipse). */
public static final String DEFAULT_OUTPUTDIR = "test-output";

/** The suite file looked up inside a jar when none was named. */
private static final String DEFAULT_XML_PATH_IN_JAR = "testng.xml";

/** How many suites run at once when none was asked for: one, so suites run sequentially. */
private static final Integer DEFAULT_SUITE_THREAD_POOL_SIZE = 1;

private static @Nullable TestNG m_instance;

private @Nullable List<String> m_commandLineMethods;
Expand Down Expand Up @@ -175,7 +181,7 @@ public class TestNG {

private @Nullable String m_jarPath;
/** The path of the testng.xml file inside the jar file */
private String m_xmlPathInJar = CommandLineArgs.XML_PATH_IN_JAR_DEFAULT;
private String m_xmlPathInJar = DEFAULT_XML_PATH_IN_JAR;

private List<String> m_stringSuites = new ArrayList<>();
private final List<Class<? extends ITestNGListener>> m_listenerClasses = new ArrayList<>();
Expand Down Expand Up @@ -876,7 +882,7 @@ public List<ISuiteListener> getSuiteListeners() {

private boolean m_ignoreMissedTestNames;

private Integer m_suiteThreadPoolSize = CommandLineArgs.SUITE_THREAD_POOL_SIZE_DEFAULT;
private Integer m_suiteThreadPoolSize = DEFAULT_SUITE_THREAD_POOL_SIZE;

private boolean m_randomizeSuites = Boolean.FALSE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public Class<?> getRealClass() {
return m_class;
}

// Deprecated as IClass.getInstanceHashCodes(); the IObject method it also serves is current.
@Deprecated
@Override
public long @Nullable [] getInstanceHashCodes() {
return m_instanceHashCodes;
Expand Down Expand Up @@ -120,11 +122,13 @@ public XmlTest getXmlTest() {
return m_defaultInstance;
}

@Deprecated
@Override
public Object[] getInstances(boolean create) {
return getInstances(create, "");
}

@Deprecated
@Override
public Object[] getInstances(boolean create, @Nullable String errorMsgPrefix) {
return Arrays.stream(getObjects(create, errorMsgPrefix))
Expand Down Expand Up @@ -163,6 +167,7 @@ public String toString() {
return Objects.toStringHelper(getClass()).add("class", m_class.getName()).toString();
}

@Deprecated
@Override
public void addInstance(Object instance) {
addObject(new IdentifiableObject(instance));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ public ITestNGMethod[] getAfterGroupsMethods() {
}

/** @see org.testng.internal.IObject#getInstanceHashCodes() */
// Deprecated as IClass.getInstanceHashCodes(); the IObject method it also serves is current.
@Deprecated
@Override
public long[] getInstanceHashCodes() {
return m_instanceHashes;
}

@Deprecated
@Override
public Object[] getInstances(boolean reuse) {
return m_instances;
Expand All @@ -152,6 +155,7 @@ public Class<?> getRealClass() {
return testClass;
}

@Deprecated
@Override
public void addInstance(Object instance) {}

Expand Down
Loading