-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug showcase: testng-team/testng#3000
- Loading branch information
Showing
3 changed files
with
48 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.example; // 1. to make test PASS: change to `org.example` | ||
|
||
import org.testng.annotations.BeforeClass; | ||
import org.testng.annotations.Test; | ||
|
||
import static org.testng.Assert.assertNotNull; | ||
|
||
public class MyTest extends MyBaseTest { | ||
|
||
@BeforeClass | ||
public void beforeClass() { | ||
assertNotNull(dependency); // fails here | ||
} | ||
|
||
@Test | ||
public void test() { | ||
} | ||
} | ||
|
||
abstract class MyBaseTest implements MyInterface { // 2. to make test PASS: remove `implements MyInterface` | ||
protected Object dependency; | ||
|
||
public void setDependency(Object dependency) { | ||
} | ||
|
||
@BeforeClass | ||
public void setupDependency() { | ||
dependency = new Object(); | ||
} | ||
|
||
@BeforeClass(dependsOnMethods = "setupDependency") | ||
public void setupAdditionalDependency_() { // 3. to make test PASS: remove `_` from the method name | ||
} | ||
} | ||
|
||
interface MyInterface { | ||
|
||
void setDependency(Object dependency); | ||
|
||
default Object getDependency() { | ||
return null; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.