Author: ffang
Date: Wed May 30 01:39:01 2007
New Revision: 542777
URL: http://svn.apache.org/viewvc?view=rev&rev=542777
Log:
update junit4 for JBI binding test
Modified:
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/JBIBindingFactoryTest.java
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptorTest.java
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java
Modified:
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/JBIBindingFactoryTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/JBIBindingFactoryTest.java?view=diff&rev=542777&r1=542776&r2=542777
==============================================================================
---
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/JBIBindingFactoryTest.java
(original)
+++
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/JBIBindingFactoryTest.java
Wed May 30 01:39:01 2007
@@ -18,7 +18,6 @@
*/
package org.apache.cxf.binding.jbi;
-import junit.framework.TestCase;
import org.apache.cxf.binding.Binding;
import org.apache.cxf.binding.jbi.interceptor.JBIFaultOutInterceptor;
@@ -27,10 +26,14 @@
import org.apache.cxf.binding.jbi.interceptor.JBIWrapperOutInterceptor;
import org.apache.cxf.interceptor.StaxOutInterceptor;
import org.apache.cxf.service.model.ServiceInfo;
+import org.junit.Assert;
+import org.junit.Test;
-public class JBIBindingFactoryTest extends TestCase {
+public class JBIBindingFactoryTest extends Assert {
+ @Test
public void testCreateBinding() {
+
JBIBindingInfo info = new JBIBindingInfo(new ServiceInfo(), "id");
Binding binding = new JBIBindingFactory().createBinding(info);
assertEquals(2, binding.getInInterceptors().size());
Modified:
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptorTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptorTest.java?view=diff&rev=542777&r1=542776&r2=542777
==============================================================================
---
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptorTest.java
(original)
+++
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIFaultOutInterceptorTest.java
Wed May 30 01:39:01 2007
@@ -27,8 +27,6 @@
import org.w3c.dom.Document;
-import junit.framework.TestCase;
-
import org.apache.cxf.binding.jbi.JBIMessage;
import org.apache.cxf.common.i18n.Message;
import org.apache.cxf.helpers.DOMUtils;
@@ -36,14 +34,18 @@
import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.phase.Phase;
import org.apache.cxf.phase.PhaseInterceptor;
+import org.junit.Assert;
+import org.junit.Test;
-public class JBIFaultOutInterceptorTest extends TestCase {
+public class JBIFaultOutInterceptorTest extends Assert {
+ @Test
public void testPhase() throws Exception {
PhaseInterceptor<JBIMessage> interceptor = new
JBIFaultOutInterceptor();
assertEquals(Phase.MARSHAL, interceptor.getPhase());
}
+ @Test
public void testNoWriter() throws Exception {
PhaseInterceptor<JBIMessage> interceptor = new
JBIFaultOutInterceptor();
try {
@@ -55,6 +57,7 @@
}
}
+ @Test
public void testNoFault() throws Exception {
PhaseInterceptor<JBIMessage> interceptor = new
JBIFaultOutInterceptor();
try {
@@ -68,6 +71,7 @@
}
}
+ @Test
public void testEmptyFault() throws Exception {
PhaseInterceptor<JBIMessage> interceptor = new
JBIFaultOutInterceptor();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -81,6 +85,7 @@
assertEquals("fault", doc.getDocumentElement().getNodeName());
}
+ @Test
public void testDetailedFault() throws Exception {
PhaseInterceptor<JBIMessage> interceptor = new
JBIFaultOutInterceptor();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
Modified:
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java
URL:
http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java?view=diff&rev=542777&r1=542776&r2=542777
==============================================================================
---
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java
(original)
+++
incubator/cxf/trunk/rt/bindings/jbi/src/test/java/org/apache/cxf/binding/jbi/interceptor/JBIOperationInInterceptorTest.java
Wed May 30 01:39:01 2007
@@ -18,20 +18,30 @@
*/
package org.apache.cxf.binding.jbi.interceptor;
-import junit.framework.TestCase;
+
+import javax.jbi.messaging.MessageExchange;
+import javax.xml.namespace.QName;
import org.apache.cxf.binding.jbi.JBIMessage;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.message.ExchangeImpl;
+import org.apache.cxf.message.MessageImpl;
import org.apache.cxf.phase.Phase;
import org.apache.cxf.phase.PhaseInterceptor;
+import org.easymock.classextension.EasyMock;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
-public class JBIOperationInInterceptorTest extends TestCase {
+public class JBIOperationInInterceptorTest extends Assert {
+ @Test
public void testPhase() throws Exception {
PhaseInterceptor<JBIMessage> interceptor = new
JBIOperationInInterceptor();
assertEquals(Phase.PRE_PROTOCOL, interceptor.getPhase());
}
- /*
+ @Ignore
public void testOperation() throws Exception {
PhaseInterceptor<JBIMessage> interceptor = new
JBIOperationInInterceptor();
JBIMessage msg = new JBIMessage(new MessageImpl());
@@ -45,6 +55,6 @@
interceptor.handleMessage(msg);
}
- */
+
}