IS: Add CheckStyle goal to Maven
authorRishi Chail <rishi.chail@est.tech>
Mon, 28 Sep 2020 11:30:58 +0000 (12:30 +0100)
committerRishi Chail <rishi.chail@est.tech>
Mon, 28 Sep 2020 11:30:58 +0000 (12:30 +0100)
Issue-ID: CCSDK-2746

https: //jira.onap.org/browse/CCSDK-2746
Change-Id: I0442b62cbecb16c979a43d3d5d68fdb1c62a2276

cps/cps-rest/src/main/java/org/onap/cps/rest/controller/RestController.java
cps/cps-service/src/main/java/org/onap/cps/api/CpService.java [moved from cps/cps-service/src/main/java/org/onap/cps/api/CPService.java with 98% similarity]
cps/cps-service/src/main/java/org/onap/cps/api/impl/CpServiceImpl.java [moved from cps/cps-service/src/main/java/org/onap/cps/api/impl/CPServiceImpl.java with 94% similarity]
cps/cps-service/src/main/java/org/onap/cps/spi/ModelPersistencyService.java
cps/pom.xml

index d2f1a3e..dc64110 100644 (file)
@@ -29,7 +29,7 @@ import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.Response;
 import javax.ws.rs.core.Response.Status;
 import org.glassfish.jersey.media.multipart.FormDataParam;
-import org.onap.cps.api.CPService;
+import org.onap.cps.api.CpService;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
 import org.opendaylight.yangtools.yang.model.parser.api.YangParserException;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -39,7 +39,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 public class RestController {
 
     @Autowired
-    private CPService cpService;
+    private CpService cpService;
 
     @POST
     @Path("uploadYangFile")
@@ -27,7 +27,7 @@ import org.opendaylight.yangtools.yang.model.parser.api.YangParserException;
 /**
  * Configuration and persistency service interface which holds methods for parsing and storing yang models and data.
  */
-public interface CPService {
+public interface CpService {
 
     /**
      * Parse and validate a string representing a yang model to generate a schema context.
@@ -26,7 +26,7 @@ import java.io.FileWriter;
 import java.io.IOException;
 import java.util.Iterator;
 import java.util.ServiceLoader;
-import org.onap.cps.api.CPService;
+import org.onap.cps.api.CpService;
 import org.onap.cps.spi.ModelPersistencyService;
 import org.opendaylight.yangtools.yang.model.api.Module;
 import org.opendaylight.yangtools.yang.model.api.SchemaContext;
@@ -41,9 +41,9 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 @Component
-public class CPServiceImpl implements CPService {
+public class CpServiceImpl implements CpService {
 
-    private final static Logger LOGGER = LoggerFactory.getLogger(CPServiceImpl.class);
+    private static final Logger LOGGER = LoggerFactory.getLogger(CpServiceImpl.class);
 
     private static final YangParserFactory PARSER_FACTORY;
 
@@ -65,7 +65,7 @@ public class CPServiceImpl implements CPService {
         final File tempFile = File.createTempFile("yang", ".yang");
         try (BufferedWriter writer = new BufferedWriter(new FileWriter(tempFile))) {
             writer.write(yangModelContent);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             LOGGER.error("Unable to write to temporary file {}", e.getMessage());
         }
         return parseAndValidateModel(tempFile);
index e0286c1..f88c6b2 100644 (file)
@@ -26,9 +26,10 @@ public interface ModelPersistencyService {
 
     /**
      * Store the module from a yang model in the database.
-     * @param name
-     * @param moduleContent
-     * @param revision
+     *
+     * @param name module name
+     * @param moduleContent module content
+     * @param revision module revision
      */
     void storeModule(final String name, final String moduleContent, final String revision);
 
index 1c1b2b1..7f50cb1 100644 (file)
@@ -86,9 +86,9 @@
               <includeResources>true</includeResources>\r
               <includeTestSourceDirectory>true</includeTestSourceDirectory>\r
               <includeTestResources>true</includeTestResources>\r
-              <consoleOutput>true</consoleOutput>\r
+              <consoleOutput>false</consoleOutput>\r
               <violationSeverity>warning</violationSeverity>\r
-              <failsOnViolation>true</failsOnViolation>\r
+              <failOnViolation>true</failOnViolation>\r
             </configuration>\r
           </execution>\r
         </executions>\r
     <module>cps-ri</module>\r
   </modules>\r
 \r
-</project>
\ No newline at end of file
+</project>\r