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

TestNG should provide an Api which allow to find all dependent of a specific test #893

Closed
juherr opened this issue Nov 23, 2015 · 7 comments · Fixed by #2839
Closed

TestNG should provide an Api which allow to find all dependent of a specific test #893

juherr opened this issue Nov 23, 2015 · 7 comments · Fixed by #2839
Milestone

Comments

@juherr
Copy link
Member

juherr commented Nov 23, 2015

https://issues.apache.org/jira/browse/SUREFIRE-1073

@krmahadevan krmahadevan added this to the 7.6.0 milestone Jan 7, 2022
@krmahadevan krmahadevan modified the milestones: 7.6.0, 7.7.0 May 18, 2022
@krmahadevan
Copy link
Member

@juherr - What is the expectations of this issue. I would specifically like to know the following:

  1. How will the user invoke this? Should this be made available only when someone creates a TestNG instance ?
  2. What would the input for this api look like ?

It would be good if you could please help add some additional context into this issue.

@krmahadevan krmahadevan removed this from the 7.7.0 milestone Nov 25, 2022
@juherr
Copy link
Member Author

juherr commented Nov 25, 2022

It is for the integrations. The need is to add the dependent TestMethods on TestMethod api

@krmahadevan
Copy link
Member

You mean something like public List<ITestNGMethod> getDownstreamDependencies() into ITestNGMethod interface right ?

@juherr
Copy link
Member Author

juherr commented Nov 25, 2022

Yes, exactly. It exists in the model but not available by the api.

About the naming, I think something closer the annotation attribute name will be better.

@krmahadevan krmahadevan added this to the 7.6.2 milestone Nov 26, 2022
@krmahadevan
Copy link
Member

@juherr

About the naming, I think something closer the annotation attribute name will be better.

What attribute are you referring to here? In TestNG, we only have a mapping from a child (Dependent method) to a parent (Independent method upon which the dependent method depends on)

But here we are asking for all children, given a parent.

public class TestClassSample {

  @Test
  public void independent() {}

  @Test(dependsOnMethods = "independent")
  public void dependent() {}

  @Test(dependsOnMethods = "independent")
  public void anotherDependent() {}
}

Here we are asking for an API, wherein if we give input as independent() it should return dependent() and anotherDependent(). Is this the right expectations?

If yes, then I think the api should be called as getDownstreamDependencies(). WDYT ?

For upstream dependencies ( which is what dependsOnMethods represents) we have this String[] getMethodsDependedUpon(); in the ITestNGMethod interface.

@juherr
Copy link
Member Author

juherr commented Nov 26, 2022

I will check again. I thought the need was to have getMethodsDependedUpon() returning object instead of string

krmahadevan added a commit to krmahadevan/testng that referenced this issue Nov 28, 2022
@krmahadevan
Copy link
Member

@juherr - I have raised a PR which now provides both upstream and downstream dependencies for a test method. Please check.

krmahadevan added a commit to krmahadevan/testng that referenced this issue Nov 28, 2022
krmahadevan added a commit to krmahadevan/testng that referenced this issue Nov 28, 2022
krmahadevan added a commit to krmahadevan/testng that referenced this issue Nov 29, 2022
krmahadevan added a commit to krmahadevan/testng that referenced this issue Nov 29, 2022
krmahadevan added a commit that referenced this issue Nov 29, 2022
@krmahadevan krmahadevan modified the milestones: 7.6.2, 7.7.0 Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants