You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2018/01/04 20:03:46 UTC
[cxf] 02/02: Update things to NOT use the old junit3 based
frameworks
This is an automated email from the ASF dual-hosted git repository.
dkulp pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit 4142d44c4db7c9971829d15a4aa4b7056788e9e6
Author: Daniel Kulp <dk...@apache.org>
AuthorDate: Thu Jan 4 14:18:18 2018 -0500
Update things to NOT use the old junit3 based frameworks
---
.../soap/interceptor/SoapFaultSerializerTest.java | 6 ++---
.../main/java/org/apache/cxf/test/XPathAssert.java | 21 +++++++++--------
.../java/org/apache/cxf/test/XPathAssertTest.java | 17 +++++++++-----
.../org/apache/cxf/tools/corba/IDLToWSDLTest.java | 26 ++++++++++++++++++++++
.../org/apache/cxf/tools/corba/WSDLToIDLTest.java | 21 +++++++++++++++++
.../tools/corba/common/CorbaPrimitiveMapTest.java | 16 +++++++------
.../cxf/tools/corba/common/ToolTestBase.java | 8 +++++--
.../idlpreprocessor/IdlPreprocessorReaderTest.java | 11 +++++++--
.../org/apache/cxf/tools/java2ws/AegisTest.java | 7 +++---
9 files changed, 97 insertions(+), 36 deletions(-)
diff --git a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
index 515588d..d420ec7 100644
--- a/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
+++ b/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java
@@ -35,8 +35,6 @@ import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import junit.framework.AssertionFailedError;
-
import org.apache.cxf.binding.soap.Soap11;
import org.apache.cxf.binding.soap.Soap12;
import org.apache.cxf.binding.soap.SoapFault;
@@ -68,8 +66,8 @@ public class SoapFaultSerializerTest extends Assert {
namespaces.put("xml", "http://www.w3.org/XML/1998/namespace");
XPathUtils xpu = new XPathUtils(namespaces);
if (!xpu.isExist(xpathExpression, doc, XPathConstants.NODE)) {
- throw new AssertionFailedError("Failed to select any nodes for expression:\n" + xpathExpression
- + " from document:\n" + StaxUtils.toString(doc));
+ fail("Failed to select any nodes for expression:\n" + xpathExpression
+ + " from document:\n" + StaxUtils.toString(doc));
}
}
diff --git a/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java b/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
index 1ace90f..0cdd794 100644
--- a/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
+++ b/testutils/src/main/java/org/apache/cxf/test/XPathAssert.java
@@ -32,7 +32,6 @@ import javax.xml.xpath.XPathFactory;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-import junit.framework.AssertionFailedError;
import org.apache.cxf.helpers.DOMUtils;
import org.apache.cxf.staxutils.StaxUtils;
@@ -59,8 +58,8 @@ public final class XPathAssert {
NodeList nodes = (NodeList)createXPath(namespaces).evaluate(xpath, node, XPathConstants.NODESET);
if (nodes.getLength() == 0) {
- throw new AssertionFailedError("Failed to select any nodes for expression:\n" + xpath
- + " from document:\n" + writeNodeToString(node));
+ Assert.fail("Failed to select any nodes for expression:\n" + xpath
+ + " from document:\n" + writeNodeToString(node));
}
return nodes;
@@ -79,14 +78,14 @@ public final class XPathAssert {
Boolean b = (Boolean)createXPath(namespaces).evaluate(xpath, node, XPathConstants.BOOLEAN);
if (b == null) {
- throw new AssertionFailedError("Failed to select any nodes for expression:\n" + xpath
- + " from document:\n" + writeNodeToString(node));
+ Assert.fail("Failed to select any nodes for expression:\n" + xpath
+ + " from document:\n" + writeNodeToString(node));
}
if (!b.booleanValue()) {
- throw new AssertionFailedError("Boolean XPath assertion evaluated to false:\n"
- + xpath
- + " from document:\n" + writeNodeToString(node));
+ Assert.fail("Boolean XPath assertion evaluated to false:\n"
+ + xpath
+ + " from document:\n" + writeNodeToString(node));
}
}
@@ -110,7 +109,7 @@ public final class XPathAssert {
if (nodes.getLength() > 0) {
String value = writeNodeToString(node);
- throw new AssertionFailedError("Found multiple nodes for expression:\n" + xpath + "\n" + value);
+ Assert.fail("Found multiple nodes for expression:\n" + xpath + "\n" + value);
}
return nodes;
@@ -143,7 +142,7 @@ public final class XPathAssert {
Assert.assertEquals(value, o);
return;
}
- throw new AssertionFailedError("No nodes were found for expression: "
+ Assert.fail("No nodes were found for expression: "
+ xpath
+ " in document "
+ writeNodeToString(node));
@@ -178,7 +177,7 @@ public final class XPathAssert {
Assert.assertEquals(value, q2);
return;
}
- throw new AssertionFailedError("No nodes were found for expression: "
+ Assert.fail("No nodes were found for expression: "
+ xpath
+ " in document "
+ writeNodeToString(node));
diff --git a/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java b/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java
index 581c971..d87b163 100644
--- a/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java
+++ b/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java
@@ -24,8 +24,6 @@ import java.util.Map;
import org.w3c.dom.Document;
-import junit.framework.AssertionFailedError;
-
import org.apache.cxf.staxutils.StaxUtils;
import org.junit.Assert;
@@ -40,19 +38,26 @@ public class XPathAssertTest extends Assert {
XPathAssert.assertValid("//a", document, null);
XPathAssert.assertInvalid("//aasd", document, null);
+ boolean f = false;
try {
XPathAssert.assertInvalid("//a", document, null);
- fail("Expression is valid!");
- } catch (AssertionFailedError e) {
+ f = true;
+ } catch (AssertionError e) {
// this is correct
}
+ if (f) {
+ fail("Expression is valid!");
+ }
try {
XPathAssert.assertValid("//aa", document, null);
- fail("Expression is invalid!");
- } catch (AssertionFailedError e) {
+ f = true;
+ } catch (AssertionError e) {
// this is correct
}
+ if (f) {
+ fail("Expression is valid!");
+ }
XPathAssert.assertXPathEquals("//b", "foo", document, null);
}
diff --git a/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java b/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java
index 4aa3c4b..4163564 100644
--- a/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java
+++ b/tools/corba/src/test/java/org/apache/cxf/tools/corba/IDLToWSDLTest.java
@@ -46,6 +46,10 @@ import org.apache.cxf.tools.corba.common.ToolTestBase;
import org.apache.cxf.tools.corba.utils.TestUtils;
import org.apache.cxf.tools.corba.utils.WSDLGenerationTester;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
public class IDLToWSDLTest extends ToolTestBase {
private static StringBuffer usageBuf;
@@ -60,6 +64,7 @@ public class IDLToWSDLTest extends ToolTestBase {
wsdlGenTester = new WSDLGenerationTester();
}
+ @Before
public void setUp() {
super.setUp();
try {
@@ -87,6 +92,7 @@ public class IDLToWSDLTest extends ToolTestBase {
FileUtils.removeDir(dir);
}
+ @After
public void tearDown() {
try {
deleteDir(output);
@@ -131,6 +137,7 @@ public class IDLToWSDLTest extends ToolTestBase {
genReader.close();
}
+ @Test
public void testNoArgs() throws Exception {
String[] cmdArgs = {};
int exc = execute(cmdArgs);
@@ -141,6 +148,7 @@ public class IDLToWSDLTest extends ToolTestBase {
checkStrings(strBuf.toString().getBytes(), bout.toByteArray());
}
+ @Test
public void testDetailOutput() throws Exception {
String[] args = new String[] {"-?"};
int exc = execute(args);
@@ -148,6 +156,7 @@ public class IDLToWSDLTest extends ToolTestBase {
assertNotNull(bout.toByteArray());
}
+ @Test
public void testVersionOutput() throws Exception {
String[] args = new String[] {"-v"};
int exc = execute(args);
@@ -155,6 +164,7 @@ public class IDLToWSDLTest extends ToolTestBase {
assertNotNull(bout.toByteArray());
}
+ @Test
public void testHelpOutput() throws Exception {
String[] args = new String[] {"-help"};
int exc = execute(args);
@@ -162,10 +172,12 @@ public class IDLToWSDLTest extends ToolTestBase {
assertNotNull(bout.toByteArray());
}
+ @Test
public void testBase64SequenceOctetMappingOption() throws Exception {
doTestSequenceOctetMappingOption(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE_BASE64BINARY);
}
+ @Test
public void testHexBinarySequenceOctetMappingOption() throws Exception {
doTestSequenceOctetMappingOption(ToolCorbaConstants.CFG_SEQUENCE_OCTET_TYPE_HEXBINARY);
}
@@ -205,6 +217,7 @@ public class IDLToWSDLTest extends ToolTestBase {
}
// test "-x <schema-namespace>"
+ @Test
public void testSchemaNamespace() throws Exception {
File input = new File(getClass().getResource("/idl/HelloWorld.idl").toURI());
File actual = new File(output, "HelloWorld.wsdl");
@@ -221,6 +234,7 @@ public class IDLToWSDLTest extends ToolTestBase {
}
// test "-f <corba-address-file>"
+ @Test
public void testCorbaAddressFile() throws Exception {
File input = new File(getClass().getResource("/idl/HelloWorld.idl").toURI());
File actual = new File(output, "HelloWorld.wsdl");
@@ -252,6 +266,7 @@ public class IDLToWSDLTest extends ToolTestBase {
}
// test "-t <corba-type-map target-namespace>"
+ @Test
public void testCorbaTypeMapTargetNamespace() throws Exception {
File input = new File(getClass().getResource("/idl/sequence_octet.idl").toURI());
File actual = new File(output, "sequence_octet.wsdl");
@@ -268,6 +283,7 @@ public class IDLToWSDLTest extends ToolTestBase {
}
// test "-b Treat bounded strings as unbounded."
+ @Test
public void testTreatBoundedStringsAsUnbounded() throws Exception {
File input = new File(getClass().getResource("/idl/String.idl").toURI());
File actual = new File(output, "String.wsdl");
@@ -283,6 +299,7 @@ public class IDLToWSDLTest extends ToolTestBase {
}
// test "-b Treat bounded strings as unbounded."
+ @Test
public void testTreatBoundedAnonStringsAsUnbounded() throws Exception {
File input = new File(getClass().getResource("/idl/Anonstring.idl").toURI());
File actual = new File(output, "Anonstring.wsdl");
@@ -297,6 +314,7 @@ public class IDLToWSDLTest extends ToolTestBase {
doTestGeneratedWsdl(expected, actual);
}
+ @Test
public void testExceptionsWithSchemasInDifferentNS() throws Exception {
File input = new File(getClass().getResource("/idl/Exception.idl").toURI());
File actual = new File(output, "Exception.wsdl");
@@ -311,6 +329,7 @@ public class IDLToWSDLTest extends ToolTestBase {
doTestGeneratedWsdl(expected, actual);
}
+ @Test
public void testOutputWSDLFileName() throws Exception {
File input = new File(getClass().getResource("/idl/HelloWorld.idl").toURI());
File actual = new File(output, "ArtixHelloWorld.wsdl");
@@ -326,6 +345,7 @@ public class IDLToWSDLTest extends ToolTestBase {
doTestGeneratedWsdl(expected, actual);
}
+ @Test
public void testMultipleIncludes() throws Exception {
File input = new File(getClass().getResource("/idl/Parent.idl").toURI());
File actual = new File(output, "Parent.wsdl");
@@ -347,6 +367,7 @@ public class IDLToWSDLTest extends ToolTestBase {
doTestGeneratedWsdl(expected, actual);
}
+ @Test
public void testExternalInterfaceRef() throws Exception {
File input = new File(getClass().getResource("/idl/ExternalInterfaceRef.idl").toURI());
File actual = new File(output, "ExternalInterfaceRef.wsdl");
@@ -367,6 +388,7 @@ public class IDLToWSDLTest extends ToolTestBase {
doTestGeneratedWsdl(expected, actual);
}
+ @Test
public void testDuplicateTypeGeneration() throws Exception {
File input = new File(getClass().getResource("/idl/duplicateAttribute.idl").toURI());
File expected =
@@ -384,6 +406,7 @@ public class IDLToWSDLTest extends ToolTestBase {
doTestGeneratedWsdl(expected, actual);
}
+ @Test
public void testUndefinedTypeRef() throws Exception {
File input = new File(getClass().getResource("/idl/ReferUndefinedType.idl").toURI());
File include1Dir = new File(getClass().getResource("/idl").toURI());
@@ -402,6 +425,7 @@ public class IDLToWSDLTest extends ToolTestBase {
}
}
+ @Test
public void testCXF4541() throws Exception {
File input = new File(getClass().getResource("/idl/missing_struct_member.idl").toURI());
String[] args = new String[] {
@@ -423,6 +447,7 @@ public class IDLToWSDLTest extends ToolTestBase {
}
fail("Did not find foo element");
}
+ @Test
public void testCXF3329() throws Exception {
File input = new File(getClass().getResource("/idl/CXF3329.idl").toURI());
String[] args = new String[] {
@@ -437,6 +462,7 @@ public class IDLToWSDLTest extends ToolTestBase {
assertTrue(s.contains("name=\"myStruct\""));
}
+ @Test
public void testCXF5340() throws Exception {
File input = new File(getClass().getResource("/idl/CXF5340.idl").toURI());
String[] args = new String[] {
diff --git a/tools/corba/src/test/java/org/apache/cxf/tools/corba/WSDLToIDLTest.java b/tools/corba/src/test/java/org/apache/cxf/tools/corba/WSDLToIDLTest.java
index 47944eb..da12864 100644
--- a/tools/corba/src/test/java/org/apache/cxf/tools/corba/WSDLToIDLTest.java
+++ b/tools/corba/src/test/java/org/apache/cxf/tools/corba/WSDLToIDLTest.java
@@ -39,6 +39,10 @@ import org.apache.cxf.tools.corba.common.ToolTestBase;
import org.apache.cxf.tools.corba.processors.wsdl.WSDLToProcessor;
import org.apache.cxf.tools.corba.utils.TestUtils;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
public class WSDLToIDLTest extends ToolTestBase {
private static String usage;
@@ -48,6 +52,7 @@ public class WSDLToIDLTest extends ToolTestBase {
PrintStream newOut;
private File output;
+ @Before
public void setUp() {
super.setUp();
try {
@@ -75,6 +80,7 @@ public class WSDLToIDLTest extends ToolTestBase {
FileUtils.removeDir(dir);
}
+ @After
public void tearDown() {
try {
deleteDir(output);
@@ -118,6 +124,7 @@ public class WSDLToIDLTest extends ToolTestBase {
genReader.close();
}
+ @Test
public void testBindingGenDefault() throws Exception {
String[] cmdArgs = {"-corba", "-i", "BasePortType",
"-d", output.getCanonicalPath(),
@@ -140,6 +147,7 @@ public class WSDLToIDLTest extends ToolTestBase {
}
}
+ @Test
public void testBindingGenSpecifiedFile() throws Exception {
String[] cmdArgs = {"-corba", "-i", "BasePortType",
@@ -165,6 +173,7 @@ public class WSDLToIDLTest extends ToolTestBase {
}
+ @Test
public void testIDLGenDefault() throws Exception {
String[] cmdArgs = {"-idl", "-b", "BaseCORBABinding",
"-d", output.getCanonicalPath(),
@@ -179,6 +188,7 @@ public class WSDLToIDLTest extends ToolTestBase {
assertTrue("Invalid Idl File Generated", line.length() > 0);
}
+ @Test
public void testIDLGenSpecifiedFile() throws Exception {
String[] cmdArgs = {"-idl", "-b", "BaseCORBABinding",
"-o", "simple-binding_gen.idl",
@@ -196,6 +206,7 @@ public class WSDLToIDLTest extends ToolTestBase {
// tests generating corba and idl in default wsdl and idl files
// pass the temp directory to create the wsdl files.
+ @Test
public void testBindAndIDLGen() throws Exception {
String[] cmdArgs = {"-i", "BasePortType",
"-b", "BaseOneCORBABinding",
@@ -224,6 +235,7 @@ public class WSDLToIDLTest extends ToolTestBase {
assertTrue("Invalid Idl File Generated", line.length() > 0);
}
+ @Test
public void testNoArgs() throws Exception {
String[] cmdArgs = {};
int exc = execute(cmdArgs);
@@ -234,6 +246,7 @@ public class WSDLToIDLTest extends ToolTestBase {
checkStrings(strBuf.toString().getBytes(), bout.toByteArray());
}
+ @Test
public void testMissingRequiredFlags() throws Exception {
String[] cmdArgs = {"-i", " interfaceName"};
int exc = execute(cmdArgs);
@@ -244,6 +257,7 @@ public class WSDLToIDLTest extends ToolTestBase {
checkStrings(expected.toString().getBytes(), bout.toByteArray());
}
+ @Test
public void testBindingGenInvalidInterface() throws Exception {
String[] cmdArgs = {"-corba", "-i", "TestInterface",
@@ -254,6 +268,7 @@ public class WSDLToIDLTest extends ToolTestBase {
checkStrings(expected.getBytes(), bout.toByteArray());
}
+ @Test
public void testBindingGenDuplicate() throws Exception {
String[] cmdArgs = {"-i", "BasePortType",
@@ -266,6 +281,7 @@ public class WSDLToIDLTest extends ToolTestBase {
}
+ @Test
public void testIdlGenMissingBinding() throws Exception {
String[] cmdArgs = {"-d", output.getAbsolutePath(),
"-idl",
@@ -276,6 +292,7 @@ public class WSDLToIDLTest extends ToolTestBase {
checkStrings(expected.getBytes(), bout.toByteArray());
}
+ @Test
public void testIdlGenInvalidBinding() throws Exception {
String[] cmdArgs = {"-d", output.getAbsolutePath(),
"-idl", "-b", "TestBinding",
@@ -286,6 +303,7 @@ public class WSDLToIDLTest extends ToolTestBase {
checkStrings(expected.getBytes(), bout.toByteArray());
}
+ @Test
public void testMissingBindingName() throws Exception {
String[] cmdArgs = {"-d", output.getAbsolutePath(),
"-i", "BasePortType",
@@ -295,18 +313,21 @@ public class WSDLToIDLTest extends ToolTestBase {
noError, execute(cmdArgs));
}
+ @Test
public void testDetailOutput() throws Exception {
String[] args = new String[] {"-?"};
WSDLToIDL.main(args);
assertNotNull(getStdOut());
}
+ @Test
public void testVersionOutput() throws Exception {
String[] args = new String[] {"-v"};
WSDLToIDL.main(args);
assertNotNull(getStdOut());
}
+ @Test
public void testHelpOutput() throws Exception {
String[] args = new String[] {"-help"};
WSDLToIDL.main(args);
diff --git a/tools/corba/src/test/java/org/apache/cxf/tools/corba/common/CorbaPrimitiveMapTest.java b/tools/corba/src/test/java/org/apache/cxf/tools/corba/common/CorbaPrimitiveMapTest.java
index d1a3a61..43af3bc 100644
--- a/tools/corba/src/test/java/org/apache/cxf/tools/corba/common/CorbaPrimitiveMapTest.java
+++ b/tools/corba/src/test/java/org/apache/cxf/tools/corba/common/CorbaPrimitiveMapTest.java
@@ -23,12 +23,14 @@ import java.util.*;
import javax.xml.namespace.QName;
-import junit.framework.TestCase;
-
import org.apache.cxf.binding.corba.wsdl.CorbaType;
-public class CorbaPrimitiveMapTest extends TestCase {
+import org.junit.Assert;
+import org.junit.Test;
+
+public class CorbaPrimitiveMapTest {
+ @Test
public void testMap() {
Map<QName, CorbaType> map = new HashMap<>();
@@ -42,10 +44,10 @@ public class CorbaPrimitiveMapTest extends TestCase {
map.put(typeName, corbaTypeImpl);
Object value = map.get(typeName);
- assertEquals(corbaTypeImpl.getName(), corbaName.getLocalPart());
- assertEquals(corbaTypeImpl.getQName(), corbaName);
- assertEquals(corbaTypeImpl.getType(), typeName);
- assertEquals(corbaTypeImpl, value);
+ Assert.assertEquals(corbaTypeImpl.getName(), corbaName.getLocalPart());
+ Assert.assertEquals(corbaTypeImpl.getQName(), corbaName);
+ Assert.assertEquals(corbaTypeImpl.getType(), typeName);
+ Assert.assertEquals(corbaTypeImpl, value);
}
}
diff --git a/tools/corba/src/test/java/org/apache/cxf/tools/corba/common/ToolTestBase.java b/tools/corba/src/test/java/org/apache/cxf/tools/corba/common/ToolTestBase.java
index 7997580..7b9c6c8 100644
--- a/tools/corba/src/test/java/org/apache/cxf/tools/corba/common/ToolTestBase.java
+++ b/tools/corba/src/test/java/org/apache/cxf/tools/corba/common/ToolTestBase.java
@@ -23,9 +23,11 @@ import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
import java.net.URL;
-import junit.framework.TestCase;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
-public abstract class ToolTestBase extends TestCase {
+public abstract class ToolTestBase extends Assert {
protected PrintStream oldStdErr;
protected PrintStream oldStdOut;
@@ -35,6 +37,7 @@ public abstract class ToolTestBase extends TestCase {
protected ByteArrayOutputStream errOut = new ByteArrayOutputStream();
protected ByteArrayOutputStream stdOut = new ByteArrayOutputStream();
+ @Before
public void setUp() {
oldStdErr = System.err;
@@ -47,6 +50,7 @@ public abstract class ToolTestBase extends TestCase {
idlLocation = ToolTestBase.class.getResource("/idl/HelloWorld.idl");
}
+ @After
public void tearDown() {
System.setErr(oldStdErr);
diff --git a/tools/corba/src/test/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReaderTest.java b/tools/corba/src/test/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReaderTest.java
index bdc8140..e37d050 100644
--- a/tools/corba/src/test/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReaderTest.java
+++ b/tools/corba/src/test/java/org/apache/cxf/tools/corba/idlpreprocessor/IdlPreprocessorReaderTest.java
@@ -29,9 +29,10 @@ import java.net.URL;
import java.util.HashMap;
import java.util.regex.Pattern;
-import junit.framework.TestCase;
+import org.junit.Assert;
+import org.junit.Test;
-public class IdlPreprocessorReaderTest extends TestCase {
+public class IdlPreprocessorReaderTest extends Assert {
private URL findTestResource(String spec) {
String location = "/idlpreprocessor/" + spec;
@@ -48,6 +49,7 @@ public class IdlPreprocessorReaderTest extends TestCase {
}
}
+ @Test
public void testResolvedInA() throws Exception {
final String location = "A.idl";
final IdlPreprocessorReader includeReader = createPreprocessorReader(location);
@@ -55,6 +57,7 @@ public class IdlPreprocessorReaderTest extends TestCase {
assertExpectedPreprocessingResult(expectedResultLocation, includeReader);
}
+ @Test
public void testMultiFileResolve() throws Exception {
final String location = "B.idl";
final IdlPreprocessorReader includeReader = createPreprocessorReader(location);
@@ -62,6 +65,7 @@ public class IdlPreprocessorReaderTest extends TestCase {
assertExpectedPreprocessingResult(expectedResultLocation, includeReader);
}
+ @Test
public void testIfElseHandling() throws Exception {
final String location = "C.idl";
final IdlPreprocessorReader includeReader = createPreprocessorReader(location);
@@ -69,6 +73,7 @@ public class IdlPreprocessorReaderTest extends TestCase {
assertExpectedPreprocessingResult(expectedResultLocation, includeReader);
}
+ @Test
public void testMaximumIncludeDepthIsDetected() throws IOException {
final String location = "MaximumIncludeDepthExceeded.idl";
try {
@@ -81,6 +86,7 @@ public class IdlPreprocessorReaderTest extends TestCase {
}
}
+ @Test
public void testUnresolvableInclude() throws IOException {
final String location = "UnresolvableInclude.idl";
try {
@@ -94,6 +100,7 @@ public class IdlPreprocessorReaderTest extends TestCase {
}
}
+ @Test
public void testDefaultIncludeResolver() throws Exception {
final String location = "B.idl";
// uses <> notation for include
diff --git a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
index 4365af2..5609f95 100644
--- a/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
+++ b/tools/javato/ws/src/test/java/org/apache/cxf/tools/java2ws/AegisTest.java
@@ -31,14 +31,13 @@ import javax.xml.xpath.XPathConstants;
import org.w3c.dom.Document;
-import junit.framework.AssertionFailedError;
-
import org.apache.cxf.helpers.FileUtils;
import org.apache.cxf.helpers.XPathUtils;
import org.apache.cxf.staxutils.StaxUtils;
import org.apache.cxf.tools.common.ToolTestBase;
import org.junit.After;
+import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -140,8 +139,8 @@ public class AegisTest extends ToolTestBase {
private void assertValid(String xpathExpression, Document doc) throws XMLStreamException {
XPathUtils xpu = new XPathUtils(getNSMap());
if (!xpu.isExist(xpathExpression, doc, XPathConstants.NODE)) {
- throw new AssertionFailedError("Failed to select any nodes for expression:\n" + xpathExpression
- + " from document:\n" + StaxUtils.toString(doc));
+ Assert.fail("Failed to select any nodes for expression:\n" + xpathExpression
+ + " from document:\n" + StaxUtils.toString(doc));
}
}
}
--
To stop receiving notification emails like this one, please contact
"commits@cxf.apache.org" <co...@cxf.apache.org>.