Checkstyle clean-up 40/38240/1
authorStephen Kitt <skitt@redhat.com>
Fri, 29 Apr 2016 14:29:53 +0000 (16:29 +0200)
committerStephen Kitt <skitt@redhat.com>
Fri, 29 Apr 2016 14:29:53 +0000 (16:29 +0200)
Let's ensure odlparent adheres to its own Checkstyle rules...

Change-Id: I7bf3d3b1e2288a95dd3a298098760438282545a5
Signed-off-by: Stephen Kitt <skitt@redhat.com>
features-test/pom.xml
features-test/src/main/java/org/opendaylight/odlparent/featuretest/CustomBundleUrlStreamHandlerFactory.java [moved from features-test/src/main/java/org/opendaylight/odlparent/featuretest/CustomBundleURLStreamHandlerFactory.java with 96% similarity]
features-test/src/main/java/org/opendaylight/odlparent/featuretest/PerRepoTestRunner.java
features-test/src/main/java/org/opendaylight/odlparent/featuretest/SingleFeatureTest.java
karaf-plugin/src/main/java/org/opendaylight/odlparent/PopulateLocalRepoMojo.java

index cfeba4390e3d0b87cc1ae539f125a7dfab24e935..f6e75b83db376c7e09acbce506526a86e48ae504 100644 (file)
                             <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
                             <excludes>
                                 <!-- Skip Apache Licensed files -->
-                                org/opendaylight/odlparent/featuretest/CustomBundleURLStreamHandlerFactory.java
+                                org/opendaylight/odlparent/featuretest/CustomBundleUrlStreamHandlerFactory.java
                             </excludes>
                             <failsOnError>false</failsOnError>
                             <consoleOutput>true</consoleOutput>
similarity index 96%
rename from features-test/src/main/java/org/opendaylight/odlparent/featuretest/CustomBundleURLStreamHandlerFactory.java
rename to features-test/src/main/java/org/opendaylight/odlparent/featuretest/CustomBundleUrlStreamHandlerFactory.java
index e58246f41cd17ae0f322cf12c7bec00602b1382e..2cb221158304312348a3388a8e4d7535f33503a0 100644 (file)
@@ -2,7 +2,7 @@
  * The NOTICE file referred to in the license statement below is available
  * as Karaf-NOTICE at the root of this project.
  */
-/**
+/*
  * 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.
@@ -18,6 +18,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 package org.opendaylight.odlparent.featuretest;
 
 import java.net.URLStreamHandler;
@@ -27,7 +28,7 @@ import org.apache.karaf.deployer.blueprint.BlueprintURLHandler;
 import org.apache.karaf.deployer.features.FeatureURLHandler;
 import org.apache.karaf.deployer.spring.SpringURLHandler;
 
-public class CustomBundleURLStreamHandlerFactory implements URLStreamHandlerFactory {
+public class CustomBundleUrlStreamHandlerFactory implements URLStreamHandlerFactory {
 
     private static final String MVN_URI_PREFIX = "mvn";
     private static final String WRAP_URI_PREFIX = "wrap";
index ae08d5c7472c98c56eaa2a2ff1d21208fa1ec379..01f80cc8ed70870529eea592c569ceee0025f3df 100644 (file)
@@ -33,7 +33,7 @@ public class PerRepoTestRunner extends ParentRunner<PerFeatureRunner> {
 
     static {
         // Static initialization, as we may be invoked multiple times
-        URL.setURLStreamHandlerFactory(new CustomBundleURLStreamHandlerFactory());
+        URL.setURLStreamHandlerFactory(new CustomBundleUrlStreamHandlerFactory());
     }
 
     /**
index 5b917e916f3a393031fd78a2bfbe11eda64a268e..e135df9b6c2efa28b1e372a8e3b8056653653818 100644 (file)
@@ -19,16 +19,19 @@ import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.features;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.karafDistributionConfiguration;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.keepRuntimeFolder;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.logLevel;
+
 import java.io.File;
-import java.io.IOException;
 import java.io.InputStream;
+import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Properties;
+
 import javax.inject.Inject;
+
 import org.apache.karaf.features.Feature;
 import org.apache.karaf.features.FeaturesService;
 import org.apache.karaf.features.Repository;
@@ -46,7 +49,6 @@ import org.ops4j.pax.exam.options.extra.VMOption;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-
 @RunWith(PerRepoTestRunner.class)
 public class SingleFeatureTest {
     private static final String MAVEN_REPO_LOCAL = "maven.repo.local";
@@ -80,7 +82,7 @@ public class SingleFeatureTest {
     private static final String KARAF_DISTRO_GROUPID_PROP = "karaf.distro.groupId";
 
     /**
-     * Property file used to store the Karaf distribution version
+     * Property file used to store the Karaf distribution version.
      */
     private static final String PROPERTIES_FILENAME = "singlefeaturetest.properties";
 
@@ -113,18 +115,18 @@ public class SingleFeatureTest {
     @Configuration
     public Option[] config() throws IOException {
         return new Option[] {
-                // TODO: Find a way to inherit memory limits from Maven options.
-                new VMOption("-Xmx2g"),
-                new VMOption("-XX:MaxPermSize=512m"),
-                getKarafDistroOption(),
-                when(Boolean.getBoolean(KEEP_UNPACK_DIRECTORY_PROP)).useOptions(keepRuntimeFolder()),
-                configureConsole().ignoreLocalConsole(),
-                logLevel(LogLevel.WARN),
-                mvnLocalRepoOption(),
-                standardKarafFeatures(),
-                editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG, LOG4J_LOGGER_ORG_OPENDAYLIGHT_YANGTOOLS_FEATURETEST,
-                        LogLevel.INFO.name()),
-                editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j.rootLogger", "INFO, stdout, osgi:*"),
+            // TODO: Find a way to inherit memory limits from Maven options.
+            new VMOption("-Xmx2g"),
+            new VMOption("-XX:MaxPermSize=512m"),
+            getKarafDistroOption(),
+            when(Boolean.getBoolean(KEEP_UNPACK_DIRECTORY_PROP)).useOptions(keepRuntimeFolder()),
+            configureConsole().ignoreLocalConsole(),
+            logLevel(LogLevel.WARN),
+            mvnLocalRepoOption(),
+            standardKarafFeatures(),
+            editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG, LOG4J_LOGGER_ORG_OPENDAYLIGHT_YANGTOOLS_FEATURETEST,
+                    LogLevel.INFO.name()),
+            editConfigurationFilePut(ETC_ORG_OPS4J_PAX_LOGGING_CFG, "log4j.rootLogger", "INFO, stdout, osgi:*"),
              /*
               *
               * Disables external snapshot repositories.
@@ -148,34 +150,34 @@ public class SingleFeatureTest {
               *
               *
               */
-                disableExternalSnapshotRepositories(),
-                CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP).value(
-                        System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP)),
-                CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATURENAME_PROP).value(
-                        System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATURENAME_PROP)),
-                CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP).value(
-                        System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP)),
+            disableExternalSnapshotRepositories(),
+            CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP).value(
+                    System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_URI_PROP)),
+            CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATURENAME_PROP).value(
+                    System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATURENAME_PROP)),
+            CoreOptions.systemProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP).value(
+                    System.getProperty(ORG_OPENDAYLIGHT_FEATURETEST_FEATUREVERSION_PROP)),
         };
     }
 
     private Option standardKarafFeatures() {
-        String url = maven().groupId("org.apache.karaf.features").artifactId("standard").
-                classifier("features").type("xml").version(getKarafVersion()).getURL();
+        String url = maven().groupId("org.apache.karaf.features").artifactId("standard").classifier("features").type(
+                "xml").version(getKarafVersion()).getURL();
         try {
             Features features = JaxbUtil.unmarshal(new URL(url).openStream(), false);
             List<String> featureNames = new ArrayList<>();
-            for(Feature f: features.getFeature()) {
+            for (Feature f : features.getFeature()) {
                 featureNames.add(f.getName());
             }
 
             return features(url, featureNames.toArray(new String[featureNames.size()]));
-        } catch(Exception e) {
+        } catch (Exception e) {
             throw new RuntimeException("Could not obtain features from URL " + url, e);
         }
     }
 
     private String getKarafVersion() {
-        if(karafVersion == null) {
+        if (karafVersion == null) {
             // We use a properties file to retrieve ${karaf.version}, instead of .versionAsInProject()
             // This avoids forcing all users to depend on Karaf in their POMs
             Properties singleFeatureTestProps = new Properties();
@@ -196,12 +198,13 @@ public class SingleFeatureTest {
     }
 
     private String getKarafDistroVersion() {
-        if(karafDistroVersion == null) {
+        if (karafDistroVersion == null) {
             karafDistroVersion = System.getProperty(KARAF_DISTRO_VERSION_PROP);
-            if(karafDistroVersion == null) {
+            if (karafDistroVersion == null) {
                 karafDistroVersion = getKarafVersion();
             } else {
-                LOG.info("Retrieved karafDistroVersion {} from system property {}", karafVersion, KARAF_DISTRO_VERSION_PROP);
+                LOG.info("Retrieved karafDistroVersion {} from system property {}", karafVersion,
+                        KARAF_DISTRO_VERSION_PROP);
             }
         }
 
index 085f120b06482988b0c1e0b05188987a908400e6..3da479948989a654f7ebf5672b35d95d31de728e 100644 (file)
@@ -26,6 +26,7 @@ import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Properties;
 import java.util.Set;
+
 import org.apache.karaf.features.internal.model.Features;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
@@ -36,7 +37,7 @@ import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.artifact.Artifact;
 import org.eclipse.aether.repository.RemoteRepository;
 import org.eclipse.aether.resolution.ArtifactResolutionException;
-import org.opendaylight.odlparent.featuretest.CustomBundleURLStreamHandlerFactory;
+import org.opendaylight.odlparent.featuretest.CustomBundleUrlStreamHandlerFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -52,7 +53,7 @@ public class PopulateLocalRepoMojo
 
     static {
         // Static initialization, as we may be invoked multiple times
-        URL.setURLStreamHandlerFactory(new CustomBundleURLStreamHandlerFactory());
+        URL.setURLStreamHandlerFactory(new CustomBundleUrlStreamHandlerFactory());
     }
 
     /**