-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add Unique Id for all test class instances #3083
Conversation
WalkthroughThis update introduces a significant shift in how TestNG handles test class objects, focusing on enhancing object management and internal workings. By associating unique IDs with test class instances and adopting Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 4
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
testng-core/src/test/resources/testng.xml
is excluded by:!**/*.xml
Files selected for processing (26)
- CHANGES.txt (1 hunks)
- testng-core-api/src/main/java/org/testng/IClass.java (2 hunks)
- testng-core-api/src/main/java/org/testng/IObject.java (1 hunks)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/TestClass.java (5 hunks)
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (6 hunks)
- testng-core/src/main/java/org/testng/internal/ClassImpl.java (8 hunks)
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java (11 hunks)
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java (8 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java (1 hunks)
- testng-core/src/test/java/test/factory/ObjectIdTest.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1 hunks)
Files not reviewed due to errors (1)
- (no review received)
Additional comments: 87
testng-core-api/src/main/java/org/testng/IClass.java (4)
- 7-7: The extension of
IClass
byIObject
aligns with the PR's objective to associate unique IDs with test class instances. This architectural change facilitates the management of test class instances and their unique identification.- 30-32: Deprecating
getInstances(boolean create)
in favor of a new method that includes an error message prefix is a good practice. It enhances error reporting by providing more context when instances cannot be created or retrieved.- 35-35: Introducing
getInstances(boolean create, String errorMsgPrefix)
as a default method ensures backward compatibility while encouraging the use of the new method signature for enhanced error context. This is a thoughtful addition.- 40-40: Deprecating
addInstance(Object instance)
without introducing a new method to replace it directly in this interface might indicate that instance management is being centralized elsewhere, possibly within theIObject
interface or its implementations. Ensure that this change aligns with the overall architecture and does not leave a gap in functionality.Verification successful
The search results confirm that instance management is being centralized in the
IObject
interface and its implementations, as indicated by the presence of theaddObject(IdentifiableObject instance)
method. This suggests that the deprecation ofaddInstance(Object instance)
in theIClass
interface aligns with an architectural shift towards centralizing instance management, and there does not appear to be a gap in functionality. Therefore, the review comment is consistent with the changes in the codebase.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that instance management is adequately handled elsewhere in the codebase. rg "addObject\(IdentifiableObject instance\)" --type javaLength of output: 766
testng-core/src/main/java/org/testng/internal/BaseClassFinder.java (2)
- 5-5: The addition of the
org.testng.IObject
import is necessary for the changes made in this file, specifically for usingIObject.IdentifiableObject
in method signatures. This change is consistent with the PR's objectives.- 36-36: Changing the
instance
parameter type in thefindOrCreateIClass
method fromObject
toIObject.IdentifiableObject
is a key part of implementing the unique ID feature for test class instances. This ensures that every instance managed byBaseClassFinder
is identifiable, supporting the overall goal of improved instance management and garbage collection.testng-core/src/test/java/org/testng/internal/MethodHelperTest.java (2)
- 3-3: The addition of the
org.testng.IObject
import is necessary for the changes made in this file, specifically for usingIObject.IdentifiableObject
in the test method. This change is consistent with the PR's objectives.- 40-40: Modifying the argument passed to
IdentifiableObject
in thefindDependedUponMethods
method to use an instance of the test class aligns with the goal of associating unique IDs with test class instances. This ensures that the test infrastructure itself is compatible with the new unique ID feature.testng-core/src/test/java/test/factory/ObjectIdTest.java (2)
- 18-28: The test
ensureOnlyOneObjectIdExistsForNormalTestClass
correctly verifies that a unique ID is associated with each instance ofSampleTestCase
. This test ensures that the implementation of unique IDs works as expected for standard test classes.- 30-40: The test
ensureOnlyOneObjectIdExistsForFactoryPoweredTestClass
verifies that a unique ID is associated with each instance created by a factory, with the expected number of unique IDs matching the number of instances created. This test ensures that the implementation of unique IDs works as expected for factory-powered test classes.testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1)
- 17-66: The
SampleTestCase
class correctly implements the recording of instances and their unique IDs in a static map. This setup is crucial for verifying that unique IDs are properly associated with each test class instance. The use ofConcurrentHashMap
forobjectMap
ensures thread safety, which is important given the parallel execution of tests.testng-core-api/src/main/java/org/testng/IObject.java (1)
- 7-64: The introduction of the
IObject
interface and theIdentifiableObject
nested class is a key part of the PR's objective to associate unique IDs with test class instances. The design allows for the encapsulation of test class instances with their unique IDs, facilitating better instance management and garbage collection. The implementation ofequals
andhashCode
methods inIdentifiableObject
based on the instance ensures correct behavior in collections.testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1)
- 19-65: The
FactoryTestCase
class correctly implements a factory method and the recording of instances and their unique IDs in a static map. This setup is crucial for verifying that unique IDs are properly associated with each factory-powered test class instance. The use ofConcurrentHashMap
forobjectMap
ensures thread safety, which is important given the parallel execution of tests and the potential for concurrent modifications to the map.testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java (1)
- 64-64: Replacing the lambda expression with an instance of
IdentifiableObject
initialized with the lambda expression inGuiceHelperTest
ensures that the unique ID feature is integrated with Guice injection. This change demonstrates the adaptability of the unique ID feature to different parts of the TestNG framework, including dependency injection.testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java (2)
- 100-108: The addition of methods to handle
IdentifiableObject
instances inFakeTestClass
ensures that the unique ID feature can be tested in a controlled environment. These methods are crucial for verifying the behavior of the unique ID feature in various scenarios.- 118-119: The
addObject(IdentifiableObject instance)
method inFakeTestClass
allows for the addition of identifiable instances to the test class, supporting the testing of instance management with unique IDs. This method complements thegetObjects
methods by providing a way to populate the test class with instances for testing.testng-core/src/main/java/org/testng/internal/NoOpTestClass.java (3)
- 25-25: Changing the type of
m_instances
toIdentifiableObject[]
inNoOpTestClass
is a necessary update to align with the unique ID feature. This change ensures that even no-operation test classes can handle identifiable instances, maintaining consistency across the framework.- 137-140: The introduction of the
getObjects(boolean create)
method returningIdentifiableObject[]
ensures thatNoOpTestClass
can provide identifiable instances, aligning with the unique ID feature's requirements. This method supports the consistent handling of instances across different parts of the TestNG framework.- 155-156: The
addObject(IdentifiableObject instance)
method allows for the addition of identifiable instances toNoOpTestClass
, supporting the framework's ability to manage instances with unique IDs consistently, even in no-operation contexts.testng-core/src/main/java/org/testng/internal/ClassImpl.java (10)
- 3-3: Importing
java.util.Arrays
is a good addition given the use ofArrays.stream
in thegetInstances
method to work with the newIdentifiableObject
type.- 27-27: Changing the type of
m_defaultInstance
fromObject
toIdentifiableObject
aligns with the PR's objective to enhance object management within TestNG by associating unique IDs with test class objects.- 29-29: Renaming
m_instances
toidentifiableObjects
and changing its type to a list ofIdentifiableObject
is a logical step following the introduction ofIdentifiableObject
. This change improves clarity and aligns with the new approach.- 32-32: The change in the type of
m_instance
toIdentifiableObject
is consistent with the overall goal of the PR. It ensures that each test class instance is wrapped with an object that includes a unique ID.- 53-54: The use of
IdentifiableObject.unwrap(instance)
to check if the instance is of typeITest
is a good practice. It ensures that the unique ID functionality is transparent to existing logic that expects plainObject
instances.- 104-115: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [94-110]
The
getDefaultInstance
method's adaptation to work withIdentifiableObject
is well-implemented. Wrapping the raw object withIdentifiableObject
when creating a default instance ensures consistency with the new object management approach.
- 123-126: Converting
IdentifiableObject
instances back toObject
ingetInstances
usingArrays.stream
andmap
is a neat way to maintain backward compatibility with existing code that expectsObject[]
.- 129-131: The
addObject
method correctly adds anIdentifiableObject
instance to theidentifiableObjects
list, ensuring that all test class instances are managed with their unique IDs.- 133-149: The
getObjects
method's logic to returnIdentifiableObject[]
and updatem_instanceHashCodes
based on the instances' hash codes is correctly implemented. It ensures that the unique ID functionality is integrated seamlessly with existing features that rely on instance hash codes.- 161-161: The
addInstance
method's adaptation to wrap the providedObject
instance withIdentifiableObject
before adding it to the list is a necessary change to align with the new object management strategy.testng-core/src/main/java/org/testng/internal/TestNGMethod.java (4)
- 9-9: The import of
org.testng.IObject
is necessary for the file to useIObject.IdentifiableObject
, aligning with the PR's objective to manage test class instances with unique IDs.- 37-37: The constructor of
TestNGMethod
now correctly expects anIObject.IdentifiableObject
instead of a plainObject
. This change is crucial for integrating the unique ID functionality into the method handling logic.- 47-47: The private constructor's adaptation to accept
IObject.IdentifiableObject
is consistent with the changes made to the public constructor, ensuring that all instances handled byTestNGMethod
are associated with unique IDs.- 175-175: The
clone
method's modification to create a newIdentifiableObject
with the instance and its ID ensures that the clonedTestNGMethod
retains the unique ID association of the original instance. This is a critical aspect of maintaining the integrity of the unique ID functionality across method clones.testng-core/src/main/java/org/testng/internal/TestListenerHelper.java (1)
- 181-181: The modification in
createListenerFactory
to access the instance viaic.getObjects(false)[0].getInstance()
is necessary to adapt to the use ofIdentifiableObject
. This ensures that the listener factory is instantiated with the correct object instance, aligning with the new object management strategy.testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java (2)
- 7-7: The import of
org.testng.IObject
is necessary for the file to useIObject.IdentifiableObject
, aligning with the PR's objective to manage test class instances with unique IDs.- 191-195: The adaptation in
computeParameters
to useIObject.IdentifiableObject
and access the instance viagetInstance()
is a necessary change to align with the new object management strategy. This ensures that the correct instance is used when instantiating nested classes.testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (2)
- 6-6: The import of
java.util.UUID
is correctly added to support the generation of unique IDs for test instances. This aligns with the PR's objective to enhance instance management within TestNG.- 368-371: The implementation of
getInstanceId()
method inWrappedTestNGMethod
correctly delegates the call to the wrappedtestNGMethod
instance. This ensures that the unique ID functionality is properly propagated through the proxy pattern. However, it's important to ensure that thetestNGMethod
instance itself supports this new method and returns a meaningfulUUID
.Verification successful
Given the lack of output from the initial script, it's necessary to refine our approach to verify the presence of the
getInstanceId
method in classes implementingITestNGMethod
. Let's start by identifying any classes that implementITestNGMethod
and then check for thegetInstanceId
method within those classes.
Given the repeated lack of output from our attempts to directly find classes implementing
ITestNGMethod
and those with agetInstanceId
method, it's necessary to verify the existence of theITestNGMethod
interface itself within the codebase. This step will help confirm that we are searching within the correct context and that the interface is indeed part of the codebase.
Given the confirmed existence of the
ITestNGMethod
interface within the codebase, the next step is to broaden our search approach to identify any potential usage or implementation of thegetInstanceId
method. This will help in understanding how and where this method is supported across the codebase.
The search across the codebase has confirmed the presence of the
getInstanceId
method in both theITestNGMethod
interface and its various implementations, includingTestNGMethod.java
,ConfigurationMethod.java
,BaseTestMethod.java
, and others. This supports the review comment's assertion that thegetInstanceId
method is correctly delegated to thetestNGMethod
instance inWrappedTestNGMethod
, ensuring that the unique ID functionality is properly propagated through the proxy pattern. Based on these findings, the implementation ofgetInstanceId()
inWrappedTestNGMethod
is verified to be in alignment with the expected behavior.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that the testNGMethod instance (likely implementations of ITestNGMethod) supports getInstanceId method and returns a valid UUID. ast-grep --lang java --pattern $'class $_ implements ITestNGMethod { $$$ getInstanceId() { $$$ } $$$ }'Length of output: 104
Script:
#!/bin/bash # First, find any classes implementing ITestNGMethod ast-grep --lang java --pattern $'class $_ implements ITestNGMethod { $$$ }'Length of output: 76
Script:
#!/bin/bash # Verify the existence of ITestNGMethod interface in the codebase rg "interface ITestNGMethod" -lLength of output: 93
Script:
#!/bin/bash # Search for the getInstanceId method across the entire codebase rg "getInstanceId" -lLength of output: 623
testng-core-api/src/main/java/org/testng/ITestNGMethod.java (2)
- 6-6: The import of
java.util.UUID
is correctly added to support the newgetInstanceId()
method, which is essential for generating unique IDs for test instances.- 301-307: The addition of the
getInstanceId()
method in theITestNGMethod
interface is a crucial part of the PR's objective to associate unique IDs with test class objects. The default implementation returningnull
is a safe placeholder, but concrete implementations must override this method to return a meaningfulUUID
. It's important to ensure all implementations ofITestNGMethod
provide a valid override of this method.testng-core/src/main/java/org/testng/internal/FactoryMethod.java (4)
- 15-15: The import of
org.testng.IObject
is correctly added to support the use ofIObject.IdentifiableObject
withinFactoryMethod
. This aligns with the PR's objective to enhance instance management by associating unique IDs with test class objects.- 75-80: The modification of the
FactoryMethod
constructor to accept anIObject.IdentifiableObject
instead of a plainObject
instance is a key part of integrating the unique ID functionality. This change ensures that factory methods can work with identifiable test instances, supporting the overall goal of improved instance management.- 82-82: The use of
IObject.IdentifiableObject.unwrap(identifiable)
to extract the actual instance from theIdentifiableObject
wrapper is correct and necessary for backward compatibility with existing code that expects plainObject
instances. This approach maintains the integrity of the unique ID feature while ensuring minimal disruption to existing functionalities.- 122-122: The assignment of
m_instance
usinggetInstance()
is a subtle yet important change. It ensures that the instance variable withinFactoryMethod
correctly references the unwrapped test instance. This change is crucial for maintaining the expected behavior of factory methods while incorporating the new unique ID feature.testng-core/src/main/java/org/testng/TestClass.java (6)
- 109-115: The update to use
IdentifiableObject
instances and the subsequent stream operations to handle test instances are correctly implemented. This change is crucial for integrating the unique ID functionality into theTestClass
and ensuring that test names can be derived fromITest
instances when available. This approach enhances the flexibility and robustness of test instance management.- 126-129: The addition of the
getObjects
method override inTestClass
to return an array ofIdentifiableObject
is a necessary update to support the new unique ID feature. This method ensures that all parts of the TestNG framework can work with identifiable test instances, facilitating better instance management and garbage collection.- 136-139: Similar to the previous comment, the addition of the
getObjects
method override with anerrorMsgPrefix
parameter is correctly implemented. This ensures consistency in how identifiable test instances are retrieved throughout the TestNG framework, aligning with the PR's objectives.- 151-154: The implementation of the
addObject
method inTestClass
to accept anIdentifiableObject
instance is a key part of integrating the unique ID functionality. This change allows for the addition of identifiable test instances to the internal structures of TestNG, supporting the overall goal of improved instance management.- 148-163: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [160-199]
The modifications to use
IdentifiableObject
instances in the initialization of configuration methods are correctly implemented. These changes ensure that all configuration methods can work with identifiable test instances, which is essential for the unique ID feature to function as intended across the TestNG framework.
- 251-251: The update to iterate over
IdentifiableObject
instances when creating test methods is correctly implemented. This ensures that test methods are associated with identifiable test instances, aligning with the PR's objective to improve test instance management through the use of unique IDs.testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java (2)
- 10-10: The addition of the
org.testng.IObject
import is necessary for the new functionality introduced in this PR. It enables the use ofIObject.IdentifiableObject
within the test methods.- 237-237: The modification to wrap the
object
withnew IObject.IdentifiableObject(object)
is essential for associating unique IDs with test class objects. This change aligns with the PR's objective to improve internal handling and garbage collection of test class instances. Ensure that this change does not inadvertently affect the functionality of existing tests.testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (3)
- 9-11: The addition of imports for
java.util.Objects
andjava.util.UUID
supports the new functionality of generating unique keys for locking mechanisms. These are necessary for the enhancements made in this PR.- 52-52: The introduction of a static final field
lock
of typeKeyAwareAutoCloseableLock
is crucial for the new locking mechanism based on unique keys. Ensure that this locking mechanism is thread-safe and does not introduce deadlocks.- 126-128: The implementation of the locking mechanism using
UUID
for generating unique keys andKeyAwareAutoCloseableLock
for managing locks is well-designed. It ensures that each test method instance is handled uniquely, which is crucial for the parallel execution of tests. Using the try-with-resources statement for automatic lock release is a good practice. However, it's important to thoroughly test this implementation to identify any potential issues related to locking, such as deadlocks or performance impacts.Also applies to: 137-137
testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java (11)
- 17-17: The import of
org.testng.IObject
is correctly added to support the new functionality of associating unique IDs with test class objects.- 38-38: The change from
Object
toIObject.IdentifiableObject
in the declaration ofm_instanceMap
is crucial for associating unique IDs with test class objects. This aligns with the PR's objectives and enhances the handling of test class instances.- 51-51: The method signature of
TestNGClassFinder
constructor now acceptsMap<Class<?>, List<IObject.IdentifiableObject>>
instead of a map with plainObject
instances. This change is necessary for the integration of unique IDs with test class objects and ensures type safety.- 75-80: The loop iterating over
m_instanceMap
and callingic.addObject(instance)
for eachIdentifiableObject
ensures that all test class instances are correctly associated with their unique IDs. This is a key part of the implementation for managing test class instances more effectively.- 88-88: The method signature of
processClass
has been correctly updated to acceptMap<Class<?>, List<IObject.IdentifiableObject>>
as an argument. This change is consistent with the overall goal of associating unique IDs with test class objects.- 100-101: The retrieval and handling of
IdentifiableObject
instances frominstanceMap
withinprocessClass
method are correctly implemented. This ensures that each test class instance is managed with its unique ID.- 169-171: The method
processFactory
correctly retrievesIdentifiableObject
instances usingic.getObjects(false)
. This is part of the mechanism to ensure that factory methods work with the new system of unique IDs for test class instances.- 184-196: The loop in
processFactory
method that handles instances returned by factory methods is correctly updated to work withIdentifiableObject
andIInstanceInfo
. This ensures that both types of objects are properly managed with their unique IDs.- 330-330: The method
addInstance(IInstanceInfo<T> ii)
is correctly updated to wrap the instance withIObject.IdentifiableObject
. This is essential for associating unique IDs with instances that are added to the test context.- 333-338: The method
addInstance(IObject.IdentifiableObject o)
correctly determines the class of the instance, taking into account whether it is an instance ofIParameterInfo
. This ensures that the correct class is used when adding instances with unique IDs.- 343-345: The method
addInstance(Class<S> clazz, IObject.IdentifiableObject instance)
correctly addsIdentifiableObject
instances tom_instanceMap
. This is a key part of managing test class instances with unique IDs.testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java (11)
- 8-9: The addition of import statements for
Optional
andIObject
aligns with the changes made in the rest of the file to support the new functionality of associating unique IDs with test class instances. This is a necessary step to ensure that the new types are available for use within the file.- 71-71: Changing the parameter type from
Object
toIObject.IdentifiableObject
in the constructor signature is a key part of implementing the unique ID functionality. This change ensures that each test class instance can be associated with a unique ID, facilitating better internal handling and potentially improving garbage collection efficiency.- 126-126: The change in the parameter type for another constructor of
ConfigurationMethod
is consistent with the overall goal of associating unique IDs with test class instances. This ensures that all instances created or manipulated by this class are properly wrapped with their unique IDs.- 160-160: The modification in the
createMethods
static method to acceptIObject.IdentifiableObject
instead ofObject
is crucial for ensuring that all test methods created by this method are associated with their unique IDs. This change is consistent with the PR's objective and is necessary for the correct functioning of the new feature.- 200-200: The change in the parameter type for
createSuiteConfigurationMethods
is aligned with the changes in other parts of the file and is necessary for the implementation of the unique ID functionality. This ensures that suite configuration methods are also associated with unique IDs.- 224-224: Similarly, the change in the parameter type for
createTestConfigurationMethods
supports the PR's objective by ensuring that test configuration methods are associated with unique IDs. This is consistent with the changes made in other parts of the file.- 247-247: The modification in the parameter type for
createClassConfigurationMethods
is necessary for the implementation of the unique ID functionality, ensuring that class configuration methods are associated with unique IDs. This change is consistent with the overall goal of the PR.- 269-269: The change in the parameter type for
createBeforeConfigurationMethods
aligns with the PR's objective by ensuring that before configuration methods are associated with unique IDs. This is consistent with the changes made in other parts of the file.- 300-300: The modification in the parameter type for
createAfterConfigurationMethods
supports the PR's objective by ensuring that after configuration methods are associated with unique IDs. This is consistent with the changes made in other parts of the file.- 331-331: The change in the parameter type for
createTestMethodConfigurationMethods
is aligned with the changes in other parts of the file and is necessary for the implementation of the unique ID functionality. This ensures that test method configuration methods are also associated with unique IDs.- 511-511: The cloning method has been updated to ensure that the cloned
ConfigurationMethod
instance is associated with the same unique ID as the original instance. This is a crucial change for maintaining the integrity of the unique ID functionality across cloned instances.testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (8)
- 12-12: The import of
java.util.UUID
is correctly added to support the generation or handling of unique IDs within the class.- 19-19: The import of
org.testng.IObject
is necessary for the changes made in this file, specifically for using theIObject.IdentifiableObject
type.- 86-86: The addition of the
m_instance
field of typeIObject.IdentifiableObject
is crucial for associating a unique ID with each test class instance. This change aligns with the PR's objective to improve garbage collection efficiency by making test class instances more identifiable.- 96-96: The constructor now accepts an
IObject.IdentifiableObject
instance as a parameter. This modification is necessary to initialize them_instance
field with a unique ID wrapped test class instance. It's important to ensure that all invocations of this constructor throughout the codebase are updated to pass the requiredIdentifiableObject
.- 153-157: The
getInstance()
method has been updated to return the actual test class instance from theIdentifiableObject
. This change is necessary to maintain compatibility with existing code that expects an instance of the test class. The use ofOptional
and method chaining ensures null safety, which is a good practice.- 159-161: The addition of the
getInstanceId()
method is a direct consequence of the PR's objective to associate unique IDs with test class instances. This method allows for the retrieval of the unique ID associated with the test class instance, which is essential for the improved garbage collection mechanism.- 392-393: The modification to the
hashCode()
method to include the identity hash code of the instance obtained viagetInstance()
is a thoughtful addition. It ensures that the hash code considers the unique identity of the test class instance, which is crucial for using these instances as keys in maps or collections.- 803-807: The
getFactoryMethodParamsInfo()
method now checks if the instance wrapped byIdentifiableObject
implementsIParameterInfo
. This change is necessary to support scenarios where test class instances are created with parameters, and it's important to retrieve these parameters for further processing or reporting.testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (2)
- 30-30: The addition of the
IObject
import is necessary for implementing the unique ID functionality for test class instances. This change aligns with the PR's objectives.- 385-392: The modification to use
IObject.IdentifiableObject
for handling test class instances and accessing the actual instance withinstance.getInstance()
is a key part of integrating the unique ID functionality. This change ensures that the unique ID is properly associated with each test class instance, which is crucial for the objectives of this PR. However, it's important to ensure that all parts of the code that interact with test class instances are updated to accommodate this new approach to avoid any potential issues.
- Ensure that the rest of the codebase that interacts with test class instances is aware of this change and correctly handles
IdentifiableObject
instances.- Consider the performance implications of adding an additional layer of abstraction with
IdentifiableObject
. While it's unlikely to have a significant impact, it's worth keeping in mind, especially in large test suites.Verification successful
The modification to use
IObject.IdentifiableObject
for handling test class instances, as seen inTestInvoker.java
and also applied inNoOpTestClass.java
, indicates a consistent application of this approach across the codebase. This supports the integration of the unique ID functionality and suggests that relevant parts of the system have been updated to accommodate this change. It remains important to ensure that all interactions with test class instances are correctly handled and to consider the performance implications of these changes, especially in large test suites.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Verify that all interactions with test class instances have been updated. rg "getInstances\(true\)" --type java # Check for potential performance implications in large test suites. echo "Manual review recommended to assess performance impact in large test suites."Length of output: 202
Script:
#!/bin/bash # Corrected verification to search for the actual method usage "getObjects(true)". rg "getObjects\(true\)" --type java # Reiterate the recommendation for a manual review to assess performance impact in large test suites. echo "Manual review recommended to assess performance impact in large test suites."Length of output: 456
testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java
Outdated
Show resolved
Hide resolved
testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java
Outdated
Show resolved
Hide resolved
testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java
Outdated
Show resolved
Hide resolved
testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
testng-core/src/test/resources/testng.xml
is excluded by:!**/*.xml
Files selected for processing (26)
- CHANGES.txt (1 hunks)
- testng-core-api/src/main/java/org/testng/IClass.java (2 hunks)
- testng-core-api/src/main/java/org/testng/IObject.java (1 hunks)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/TestClass.java (5 hunks)
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (6 hunks)
- testng-core/src/main/java/org/testng/internal/ClassImpl.java (8 hunks)
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java (11 hunks)
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java (8 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java (1 hunks)
- testng-core/src/test/java/test/factory/ObjectIdTest.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1 hunks)
Files skipped from review as they are similar to previous changes (25)
- CHANGES.txt
- testng-core-api/src/main/java/org/testng/IClass.java
- testng-core-api/src/main/java/org/testng/IObject.java
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java
- testng-core/src/main/java/org/testng/TestClass.java
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java
- testng-core/src/main/java/org/testng/internal/ClassImpl.java
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java
- testng-core/src/test/java/test/factory/ObjectIdTest.java
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java
Additional comments: 2
testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (2)
- 6-6: The addition of
java.util.UUID
import is appropriate for generating unique IDs, aligning with the PR's objective to associate unique IDs with test class objects. This import is necessary for the implementation of thegetInstanceId()
method.- 3-9: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [22-22]
The use of
java.util.Random
for generating amultiplicationFactor
is noted. While this usage is not directly related to security contexts such as password or token generation, it's important to be aware of the limitations ofRandom
for cryptographic purposes. In this specific case, the use ofRandom
is acceptable as it's used to generate a hashcode multiplier, not for security-sensitive operations.
testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
testng-core/src/test/resources/testng.xml
is excluded by:!**/*.xml
Files selected for processing (26)
- CHANGES.txt (1 hunks)
- testng-core-api/src/main/java/org/testng/IClass.java (2 hunks)
- testng-core-api/src/main/java/org/testng/IObject.java (1 hunks)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/TestClass.java (5 hunks)
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (6 hunks)
- testng-core/src/main/java/org/testng/internal/ClassImpl.java (8 hunks)
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java (11 hunks)
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java (8 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java (1 hunks)
- testng-core/src/test/java/test/factory/ObjectIdTest.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1 hunks)
Files skipped from review as they are similar to previous changes (25)
- CHANGES.txt
- testng-core-api/src/main/java/org/testng/IClass.java
- testng-core-api/src/main/java/org/testng/IObject.java
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java
- testng-core/src/main/java/org/testng/TestClass.java
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java
- testng-core/src/main/java/org/testng/internal/ClassImpl.java
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java
- testng-core/src/test/java/test/factory/ObjectIdTest.java
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java
Additional comments: 3
testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (3)
- 6-6: The import of
UUID
is correctly added to support the generation of unique IDs for test instances. This aligns with the PR's objective to enhance instance management within TestNG.- 368-371: The implementation of
getInstanceId()
correctly delegates the call to the wrappedITestNGMethod
instance. This approach is consistent with the proxy pattern used inWrappedTestNGMethod
. Ensure that theITestNGMethod
interface and its implementations are updated to include thegetInstanceId()
method, as this change impacts the contract ofITestNGMethod
.- 3-9: > 📝 NOTE
This review was outside the diff hunks, and no overlapping diff hunk was found. Original lines [22-22]
The use of
Random
to generate amultiplicationFactor
for thehashCode()
method is noted. While the static analysis tool suggests usingSecureRandom
for cryptographic strength, the current usage context does not involve security-sensitive operations. However, it's important to ensure that the randomness provided byRandom
is sufficient for the intended purpose of creating a uniquehashCode
. If the uniqueness ofhashCode
is critical, consider evaluating the distribution and collision probability of the generated values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM except I think it is details of implementation that should be exposed into the API.
Except the deprecations, could you try to remove the API update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
testng-core/src/test/resources/testng.xml
is excluded by:!**/*.xml
Files selected for processing (26)
- CHANGES.txt (1 hunks)
- testng-core-api/src/main/java/org/testng/IClass.java (1 hunks)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java (3 hunks)
- testng-core-api/src/main/java/org/testng/internal/IObject.java (1 hunks)
- testng-core/src/main/java/org/testng/TestClass.java (5 hunks)
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (6 hunks)
- testng-core/src/main/java/org/testng/internal/ClassImpl.java (8 hunks)
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java (11 hunks)
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java (5 hunks)
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java (7 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java (1 hunks)
- testng-core/src/test/java/test/factory/ObjectIdTest.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1 hunks)
Files skipped from review as they are similar to previous changes (24)
- CHANGES.txt
- testng-core-api/src/main/java/org/testng/IClass.java
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java
- testng-core/src/main/java/org/testng/TestClass.java
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java
- testng-core/src/main/java/org/testng/internal/ClassImpl.java
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java
- testng-core/src/test/java/test/factory/ObjectIdTest.java
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java
Additional comments: 10
testng-core-api/src/main/java/org/testng/internal/IObject.java (8)
- 22-22: The method
getObjects
is well-defined, providing a mechanism to retrieve instances associated with a class, optionally creating them if necessary. This method supports the core functionality of managing test instances with unique IDs.- 25-25: The method
getInstanceHashCodes
offers a way to retrieve hash codes of instances, which could be useful for debugging or logging purposes. However, ensure that the use of hash codes aligns with the unique ID mechanism and does not introduce any potential for confusion or collision.- 28-28: The
addObject
method allows adding a new instance to the list of managed instances. This is crucial for dynamically managing instances, especially in scenarios involving factories or dynamically generated tests.- 34-36: The static method
instanceHashCodes
provides a utility to retrieve hash codes for instances that are compatible withIObject
. This method enhances the interface's usability by allowing operations on generic objects without explicit casting by the caller.- 44-46: The overloaded static method
objects
without theerrorMsgPrefix
parameter simplifies the retrieval ofIdentifiableObject
arrays by providing a default error message prefix. This method enhances usability by reducing the need for callers to specify common parameters.- 56-60: The static method
objects
with theerrorMsgPrefix
parameter is a comprehensive way to retrieveIdentifiableObject
arrays, allowing for customized error handling. This method is essential for scenarios where detailed error messages are necessary for debugging or logging.- 67-72: The static method
cast
provides a safe way to cast objects toIObject
if they implement the interface. This utility method is crucial for working with objects in a type-safe manner, reducing the risk ofClassCastException
.- 75-115: The nested class
IdentifiableObject
is well-designed, encapsulating a test class instance and its associated unique ID. The constructors, accessors, and overriddenequals
andhashCode
methods are correctly implemented, ensuring that instances are uniquely identifiable and can be used effectively in collections. This class is central to the enhancement introduced by this pull request, enabling efficient management and identification of test class instances.testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (2)
- 6-6: The import of
java.util.UUID
is necessary for the new functionality introduced by thegetInstanceId
method. This addition is correctly placed and follows Java import conventions.- 368-371: The implementation of the
getInstanceId
method correctly delegates the call to the wrappedITestNGMethod
instance. This approach maintains consistency with the proxy pattern used throughout theWrappedTestNGMethod
class. However, ensure that theITestNGMethod
interface and its implementations are updated to include thegetInstanceId()
method, as this change impacts the contract ofITestNGMethod
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to path filters (1)
testng-core/src/test/resources/testng.xml
is excluded by:!**/*.xml
Files selected for processing (26)
- CHANGES.txt (1 hunks)
- testng-core-api/src/main/java/org/testng/IClass.java (1 hunks)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/TestClass.java (5 hunks)
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (6 hunks)
- testng-core/src/main/java/org/testng/internal/ClassImpl.java (8 hunks)
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java (11 hunks)
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/IObject.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java (5 hunks)
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java (7 hunks)
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java (2 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (4 hunks)
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java (1 hunks)
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java (2 hunks)
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java (1 hunks)
- testng-core/src/test/java/test/factory/ObjectIdTest.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1 hunks)
Files skipped from review as they are similar to previous changes (24)
- CHANGES.txt
- testng-core-api/src/main/java/org/testng/IClass.java
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java
- testng-core/src/main/java/org/testng/TestClass.java
- testng-core/src/main/java/org/testng/internal/BaseClassFinder.java
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java
- testng-core/src/main/java/org/testng/internal/ClassImpl.java
- testng-core/src/main/java/org/testng/internal/ConfigurationMethod.java
- testng-core/src/main/java/org/testng/internal/FactoryMethod.java
- testng-core/src/main/java/org/testng/internal/NoOpTestClass.java
- testng-core/src/main/java/org/testng/internal/TestListenerHelper.java
- testng-core/src/main/java/org/testng/internal/TestNGClassFinder.java
- testng-core/src/main/java/org/testng/internal/TestNGMethod.java
- testng-core/src/main/java/org/testng/internal/invokers/TestInvoker.java
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java
- testng-core/src/main/java/org/testng/internal/objects/SimpleObjectDispenser.java
- testng-core/src/test/java/org/testng/internal/DynamicGraphHelperTest.java
- testng-core/src/test/java/org/testng/internal/MethodHelperTest.java
- testng-core/src/test/java/org/testng/internal/MethodInstanceTest.java
- testng-core/src/test/java/org/testng/internal/dynamicgraph/FakeTestClass.java
- testng-core/src/test/java/org/testng/internal/objects/GuiceHelperTest.java
- testng-core/src/test/java/test/factory/ObjectIdTest.java
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a better solution but I think it need another iteration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (7)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (7 hunks)
- testng-core/src/main/java/org/testng/internal/IInstanceIdentity.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (4 hunks)
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1 hunks)
Files skipped from review as they are similar to previous changes (6)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java
testng-core/src/main/java/org/testng/internal/IInstanceIdentity.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (7)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (7 hunks)
- testng-core/src/main/java/org/testng/internal/IInstanceIdentity.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (4 hunks)
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java
- testng-core/src/main/java/org/testng/internal/IInstanceIdentity.java
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (7)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java (7 hunks)
- testng-core/src/main/java/org/testng/internal/IInstanceIdentity.java (1 hunks)
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java (3 hunks)
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java (4 hunks)
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java (1 hunks)
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- testng-core-api/src/main/java/org/testng/ITestNGMethod.java
- testng-core/src/main/java/org/testng/internal/BaseTestMethod.java
- testng-core/src/main/java/org/testng/internal/IInstanceIdentity.java
- testng-core/src/main/java/org/testng/internal/WrappedTestNGMethod.java
- testng-core/src/main/java/org/testng/internal/invokers/TestMethodWorker.java
- testng-core/src/test/java/test/factory/issue3079/FactoryTestCase.java
- testng-core/src/test/java/test/factory/issue3079/SampleTestCase.java
Closes #3079
Fixes #3079 .
Did you remember to?
CHANGES.txt
./gradlew autostyleApply
We encourage pull requests that:
If your pull request involves fixing SonarQube issues then we would suggest that you please discuss this with the
TestNG-dev before you spend time working on it.
Note: For more information on contribution guidelines please make sure you refer our Contributing section for detailed set of steps.
Summary by CodeRabbit
DataProvider
behavior to align with previous versions for retrying tests.synchronized
blocks withReentrantLock
for improved concurrency handling.IdentifiableObject
andUUID
.