camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r643788 - in /activemq/camel/trunk: components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/ components/camel-mina/src/test/java/org/apache/camel/component/mina/ components/camel-spring/src/main/java/org/apache/camel/sprin...
Date Wed, 02 Apr 2008 08:28:11 GMT
Author: ningjiang
Date: Wed Apr  2 01:28:05 2008
New Revision: 643788

URL: http://svn.apache.org/viewvc?rev=643788&view=rev
Log:
Fixed some CS errors

Modified:
    activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java
    activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaProducerShutdownMockTest.java
    activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
    activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/XsltTest.java
    activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
    activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
    activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java

Modified: activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java?rev=643788&r1=643787&r2=643788&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java
(original)
+++ activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FromFtpToAsciiFileTest.java
Wed Apr  2 01:28:05 2008
@@ -1,10 +1,26 @@
+/**
+ * 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.camel.component.file.remote;
 
-import org.apache.camel.builder.RouteBuilder;
-import org.apache.camel.component.file.FileComponent;
 import org.apache.camel.Endpoint;
-import org.apache.camel.Producer;
 import org.apache.camel.Exchange;
+import org.apache.camel.Producer;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.file.FileComponent;
 
 /**
  * Unit test to verify that we can pool an ASCII file from the FTP Server and store it on
a local file path

Modified: activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaProducerShutdownMockTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaProducerShutdownMockTest.java?rev=643788&r1=643787&r2=643788&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaProducerShutdownMockTest.java
(original)
+++ activemq/camel/trunk/components/camel-mina/src/test/java/org/apache/camel/component/mina/MinaProducerShutdownMockTest.java
Wed Apr  2 01:28:05 2008
@@ -42,7 +42,7 @@
         mock.expectedBodiesReceived("Hello World");
 
 
-        // create our mock and record expected behaviour = that worker timeout should be
set to 0
+        // create our mock and record expected behavior = that worker timeout should be set
to 0
         SocketConnector mockConnector = createMock(SocketConnector.class);
         mockConnector.setWorkerTimeout(0);
         replay(mockConnector);

Modified: activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java?rev=643788&r1=643787&r2=643788&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/main/java/org/apache/camel/spring/Main.java
Wed Apr  2 01:28:05 2008
@@ -123,8 +123,7 @@
                 start();
                 waitUntilCompleted();
                 stop();
-            }
-            catch (Exception e) {
+            } catch (Exception e) {
                 LOG.error("Failed: " + e, e);
             }
         }
@@ -237,8 +236,7 @@
                 System.err.println("Expected fileName for ");
                 showOptions();
                 completed();
-            }
-            else {
+            } else {
                 String parameter = remainingArgs.removeFirst();
                 doProcess(arg, parameter, remainingArgs);
             }
@@ -356,12 +354,10 @@
                     LOG.info("Waiting for: " + duration + " " + unit);
                     latch.await(duration, unit);
                     completed.set(true);
-                }
-                else {
+                } else {
                     latch.await();
                 }
-            }
-            catch (InterruptedException e) {
+            } catch (InterruptedException e) {
                 LOG.debug("Caught: " + e);
             }
         }

Modified: activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/XsltTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/XsltTest.java?rev=643788&r1=643787&r2=643788&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/XsltTest.java
(original)
+++ activemq/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/XsltTest.java
Wed Apr  2 01:28:05 2008
@@ -16,18 +16,12 @@
  */
 package org.apache.camel.spring.processor;
 
-import java.net.URL;
-
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.EndpointInject;
 import org.apache.camel.CamelTemplate;
-import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.EndpointInject;
 import org.apache.camel.component.mock.MockEndpoint;
-
-import static org.apache.camel.builder.xml.XsltBuilder.xslt;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests;
-import org.springframework.beans.factory.annotation.Autowired;
 
 /**
  * @version $Revision$

Modified: activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java?rev=643788&r1=643787&r2=643788&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java
(original)
+++ activemq/camel/trunk/components/camel-uface/src/main/java/org/apache/camel/component/uface/UFaceEndpoint.java
Wed Apr  2 01:28:05 2008
@@ -1,5 +1,4 @@
 /**
- *
  * 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.
@@ -7,7 +6,7 @@
  * (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
+ *      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,
@@ -15,6 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.apache.camel.component.uface;
 
 import java.util.List;

Modified: activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java?rev=643788&r1=643787&r2=643788&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
(original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/DotMojo.java
Wed Apr  2 01:28:05 2008
@@ -44,8 +44,9 @@
 import org.codehaus.plexus.util.cli.Commandline;
 
 /**
- * Runs Camel embedded with META-INF/services/*.xml spring files to try create DOT files
for the
- * routing rules, then converts the DOT files into another format such as PNG
+ * Runs Camel embedded with META-INF/services/*.xml spring files to try create
+ * DOT files for the routing rules, then converts the DOT files into another
+ * format such as PNG
  *
  * @version $Revision$
  * @goal dot
@@ -60,27 +61,29 @@
      * Subdirectory for report.
      */
     protected static final String SUBDIRECTORY = "cameldoc";
-    private String indexHtmlContent;
     //
     // For running Camel embedded
-    //-------------------------------------------------------------------------
+    // -------------------------------------------------------------------------
     //
     /**
-     * The duration to run the application for which by default is in milliseconds.
+     * The duration to run the application for which by default is in
+     * milliseconds.
      *
      * @parameter expression="2s"
      * @readonly
      */
     protected String duration;
     /**
-     * Whether we should boot up camel with the META-INF/services/*.xml to generate the DOT
file
+     * Whether we should boot up camel with the META-INF/services/*.xml to
+     * generate the DOT file
      *
      * @parameter expression="true"
      * @readonly
      */
     protected boolean runCamel;
     /**
-     * Should we try run the DOT executable on the generated .DOT file to generate images
+     * Should we try run the DOT executable on the generated .DOT file to
+     * generate images
      *
      * @parameter expression="true"
      * @readonly
@@ -111,22 +114,24 @@
      */
     private File outputDirectory;
     /**
-     * In the case of multiple camel contexts, setting aggregate == true will aggregate all
-     * into a monolithic context, otherwise they will be processed independently.
+     * In the case of multiple camel contexts, setting aggregate == true will
+     * aggregate all into a monolithic context, otherwise they will be processed
+     * independently.
      *
      * @parameter
      */
     private String aggregate;
     /**
-     * GraphViz executable location; visualization (images) will be
-     * generated only if you install this program and set this property to the
-     * executable dot (dot.exe on Win).
+     * GraphViz executable location; visualization (images) will be generated
+     * only if you install this program and set this property to the executable
+     * dot (dot.exe on Win).
      *
      * @parameter expression="dot"
      */
     private String executable;
     /**
-     * Graphviz output types. Default is png. Possible values: png, jpg, gif, svg.
+     * Graphviz output types. Default is png. Possible values: png, jpg, gif,
+     * svg.
      *
      * @required
      */
@@ -144,6 +149,8 @@
      */
     private Renderer renderer;
 
+    private String indexHtmlContent;
+
     /**
      * @param locale report locale.
      * @return report description.
@@ -182,8 +189,7 @@
         this.execute(this.buildDirectory, Locale.getDefault());
         try {
             writeIndexHtmlFile(outputDirectory, "index.html", indexHtmlContent);
-        }
-        catch (IOException e) {
+        } catch (IOException e) {
             throw new MojoExecutionException("Failed: " + e, e);
         }
     }
@@ -198,12 +204,10 @@
             Sink kitchenSink = getSink();
             if (kitchenSink != null) {
                 kitchenSink.rawText(indexHtmlContent);
-            }
-            else {
+            } else {
                 writeIndexHtmlFile(outputDirectory, "index.html", indexHtmlContent);
             }
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             final MavenReportException ex = new MavenReportException(e.getMessage());
             ex.initCause(e.getCause());
             throw ex;
@@ -214,15 +218,14 @@
      * Executes DOT generator.
      *
      * @param outputDir report output directory.
-     * @param locale    report locale.
+     * @param locale report locale.
      * @throws MojoExecutionException if there were any execution errors.
      */
     protected void execute(final File outputDir, final Locale locale) throws MojoExecutionException
{
 
         try {
             runCamelEmbedded(outputDir);
-        }
-        catch (DependencyResolutionRequiredException e) {
+        } catch (DependencyResolutionRequiredException e) {
             throw new MojoExecutionException("Failed: " + e, e);
         }
         outputDir.mkdirs();
@@ -233,9 +236,8 @@
         if (graphvizOutputTypes == null) {
             if (graphvizOutputType == null) {
                 graphvizOutputTypes = DEFAULT_GRAPHVIZ_OUTPUT_TYPES;
-            }
-            else {
-                graphvizOutputTypes = new String[]{graphvizOutputType};
+            } else {
+                graphvizOutputTypes = new String[] {graphvizOutputType};
             }
         }
         try {
@@ -246,8 +248,8 @@
             }
 
             boolean multipleCamelContexts = contextNames.size() > 1;
-
-            for (int i = 0, size = files.size(); i < size; i++) {
+            int size = files.size();
+            for (int i = 0; i < size; i++) {
                 File file = files.get(i);
                 String contextName = null;
                 if (multipleCamelContexts) {
@@ -279,16 +281,15 @@
                 out.println("</ul>");
                 indexHtmlContent = buffer.toString();
             }
-        }
-        catch (CommandLineException e) {
+        } catch (CommandLineException e) {
             throw new MojoExecutionException("Failed: " + e, e);
-        }
-        catch (IOException e) {
+        } catch (IOException e) {
             throw new MojoExecutionException("Failed: " + e, e);
         }
     }
 
-    private void generate(int index, File file, String contextName) throws CommandLineException,
MojoExecutionException, IOException {
+    private void generate(int index, File file, String contextName) throws CommandLineException,
+        MojoExecutionException, IOException {
 
         StringWriter buffer = new StringWriter();
         PrintWriter out = new PrintWriter(buffer);
@@ -339,15 +340,14 @@
             mojo.setPluginContext(getPluginContext());
             try {
                 mojo.executeWithoutWrapping();
-            }
-            catch (Exception e) {
+            } catch (Exception e) {
                 getLog().error("Failed to run Camel embedded: " + e, e);
             }
         }
     }
 
     protected void writeIndexHtmlFile(File dir, String fileName, String content) throws IOException
{
-        //File dir = outputDirectory;
+        // File dir = outputDirectory;
         dir.mkdirs();
         File html = new File(dir, fileName);
         PrintWriter out = null;
@@ -360,14 +360,12 @@
             out.println();
             if (content == null) {
                 out.write("<p>No EIP diagrams available</p>");
-            }
-            else {
+            } else {
                 out.write(content);
             }
             out.println("</body>");
             out.println("</html>");
-        }
-        finally {
+        } finally {
             String description = "Failed to close html output file";
             close(out, description);
         }
@@ -376,8 +374,7 @@
     protected void printHtmlHeader(PrintWriter out, String contextName) {
         if (contextName != null) {
             out.println("<h1>EIP Patterns for CamelContext: " + contextName + "</h1>");
-        }
-        else {
+        } else {
             out.println("<h1>Camel EIP Patterns</h1>");
         }
         out.println();
@@ -402,8 +399,7 @@
         if (closeable != null) {
             try {
                 closeable.close();
-            }
-            catch (IOException e) {
+            } catch (IOException e) {
                 getLog().warn(description + ": " + e);
             }
         }
@@ -450,8 +446,7 @@
         int idx = name.lastIndexOf(".");
         if (idx > 0) {
             return name.substring(0, idx);
-        }
-        else {
+        } else {
             return name;
         }
     }
@@ -459,8 +454,7 @@
     private void appendFiles(List<File> output, File file) {
         if (file.isDirectory()) {
             appendDirectory(output, file);
-        }
-        else {
+        } else {
             if (isValid(file)) {
                 output.add(file);
             }
@@ -487,16 +481,13 @@
                 String line = reader.readLine();
                 if (line == null) {
                     break;
-                }
-                else {
+                } else {
                     out.println(line);
                 }
             }
-        }
-        catch (IOException e) {
+        } catch (IOException e) {
             throw new MojoExecutionException("Failed: " + e, e);
-        }
-        finally {
+        } finally {
             close(reader, "cmapx file");
         }
     }

Modified: activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java?rev=643788&r1=643787&r2=643788&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
(original)
+++ activemq/camel/trunk/tooling/maven/camel-maven-plugin/src/main/java/org/apache/camel/maven/EmbeddedMojo.java
Wed Apr  2 01:28:05 2008
@@ -83,21 +83,19 @@
     public void execute() throws MojoExecutionException {
         try {
             executeWithoutWrapping();
-        }
-        catch (Exception e) {
+        } catch (Exception e) {
             throw new MojoExecutionException("Failed: " + e, e);
         }
     }
 
     public void executeWithoutWrapping() throws MalformedURLException, ClassNotFoundException,
-            NoSuchMethodException, IllegalAccessException, MojoExecutionException {
+        NoSuchMethodException, IllegalAccessException, MojoExecutionException {
         ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
         try {
             ClassLoader newLoader = createClassLoader(null);
             Thread.currentThread().setContextClassLoader(newLoader);
             runCamel(newLoader);
-        }
-        finally {
+        } finally {
             Thread.currentThread().setContextClassLoader(oldClassLoader);
         }
     }
@@ -159,7 +157,8 @@
     //-------------------------------------------------------------------------
 
     protected void runCamel(ClassLoader newLoader) throws ClassNotFoundException, NoSuchMethodException,
-            IllegalAccessException, MojoExecutionException {
+        IllegalAccessException, MojoExecutionException {
+
         getLog().debug("Running Camel in: " + newLoader);
         Class<?> type = newLoader.loadClass("org.apache.camel.spring.Main");
         Method method = type.getMethod("main", String[].class);
@@ -167,9 +166,8 @@
         getLog().debug("Starting the Camel Main with arguments: " + Arrays.asList(arguments));
 
         try {
-            method.invoke(null, new Object[]{arguments});
-        }
-        catch (InvocationTargetException e) {
+            method.invoke(null, new Object[] {arguments});
+        } catch (InvocationTargetException e) {
             Throwable t = e.getTargetException();
             throw new MojoExecutionException("Failed: " + t, t);
         }

Modified: activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java?rev=643788&r1=643787&r2=643788&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
(original)
+++ activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
Wed Apr  2 01:28:05 2008
@@ -39,21 +39,23 @@
 import org.w3c.dom.NodeList;
 import org.w3c.tidy.Tidy;
 
+
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectHelper;
-
 import org.codehaus.plexus.util.cli.CommandLineException;
 import org.codehaus.plexus.util.cli.CommandLineUtils;
 import org.codehaus.plexus.util.cli.Commandline;
-import org.codehaus.plexus.util.cli.StreamConsumer;
 import org.codehaus.plexus.util.cli.Commandline.Argument;
+import org.codehaus.plexus.util.cli.StreamConsumer;
+
+
 
 /**
  * Goal which extracts the content div from the html page and converts to PDF
  * using Prince
- * 
+ *
  * @goal compile
  * @phase compile
  */
@@ -61,7 +63,7 @@
 
     /**
      * The URL to the confluence page to convert.
-     * 
+     *
      * @parameter expression="${page}"
      *            default-value="http://cwiki.apache.org/confluence/display/CAMEL/Index"
      * @required
@@ -70,7 +72,7 @@
 
     /**
      * The output file name for the pdf.
-     * 
+     *
      * @parameter expression="${pdf}"
      *            default-value="${project.build.directory}/site/manual/${project.artifactId}-${project.version}.pdf"
      */
@@ -78,14 +80,14 @@
 
     /**
      * The css style sheets that should be linked.
-     * 
+     *
      * @parameter
      */
     private String[] styleSheets;
 
     /**
      * Content that should be added in the head element of the html file.
-     * 
+     *
      * @parameter
      */
     private String head;
@@ -94,14 +96,14 @@
      * The first div with who's class matches the contentDivClass will be
      * assumed to be the content section of the HTML and is what will be used as
      * the content in the PDF.
-     * 
+     *
      * @parameter default-value="wiki-content"
      */
     private String contentDivClass = "wiki-content";
 
     /**
      * Arguments that should be passed to the prince html to pdf processor.
-     * 
+     *
      * @parameter
      */
     private String[] princeArgs;
@@ -110,7 +112,7 @@
      * If there is an error converting the HTML to PDF should the build fail?
      * default to false since this requires the prince tool to be installed and
      * on the PATH of the system.
-     * 
+     *
      * @parameter default-value="false"
      */
     private boolean errorOnConverionFailure;
@@ -118,14 +120,14 @@
     /**
      * If there is an error downloading the HTML should the build fail? default
      * to false since this usually requires the user to be online.
-     * 
+     *
      * @parameter default-value="false"
      */
     private boolean errorOnDownloadFailure;
 
     /**
      * The maven project.
-     * 
+     *
      * @parameter expression="${project}"
      * @required
      * @readonly
@@ -139,14 +141,14 @@
 
     /**
      * The type used when attaching the artifact to the deployment.
-     * 
+     *
      * @parameter default-value="pdf"
      */
     private String type;
 
     /**
      * Classifier to add to the artifact generated.
-     * 
+     *
      * @parameter
      */
     private String classifier;



Mime
View raw message