cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r724429 - in /cxf/trunk: common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java common/common/src/test/java/org/apache/cxf/helpers/FileUtilsTest.java rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
Date Mon, 08 Dec 2008 18:02:08 GMT
Author: dkulp
Date: Mon Dec  8 10:02:07 2008
New Revision: 724429

URL: http://svn.apache.org/viewvc?rev=724429&view=rev
Log:
Fix checkstyle/pmd errors

Modified:
    cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
    cxf/trunk/common/common/src/test/java/org/apache/cxf/helpers/FileUtilsTest.java
    cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java

Modified: cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java?rev=724429&r1=724428&r2=724429&view=diff
==============================================================================
--- cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java (original)
+++ cxf/trunk/common/common/src/main/java/org/apache/cxf/helpers/FileUtils.java Mon Dec  8
10:02:07 2008
@@ -57,10 +57,11 @@
             int x = (int)(Math.random() * 1000000);
             s = System.getProperty("java.io.tmpdir");
             File checkExists = new File(s);
-            if(!checkExists.exists()) {
+            if (!checkExists.exists()) {
                 throw new RuntimeException("The directory " 
                                        + checkExists.getAbsolutePath() 
-                                       + " does not exist, please set java.io.tempdir to
an existing directory");
+                                       + " does not exist, please set java.io.tempdir"
+                                       + "to an existing directory");
             }
             File f = new File(s, "cxf-tmp-" + x);
             while (!f.mkdir()) {

Modified: cxf/trunk/common/common/src/test/java/org/apache/cxf/helpers/FileUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/common/common/src/test/java/org/apache/cxf/helpers/FileUtilsTest.java?rev=724429&r1=724428&r2=724429&view=diff
==============================================================================
--- cxf/trunk/common/common/src/test/java/org/apache/cxf/helpers/FileUtilsTest.java (original)
+++ cxf/trunk/common/common/src/test/java/org/apache/cxf/helpers/FileUtilsTest.java Mon Dec
 8 10:02:07 2008
@@ -1,6 +1,23 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.cxf.helpers;
 
-import java.io.File;
 
 
 import org.junit.Assert;

Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java?rev=724429&r1=724428&r2=724429&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/spring/SpringBeansTest.java
Mon Dec  8 10:02:07 2008
@@ -67,32 +67,29 @@
         }
     }
 
+    private EndpointImpl getEndpointImplBean(String s, ClassPathXmlApplicationContext ctx)
{
+        Object bean = ctx.getBean(s);
+        assertNotNull(bean);
+        return (EndpointImpl) bean;
+    }
+    
     @Test
     public void testEndpoints() throws Exception {
         ClassPathXmlApplicationContext ctx =
             new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/endpoints.xml"});
 
-        Object bean = ctx.getBean("simple");
-        assertNotNull(bean);
-
-        EndpointImpl ep = (EndpointImpl) bean;
+        EndpointImpl ep = getEndpointImplBean("simple", ctx);
         assertNotNull(ep.getImplementor());
         assertNotNull(ep.getServer());
 
-        bean = ctx.getBean("simpleWithAddress");
-        assertNotNull(bean);
-
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("simpleWithAddress", ctx);
         if (!(ep.getImplementor() instanceof org.apache.hello_world_soap_http.GreeterImpl))
{
             fail("can't get the right implementor object");
         }
         assertEquals("http://localhost:8080/simpleWithAddress",
                      ep.getServer().getEndpoint().getEndpointInfo().getAddress());
 
-        bean = ctx.getBean("inlineImplementor");
-        assertNotNull(bean);
-
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("inlineImplementor", ctx);
         if (!(ep.getImplementor() instanceof org.apache.hello_world_soap_http.GreeterImpl))
{
             fail("can't get the right implementor object");
         }
@@ -102,22 +99,16 @@
         assertNotNull(ep.getServer());
 
 
-        bean = ctx.getBean("inlineInvoker");
-        assertNotNull(bean);
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("inlineInvoker", ctx);
         assertTrue(ep.getInvoker() instanceof NullInvoker);
         assertTrue(ep.getService().getInvoker() instanceof NullInvoker);
 
-        bean = ctx.getBean("simpleWithBindingUri");
-        assertNotNull(bean);
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("simpleWithBindingUri", ctx);
         assertEquals("get the wrong bindingId",
                      ep.getBindingUri(),
                      "http://cxf.apache.org/bindings/xformat");
 
-        bean = ctx.getBean("simpleWithBinding");
-        assertNotNull(bean);
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("simpleWithBinding", ctx);
         BindingConfiguration bc = ep.getBindingConfig();
         assertTrue(bc instanceof SoapBindingConfiguration);
         SoapBindingConfiguration sbc = (SoapBindingConfiguration) bc;
@@ -125,22 +116,14 @@
         assertTrue("the soap configure should set isMtomEnabled to be true",
                    sbc.isMtomEnabled());
 
-        bean = ctx.getBean("implementorClass");
-        assertNotNull(bean);
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("implementorClass", ctx);
         assertEquals(Hello.class, ep.getImplementorClass());
         assertTrue(ep.getImplementor().getClass() == Object.class);
 
-        bean = ctx.getBean("epWithProps");
-        assertNotNull(bean);
-
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("epWithProps", ctx);
         assertEquals("bar", ep.getProperties().get("foo"));
 
-        bean = ctx.getBean("classImpl");
-        assertNotNull(bean);
-
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("classImpl", ctx);
         assertTrue(ep.getImplementor() instanceof Hello);
 
         QName name = ep.getServer().getEndpoint().getService().getName();
@@ -151,22 +134,19 @@
         assertEquals("http://service.jaxws.cxf.apache.org/endpoint", name.getNamespaceURI());
         assertEquals("HelloEndpointCustomized", name.getLocalPart());
 
-        bean = ctx.getBean("wsdlLocation");
+        Object bean = ctx.getBean("wsdlLocation");
         assertNotNull(bean);
 
-        bean = ctx.getBean("publishedEndpointUrl");
-        assertNotNull(bean);
+        ep = getEndpointImplBean("publishedEndpointUrl", ctx);
         String expectedEndpointUrl = "http://cxf.apache.org/Greeter";
-        ep = (EndpointImpl) bean;
         assertEquals(expectedEndpointUrl, ep.getPublishedEndpointUrl());
         
-        bean = ctx.getBean("epWithDataBinding");
-        assertNotNull(bean);
-        ep = (EndpointImpl) bean;
+        ep = getEndpointImplBean("epWithDataBinding", ctx);
         DataBinding dataBinding = ep.getDataBinding();
         
         assertTrue(dataBinding instanceof JAXBDataBinding);
-        assertEquals("The namespace map should have an entry", ((JAXBDataBinding)dataBinding).getNamespaceMap().size(),1);
+        assertEquals("The namespace map should have an entry",
+                     ((JAXBDataBinding)dataBinding).getNamespaceMap().size(), 1);
         // test for existence of Endpoint without an id element
         boolean found = false;
         String[] names = ctx.getBeanNamesForType(EndpointImpl.class);



Mime
View raw message