Fixed the path for finding the src files.
Added eclipse lifecycle to ignore the oparent checkstyle
bug.
Cleaned up existing checkstyle issues.
Added entries into .gitignore to ignore debug logging
directories created.
Issue-ID: POLICY-1136
Change-Id: I684038babcb9723cfc4bef2b2a713425ae077599
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
.DS_Store
+.checkstyle
.project
.settings
.classpath
.metadata/
/bin/
.idea
+logs/
+debug-logs/
*/
@Override
public void setName(String name) {
- this.name=name;
+ this.name = name;
}
/**
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+import java.io.FileReader;
+import org.onap.policy.api.main.PolicyApiException;
+import org.onap.policy.api.main.startstop.ApiCommandLineArguments;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.common.parameters.GroupValidationResult;
-import org.onap.policy.api.main.PolicyApiException;
-import org.onap.policy.api.main.startstop.ApiCommandLineArguments;
-
-import java.io.FileReader;
/**
* This class handles reading, parsing and validating of policy api parameters from JSON files.
import io.swagger.annotations.Info;
import io.swagger.annotations.SwaggerDefinition;
import io.swagger.annotations.Tag;
-import org.onap.policy.common.endpoints.report.HealthCheckReport;
-
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
+import org.onap.policy.common.endpoints.report.HealthCheckReport;
/**
* Class to provide api REST services.
package org.onap.policy.api.main.rest;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+import org.onap.policy.api.main.parameters.RestServerParameters;
import org.onap.policy.common.capabilities.Startable;
import org.onap.policy.common.endpoints.http.server.HttpServletServer;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
-import org.onap.policy.api.main.parameters.RestServerParameters;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
/**
* Class to manage life cycle of api rest server.
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public boolean start() {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public boolean stop() {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public void shutdown() {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public boolean isAlive() {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}.
*/
@Override
public String toString() {
package org.onap.policy.api.main.rest;
-import org.onap.policy.common.endpoints.report.HealthCheckReport;
import org.onap.policy.api.main.startstop.ApiActivator;
+import org.onap.policy.common.endpoints.report.HealthCheckReport;
/**
* Class to fetch health check of api service.
package org.onap.policy.api.main.startstop;
+import org.onap.policy.api.main.PolicyApiException;
+import org.onap.policy.api.main.parameters.ApiParameterGroup;
import org.onap.policy.api.main.rest.ApiRestServer;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.common.parameters.ParameterService;
-import org.onap.policy.api.main.PolicyApiException;
-import org.onap.policy.api.main.parameters.ApiParameterGroup;
/**
* This class wraps a distributor so that it can be activated as a complete service together with all its api
*
* @throws PolicyApiException on errors in initializing the service
*/
- @SuppressWarnings("unchecked")
public void initialize() throws PolicyApiException {
LOGGER.debug("Policy api starting as a service . . .");
startApiRestServer();
package org.onap.policy.api.main.startstop;
+import java.io.File;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URL;
+import java.util.Arrays;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.DefaultParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
-import org.onap.policy.common.utils.resources.ResourceUtils;
import org.onap.policy.api.main.PolicyApiException;
import org.onap.policy.api.main.PolicyApiRuntimeException;
+import org.onap.policy.common.utils.resources.ResourceUtils;
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.URL;
-import java.util.Arrays;
/**
* This class reads and handles command line parameters for the policy api main program.
package org.onap.policy.api.main.startstop;
+import java.util.Arrays;
import org.onap.policy.api.main.PolicyApiException;
-import org.onap.policy.common.logging.flexlogger.FlexLogger;
-import org.onap.policy.common.logging.flexlogger.Logger;
import org.onap.policy.api.main.parameters.ApiParameterGroup;
import org.onap.policy.api.main.parameters.ApiParameterHandler;
-
-import java.util.Arrays;
+import org.onap.policy.common.logging.flexlogger.FlexLogger;
+import org.onap.policy.common.logging.flexlogger.Logger;
/**
* This class initiates ONAP Policy Framework policy api.
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
import org.junit.Test;
import org.onap.policy.common.parameters.GroupValidationResult;
<groupId>org.onap.policy.parent</groupId>
<artifactId>integration</artifactId>
<version>2.0.0-SNAPSHOT</version>
- <relativePath/>
+ <relativePath />
</parent>
<groupId>org.onap.policy.api</groupId>
<artifactId>policy-api</artifactId>
- <version>2.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<!-- sonar/jacoco overrides -->
- <!-- Overriding oparent default sonar/jacoco settings Combine all our reports
- into one file shared across sub-modules -->
+ <!-- Overriding oparent default sonar/jacoco settings Combine all our reports into one file shared across sub-modules -->
<sonar.jacoco.reportPath>${project.basedir}/../target/code-coverage/jacoco-ut.exec</sonar.jacoco.reportPath>
<sonar.jacoco.itReportPath>${project.basedir}/../target/code-coverage/jacoco-it.exec</sonar.jacoco.itReportPath>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>
</goals>
<phase>process-sources</phase>
<configuration>
- <!-- Use Google Java Style Guide:
- https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
- with minor changes -->
+ <!-- Use Google Java Style Guide: https://github.com/checkstyle/checkstyle/blob/master/src/main/resources/google_checks.xml
+ with minor changes -->
<configLocation>onap-checkstyle/onap-java-style.xml</configLocation>
<!-- <sourceDirectory> is needed so that checkstyle ignores the generated sources directory -->
- <sourceDirectory>${project.build.sourceDirectory}/src/main/java</sourceDirectory>
+ <sourceDirectory>${project.build.sourceDirectory}</sourceDirectory>
<includeResources>true</includeResources>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<includeTestResources>true</includeTestResources>
<dependency>
<groupId>org.onap.oparent</groupId>
<artifactId>checkstyle</artifactId>
- <version>1.1.0</version>
+ <version>${oparent.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
- <!-- Note: This exclusion list should match <sonar.exclusions> property
- above -->
+ <!-- Note: This exclusion list should match <sonar.exclusions> property above -->
<excludes>
<exclude>**/gen/**</exclude>
<exclude>**/generated-sources/**</exclude>
</excludes>
</configuration>
<executions>
- <!-- Prepares the property pointing to the JaCoCo runtime agent which
- is passed as VM argument when Maven the Surefire plugin is executed. -->
+ <!-- Prepares the property pointing to the JaCoCo runtime agent which is passed as VM argument when
+ Maven the Surefire plugin is executed. -->
<execution>
<id>pre-unit-test</id>
<goals>
<destFile>${sonar.jacoco.reportPath}</destFile>
</configuration>
</execution>
- <!-- Ensures that the code coverage report for unit tests is created
- after unit tests have been run. -->
+ <!-- Ensures that the code coverage report for unit tests is created after unit tests have been run. -->
<execution>
<id>post-unit-test</id>
<phase>test</phase>
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>org.eclipse.m2e</groupId>
+ <artifactId>lifecycle-mapping</artifactId>
+ <version>1.0.0</version>
+ <configuration>
+ <lifecycleMappingMetadata>
+ <pluginExecutions>
+ <pluginExecution>
+ <pluginExecutionFilter>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <versionRange>2.17,)</versionRange>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </pluginExecutionFilter>
+ <action>
+ <ignore />
+ </action>
+ </pluginExecution>
+ </pluginExecutions>
+ </lifecycleMappingMetadata>
+ </configuration>
+ </plugin>
</plugins>
</pluginManagement>
</build>