From 6245caa117aa9f7c00387bde10856a64cfeec782 Mon Sep 17 00:00:00 2001 From: Thorsten Vitt <thorsten.vitt@uni-wuerzburg.de> Date: Mon, 9 Sep 2013 18:19:47 +0200 Subject: [PATCH] Removed deprecations from tests --- .../services/aggregator/AbstractIntegrationTest.java | 3 +-- .../services/aggregator/TextGridRepTest.java | 4 ++-- .../services/aggregator/teicorpus/TEICorpusTest.java | 3 +-- .../aggregator/teicorpus/TEIHeaderStackTest.java | 12 +++++------- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/test/java/info/textgrid/services/aggregator/AbstractIntegrationTest.java b/src/test/java/info/textgrid/services/aggregator/AbstractIntegrationTest.java index ffc5715..aa8ea95 100644 --- a/src/test/java/info/textgrid/services/aggregator/AbstractIntegrationTest.java +++ b/src/test/java/info/textgrid/services/aggregator/AbstractIntegrationTest.java @@ -8,7 +8,6 @@ import java.net.URLConnection; import com.google.common.io.ByteStreams; -import com.google.common.io.NullOutputStream; public abstract class AbstractIntegrationTest { @@ -42,7 +41,7 @@ protected HttpURLConnection createRequest(final String request) protected long readContents(final URLConnection connection) throws IOException { final InputStream content = connection.getInputStream(); final long realLength = ByteStreams.copy(content, - new NullOutputStream()); + ByteStreams.nullOutputStream()); return realLength; } diff --git a/src/test/java/info/textgrid/services/aggregator/TextGridRepTest.java b/src/test/java/info/textgrid/services/aggregator/TextGridRepTest.java index 95efdda..91c135a 100644 --- a/src/test/java/info/textgrid/services/aggregator/TextGridRepTest.java +++ b/src/test/java/info/textgrid/services/aggregator/TextGridRepTest.java @@ -1,7 +1,7 @@ package info.textgrid.services.aggregator; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertNotNull; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import info.textgrid.middleware.confclient.ConfservClientConstants; import info.textgrid.middleware.tgsearch.client.SearchClient; import info.textgrid.namespaces.middleware.tgcrud.services.tgcrudservice.TGCrudService; diff --git a/src/test/java/info/textgrid/services/aggregator/teicorpus/TEICorpusTest.java b/src/test/java/info/textgrid/services/aggregator/teicorpus/TEICorpusTest.java index b162765..b5e192a 100644 --- a/src/test/java/info/textgrid/services/aggregator/teicorpus/TEICorpusTest.java +++ b/src/test/java/info/textgrid/services/aggregator/teicorpus/TEICorpusTest.java @@ -16,9 +16,8 @@ import javax.ws.rs.core.Response; import javax.ws.rs.core.StreamingOutput; -import junit.framework.Assert; - import org.apache.cxf.helpers.IOUtils; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/src/test/java/info/textgrid/services/aggregator/teicorpus/TEIHeaderStackTest.java b/src/test/java/info/textgrid/services/aggregator/teicorpus/TEIHeaderStackTest.java index 441c906..94d5f2f 100644 --- a/src/test/java/info/textgrid/services/aggregator/teicorpus/TEIHeaderStackTest.java +++ b/src/test/java/info/textgrid/services/aggregator/teicorpus/TEIHeaderStackTest.java @@ -7,7 +7,6 @@ import info.textgrid.namespaces.middleware.tgcrud.services.tgcrudservice.ObjectNotFoundFault; import info.textgrid.services.aggregator.ITextGridRep; import info.textgrid.services.aggregator.TextGridRepProvider; -import info.textgrid.services.aggregator.teicorpus.TEIHeaderStack; import javax.xml.bind.JAXBException; import javax.xml.parsers.ParserConfigurationException; @@ -15,8 +14,7 @@ import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.w3c.dom.Document; @@ -44,17 +42,17 @@ public void extracted() throws ObjectNotFoundFault, MetadataParseFault, @Test public void testGenerateCommonDOM() throws ParserConfigurationException, JAXBException { - Document document = stack.generateCommonDOM(); + final Document document = stack.generateCommonDOM(); Assert.assertNotNull(document); - NodeList childNodes = document.getDocumentElement().getChildNodes(); + final NodeList childNodes = document.getDocumentElement().getChildNodes(); Assert.assertTrue("No child nodes :-(", childNodes.getLength() > 0); } @Test public void testLoadStylesheet() throws TransformerConfigurationException { - Templates stylesheet = stack.getStylesheet(); + final Templates stylesheet = stack.getStylesheet(); Assert.assertNotNull(stylesheet); - Transformer transformer = stylesheet.newTransformer(); + final Transformer transformer = stylesheet.newTransformer(); Assert.assertNotNull(transformer); } -- GitLab