<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> 
        <base href="https://issues.shibboleth.net/jira"> 
        <title>Message Title</title> 
    </head> 
    <body class="jira" style="color: #333333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.429"> 
        <table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt" bgcolor="#f5f5f5"> 
            <!-- header here --> 
            <tbody>
                <tr> 
                    <td id="header-pattern-container" style="padding: 0px; border-collapse: collapse; padding: 10px 20px"> 
                        <table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                            <tbody>
                                <tr> 
                                    <td id="header-avatar-image-container" valign="top" style="padding: 0px; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px" width="32"> <img id="header-avatar-image" class="image_fix" src="cid:jira-generated-image-avatar-7ca9a694-4215-4443-9c73-7c006da810d7" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"> </td> 
                                    <td id="header-text-container" valign="middle" style="padding: 0px; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> <a class="user-hover" rel="putmanb@shibboleth.net" id="email_putmanb@shibboleth.net" href="https://issues.shibboleth.net/jira/secure/ViewProfile.jspa?name=putmanb%40shibboleth.net" style="color:#0052cc;; color: #3b73af; text-decoration: none">Brent Putman</a> <strong>created</strong> an issue </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="email-content-container" style="padding: 0px; border-collapse: collapse; padding: 0 20px"> 
                        <table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: separate"> 
                            <tbody>
                                <tr> 
                                    <!-- there needs to be content in the cell for it to render in some clients --> 
                                    <td class="email-content-rounded-top mobile-expand" style="padding: 0px; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 15px; background-color: #ffffff; border-left: 1px solid #cccccc; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px; height: 10px; line-height: 10px; padding: 0 15px 0 16px; mso-line-height-rule: exactly" height="10" bgcolor="#ffffff"> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> 
                                        <table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                            <tbody>
                                                <tr> 
                                                    <td class="page-title-pattern-first-line " style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; padding-top: 10px"> <a href="https://issues.shibboleth.net/jira/browse/IDP" style="color: #3b73af; text-decoration: none">Identity Provider</a> / <a href="https://issues.shibboleth.net/jira/browse/IDP-1508" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-a3c9e321-a49b-4734-8608-d4f5d1a0cf5b" height="16" width="16" border="0" align="absmiddle" alt="Bug" style="vertical-align: text-bottom"></a> <a href="https://issues.shibboleth.net/jira/browse/IDP-1508" style="color: #3b73af; text-decoration: none">IDP-1508</a> </td> 
                                                </tr> 
                                                <tr> 
                                                    <td style="vertical-align: top;; padding: 0px; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" class="page-title-pattern-header-container"> <span class="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"> <a href="https://issues.shibboleth.net/jira/browse/IDP-1508" style="color: #3b73af; text-decoration: none">TestNG @BeforeTest and @AfterTest is being misused</a> </span> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand  wrapper-special-margin" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; padding-top: 10px; padding-bottom: 5px" bgcolor="#ffffff"> 
                                        <table class="keyvalue-table" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                            <tbody>
                                                <tr> 
                                                    <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Issue Type:</th> 
                                                    <td class="has-icon" style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <img src="cid:jira-generated-image-avatar-a3c9e321-a49b-4734-8608-d4f5d1a0cf5b" height="16" width="16" border="0" align="absmiddle" alt="Bug" style="vertical-align: text-bottom"> Bug </td> 
                                                </tr> 
                                                <tr> 
                                                    <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Assignee:</th> 
                                                    <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <a class="user-hover" rel="tzeller@shibboleth.net" id="email_tzeller@shibboleth.net" href="https://issues.shibboleth.net/jira/secure/ViewProfile.jspa?name=tzeller%40shibboleth.net" style="color:#0052cc;; color: #3b73af; text-decoration: none">Tom Zeller</a> </td> 
                                                </tr> 
                                                <tr> 
                                                    <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Attachments:</th> 
                                                    <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> Screenshot 2019-10-09 18.31.38.png </td> 
                                                </tr> 
                                                <tr> 
                                                    <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Created:</th> 
                                                    <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> 09/Oct/19 7:32 PM </td> 
                                                </tr> 
                                                <tr> 
                                                    <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Priority:</th> 
                                                    <td class="has-icon" style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <img src="cid:jira-generated-image-static-major-7ba7b622-633a-4d0e-9c3e-d3ccd2f5297c" height="16" width="16" border="0" align="absmiddle" alt="Major" style="vertical-align: text-bottom"> Major </td> 
                                                </tr> 
                                                <tr> 
                                                    <th style="color: #707070; font: normal 14px/20px Arial, sans-serif; text-align: left; vertical-align: top; padding: 2px 0">Reporter:</th> 
                                                    <td style="padding: 0px; border-collapse: collapse; font: normal 14px/20px Arial, sans-serif; padding: 2px 0 2px 5px; vertical-align: top"> <a class="user-hover" rel="putmanb@shibboleth.net" id="email_putmanb@shibboleth.net" href="https://issues.shibboleth.net/jira/secure/ViewProfile.jspa?name=putmanb%40shibboleth.net" style="color:#0052cc;; color: #3b73af; text-decoration: none">Brent Putman</a> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand  issue-description-container" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; padding-top: 5px; padding-bottom: 10px" bgcolor="#ffffff"> 
                                        <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
                                            <tbody>
                                                <tr> 
                                                    <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 10px 0"> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0; margin-top: 0">We seem to be misusing these 2 annotations in multiple projects in the IdP stack.</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Note that that annotation does <b>not</b> mean execute the annotated method before/after each @Test method (that would be @Before-/AfterMethod), nor does it mean before/after all the @Test methods in that test class (that would be @Before-/AfterClass).</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">The docs:</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0"><em><b>@BeforeTest:</b></em> <em>The annotated method will be run before any test method belonging to the classes inside the <test> tag is run.</em><br> <em><b>@AfterTest:</b></em> <em>The annotated method will be run after all the test methods belonging to the classes inside the <test> tag have run.</em></p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">TestNG's runtime design is that a Suite consists of 1 or more Tests.  A Test consists of 1 or more TestNG classes.  A TestNG class contains 1 or more methods annotated with @Test or other TestNG annotations.</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0"><a href="https://testng.org/doc/documentation-main.html#introduction" class="external-link" target="_blank" rel="nofollow noopener" style="color: #3b73af; text-decoration: none">https://testng.org/doc/documentation-main.html#introduction</a></p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">We don't generally use explicitly constructed TestNG Suite config XML files, so we aren't explicitly defining Suites and "Tests" (the kind that live directly inside Suites). (See the first file listing in below for an example of what such an explicit config with multiple Tests in a Suite would look like).</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0"><a href="https://testng.org/doc/documentation-main.html#testng-xml" class="external-link" target="_blank" rel="nofollow noopener" style="color: #3b73af; text-decoration: none">https://testng.org/doc/documentation-main.html#testng-xml</a></p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">So when we run TestNG tests in Eclipse or Maven, it's internally synthetically generating a single default Suite, and within that a single default Test containing all the test classes to be included in that run. That's what you see in Eclipse for example at the top of the test pane tree.</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">So @Before-/AfterTest methods are just going to run <b>once</b>, before and after that single default Test. In our usage without test suite config files, it's effectively going to be almost the same as if @Before-/AfterSuite had been used.</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">Maybe this is really what was meant in some places... But based on some usage I've seen (e.g. setting up and tearing down an in-memory LDAP server just for use by a single test class) I suspect most or all of these were really meant to be either @Before-/AfterClass or even @Before-/AfterMethod.</p> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0">List of current usage</p> 
                                                        <div class="code panel" style="border-width: 1px;; border: 1px solid #cccccc; background: #f5f5f5; font-size: 12px; line-height: 1.333; font-family: monospace; border: 1px solid #cccccc; -moz-border-radius: 3px 3px 3px 3px; border-radius: 3px 3px 3px 3px; margin: 9px 0">
                                                            <div class="codeContent panelContent" style="padding: 9px 12px"> 
                                                                <pre class="code-java" style="margin: 10px 0 0 0; margin-top: 0; max-height: 30em; overflow: auto; white-space: pre-wrap; word-wrap: normal">
egrep -l -R <span class="code-quote" style="color: #009100">'@(Before|After)Test'</span> java-support/src/test spring-extensions/src/test java-opensaml<span class="code-comment" style="color: #808080">/*/src/test java-identity-provider/*/</span>src/test

java-support/src/test/java/net/shibboleth/utilities/java/support/xml/AttributeSupportTest.java
java-support/src/test/java/net/shibboleth/utilities/java/support/xml/DOMTypeSupportTest.java
java-support/src/test/java/net/shibboleth/utilities/java/support/xml/ElementSupportTest.java
java-support/src/test/java/net/shibboleth/utilities/java/support/xml/QNameSupportTest.java
java-support/src/test/java/net/shibboleth/utilities/java/support/xml/SchemaBuilderTest.java
java-support/src/test/java/net/shibboleth/utilities/java/support/xml/SerializeSupportTest.java
java-opensaml/opensaml-security-impl/src/test/java/org/opensaml/security/trust/impl/TrustEngineX509TrustManagerTest.java
java-opensaml/opensaml-storage-impl/src/test/java/org/opensaml/storage/impl/LDAPStorageServiceTest.java
java-identity-provider/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/impl/ScriptedMatcherTest.java
java-identity-provider/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/AndMatcherTest.java
java-identity-provider/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/NotMatcherTest.java
java-identity-provider/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/matcher/logic/impl/OrMatcherTest.java
java-identity-provider/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/impl/ScriptedPolicyRuleTest.java
java-identity-provider/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/AndPolicyRuleTest.java
java-identity-provider/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/NotPolicyRuleTest.java
java-identity-provider/idp-attribute-filter-impl/src/test/java/net/shibboleth/idp/attribute/filter/policyrule/logic/impl/OrPolicyRuleTest.java
java-identity-provider/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/impl/StoredIDDataConnectorTest.java
java-identity-provider/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/LDAPDataConnectorTest.java
java-identity-provider/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/ldap/impl/Regressions.java
java-identity-provider/idp-attribute-resolver-impl/src/test/java/net/shibboleth/idp/attribute/resolver/dc/rdbms/impl/RDBMSDataConnectorTest.java
java-identity-provider/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/AttributeResolverTest.java
java-identity-provider/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/ldap/LDAPDataConnectorParserTest.java
java-identity-provider/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/dc/rdbms/RDBMSDataConnectorParserTest.java
java-identity-provider/idp-attribute-resolver-spring/src/test/java/net/shibboleth/idp/attribute/resolver/spring/failfast/AttributeResolverFailFastTest.java
java-identity-provider/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/principal/impl/ExactPrincipalEvalPredicateFactoryTest.java
java-identity-provider/idp-authn-impl/src/test/java/net/shibboleth/idp/authn/principal/impl/InexactPrincipalEvalPredicateFactoryTest.java
java-identity-provider/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/EncodingTicketServiceTest.java
java-identity-provider/idp-cas-impl/src/test/java/net/shibboleth/idp/cas/ticket/impl/SimpleTicketServiceTest.java
java-identity-provider/idp-conf/src/test/java/net/shibboleth/idp/test/flows/AbstractFlowTest.java
java-identity-provider/idp-profile-api/src/test/java/net/shibboleth/idp/profile/ScriptedActionTest.java

 </pre> 
                                                            </div>
                                                        </div> <p style="margin-top:0;margin-bottom:10px;; margin: 10px 0 0 0"> </p> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> 
                                        <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="actions-pattern-container" valign="middle" style="padding: 0px; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0"> 
                                                        <table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                                            <tbody>
                                                                <tr> 
                                                                    <td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0; vertical-align: middle"> <a href="https://issues.shibboleth.net/jira/browse/IDP-1508#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none"> <img class="actions-pattern-action-icon-image" src="cid:jira-generated-image-static-comment-icon-721eff20-56ba-4e4d-af7f-bc3d08aee49f" alt="Add Comment" title="Add Comment" height="16" width="16" border="0" style="vertical-align: middle"> </a> </td> 
                                                                    <td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px"> <a href="https://issues.shibboleth.net/jira/browse/IDP-1508#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> </td> 
                                                                </tr> 
                                                            </tbody>
                                                        </table> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <!-- there needs to be content in the cell for it to render in some clients --> 
                                <tr> 
                                    <td class="email-content-rounded-bottom mobile-expand" style="padding: 0px; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #ffffff; border-top: 0; border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly" height="5" bgcolor="#ffffff"> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="footer-pattern" style="padding: 0px; border-collapse: collapse; padding: 12px 20px"> 
                        <table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                            <tbody>
                                <tr> 
                                    <td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0px; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> This message was sent by Atlassian Jira <span id="footer-build-information">(v8.4.1#804002-<span title="94e96d6294939fc41f873484cf96b18ab6f2be0a" data-commit-id="94e96d6294939fc41f873484cf96b18ab6f2be0a}">sha1:94e96d6</span>)</span> </td> 
                                    <td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0px; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
                                        <table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="footer-pattern-logo-desktop-padding" style="padding: 0px; border-collapse: collapse; padding-top: 3px"> <img id="footer-pattern-logo-desktop" src="https://issues.shibboleth.net/jira/images/mail/atlassian-email-logo.png" alt="Atlassian logo" title="Atlassian logo" width="191" height="24" class="image_fix"> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
            </tbody>
        </table>   
    </body>
</html>