You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2011/03/07 08:50:26 UTC

svn commit: r1078706 - in /maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site: AbstractSiteDeployWebDavTest.java AuthAsyncProxyServlet.java SimpleDavServerHandler.java SiteDeployWebDavTest.java SiteMojoTest.java

Author: hboutemy
Date: Mon Mar  7 07:50:26 2011
New Revision: 1078706

URL: http://svn.apache.org/viewvc?rev=1078706&view=rev
Log:
fixed minor code formatting issues

Modified:
    maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java
    maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java
    maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java
    maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java
    maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java

Modified: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java?rev=1078706&r1=1078705&r2=1078706&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AbstractSiteDeployWebDavTest.java Mon Mar  7 07:50:26 2011
@@ -1,5 +1,24 @@
 package org.apache.maven.plugins.site;
 
+/*
+ * 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.
+ */
+
 import java.io.File;
 import java.util.Arrays;
 import java.util.Collections;
@@ -28,8 +47,6 @@ import org.junit.runners.JUnit4;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
-
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
  * @version $Id$
@@ -39,7 +56,7 @@ public abstract class AbstractSiteDeploy
     extends AbstractMojoTestCase
 {
     
-    File siteTargetPath = new File(getBasedir() + File.separator + "target" +  File.separator + "siteTargetDeploy");
+    File siteTargetPath = new File( getBasedir() + File.separator + "target" + File.separator + "siteTargetDeploy" );
     
     private Logger log = LoggerFactory.getLogger( getClass() );
     
@@ -48,7 +65,7 @@ public abstract class AbstractSiteDeploy
         throws Exception
     {
         super.setUp();
-        if (!siteTargetPath.exists())
+        if ( !siteTargetPath.exists() )
         {
             siteTargetPath.mkdirs();
             FileUtils.cleanDirectory( siteTargetPath );
@@ -57,10 +74,12 @@ public abstract class AbstractSiteDeploy
     
     abstract String getMojoName();
     
-    abstract AbstractMojo getMojo( File pluginXmlFile ) throws Exception;
+    abstract AbstractMojo getMojo( File pluginXmlFile )
+        throws Exception;
     
     @Test
-    public void noAuthzDavDeploy() throws Exception
+    public void noAuthzDavDeploy()
+        throws Exception
     {
         FileUtils.cleanDirectory( siteTargetPath );
         SimpleDavServerHandler simpleDavServerHandler = new SimpleDavServerHandler( siteTargetPath );
@@ -69,7 +88,8 @@ public abstract class AbstractSiteDeploy
             File pluginXmlFile = getTestFile( "src/test/resources/unit/deploy-dav/pom.xml" );
             AbstractMojo mojo = getMojo( pluginXmlFile );
             assertNotNull( mojo );
-            SiteMavenProjectStub siteMavenProjectStub = new SiteMavenProjectStub("src/test/resources/unit/deploy-dav/pom.xml"); 
+            SiteMavenProjectStub siteMavenProjectStub =
+                new SiteMavenProjectStub( "src/test/resources/unit/deploy-dav/pom.xml" );
             
             siteMavenProjectStub.getDistributionManagement().getSite()
                 .setUrl( "dav:http://localhost:" + simpleDavServerHandler.getPort() + "/site/" );
@@ -77,7 +97,7 @@ public abstract class AbstractSiteDeploy
             setVariableValueToObject( mojo, "project", siteMavenProjectStub );
             Settings settings = new Settings();
             setVariableValueToObject( mojo, "settings", settings );
-            File inputDirectory = new File("src/test/resources/unit/deploy-dav/target/site");
+            File inputDirectory = new File( "src/test/resources/unit/deploy-dav/target/site" );
             
             setVariableValueToObject( mojo, "inputDirectory", inputDirectory );
             mojo.execute();
@@ -103,7 +123,8 @@ public abstract class AbstractSiteDeploy
             File pluginXmlFile = getTestFile( "src/test/resources/unit/deploy-dav/pom.xml" );
             AbstractMojo mojo = getMojo( pluginXmlFile );
             assertNotNull( mojo );
-            SiteMavenProjectStub siteMavenProjectStub = new SiteMavenProjectStub("src/test/resources/unit/deploy-dav/pom.xml");
+            SiteMavenProjectStub siteMavenProjectStub =
+                new SiteMavenProjectStub( "src/test/resources/unit/deploy-dav/pom.xml" );
             // olamy, Note : toto is something like foo or bar for french folks :-)
             String siteUrl = "dav:http://toto.com/site/";
             siteMavenProjectStub.getDistributionManagement().getSite().setUrl( siteUrl );
@@ -131,7 +152,7 @@ public abstract class AbstractSiteDeploy
             SettingsDecrypter settingsDecrypter = getContainer().lookup( SettingsDecrypter.class );
             setVariableValueToObject( mojo, "settingsDecrypter", settingsDecrypter );
             
-            File inputDirectory = new File("src/test/resources/unit/deploy-dav/target/site");
+            File inputDirectory = new File( "src/test/resources/unit/deploy-dav/target/site" );
             
             setVariableValueToObject( mojo, "inputDirectory", inputDirectory );
             mojo.execute();
@@ -140,7 +161,7 @@ public abstract class AbstractSiteDeploy
             
             assertTrue( requestsContainsProxyUse( simpleDavServerHandler.httpRequests ) );
             
-            for (HttpRequest rq : simpleDavServerHandler.httpRequests)
+            for ( HttpRequest rq : simpleDavServerHandler.httpRequests )
             {
                 log.info( rq.toString() );
             }
@@ -163,7 +184,7 @@ public abstract class AbstractSiteDeploy
         Map<String, String> authentications = new HashMap<String, String>();
         authentications.put( "foo", "titi" );
         
-        AuthAsyncProxyServlet servlet = new  AuthAsyncProxyServlet(authentications, siteTargetPath);
+        AuthAsyncProxyServlet servlet = new AuthAsyncProxyServlet( authentications, siteTargetPath );
 
         SimpleDavServerHandler simpleDavServerHandler = new SimpleDavServerHandler( servlet );        
         try
@@ -171,7 +192,8 @@ public abstract class AbstractSiteDeploy
             File pluginXmlFile = getTestFile( "src/test/resources/unit/deploy-dav/pom.xml" );
             AbstractMojo mojo = getMojo( pluginXmlFile );
             assertNotNull( mojo );
-            SiteMavenProjectStub siteMavenProjectStub = new SiteMavenProjectStub("src/test/resources/unit/deploy-dav/pom.xml"); 
+            SiteMavenProjectStub siteMavenProjectStub =
+                new SiteMavenProjectStub( "src/test/resources/unit/deploy-dav/pom.xml" );
             
             siteMavenProjectStub.getDistributionManagement().getSite()
                 .setUrl( "dav:http://toto.com/site/" );
@@ -201,10 +223,10 @@ public abstract class AbstractSiteDeploy
             SettingsDecrypter settingsDecrypter = getContainer().lookup( SettingsDecrypter.class );
             setVariableValueToObject( mojo, "settingsDecrypter", settingsDecrypter );
             
-            File inputDirectory = new File("src/test/resources/unit/deploy-dav/target/site");
+            File inputDirectory = new File( "src/test/resources/unit/deploy-dav/target/site" );
             
             // test which mojo we are using
-            if (ReflectionUtils.getFieldByNameIncludingSuperclasses( "inputDirectory", mojo.getClass() ) != null)
+            if ( ReflectionUtils.getFieldByNameIncludingSuperclasses( "inputDirectory", mojo.getClass() ) != null )
             {
                 setVariableValueToObject( mojo, "inputDirectory", inputDirectory );
             }
@@ -225,8 +247,8 @@ public abstract class AbstractSiteDeploy
             
             assertContentInFiles();
             assertTrue( requestsContainsProxyUse( servlet.httpRequests ) );
-            assertAtLeastOneRequestContainsHeader(servlet.httpRequests, "Proxy-Authorization");
-            for (HttpRequest rq : servlet.httpRequests)
+            assertAtLeastOneRequestContainsHeader( servlet.httpRequests, "Proxy-Authorization" );
+            for ( HttpRequest rq : servlet.httpRequests )
             {
                 log.info( rq.toString() );
             }

Modified: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java?rev=1078706&r1=1078705&r2=1078706&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/AuthAsyncProxyServlet.java Mon Mar  7 07:50:26 2011
@@ -1,5 +1,24 @@
 package org.apache.maven.plugins.site;
 
+/*
+ * 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.
+ */
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -21,32 +40,13 @@ import org.mortbay.proxy.AsyncProxyServl
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/*
- * 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.
- */
-
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
  * @since 
  * @version $Id$
  */
 public class AuthAsyncProxyServlet
-extends AsyncProxyServlet
+    extends AsyncProxyServlet
 {
     private Map<String, String> authentications;
 

Modified: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java?rev=1078706&r1=1078705&r2=1078706&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SimpleDavServerHandler.java Mon Mar  7 07:50:26 2011
@@ -1,5 +1,24 @@
 package org.apache.maven.plugins.site;
 
+/*
+ * 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.
+ */
+
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
@@ -26,25 +45,6 @@ import org.mortbay.jetty.servlet.Servlet
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-/*
- * 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.
- */
-
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
  * @since 3.0-beta-2

Modified: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java?rev=1078706&r1=1078705&r2=1078706&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteDeployWebDavTest.java Mon Mar  7 07:50:26 2011
@@ -1,9 +1,5 @@
 package org.apache.maven.plugins.site;
 
-import java.io.File;
-
-import org.apache.maven.plugin.AbstractMojo;
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -23,6 +19,10 @@ import org.apache.maven.plugin.AbstractM
  * under the License.
  */
 
+import java.io.File;
+
+import org.apache.maven.plugin.AbstractMojo;
+
 /**
  * @author <a href="mailto:olamy@apache.org">olamy</a>
  * @since 3.0-beta-2
@@ -39,7 +39,8 @@ public class SiteDeployWebDavTest
     }
 
     @Override
-    AbstractMojo getMojo( File pluginXmlFile ) throws Exception
+    AbstractMojo getMojo( File pluginXmlFile )
+        throws Exception
     {
         return (SiteDeployMojo) lookupMojo( getMojoName(), pluginXmlFile );
     }

Modified: maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java?rev=1078706&r1=1078705&r2=1078706&view=diff
==============================================================================
--- maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java (original)
+++ maven/plugins/branches/maven-site-plugin-3.x/src/test/java/org/apache/maven/plugins/site/SiteMojoTest.java Mon Mar  7 07:50:26 2011
@@ -18,6 +18,7 @@ package org.apache.maven.plugins.site;
  * specific language governing permissions and limitations
  * under the License.
  */
+
 import java.io.File;
 import java.util.HashMap;