changeset 149:9d1228ff9411

Cleanup code and pom file
author Jie Kang <21.jiekang@gmail.com>
date Wed, 08 Mar 2017 11:42:46 -0500
parents 0d92d1105374
children 013a422a2e7c
files server/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/handler/MongoStorageHandler.java server/core/src/test/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/MongoResponseBuilderTest.java server/core/src/test/java/com/redhat/thermostat/server/core/web/setup/TimedTestSetup.java server/core/src/test/java/com/redhat/thermostat/test/util/MongodTestUtil.java server/core/src/test/java/com/redhat/thermostat/test/util/TestPortSetup.java server/distribution/pom.xml server/distribution/src/assembly/src.xml
diffstat 7 files changed, 5 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/server/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/handler/MongoStorageHandler.java	Wed Mar 08 11:25:30 2017 -0500
+++ b/server/core/src/main/java/com/redhat/thermostat/server/core/internal/storage/mongo/handler/MongoStorageHandler.java	Wed Mar 08 11:42:46 2017 -0500
@@ -60,7 +60,6 @@
 import com.mongodb.BasicDBObject;
 import com.mongodb.CursorType;
 import com.mongodb.client.FindIterable;
-import com.mongodb.client.model.IndexOptionDefaults;
 import com.mongodb.client.model.IndexOptions;
 import com.mongodb.client.model.Indexes;
 import com.mongodb.util.JSON;
--- a/server/core/src/test/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/MongoResponseBuilderTest.java	Wed Mar 08 11:25:30 2017 -0500
+++ b/server/core/src/test/java/com/redhat/thermostat/server/core/internal/storage/mongo/response/MongoResponseBuilderTest.java	Wed Mar 08 11:42:46 2017 -0500
@@ -14,8 +14,6 @@
 import com.mongodb.Block;
 import com.mongodb.CursorType;
 import com.mongodb.Function;
-import com.mongodb.ServerAddress;
-import com.mongodb.ServerCursor;
 import com.mongodb.client.FindIterable;
 import com.mongodb.client.MongoCursor;
 import com.mongodb.client.MongoIterable;
--- a/server/core/src/test/java/com/redhat/thermostat/server/core/web/setup/TimedTestSetup.java	Wed Mar 08 11:25:30 2017 -0500
+++ b/server/core/src/test/java/com/redhat/thermostat/server/core/web/setup/TimedTestSetup.java	Wed Mar 08 11:42:46 2017 -0500
@@ -7,7 +7,7 @@
 import org.junit.AfterClass;
 
 public class TimedTestSetup {
-    public static final Map<String, List<Long>> times = new HashMap<>();
+    protected static final Map<String, List<Long>> times = new HashMap<>();
 
     @AfterClass
     public static void afterClassTimedTestSetup() throws Exception {
--- a/server/core/src/test/java/com/redhat/thermostat/test/util/MongodTestUtil.java	Wed Mar 08 11:25:30 2017 -0500
+++ b/server/core/src/test/java/com/redhat/thermostat/test/util/MongodTestUtil.java	Wed Mar 08 11:42:46 2017 -0500
@@ -56,7 +56,7 @@
     public void stopMongod() {
         try {
             mongoClient.getDatabase("admin").runCommand(new Document("shutdown", 1));
-        } catch (Exception e) {
+        } catch (Exception ignored) {
         }
         mongoClient.close();
         mongoClient = null;
--- a/server/core/src/test/java/com/redhat/thermostat/test/util/TestPortSetup.java	Wed Mar 08 11:25:30 2017 -0500
+++ b/server/core/src/test/java/com/redhat/thermostat/test/util/TestPortSetup.java	Wed Mar 08 11:42:46 2017 -0500
@@ -1,6 +1,6 @@
 package com.redhat.thermostat.test.util;
 
-public class TestPortSetup {
+class TestPortSetup {
     public final static int MONGODB_PORT = 28000;
     public final static int SERVER_PORT = 27000;
 }
--- a/server/distribution/pom.xml	Wed Mar 08 11:25:30 2017 -0500
+++ b/server/distribution/pom.xml	Wed Mar 08 11:42:46 2017 -0500
@@ -46,10 +46,6 @@
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
-    <properties>
-        <thermostat.plugin>server</thermostat.plugin>
-    </properties>
-
     <artifactId>thermostat-server-distribution</artifactId>
     <name>Thermostat Server Distribution</name>
 
@@ -67,7 +63,7 @@
                 </configuration>
                 <executions>
                     <execution>
-                        <id>assemble-plugin</id>
+                        <id>assemble-jar</id>
                         <phase>package</phase>
                         <goals>
                             <goal>single</goal>
--- a/server/distribution/src/assembly/src.xml	Wed Mar 08 11:25:30 2017 -0500
+++ b/server/distribution/src/assembly/src.xml	Wed Mar 08 11:42:46 2017 -0500
@@ -39,7 +39,7 @@
 <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
-    <id>jar-with-dependencies</id>
+    <id>assemble-jar</id>
     <formats>
         <format>jar</format>
     </formats>