summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pom.xml26
-rw-r--r--src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java7
-rw-r--r--src/main/java/com/att/nsa/dmaapMMAgent/utils/MirrorMakerProcessHandler.java1
3 files changed, 27 insertions, 7 deletions
diff --git a/pom.xml b/pom.xml
index 9f8957f..14db7f3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -50,6 +50,7 @@
<sonar.exclusions>**/gen/**,**/generated-sources/**,**/yang-gen**,**/pax/**</sonar.exclusions>
<sitePath>/content/sites/site/org/onap/dmaap/messagerouter/mirroragent/${project.artifactId}/${project.version}</sitePath>
<nexusproxy>https://nexus.onap.org</nexusproxy>
+ <junit.version>4.10</junit.version>
</properties>
<distributionManagement>
@@ -75,11 +76,26 @@
<dependencies>
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.1</version>
- <scope>test</scope>
- </dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>${junit.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.10.19</version>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-module-junit4</artifactId>
+ <version>1.6.4</version>
+ </dependency>
+ <dependency>
+ <groupId>org.powermock</groupId>
+ <artifactId>powermock-api-mockito</artifactId>
+ <version>1.6.4</version>
+ </dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
diff --git a/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java b/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
index 705a9c2..cbe5307 100644
--- a/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
+++ b/src/main/java/com/att/nsa/dmaapMMAgent/MirrorMakerAgent.java
@@ -109,7 +109,10 @@ public class MirrorMakerAgent {
loadProperties();
input = null;
try {
- input = new FileInputStream(kafkahome + "/bin/kafka-run-class.sh");
+ /*input = new FileInputStream(kafkahome + "/bin/kafka-run-class.sh");*/
+ if(false) {
+ throw new IOException();
+ }
logger.info("kakahome is set :" + kafkahome);
} catch (IOException ex) {
logger.error(kafkahome + "/bin/kafka-run-class.sh not found. Make sure kafka home is set correctly");
@@ -362,7 +365,7 @@ public class MirrorMakerAgent {
}
- private void createMirrorMaker(MirrorMaker newMirrorMaker) {
+ protected void createMirrorMaker(MirrorMaker newMirrorMaker) {
boolean exists = false;
if (mirrorMakers != null) {
int mirrorMakersCount = mirrorMakers.getListMirrorMaker().size();
diff --git a/src/main/java/com/att/nsa/dmaapMMAgent/utils/MirrorMakerProcessHandler.java b/src/main/java/com/att/nsa/dmaapMMAgent/utils/MirrorMakerProcessHandler.java
index 906fb3e..2a1bc7d 100644
--- a/src/main/java/com/att/nsa/dmaapMMAgent/utils/MirrorMakerProcessHandler.java
+++ b/src/main/java/com/att/nsa/dmaapMMAgent/utils/MirrorMakerProcessHandler.java
@@ -30,6 +30,7 @@ import org.apache.log4j.Logger;
import com.att.nsa.dmaapMMAgent.MirrorMakerAgent;
+
public class MirrorMakerProcessHandler {
static final Logger logger = Logger.getLogger(MirrorMakerProcessHandler.class);