Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 78582 invoked from network); 18 Dec 2009 19:53:19 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Dec 2009 19:53:19 -0000 Received: (qmail 92927 invoked by uid 500); 18 Dec 2009 19:53:19 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 92853 invoked by uid 500); 18 Dec 2009 19:53:19 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 92839 invoked by uid 99); 18 Dec 2009 19:53:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Dec 2009 19:53:19 +0000 X-ASF-Spam-Status: No, hits=-1998.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Dec 2009 19:53:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id F0F2E2388A1A; Fri, 18 Dec 2009 19:52:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r892360 - in /cxf/trunk: integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ parent/ rt/core/src/main/java/org/apache/cxf/bus/spring/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/ rt/transports/jms/src/ma... Date: Fri, 18 Dec 2009 19:52:53 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20091218195253.F0F2E2388A1A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Fri Dec 18 19:52:52 2009 New Revision: 892360 URL: http://svn.apache.org/viewvc?rev=892360&view=rev Log: Don't use deprecated Spring base test class. Use the better JUnit4 version Modified: cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/AbstractInvocationHandlerTest.java cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/HandlerTestBase.java cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvocationHandlerFactoryTest.java cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvokingInvocationHandlerTest.java cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ObjectMethodInvocationHandlerTest.java cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java cxf/trunk/parent/pom.xml cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java Modified: cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/AbstractInvocationHandlerTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/AbstractInvocationHandlerTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/AbstractInvocationHandlerTest.java (original) +++ cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/AbstractInvocationHandlerTest.java Fri Dec 18 19:52:52 2009 @@ -29,9 +29,6 @@ public AbstractInvocationHandlerTest() { } - public AbstractInvocationHandlerTest(String name) { - super(name); - } // seach for the setNext method @Test Modified: cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/HandlerTestBase.java URL: http://svn.apache.org/viewvc/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/HandlerTestBase.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/HandlerTestBase.java (original) +++ cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/HandlerTestBase.java Fri Dec 18 19:52:52 2009 @@ -47,10 +47,7 @@ public HandlerTestBase() { } - - public HandlerTestBase(String aName) { - - } + @Before public void setUp() { Modified: cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvocationHandlerFactoryTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvocationHandlerFactoryTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvocationHandlerFactoryTest.java (original) +++ cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvocationHandlerFactoryTest.java Fri Dec 18 19:52:52 2009 @@ -41,9 +41,6 @@ super(); } - public InvocationHandlerFactoryTest(String name) { - super(name); - } @Before public void setUp() { Modified: cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvokingInvocationHandlerTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvokingInvocationHandlerTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvokingInvocationHandlerTest.java (original) +++ cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/InvokingInvocationHandlerTest.java Fri Dec 18 19:52:52 2009 @@ -35,10 +35,6 @@ CXFInvocationHandler handler; CXFInvocationHandlerData data; - public InvokingInvocationHandlerTest(String name) { - super(name); - } - public InvokingInvocationHandlerTest() { super(); } Modified: cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ObjectMethodInvocationHandlerTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ObjectMethodInvocationHandlerTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ObjectMethodInvocationHandlerTest.java (original) +++ cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ObjectMethodInvocationHandlerTest.java Fri Dec 18 19:52:52 2009 @@ -39,9 +39,6 @@ public ObjectMethodInvocationHandlerTest() { super(); } - public ObjectMethodInvocationHandlerTest(String name) { - super(name); - } @Before public void setUp() { Modified: cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java (original) +++ cxf/trunk/integration/jca/src/test/java/org/apache/cxf/jca/cxf/handlers/ProxyInvocationHandlerTest.java Fri Dec 18 19:52:52 2009 @@ -35,10 +35,7 @@ public ProxyInvocationHandlerTest() { super(); } - - public ProxyInvocationHandlerTest(String name) { - super(name); - } + @Before public void setUp() { Modified: cxf/trunk/parent/pom.xml URL: http://svn.apache.org/viewvc/cxf/trunk/parent/pom.xml?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/parent/pom.xml (original) +++ cxf/trunk/parent/pom.xml Fri Dec 18 19:52:52 2009 @@ -392,7 +392,7 @@ junit junit - 4.4 + 4.7 test Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java (original) +++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/SpringBeanLocator.java Fri Dec 18 19:52:52 2009 @@ -27,6 +27,7 @@ import java.util.List; import org.apache.cxf.configuration.ConfiguredBeanLocator; +import org.apache.cxf.helpers.CastUtils; import org.springframework.beans.Mergeable; import org.springframework.beans.PropertyValue; import org.springframework.beans.factory.config.BeanDefinition; @@ -54,12 +55,10 @@ } /** {@inheritDoc}*/ - @SuppressWarnings("unchecked") public Collection getBeansOfType(Class type) { - return context.getBeansOfType(type, false, true).values(); + return CastUtils.cast(context.getBeansOfType(type, false, true).values()); } - @SuppressWarnings("unchecked") public boolean loadBeansOfType(Class type, BeanLoaderListener listener) { List list = new ArrayList(Arrays.asList(context.getBeanNamesForType(type, Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java (original) +++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/ext/logging/atom/AtomPushEngineConfigurator.java Fri Dec 18 19:52:52 2009 @@ -158,7 +158,6 @@ } } - @SuppressWarnings("unchecked") private Converter createConverter(String clazz) { try { Constructor ctor = loadClass(clazz, Converter.class).getConstructor(); Modified: cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java (original) +++ cxf/trunk/rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/JMSDestination.java Fri Dec 18 19:52:52 2009 @@ -124,12 +124,13 @@ } private Destination resolveDestinationName(final JmsTemplate jmsTemplate, final String name) { - return (Destination)jmsTemplate.execute(new SessionCallback() { + SessionCallback sc = new SessionCallback() { public Object doInJms(Session session) throws JMSException { DestinationResolver resolv = jmsTemplate.getDestinationResolver(); return resolv.resolveDestinationName(session, name, jmsConfig.isPubSubDomain()); } - }); + }; + return (Destination)jmsTemplate.execute(sc); } public Destination getReplyToDestination(JmsTemplate jmsTemplate, Message inMessage) throws JMSException { Modified: cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java (original) +++ cxf/trunk/rt/transports/jms/src/test/java/org/apache/cxf/transport/jms/JMSConduitTest.java Fri Dec 18 19:52:52 2009 @@ -163,11 +163,12 @@ JMSConfiguration jmsConfig = conduit.getJmsConfig(); JmsTemplate jmsTemplate = new JmsTemplate(); jmsTemplate.setConnectionFactory(jmsConfig.getOrCreateWrappedConnectionFactory()); - javax.jms.Message message = (javax.jms.Message)jmsTemplate.execute(new SessionCallback() { + SessionCallback sc = new SessionCallback() { public Object doInJms(Session session) throws JMSException { return JMSUtils.createAndSetPayload(testBytes, session, JMSConstants.BYTE_MESSAGE_TYPE); } - }); + }; + javax.jms.Message message = (javax.jms.Message)jmsTemplate.execute(sc); // The ibm jdk finalizes conduit (during most runs of this test) and // causes it to fail unless we reference the conduit here after the Modified: cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java (original) +++ cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java Fri Dec 18 19:52:52 2009 @@ -28,24 +28,23 @@ import org.apache.cxf.systest.aegis.bean.Item; import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor; +import org.junit.Assert; import org.junit.Test; -import org.springframework.test.AbstractDependencyInjectionSpringContextTests; + +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; /** * */ -public class AegisJaxWsTest extends AbstractDependencyInjectionSpringContextTests { +@ContextConfiguration(locations = { "classpath:aegisJaxWsBeans.xml" }) +public class AegisJaxWsTest extends AbstractJUnit4SpringContextTests { private AegisJaxWs client; public AegisJaxWsTest() { } - @Override - protected String[] getConfigLocations() { - return new String[] {"classpath:aegisJaxWsBeans.xml"}; - } - private void setupForTest(boolean sec) throws Exception { JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); @@ -72,16 +71,16 @@ public void testGetItemSecure() throws Exception { setupForTest(true); Item item = client.getItemByKey(" jack&jill ", "b"); - assertEquals(33, item.getKey().intValue()); - assertEquals(" jack&jill :b", item.getData()); + Assert.assertEquals(33, item.getKey().intValue()); + Assert.assertEquals(" jack&jill :b", item.getData()); } @Test public void testGetItem() throws Exception { setupForTest(false); Item item = client.getItemByKey(" a ", "b"); - assertEquals(33, item.getKey().intValue()); - assertEquals(" a :b", item.getData()); + Assert.assertEquals(33, item.getKey().intValue()); + Assert.assertEquals(" a :b", item.getData()); } @Test public void testMapSpecified() throws Exception { @@ -92,14 +91,14 @@ client.addItem(item); Map items = client.getItemsMapSpecified(); - assertNotNull(items); - assertEquals(1, items.size()); + Assert.assertNotNull(items); + Assert.assertEquals(1, items.size()); Map.Entry entry = items.entrySet().iterator().next(); - assertNotNull(entry); + Assert.assertNotNull(entry); Item item2 = entry.getValue(); Integer key2 = entry.getKey(); - assertEquals(42, key2.intValue()); - assertEquals("Godzilla", item2.getData()); + Assert.assertEquals(42, key2.intValue()); + Assert.assertEquals("Godzilla", item2.getData()); } } Modified: cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java (original) +++ cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/CharacterSchemaTest.java Fri Dec 18 19:52:52 2009 @@ -30,13 +30,19 @@ import org.apache.cxf.aegis.type.basic.CharacterAsStringType; import org.apache.cxf.endpoint.Server; import org.apache.cxf.test.TestUtilities; + +import org.junit.Assert; import org.junit.Test; -import org.springframework.test.AbstractDependencyInjectionSpringContextTests; + +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; + /** * */ -public class CharacterSchemaTest extends AbstractDependencyInjectionSpringContextTests { +@ContextConfiguration(locations = { "classpath:aegisSportsServiceBeans.xml" }) +public class CharacterSchemaTest extends AbstractJUnit4SpringContextTests { private TestUtilities testUtilities; @@ -44,11 +50,6 @@ testUtilities = new TestUtilities(getClass()); } - @Override - protected String[] getConfigLocations() { - return new String[] {"classpath:aegisSportsServiceBeans.xml"}; - } - @Test public void testSchema() throws Exception { testUtilities.setBus((Bus)applicationContext.getBean("cxf")); @@ -57,9 +58,9 @@ Server s = testUtilities. getServerForService(new QName("http://aegis.systest.cxf.apache.org/", "SportsService")); - assertNotNull(s); + Assert.assertNotNull(s); Document wsdl = testUtilities.getWSDLDocument(s); - assertNotNull(wsdl); + Assert.assertNotNull(wsdl); NodeList typeAttrList = testUtilities.assertValid("//xsd:complexType[@name='BeanWithCharacter']/xsd:sequence" + "/xsd:element[@name='character']" @@ -69,11 +70,11 @@ String typeAttrValue = typeAttr.getValue(); // now, this thing is a qname with a :, and we have to work out if it's correct. String[] pieces = typeAttrValue.split(":"); - assertEquals(CharacterAsStringType.CHARACTER_AS_STRING_TYPE_QNAME.getLocalPart(), + Assert.assertEquals(CharacterAsStringType.CHARACTER_AS_STRING_TYPE_QNAME.getLocalPart(), pieces[1]); Node elementNode = typeAttr.getOwnerElement(); String url = testUtilities.resolveNamespacePrefix(pieces[0], elementNode); - assertEquals(CharacterAsStringType.CHARACTER_AS_STRING_TYPE_QNAME.getNamespaceURI(), + Assert.assertEquals(CharacterAsStringType.CHARACTER_AS_STRING_TYPE_QNAME.getNamespaceURI(), url); } } Modified: cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java (original) +++ cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/mtom/MtomTest.java Fri Dec 18 19:52:52 2009 @@ -39,13 +39,18 @@ import org.apache.cxf.systest.aegis.mtom.fortest.DataHandlerBean; import org.apache.cxf.systest.aegis.mtom.fortest.MtomTestImpl; import org.apache.cxf.test.TestUtilities; + +import org.junit.Assert; import org.junit.Test; -import org.springframework.test.AbstractDependencyInjectionSpringContextTests; + +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; /** * */ -public class MtomTest extends AbstractDependencyInjectionSpringContextTests { +@ContextConfiguration(locations = { "classpath:mtomTestBeans.xml" }) +public class MtomTest extends AbstractJUnit4SpringContextTests { private org.apache.cxf.systest.aegis.mtom.fortest.MtomTestImpl impl; private org.apache.cxf.systest.aegis.mtom.fortest.MtomTest client; @@ -55,11 +60,6 @@ testUtilities = new TestUtilities(getClass()); } - @Override - protected String[] getConfigLocations() { - return new String[] {"classpath:mtomTestBeans.xml"}; - } - private void setupForTest(boolean enableClientMTOM) throws Exception { AegisDatabinding aegisBinding = new AegisDatabinding(); aegisBinding.setMtomEnabled(enableClientMTOM); @@ -82,8 +82,8 @@ public void testMtomReply() throws Exception { setupForTest(true); DataHandlerBean dhBean = client.produceDataHandlerBean(); - assertNotNull(dhBean); - assertEquals(MtomTestImpl.STRING_DATA, dhBean.getDataHandler().getContent()); + Assert.assertNotNull(dhBean); + Assert.assertEquals(MtomTestImpl.STRING_DATA, dhBean.getDataHandler().getContent()); } @Test @@ -97,10 +97,10 @@ dhBean.setDataHandler(dataHandler); client.acceptDataHandler(dhBean); DataHandlerBean accepted = impl.getLastDhBean(); - assertNotNull(accepted); + Assert.assertNotNull(accepted); String data = (String) accepted.getDataHandler().getContent(); - assertNotNull(data); - assertEquals("This is the cereal shot from guns.", data); + Assert.assertNotNull(data); + Assert.assertEquals("This is the cereal shot from guns.", data); } @Test @@ -114,10 +114,10 @@ dhBean.setDataHandler(dataHandler); client.acceptDataHandler(dhBean); DataHandlerBean accepted = impl.getLastDhBean(); - assertNotNull(accepted); + Assert.assertNotNull(accepted); Object data = accepted.getDataHandler().getContent(); - assertNotNull(data); - assertEquals("This is the cereal shot from guns.", data); + Assert.assertNotNull(data); + Assert.assertEquals("This is the cereal shot from guns.", data); } @Test @@ -129,7 +129,7 @@ getServerForService(new QName("http://fortest.mtom.aegis.systest.cxf.apache.org/", "MtomTest")); Document wsdl = testUtilities.getWSDLDocument(s); - assertNotNull(wsdl); + Assert.assertNotNull(wsdl); NodeList typeAttrList = testUtilities.assertValid("//xsd:complexType[@name='inputDhBean']/xsd:sequence/" + "xsd:element[@name='dataHandler']/" @@ -139,14 +139,14 @@ String typeAttrValue = typeAttr.getValue(); // now, this thing is a qname with a :, and we have to work out if it's correct. String[] pieces = typeAttrValue.split(":"); - assertEquals("base64Binary", pieces[1]); + Assert.assertEquals("base64Binary", pieces[1]); Node elementNode = typeAttr.getOwnerElement(); String url = testUtilities.resolveNamespacePrefix(pieces[0], elementNode); - assertEquals(SOAPConstants.XSD, url); + Assert.assertEquals(SOAPConstants.XSD, url); s = testUtilities.getServerForAddress("http://localhost:9002/mtomXmime"); wsdl = testUtilities.getWSDLDocument(s); - assertNotNull(wsdl); + Assert.assertNotNull(wsdl); typeAttrList = testUtilities.assertValid("//xsd:complexType[@name='inputDhBean']/xsd:sequence/" + "xsd:element[@name='dataHandler']/" @@ -156,10 +156,10 @@ typeAttrValue = typeAttr.getValue(); // now, this thing is a qname with a :, and we have to work out if it's correct. pieces = typeAttrValue.split(":"); - assertEquals("base64Binary", pieces[1]); + Assert.assertEquals("base64Binary", pieces[1]); elementNode = typeAttr.getOwnerElement(); url = testUtilities.resolveNamespacePrefix(pieces[0], elementNode); - assertEquals(AbstractXOPType.XML_MIME_NS, url); + Assert.assertEquals(AbstractXOPType.XML_MIME_NS, url); /* when I add a test for a custom mapping. testUtilities.assertValid("//xsd:complexType[@name='inputDhBean']/xsd:sequence/" Modified: cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java (original) +++ cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/jaxb/TestServiceTest.java Fri Dec 18 19:52:52 2009 @@ -33,39 +33,42 @@ import org.apache.cxf.systest.jaxb.model.Widget; import org.apache.cxf.systest.jaxb.service.TestService; import org.apache.cxf.test.TestUtilities; + +import org.junit.Assert; import org.junit.Test; -import org.springframework.test.AbstractDependencyInjectionSpringContextTests; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -public class TestServiceTest extends AbstractDependencyInjectionSpringContextTests { +@ContextConfiguration(locations = { "classpath:extrajaxbclass.xml" }) +public class TestServiceTest extends AbstractJUnit4SpringContextTests { - private TestService testClient; private TestUtilities testUtilities; public TestServiceTest() { - setAutowireMode(AbstractDependencyInjectionSpringContextTests.AUTOWIRE_BY_NAME); testUtilities = new TestUtilities(getClass()); } @Test public void testExtraSubClassWithJaxb() throws Throwable { Widget expected = new ExtendedWidget(42, "blah", "blah", true, true); - + TestService testClient = getTestClient(); Widget widgetFromService = testClient.getWidgetById((long)42); - assertEquals(expected, widgetFromService); + Assert.assertEquals(expected, widgetFromService); } @Test public void testExtraSubClassWithJaxbFromEndpoint() throws Throwable { Widget expected = new ExtendedWidget(42, "blah", "blah", true, true); - + + TestService testClient = getTestClient(); ((BindingProvider)testClient).getRequestContext() .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "http://localhost:7081/service/TestEndpoint"); Widget widgetFromService = testClient.getWidgetById((long)42); - assertEquals(expected, widgetFromService); + Assert.assertEquals(expected, widgetFromService); } @@ -73,7 +76,7 @@ public void testSchema() throws Exception { URL url = new URL("http://localhost:7081/service/TestService?wsdl"); String s = IOUtils.toString(url.openStream()); - assertTrue(s, s.contains("application/octet-stream")); + Assert.assertTrue(s, s.contains("application/octet-stream")); } @Test @@ -92,27 +95,11 @@ + "/xsd:sequence/xsd:element[@name='publicString']", wsdl); } - /* - * (non-Javadoc) - * - * @see org.springframework.test.AbstractSingleSpringContextTests#getConfigLocations() - */ - @Override - protected String[] getConfigLocations() { - return new String[] {"classpath:extrajaxbclass.xml"}; - } /** * @return the testClient */ public TestService getTestClient() { - return testClient; - } - - /** - * @param testClient the testClient to set - */ - public void setTestClient(TestService testClient) { - this.testClient = testClient; + return (TestService)applicationContext.getBean("testClient", TestService.class); } } Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java?rev=892360&r1=892359&r2=892360&view=diff ============================================================================== --- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java (original) +++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/wsdl/CrossSchemaImportsTests.java Fri Dec 18 19:52:52 2009 @@ -25,22 +25,24 @@ import org.apache.cxf.Bus; import org.apache.cxf.endpoint.Server; import org.apache.cxf.test.TestUtilities; + +import org.junit.Assert; import org.junit.Test; -import org.springframework.test.AbstractDependencyInjectionSpringContextTests; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; -public class CrossSchemaImportsTests extends AbstractDependencyInjectionSpringContextTests { +@ContextConfiguration(locations = { "classpath:crossSchemaBeans.xml" }) +public class CrossSchemaImportsTests extends AbstractJUnit4SpringContextTests { private TestUtilities testUtilities; public CrossSchemaImportsTests() { - setAutowireMode(AbstractDependencyInjectionSpringContextTests.AUTOWIRE_BY_NAME); testUtilities = new TestUtilities(getClass()); } @Test public void testJaxbCrossSchemaImport() throws Exception { - System.out.println("TEst"); testUtilities.setBus((Bus)applicationContext.getBean("cxf")); testUtilities.addDefaultNamespaces(); Server s = testUtilities.getServerForService(new QName("http://apache.org/type_test/doc", @@ -50,16 +52,7 @@ assertValid("//xsd:schema[@targetNamespace='http://apache.org/type_test/doc']/" + "xsd:import[@namespace='http://apache.org/type_test/types1']", wsdl); - assertEquals(1, LifeCycleListenerTester.getInitCount()); + Assert.assertEquals(1, LifeCycleListenerTester.getInitCount()); } - /* - * (non-Javadoc) - * - * @see org.springframework.test.AbstractSingleSpringContextTests#getConfigLocations() - */ - @Override - protected String[] getConfigLocations() { - return new String[] {"classpath:crossSchemaBeans.xml"}; - } }