[java-support] branch master updated: IDP-1508 - TestNG @BeforeTest and @AfterTest are being misused

Scott Cantor cantor.2 at osu.edu
Tue Apr 7 15:10:19 EDT 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-support.

View the commit online:
http://git.shibboleth.net/view/?p=java-support.git;a=commit;h=fe5916ccb32fc2d5d87c7bf05046a9257aaf87b6

The following commit(s) were added to refs/heads/master by this push:
       new  fe5916c   IDP-1508 - TestNG @BeforeTest and @AfterTest are being misused
fe5916c is described below

commit fe5916ccb32fc2d5d87c7bf05046a9257aaf87b6
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Apr 7 15:10:17 2020 -0400

    IDP-1508 - TestNG @BeforeTest and @AfterTest are being misused
    
    https://issues.shibboleth.net/jira/browse/IDP-1508
    
    Sanitize java-support.
---
 .../shibboleth/utilities/java/support/xml/AttributeSupportTest.java   | 4 ++--
 .../net/shibboleth/utilities/java/support/xml/DOMTypeSupportTest.java | 4 ++--
 .../net/shibboleth/utilities/java/support/xml/ElementSupportTest.java | 4 ++--
 .../net/shibboleth/utilities/java/support/xml/QNameSupportTest.java   | 4 ++--
 .../net/shibboleth/utilities/java/support/xml/SchemaBuilderTest.java  | 4 ++--
 .../shibboleth/utilities/java/support/xml/SerializeSupportTest.java   | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/test/java/net/shibboleth/utilities/java/support/xml/AttributeSupportTest.java b/src/test/java/net/shibboleth/utilities/java/support/xml/AttributeSupportTest.java
index e8b0f30..ac128ba 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/xml/AttributeSupportTest.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/xml/AttributeSupportTest.java
@@ -35,8 +35,8 @@ import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.testng.Assert;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.BeforeTest;
 import org.testng.annotations.Test;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -79,7 +79,7 @@ public class AttributeSupportTest {
 
     private BasicParserPool parserPool;
 
-    @BeforeTest public void setUp() throws XMLParserException, ComponentInitializationException, SAXException,
+    @BeforeClass public void setUp() throws XMLParserException, ComponentInitializationException, SAXException,
             IOException {
         parserPool = new BasicParserPool();
         parserPool.initialize();
diff --git a/src/test/java/net/shibboleth/utilities/java/support/xml/DOMTypeSupportTest.java b/src/test/java/net/shibboleth/utilities/java/support/xml/DOMTypeSupportTest.java
index c966a60..93aef43 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/xml/DOMTypeSupportTest.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/xml/DOMTypeSupportTest.java
@@ -29,7 +29,7 @@ import net.shibboleth.utilities.java.support.component.ComponentInitializationEx
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 import org.w3c.dom.Element;
 import org.xml.sax.SAXException;
@@ -43,7 +43,7 @@ public class DOMTypeSupportTest {
     private Element xsStringXSITypeElement;
     private Element noXSITypeElement;
     
-    @BeforeTest public void setup() throws ComponentInitializationException, SAXException, IOException, XMLParserException {
+    @BeforeClass public void setup() throws ComponentInitializationException, SAXException, IOException, XMLParserException {
         BasicParserPool pool = new BasicParserPool();
         pool.initialize();
         parserPool = pool;
diff --git a/src/test/java/net/shibboleth/utilities/java/support/xml/ElementSupportTest.java b/src/test/java/net/shibboleth/utilities/java/support/xml/ElementSupportTest.java
index 8c18e12..122d244 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/xml/ElementSupportTest.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/xml/ElementSupportTest.java
@@ -34,7 +34,7 @@ import net.shibboleth.utilities.java.support.primitive.StringSupport;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -66,7 +66,7 @@ public class ElementSupportTest {
 
     private Element rootElement;
 
-    @BeforeTest public void setUp() throws XMLParserException, ComponentInitializationException, SAXException,
+    @BeforeClass public void setUp() throws XMLParserException, ComponentInitializationException, SAXException,
             IOException {
         parserPool = new BasicParserPool();
         parserPool.setCoalescing(false);
diff --git a/src/test/java/net/shibboleth/utilities/java/support/xml/QNameSupportTest.java b/src/test/java/net/shibboleth/utilities/java/support/xml/QNameSupportTest.java
index dbf7ba7..6349ac9 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/xml/QNameSupportTest.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/xml/QNameSupportTest.java
@@ -30,7 +30,7 @@ import net.shibboleth.utilities.java.support.logic.ConstraintViolationException;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
@@ -63,7 +63,7 @@ public class QNameSupportTest {
 
     private Element child;
 
-    @BeforeTest public void setup() throws ComponentInitializationException, SAXException, IOException,
+    @BeforeClass public void setup() throws ComponentInitializationException, SAXException, IOException,
             XMLParserException {
         BasicParserPool pool = new BasicParserPool();
         pool.initialize();
diff --git a/src/test/java/net/shibboleth/utilities/java/support/xml/SchemaBuilderTest.java b/src/test/java/net/shibboleth/utilities/java/support/xml/SchemaBuilderTest.java
index 1780bb6..a88a887 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/xml/SchemaBuilderTest.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/xml/SchemaBuilderTest.java
@@ -30,7 +30,7 @@ import net.shibboleth.utilities.java.support.resource.TestResourceConverter;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 import org.xml.sax.SAXException;
 
@@ -59,7 +59,7 @@ public class SchemaBuilderTest {
         return new StreamSource(fails.getInputStream());
     }
 
-    @BeforeTest public void setup()  {
+    @BeforeClass public void setup()  {
         works = new ClassPathResource(TEST_DIR + "schemaBuilderTest-works.xml");
         fails = new ClassPathResource(TEST_DIR + "schemaBuilderTest-fails.xml");
     }
diff --git a/src/test/java/net/shibboleth/utilities/java/support/xml/SerializeSupportTest.java b/src/test/java/net/shibboleth/utilities/java/support/xml/SerializeSupportTest.java
index 3362a49..89bf9d8 100644
--- a/src/test/java/net/shibboleth/utilities/java/support/xml/SerializeSupportTest.java
+++ b/src/test/java/net/shibboleth/utilities/java/support/xml/SerializeSupportTest.java
@@ -27,7 +27,7 @@ import javax.xml.parsers.DocumentBuilder;
 import org.springframework.core.io.ClassPathResource;
 import org.springframework.core.io.Resource;
 import org.testng.Assert;
-import org.testng.annotations.BeforeTest;
+import org.testng.annotations.BeforeClass;
 import org.testng.annotations.Test;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Document;
@@ -136,7 +136,7 @@ public class SerializeSupportTest {
         }
     }
 
-    @BeforeTest public void setup()
+    @BeforeClass public void setup()
             throws XMLParserException, ComponentInitializationException, SAXException, IOException {
         parserPool = new BasicParserPool();
         parserPool.initialize();

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list