Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos #2772

Merged
merged 8 commits into from Jun 3, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGES.txt
Expand Up @@ -1322,7 +1322,7 @@ Added: comand line support for setting parallel mode, suite and test names
Eclipse plug-in
Added: Support for configuring per project usedefaultlisteners
Added: Contextual drop-down menu on failures tab of the TestNG view to enable running/debugging method failure only
Added: Suppport for configuring per project TestNG jar usage (project provided one or plugin provided one)
Added: Support for configuring per project TestNG jar usage (project provided one or plugin provided one)

===========================================================================
5.2
Expand Down
4 changes: 2 additions & 2 deletions build-logic/jvm/build.gradle.kts
Expand Up @@ -11,8 +11,8 @@ repositories {
dependencies {
implementation(project(":basics"))
implementation(project(":code-quality"))
implementation("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.74")
implementation("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.20")
implementation("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.78")
implementation("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.6.21")
}

tasks.withType<KotlinCompile>().configureEach {
Expand Down
2 changes: 1 addition & 1 deletion build-logic/publishing/build.gradle.kts
Expand Up @@ -10,7 +10,7 @@ repositories {

dependencies {
implementation(project(":jvm"))
implementation("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.74")
implementation("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.78")
implementation("com.github.johnrengelman.shadow:com.github.johnrengelman.shadow.gradle.plugin:7.0.0")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
Expand Down
22 changes: 11 additions & 11 deletions testng-asserts/src/test/java/org/testng/AssertTest.java
Expand Up @@ -47,9 +47,9 @@ public void testCollectionAssertEquals() {
}

@Test(description = "GITHUB-2483", expectedExceptions = AssertionError.class)
public void testAsymetricNotEquals() {
AsymetricEquals equalsSame = AsymetricEquals.equalsSame();
AsymetricEquals equalsAll = AsymetricEquals.equalsAll();
public void testAsymmetricNotEquals() {
AsymmetricEquals equalsSame = AsymmetricEquals.equalsSame();
AsymmetricEquals equalsAll = AsymmetricEquals.equalsAll();
// sanity
Assert.assertFalse(equalsSame.equals(equalsAll));
Assert.assertTrue(equalsAll.equals(equalsSame));
Expand Down Expand Up @@ -617,28 +617,28 @@ public int hashCode() {
}
}

static class AsymetricEquals {
static class AsymmetricEquals {

static AsymetricEquals equalsAll() {
return new AsymetricEquals(null);
static AsymmetricEquals equalsAll() {
return new AsymmetricEquals(null);
}

static AsymetricEquals equalsSame() {
return new AsymetricEquals(new Object());
static AsymmetricEquals equalsSame() {
return new AsymmetricEquals(new Object());
}

Object value;

private AsymetricEquals(Object value) {
private AsymmetricEquals(Object value) {
this.value = value;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof AsymetricEquals)) return false;
if (!(o instanceof AsymmetricEquals)) return false;

AsymetricEquals that = (AsymetricEquals) o;
AsymmetricEquals that = (AsymmetricEquals) o;
if (value == null) return true;
return value.equals(that.value);
}
Expand Down
@@ -1,6 +1,6 @@
package org.testng;

// WARNING: Donot delete this interface. This is internally being referred to by Gradle here
// WARNING: Do not delete this interface. This is internally being referred to by Gradle here
// https://github.com/gradle/gradle/blob/f0b9d60906c7b8c42cd6c61a39ae7b74767bb012/subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/testng/TestNGListenerAdapterFactory.java#L37-L49
/** @deprecated As of release 7.0.0, replaced by {@link org.testng.IConfigurationListener} */
@Deprecated
Expand Down
2 changes: 1 addition & 1 deletion testng-core-api/src/main/java/org/testng/Reporter.java
Expand Up @@ -75,7 +75,7 @@ private static synchronized void log(String s, ITestResult m) {
}

if (m == null) {
// Persist the output temporarily into a Threadlocal String list.
// Persist the output temporarily into a ThreadLocal String list.
if (m_orphanedOutput.get() == null) {
m_orphanedOutput.set(new ArrayList<>());
}
Expand Down
Expand Up @@ -72,9 +72,9 @@

/**
* The maximum number of milliseconds this method should take. If it hasn't returned after this
* time, this method will fail and it will cause test methods depending on it to be skipped.
* time, this method will fail, and it will cause test methods depending on it to be skipped.
*
* @return the valude (default 0)
* @return the value (default 0)
*/
long timeOut() default 0;
}
Expand Up @@ -21,7 +21,7 @@
String dataProvider() default "";

/**
* The class where to look for the data provider. If not specified, the dataprovider will be
* The class where to look for the data provider. If not specified, the data provider will be
* looked on the class of the current test method or one of its super classes. If this attribute
* is specified, the data provider method needs to be static on the specified class.
*
Expand Down
Expand Up @@ -96,7 +96,7 @@
String dataProvider() default "";

/**
* The class where to look for the data provider. If not specified, the dataprovider will be
* The class where to look for the data provider. If not specified, the data provider will be
* looked on the class of the current test method or one of its super classes. If this attribute
* is specified, the data provider method needs to be static on the specified class.
*
Expand Down
Expand Up @@ -89,7 +89,7 @@ public static void setProperty(Object instance, String name, String value) {
}

Object realValue = convertType(propClass, value, name);
// TODO: Here the property desc is serched again
// TODO: Here the property desc is searched again
setPropertyRealValue(instance, name, realValue);
}

Expand Down Expand Up @@ -130,7 +130,7 @@ private static PropertyDescriptor getPropertyDescriptor(
public static void setPropertyRealValue(Object instance, String name, Object value) {
if (instance == null) {
LOGGER.warn(
"Cannot set property " + name + " with value " + value + ". Targe instance is null");
"Cannot set property " + name + " with value " + value + ". Target instance is null");
return;
}

Expand Down
@@ -1,6 +1,6 @@
package org.testng.xml;

/** Represents the capabilities of a XML serialiser (As string) */
/** Represents the capabilities of a XML serializer (As string) */
public interface IWeaveXml {
/**
* Helps represent the contents of {@link XmlSuite} as a String.
Expand Down
Expand Up @@ -14,7 +14,7 @@ private XmlWeaver() {}

private static IWeaveXml getInstance() {
if (testMode) {
// Donot resort to caching when running Unit tests for TestNG, because we have to check
// Do not resort to caching when running Unit tests for TestNG, because we have to check
// both implementations. If we cache the instance, then its not possible to do that.
return attemptDefaultImplementationInstantiation();
}
Expand Down
6 changes: 3 additions & 3 deletions testng-core/src/main/java/org/testng/SuiteRunnerWorker.java
Expand Up @@ -158,10 +158,10 @@ public void calculateResultCounts(XmlSuite xmlSuite, SuiteRunnerMap suiteRunnerM
for (ISuiteResult isr : tempSuiteResult) {
ITestContext ctx = isr.getTestContext();
int passes = ctx.getPassedTests().size();
Map<String, Integer> seggregated = seggregateSkippedTests(ctx);
int skipped = seggregated.get(SKIPPED);
Map<String, Integer> segregated = seggregateSkippedTests(ctx);
int skipped = segregated.get(SKIPPED);
m_skipped += skipped;
int retried = seggregated.get(RETRIED);
int retried = segregated.get(RETRIED);
m_retries += retried;
int failed =
ctx.getFailedTests().size() + ctx.getFailedButWithinSuccessPercentageTests().size();
Expand Down
Expand Up @@ -13,8 +13,8 @@
* a time trigger.
*
* <p>By default the time format is yyyy/MM/dd (according to {@code SimpleDateFormat}). You can
* customize this by using the specialized constructors. Suppported date formats are according to
* the {@code SimpleDateFormat}.
* customize this by using the specialized constructors. Supported date formats are according to the
* {@code SimpleDateFormat}.
*
* @since 5.6
*/
Expand All @@ -41,7 +41,7 @@ public TimeBombSkipException(String msg, Date expirationDate) {

/**
* Creates a {@code TimeBombedSkipException} using the <code>expirationDate</code>. The <code>
* format</code> parameter wiil be used for performing the time comparison.
* format</code> parameter will be used for performing the time comparison.
*
* @param msg exception message
* @param expirationDate time limit after which the SKIP becomes a FAILURE
Expand Down Expand Up @@ -112,7 +112,7 @@ public TimeBombSkipException(String msg, Date expirationDate, Throwable cause) {

/**
* Creates a {@code TimeBombedSkipException} using the <code>expirationDate</code>. The <code>
* format</code> parameter wiil be used for performing the time comparison.
* format</code> parameter will be used for performing the time comparison.
*
* @param msg exception message
* @param expirationDate time limit after which the SKIP becomes a FAILURE
Expand Down
Expand Up @@ -374,13 +374,13 @@ protected void initGroups(Class<? extends ITestOrConfiguration> annotationClass)
protected void initBeforeAfterGroups(
Class<? extends ITestOrConfiguration> annotationClass, String[] groups) {
String[] groupsAtMethodLevel =
calculateGroupsTouseConsideringValuesAndGroupValues(annotationClass, groups);
calculateGroupsToUseConsideringValuesAndGroupValues(annotationClass, groups);
// @BeforeGroups and @AfterGroups annotation cannot be used at Class level. So its always null
setGroups(getStringArray(groupsAtMethodLevel, null));
initRestOfGroupDependencies(annotationClass);
}

private String[] calculateGroupsTouseConsideringValuesAndGroupValues(
private String[] calculateGroupsToUseConsideringValuesAndGroupValues(
Class<? extends ITestOrConfiguration> annotationClass, String[] groups) {
if (groups == null || groups.length == 0) {
ITestOrConfiguration annotation =
Expand Down
16 changes: 8 additions & 8 deletions testng-core/src/main/java/org/testng/internal/Parameters.java
Expand Up @@ -234,8 +234,8 @@ private static List<Object> createParams(
XmlSuite xmlSuite) {
List<Object> vResult = Lists.newArrayList();
if (optionalValues.length != parameterNames.length) {
FilterOutInJectedTypesResult filterOutResult =
filterOutInJectedTypesFromOptionalValues(parameterTypes, optionalValues);
FilterOutInjectedTypesResult filterOutResult =
filterOutInjectedTypesFromOptionalValues(parameterTypes, optionalValues);
optionalValues = filterOutResult.getOptionalValues();
parameterTypes = filterOutResult.getParameterTypes();
}
Expand Down Expand Up @@ -277,9 +277,9 @@ private static List<Object> createParams(
*
* @param parameterTypes - The parameter types to be used
* @param optionalValues - The optional values to be considered.
* @return FilterOutInJectedTypesResult
* @return FilterOutInjectedTypesResult
*/
static FilterOutInJectedTypesResult filterOutInJectedTypesFromOptionalValues(
static FilterOutInjectedTypesResult filterOutInjectedTypesFromOptionalValues(
Class<?>[] parameterTypes, String[] optionalValues) {
List<Class<?>> typeList = Lists.newArrayList(parameterTypes);
List<String> optionalValueList = Lists.newArrayList(optionalValues);
Expand All @@ -293,16 +293,16 @@ static FilterOutInJectedTypesResult filterOutInJectedTypesFromOptionalValues(
typeIterator.remove();
}
}
return new FilterOutInJectedTypesResult(
return new FilterOutInjectedTypesResult(
typeList.toArray(new Class<?>[0]), optionalValueList.toArray(new String[0]));
}

/** Store the result of parameterTypes and optionalValues after filter out injected types */
static final class FilterOutInJectedTypesResult {
static final class FilterOutInjectedTypesResult {
private final Class<?>[] parameterTypes;
private final String[] optionalValues;

private FilterOutInJectedTypesResult(Class<?>[] parameterTypes, String[] optionalValues) {
private FilterOutInjectedTypesResult(Class<?>[] parameterTypes, String[] optionalValues) {
this.parameterTypes = parameterTypes;
this.optionalValues = optionalValues;
}
Expand Down Expand Up @@ -790,7 +790,7 @@ public static ParameterHolder handleParameters(
initParams =
MethodInvocationHelper.invokeDataProvider(
dataProviderMethod
.getInstance(), /* a test instance or null if the dataprovider is static*/
.getInstance(), /* a test instance or null if the data provider is static*/
dataProviderMethod.getMethod(),
testMethod,
methodParams.context,
Expand Down
Expand Up @@ -51,11 +51,11 @@ public List<ITestResult> runInSequence(
tmpResults.add(tmpResult);
tmpResultsIndex++;
} finally {
boolean lastSucces = false;
boolean lastSuccess = false;
if (tmpResultsIndex >= 0) {
lastSucces = (tmpResults.get(tmpResultsIndex).getStatus() == ITestResult.SUCCESS);
lastSuccess = (tmpResults.get(tmpResultsIndex).getStatus() == ITestResult.SUCCESS);
}
if (failure.instances.isEmpty() || lastSucces) {
if (failure.instances.isEmpty() || lastSuccess) {
result.addAll(tmpResults);
} else {
List<ITestResult> retryResults = Lists.newArrayList();
Expand Down
Expand Up @@ -109,32 +109,32 @@ public String toString() {
public void run() {
this.currentThreadId = Thread.currentThread().getId();
if (RuntimeBehavior.enforceThreadAffinity()
&& doesTaskHavePreRequistes()
&& doesTaskHavePreRequisites()
&& currentThreadId != threadIdToRunOn) {
completed = false;
return;
}

for (IMethodInstance testMthdInst : m_methodInstances) {
ITestNGMethod testMethod = testMthdInst.getMethod();
for (IMethodInstance testMethodInstance : m_methodInstances) {
ITestNGMethod testMethod = testMethodInstance.getMethod();
if (canInvokeBeforeClassMethods()) {
synchronized (testMethod.getInstance()) {
invokeBeforeClassMethods(testMethod.getTestClass(), testMthdInst);
invokeBeforeClassMethods(testMethod.getTestClass(), testMethodInstance);
}
}

// Invoke test method
try {
invokeTestMethods(testMethod, testMthdInst.getInstance());
invokeTestMethods(testMethod, testMethodInstance.getInstance());
} finally {
synchronized (testMethod.getInstance()) {
invokeAfterClassMethods(testMethod.getTestClass(), testMthdInst);
invokeAfterClassMethods(testMethod.getTestClass(), testMethodInstance);
}
}
}
}

private boolean doesTaskHavePreRequistes() {
private boolean doesTaskHavePreRequisites() {
return threadIdToRunOn != -1;
}

Expand Down