This is an automated email from the git hooks/post-receive script. eugene-guest pushed a commit to annotated tag OpenBSD in repository testng.
commit 328620f61d3ea7fb5d12cfd9ee659c755a5468fc Author: Julien Herr <[email protected]> Date: Tue May 12 13:02:46 2015 +0200 Fix #420 --- src/main/java/org/testng/internal/Invoker.java | 12 ++++++--- src/test/java/test/enable/EnableTest.java | 34 ++++++++++++++------------ 2 files changed, 26 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/testng/internal/Invoker.java b/src/main/java/org/testng/internal/Invoker.java index 30657ba..abc75d0 100644 --- a/src/main/java/org/testng/internal/Invoker.java +++ b/src/main/java/org/testng/internal/Invoker.java @@ -183,11 +183,11 @@ public class Invoker implements IInvoker { // Only run the configuration if // - the test is enabled and // - the Configuration method belongs to the same class or a parent - if(MethodHelper.isEnabled(objectClass, m_annotationFinder)) { - configurationAnnotation = AnnotationHelper.findConfiguration(m_annotationFinder, method); + configurationAnnotation = AnnotationHelper.findConfiguration(m_annotationFinder, method); + boolean alwaysRun= isAlwaysRun(configurationAnnotation); + if(MethodHelper.isEnabled(objectClass, m_annotationFinder) || alwaysRun) { if (MethodHelper.isEnabled(configurationAnnotation)) { - boolean alwaysRun= isAlwaysRun(configurationAnnotation); if (!confInvocationPassed(tm, currentTestMethod, testClass, instance) && !alwaysRun) { handleConfigurationSkip(tm, testResult, configurationAnnotation, currentTestMethod, instance, suite); @@ -273,7 +273,11 @@ public class Invoker implements IInvoker { if ((configurationAnnotation.getAfterSuite() || configurationAnnotation.getAfterTest() || configurationAnnotation.getAfterTestClass() - || configurationAnnotation.getAfterTestMethod()) + || configurationAnnotation.getAfterTestMethod() + || configurationAnnotation.getBeforeTestMethod() + || configurationAnnotation.getBeforeTestClass() + || configurationAnnotation.getBeforeTest() + || configurationAnnotation.getBeforeSuite()) && configurationAnnotation.getAlwaysRun()) { alwaysRun= true; diff --git a/src/test/java/test/enable/EnableTest.java b/src/test/java/test/enable/EnableTest.java index 3287da6..a76e945 100644 --- a/src/test/java/test/enable/EnableTest.java +++ b/src/test/java/test/enable/EnableTest.java @@ -27,20 +27,22 @@ public class EnableTest extends SimpleBaseTest { Assert.assertEquals(invokedMethods.get(3), "beforeSuiteNoRunA2"); Assert.assertEquals(invokedMethods.get(4), "beforeSuiteRunA"); Assert.assertEquals(invokedMethods.get(5), "beforeSuiteRunA2"); - Assert.assertEquals(invokedMethods.get(6), "beforeSuiteC"); - Assert.assertEquals(invokedMethods.get(7), "beforeSuiteC2"); - Assert.assertEquals(invokedMethods.get(8), "beforeSuiteNoRunC"); - Assert.assertEquals(invokedMethods.get(9), "beforeSuiteNoRunC2"); - Assert.assertEquals(invokedMethods.get(10), "beforeSuiteRunC"); - Assert.assertEquals(invokedMethods.get(11), "beforeSuiteRunC2"); - Assert.assertEquals(invokedMethods.get(12), "testA2"); - Assert.assertEquals(invokedMethods.get(13), "testA3"); - Assert.assertEquals(invokedMethods.get(14), "testB2"); - Assert.assertEquals(invokedMethods.get(15), "testB3"); - Assert.assertEquals(invokedMethods.get(16), "testC"); - Assert.assertEquals(invokedMethods.get(17), "testC2"); - Assert.assertEquals(invokedMethods.get(18), "testC3"); - Assert.assertEquals(invokedMethods.size(), 19); + Assert.assertEquals(invokedMethods.get(6), "beforeSuiteRunB"); + Assert.assertEquals(invokedMethods.get(7), "beforeSuiteRunB2"); + Assert.assertEquals(invokedMethods.get(8), "beforeSuiteC"); + Assert.assertEquals(invokedMethods.get(9), "beforeSuiteC2"); + Assert.assertEquals(invokedMethods.get(10), "beforeSuiteNoRunC"); + Assert.assertEquals(invokedMethods.get(11), "beforeSuiteNoRunC2"); + Assert.assertEquals(invokedMethods.get(12), "beforeSuiteRunC"); + Assert.assertEquals(invokedMethods.get(13), "beforeSuiteRunC2"); + Assert.assertEquals(invokedMethods.get(14), "testA2"); + Assert.assertEquals(invokedMethods.get(15), "testA3"); + Assert.assertEquals(invokedMethods.get(16), "testB2"); + Assert.assertEquals(invokedMethods.get(17), "testB3"); + Assert.assertEquals(invokedMethods.get(18), "testC"); + Assert.assertEquals(invokedMethods.get(19), "testC2"); + Assert.assertEquals(invokedMethods.get(20), "testC3"); + Assert.assertEquals(invokedMethods.size(), 21); } @Test(description = "https://github.com/cbeust/testng/issues/420") @@ -48,11 +50,11 @@ public class EnableTest extends SimpleBaseTest { TestNG tng = create(Issue420FirstSample.class, Issue420SecondSample.class); InvokedMethodListener listener = new InvokedMethodListener(); tng.addListener(listener); - tng.setVerbose(10); tng.run(); assertThat(listener.getInvokedMethods()).containsExactly( - "initEnvironment", "verifySomethingFirstSample", "verifySomethingSecondSample" + "initEnvironment", + "verifySomethingFirstSample", "verifySomethingSecondSample" ); } } -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/testng.git _______________________________________________ pkg-java-commits mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

