Fixes for IT base 50/47350/1
authorSam Hague <shague@redhat.com>
Thu, 20 Oct 2016 17:49:05 +0000 (13:49 -0400)
committerSam Hague <shague@redhat.com>
Thu, 20 Oct 2016 17:49:05 +0000 (13:49 -0400)
Change-Id: Idce92e17acabc948e599e992a0e669ad41198341
Signed-off-by: Sam Hague <shague@redhat.com>
commons/it-parent/pom.xml [new file with mode: 0644]
commons/pom.xml
it/pom.xml
it/src/test/java/org/opendaylight/genius/it/InterfaceManagerIT.java
pom.xml

diff --git a/commons/it-parent/pom.xml b/commons/it-parent/pom.xml
new file mode 100644 (file)
index 0000000..e18c582
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright (C) 2016 Red Hat, Inc. and others. All rights reserved.
+
+This program and the accompanying materials are made available under the
+terms of the Eclipse Public License v1.0 which accompanies this distribution,
+and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>org.opendaylight.controller</groupId>
+    <artifactId>mdsal-it-parent</artifactId>
+    <version>1.5.0-SNAPSHOT</version>
+    <relativePath/>
+  </parent>
+
+  <groupId>org.opendaylight.genius</groupId>
+  <artifactId>it-parent</artifactId>
+  <version>0.2.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <properties>
+    <skip.surefire.tests>false</skip.surefire.tests>
+  </properties>
+  <profiles>
+    <profile>
+      <id>default</id>
+      <activation>
+        <activeByDefault>true</activeByDefault>
+      </activation>
+      <properties>
+        <skipITs>true</skipITs>
+      </properties>
+    </profile>
+    <profile>
+      <id>integrationtest</id>
+      <activation>
+        <activeByDefault>false</activeByDefault>
+      </activation>
+      <properties>
+        <skipITs>false</skipITs>
+        <skip.surefire.tests>true</skip.surefire.tests>
+        <skip.karaf.featureTest>true</skip.karaf.featureTest>
+        <maven.javadoc.skip>true</maven.javadoc.skip>
+        <maven.source.skip>true</maven.source.skip>
+        <checkstyle.skip>true</checkstyle.skip>
+        <findbugs.skip>true</findbugs.skip>
+        <pmd.skip>true</pmd.skip>
+        <cpd.skip>true</cpd.skip>
+        <maven.site.skip>true</maven.site.skip>
+        <invoker.skip>true</invoker.skip>
+        <enforcer.skip>true</enforcer.skip>
+      </properties>
+    </profile>
+  </profiles>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.codehaus.sonar-plugins.java</groupId>
+        <artifactId>sonar-jacoco-listeners</artifactId>
+        <version>${sonar-jacoco-listeners.version}</version>
+        <scope>test</scope>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.jacoco</groupId>
+        <artifactId>jacoco-maven-plugin</artifactId>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-failsafe-plugin</artifactId>
+        <configuration>
+          <properties>
+            <property>
+              <name>listener</name>
+              <value>org.sonar.java.jacoco.JUnitListener</value>
+            </property>
+          </properties>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <skipTests>${skip.surefire.tests}</skipTests>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>prep-jacoco-agent</id>
+            <phase>pre-integration-test</phase>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <configuration>
+              <target>
+                <copy file="${settings.localRepository}/org/jacoco/org.jacoco.agent/${jacoco.version}/org.jacoco.agent-${jacoco.version}-runtime.jar"
+                      tofile="target/exam/jars/org.jacoco.agent.jar" />
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>
index a791767268b906fa048623e162c7af921bf299e7..5376bf8f623a64d211edf4980c3e08680aeca945 100644 (file)
@@ -27,6 +27,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
   <modules>
     <module>binding-parent</module>
     <module>config-parent</module>
+    <module>it-parent</module>
   </modules>
 
   <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->
index 2d1132eab8558680ceb1584ae4a7e66cfff7222b..cdfe39fe32981ca2f1cf67e5183beb2a992ce208 100644 (file)
@@ -6,35 +6,45 @@ This program and the accompanying materials are made available under the
 terms of the Eclipse Public License v1.0 which accompanies this distribution,
 and is available at http://www.eclipse.org/legal/epl-v10.html
 -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
   <parent>
-    <groupId>org.opendaylight.controller</groupId>
-    <artifactId>mdsal-it-parent</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath/>
+    <artifactId>it-parent</artifactId>
+    <groupId>org.opendaylight.genius</groupId>
+    <version>0.2.0-SNAPSHOT</version>
+    <relativePath>../commons/it-parent</relativePath>
   </parent>
 
-  <groupId>org.opendaylight.genius</groupId>
   <artifactId>genius-it</artifactId>
-  <version>0.2.0-SNAPSHOT</version>
-  <packaging>bundle</packaging>
-
-  <properties>
-    <skipITs>false</skipITs>
-    <karaf.distro.groupId>org.opendaylight.genius</karaf.distro.groupId>
-    <karaf.distro.artifactId>genius-karaf</karaf.distro.artifactId>
-    <karaf.distro.version>0.2.0-SNAPSHOT</karaf.distro.version>
-    <karaf.distro.type>zip</karaf.distro.type>
-  </properties>
+  <packaging>jar</packaging>
 
   <dependencies>
     <dependency>
       <groupId>${project.groupId}</groupId>
       <artifactId>genius-features</artifactId>
       <version>${project.version}</version>
+      <classifier>features</classifier>
+      <type>xml</type>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.sonar-plugins.java</groupId>
+      <artifactId>sonar-jacoco-listeners</artifactId>
+      <scope>test</scope>
     </dependency>
   </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-checkstyle-plugin</artifactId>
+        <configuration>
+          <propertyExpansion>checkstyle.violationSeverity=error</propertyExpansion>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
 </project>
index 2bb39f978e8cc1157384685fb42e13621563e381..823f77836eebadde6781e0062f0aa0822369bd0c 100644 (file)
@@ -10,17 +10,22 @@ package org.opendaylight.genius.it;
 import static org.ops4j.pax.exam.CoreOptions.composite;
 import static org.ops4j.pax.exam.CoreOptions.maven;
 import static org.ops4j.pax.exam.karaf.options.KarafDistributionOption.editConfigurationFilePut;
+import static org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel.ERROR;
+import static org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel.INFO;
+import static org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel.WARN;
 
+import javax.inject.Inject;
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.runner.RunWith;
+import org.opendaylight.controller.md.sal.binding.api.DataBroker;
 import org.opendaylight.controller.mdsal.it.base.AbstractMdsalTestBase;
 import org.ops4j.pax.exam.Option;
 import org.ops4j.pax.exam.junit.PaxExam;
-import org.ops4j.pax.exam.karaf.options.LogLevelOption.LogLevel;
 import org.ops4j.pax.exam.options.MavenUrlReference;
 import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
 import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.exam.util.Filter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -28,16 +33,8 @@ import org.slf4j.LoggerFactory;
 @ExamReactorStrategy(PerClass.class)
 public class InterfaceManagerIT extends AbstractMdsalTestBase {
     private static final Logger LOG = LoggerFactory.getLogger(InterfaceManagerIT.class);
-
-    @Override
-    public String getModuleName() {
-        return "interfacemanager";
-    }
-
-    @Override
-    public String getInstanceName() {
-        return "interfacemanager-default";
-    }
+    @Inject @Filter(timeout = 60000)
+    private static DataBroker dataBroker = null;
 
     @Override
     public MavenUrlReference getFeatureRepo() {
@@ -56,15 +53,21 @@ public class InterfaceManagerIT extends AbstractMdsalTestBase {
 
     @Override
     public Option getLoggingOption() {
-        Option option = editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
-                logConfiguration(InterfaceManagerIT.class),
-                LogLevel.INFO.name());
-        option = composite(option, super.getLoggingOption());
-        return option;
+        return composite(
+                editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                        logConfiguration(InterfaceManagerIT.class),
+                        INFO.name()),
+                editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                        "log4j.logger.org.opendaylight.controller.configpusherfeature.internal.FeatureConfigPusher",
+                        ERROR.name()),
+                editConfigurationFilePut(ORG_OPS4J_PAX_LOGGING_CFG,
+                        "log4j.logger.org.opendaylight.yangtools.yang.parser.repo.YangTextSchemaContextResolver",
+                        WARN.name()),
+                super.getLoggingOption());
     }
 
     @Test
-    public void testgeniusFeatureLoad() {
+    public void testGeniusFeatureLoad() {
         Assert.assertTrue(true);
     }
 }
diff --git a/pom.xml b/pom.xml
index 4f81dc9c1bbc2498406dbbd23ec95680ac1e1954..b75db0aa4db40a97c38d34e053605c755085f7b5 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -48,7 +48,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html INTERNAL
     <module>fcapsmanager</module>
     <module>fcapsapplication</module>
     <module>resourcemanager</module>
-    <!--module>it</module-->
+    <module>it</module>
   </modules>
 
   <!-- DO NOT install or deploy the repo root pom as it's only needed to initiate a build -->