summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sparkybe-onap-application/pom.xml41
-rw-r--r--sparkybe-onap-service/pom.xml30
-rw-r--r--sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java10
-rw-r--r--sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java8
-rw-r--r--sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/CaptureLoggerAppender.java247
-rw-r--r--sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/LogValidator.java85
6 files changed, 34 insertions, 387 deletions
diff --git a/sparkybe-onap-application/pom.xml b/sparkybe-onap-application/pom.xml
index 04fd2a2..b8da6da 100644
--- a/sparkybe-onap-application/pom.xml
+++ b/sparkybe-onap-application/pom.xml
@@ -29,18 +29,20 @@
<dependencyManagement>
- <dependencies>
-
- <!-- Camel BOM -->
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-spring-boot-dependencies</artifactId>
- <version>${camel-spring-boot.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
- </dependencies>
- </dependencyManagement>
+ <dependencies>
+
+ <!-- Camel BOM -->
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-spring-boot-dependencies</artifactId>
+ <version>${camel-spring-boot.version}</version>
+ <type>pom</type>
+ <scope>import</scope>
+ </dependency>
+
+ </dependencies>
+
+</dependencyManagement>
<dependencies>
@@ -58,7 +60,6 @@
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-restlet</artifactId>
- <version>${camel-spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@@ -70,7 +71,6 @@
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-servlet</artifactId>
- <version>${camel-spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@@ -108,8 +108,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
+ </dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util -->
<dependency>
@@ -170,7 +169,7 @@
<dependency>
<groupId>org.onap.aai.logging-service</groupId>
<artifactId>common-logging</artifactId>
- <version>1.2.0</version>
+ <version>1.2.1</version>
</dependency>
<dependency>
@@ -208,11 +207,6 @@
<artifactId>rest-client</artifactId>
<version>1.2.0</version>
</dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
<!-- https://mvnrepository.com/artifact/org.restlet.jee/org.restlet.ext.servlet -->
<dependency>
@@ -371,7 +365,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.7</version>
<executions>
<execution>
<id>copy-docker-file</id>
@@ -402,7 +395,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
- <version>3.0.0</version>
<executions>
<execution>
<id>copy-installed</id>
@@ -460,7 +452,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.3</version>
<configuration>
<reportPlugins>
<plugin>
diff --git a/sparkybe-onap-service/pom.xml b/sparkybe-onap-service/pom.xml
index 37c464f..4d2a86d 100644
--- a/sparkybe-onap-service/pom.xml
+++ b/sparkybe-onap-service/pom.xml
@@ -39,6 +39,7 @@
<type>pom</type>
<scope>import</scope>
</dependency>
+
</dependencies>
</dependencyManagement>
@@ -64,7 +65,6 @@ some of the depedencies should probably have a scope of provided so they don't a
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-restlet</artifactId>
- <version>${camel-spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@@ -76,7 +76,6 @@ some of the depedencies should probably have a scope of provided so they don't a
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-servlet</artifactId>
- <version>${camel-spring-boot.version}</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
@@ -114,8 +113,7 @@ some of the depedencies should probably have a scope of provided so they don't a
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
+ </dependency>
<!-- https://mvnrepository.com/artifact/org.eclipse.jetty/jetty-util -->
<dependency>
@@ -166,7 +164,7 @@ some of the depedencies should probably have a scope of provided so they don't a
<dependency>
<groupId>org.onap.aai.logging-service</groupId>
<artifactId>common-logging</artifactId>
- <version>1.2.0</version>
+ <version>1.2.1</version>
</dependency>
@@ -206,13 +204,6 @@ some of the depedencies should probably have a scope of provided so they don't a
<version>1.2.0</version>
</dependency>
-
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>2.4</version>
- </dependency>
-
<!-- https://mvnrepository.com/artifact/org.restlet.jee/org.restlet.ext.servlet -->
<dependency>
<groupId>org.restlet.jee</groupId>
@@ -461,7 +452,6 @@ some of the depedencies should probably have a scope of provided so they don't a
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
- <version>3.3</version>
<configuration>
<reportPlugins>
<plugin>
@@ -549,6 +539,20 @@ some of the depedencies should probably have a scope of provided so they don't a
</plugins>
</build>
+
+ <distributionManagement>
+ <repository>
+ <id>ecomp-releases</id>
+ <name>ECOMP Release Repository</name>
+ <url>${nexusproxy}/content/repositories/releases/</url>
+ </repository>
+ <snapshotRepository>
+ <id>ecomp-snapshots</id>
+ <name>ECOMP Snapshot Repository</name>
+ <url>${nexusproxy}/content/repositories/snapshots/</url>
+ </snapshotRepository>
+ </distributionManagement>
+
</project>
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java
index 0c3a8ce..11beabd 100644
--- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java
+++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/security/SecurityContextFactoryImplTest.java
@@ -35,18 +35,12 @@ import javax.net.ssl.SSLContext;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
-import org.onap.aai.sparky.security.SecurityContextFactory;
-import org.onap.aai.sparky.security.SecurityContextFactoryImpl;
-import org.onap.aai.sparky.util.LogValidator;
-
-import ch.qos.logback.classic.Level;
/**
* The Class SecurityContextFactoryImplTest.
*/
public class SecurityContextFactoryImplTest {
-
- private LogValidator logValidator;
+
/**
* Inits the.
@@ -55,8 +49,6 @@ public class SecurityContextFactoryImplTest {
*/
@Before
public void init() throws Exception {
- logValidator = new LogValidator();
- logValidator.initializeLogger(Level.WARN);
}
/**
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java
index 0451ec5..5855960 100644
--- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java
+++ b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/synchronizer/IndexDocumentTest.java
@@ -32,9 +32,6 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
-import org.onap.aai.sparky.util.LogValidator;
-
-import ch.qos.logback.classic.Level;
/**
@@ -43,9 +40,6 @@ import ch.qos.logback.classic.Level;
@RunWith(MockitoJUnitRunner.class)
public class IndexDocumentTest {
- private LogValidator logValidator;
-
-
/**
* Inits the.
*
@@ -53,8 +47,6 @@ public class IndexDocumentTest {
*/
@Before
public void init() throws Exception {
- logValidator = new LogValidator();
- logValidator.initializeLogger(Level.WARN);
}
/**
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/CaptureLoggerAppender.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/CaptureLoggerAppender.java
deleted file mode 100644
index 443328e..0000000
--- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/CaptureLoggerAppender.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/**
- * ============LICENSE_START===================================================
- * SPARKY (AAI UI service)
- * ============================================================================
- * Copyright © 2017 AT&T Intellectual Property.
- * Copyright © 2017 Amdocs
- * All rights reserved.
- * ============================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=====================================================
- *
- * ECOMP and OpenECOMP are trademarks
- * and service marks of AT&T Intellectual Property.
- */
-
-package org.onap.aai.sparky.util;
-
-import java.util.ArrayList;
-import java.util.Deque;
-import java.util.List;
-import java.util.concurrent.ConcurrentLinkedDeque;
-
-import ch.qos.logback.classic.spi.LoggingEvent;
-import ch.qos.logback.core.Appender;
-import ch.qos.logback.core.Context;
-import ch.qos.logback.core.LogbackException;
-import ch.qos.logback.core.filter.Filter;
-import ch.qos.logback.core.spi.FilterReply;
-import ch.qos.logback.core.status.Status;
-
-/**
- * A test class used to provide a concrete log stub of the Log4j API interface. The goal is to
- * transparently capture logging paths so we can add log validation during the junit validation
- * without post-analyzing on-disk logs.
- *
- * @author DAVEA
- *
- */
-@SuppressWarnings("rawtypes")
-public class CaptureLoggerAppender implements Appender {
-
- private Deque<LoggingEvent> capturedLogs;
-
- /**
- * Instantiates a new capture logger appender.
- */
- public CaptureLoggerAppender() {
- capturedLogs = new ConcurrentLinkedDeque<LoggingEvent>();
- }
-
- /**
- * Drain all logs.
- *
- * @return the list
- */
- public List<LoggingEvent> drainAllLogs() {
- List<LoggingEvent> loggingEvents = new ArrayList<LoggingEvent>();
-
- LoggingEvent event = null;
-
- while (capturedLogs.peek() != null) {
- event = capturedLogs.pop();
- loggingEvents.add(event);
- }
-
- return loggingEvents;
- }
-
- /**
- * Clears the capture logs double-ended queue and returns the size of the queue before it was
- * cleared.
- *
- * @return int numCapturedLogs
- */
- public int clearAllLogs() {
- int numCapturedLogs = capturedLogs.size();
- capturedLogs.clear();
- return numCapturedLogs;
- }
-
-
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.LifeCycle#start()
- */
- @Override
- public void start() {}
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.LifeCycle#stop()
- */
- @Override
- public void stop() {}
-
- @Override
- public boolean isStarted() {
- // TODO Auto-generated method stub
- System.out.println("isStarted");
- return false;
- }
-
- @Override
- public void setContext(Context context) {
- // TODO Auto-generated method stub
- System.out.println("setContext");
-
- }
-
- @Override
- public Context getContext() {
- // TODO Auto-generated method stub
- System.out.println("getContext");
- return null;
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.ContextAware#addStatus(ch.qos.logback.core.status.Status)
- */
- @Override
- public void addStatus(Status status) {
- // TODO Auto-generated method stub
- System.out.println("addStatus");
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.ContextAware#addInfo(java.lang.String)
- */
- @Override
- public void addInfo(String msg) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.ContextAware#addInfo(java.lang.String, java.lang.Throwable)
- */
- @Override
- public void addInfo(String msg, Throwable ex) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.ContextAware#addWarn(java.lang.String)
- */
- @Override
- public void addWarn(String msg) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.ContextAware#addWarn(java.lang.String, java.lang.Throwable)
- */
- @Override
- public void addWarn(String msg, Throwable ex) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.ContextAware#addError(java.lang.String)
- */
- @Override
- public void addError(String msg) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.ContextAware#addError(java.lang.String, java.lang.Throwable)
- */
- @Override
- public void addError(String msg, Throwable ex) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.FilterAttachable#addFilter(ch.qos.logback.core.filter.Filter)
- */
- @Override
- public void addFilter(Filter newFilter) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.FilterAttachable#clearAllFilters()
- */
- @Override
- public void clearAllFilters() {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public List getCopyOfAttachedFiltersList() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.spi.FilterAttachable#getFilterChainDecision(java.lang.Object)
- */
- @Override
- public FilterReply getFilterChainDecision(Object event) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public String getName() {
- // TODO Auto-generated method stub
- System.out.println("getName");
- return "MOCK";
- }
-
- /* (non-Javadoc)
- * @see ch.qos.logback.core.Appender#doAppend(java.lang.Object)
- */
- @Override
- public void doAppend(Object event) throws LogbackException {
- // TODO Auto-generated method stub
- // System.out.println("doAppend(), event = " + event);
- // System.out.println("event class = " + event.getClass().getSimpleName());
- capturedLogs.add((LoggingEvent) event);
- }
-
- @Override
- public void setName(String name) {
- // TODO Auto-generated method stub
- System.out.println("setName() name = " + name);
-
- }
-
-}
diff --git a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/LogValidator.java b/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/LogValidator.java
deleted file mode 100644
index a138846..0000000
--- a/sparkybe-onap-service/src/test/java/org/onap/aai/sparky/util/LogValidator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * ============LICENSE_START===================================================
- * SPARKY (AAI UI service)
- * ============================================================================
- * Copyright © 2017 AT&T Intellectual Property.
- * Copyright © 2017 Amdocs
- * All rights reserved.
- * ============================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=====================================================
- *
- * ECOMP and OpenECOMP are trademarks
- * and service marks of AT&T Intellectual Property.
- */
-
-package org.onap.aai.sparky.util;
-
-import java.util.List;
-
-import org.slf4j.LoggerFactory;
-
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.spi.LoggingEvent;
-
-/**
- * The Class LogValidator.
- */
-public class LogValidator {
-
- protected CaptureLoggerAppender logger = null;
-
- /**
- * Initialize logger.
- *
- * @param level the level
- */
- @SuppressWarnings("unchecked")
- public void initializeLogger(Level level) {
- ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory
- .getLogger(ch.qos.logback.classic.Logger.ROOT_LOGGER_NAME);
- root.detachAndStopAllAppenders();
- logger = new CaptureLoggerAppender();
- root.setLevel(level);
- root.addAppender(logger);
- }
-
- public CaptureLoggerAppender getLogger() {
- return logger;
- }
-
- /**
- * Dump and count logs.
- *
- * @param logToConsole the log to console
- * @return the int
- */
- public int dumpAndCountLogs(boolean logToConsole) {
-
- List<LoggingEvent> logs = logger.drainAllLogs();
-
- if (logs == null) {
- return 0;
- }
-
- if (logToConsole) {
- for (LoggingEvent e : logs) {
- System.out.println(e);
- }
- }
-
- return logs.size();
-
- }
-
-}