Author: tveronezi
Date: Fri May 30 13:40:55 2014
New Revision: 1598596
URL: http://svn.apache.org/r1598596
Log:
TOMEE-1231 100% code coverage for
ManagedScheduledExecutorServiceImplFactory.java
It also prepares jacoco plugin for the rest of the modules.
Added:
tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedScheduledExecutorServiceImplFactoryTest.java
Removed:
tomee/tomee/trunk/container/openejb-api/src/test/
Modified:
tomee/tomee/trunk/arquillian/pom.xml
tomee/tomee/trunk/assembly/pom.xml
tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/pom.xml
tomee/tomee/trunk/itests/pom.xml
tomee/tomee/trunk/pom.xml
tomee/tomee/trunk/tck/pom.xml
Modified: tomee/tomee/trunk/arquillian/pom.xml
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/pom.xml?rev=1598596&r1=1598595&r2=1598596&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/pom.xml (original)
+++ tomee/tomee/trunk/arquillian/pom.xml Fri May 30 13:40:55 2014
@@ -35,6 +35,7 @@
<version.arquillian>1.1.4.Final</version.arquillian>
<version.shrinkwrap.descriptor>2.0.0-alpha-6</version.shrinkwrap.descriptor>
<version.shrinkwrap.shrinkwrap>1.1.2</version.shrinkwrap.shrinkwrap>
+ <test.coverage.skip>true</test.coverage.skip>
</properties>
<modules>
Modified: tomee/tomee/trunk/assembly/pom.xml
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/assembly/pom.xml?rev=1598596&r1=1598595&r2=1598596&view=diff
==============================================================================
--- tomee/tomee/trunk/assembly/pom.xml (original)
+++ tomee/tomee/trunk/assembly/pom.xml Fri May 30 13:40:55 2014
@@ -28,7 +28,9 @@
<artifactId>assembly</artifactId>
<packaging>pom</packaging>
<name>OpenEJB :: Assembly</name>
-
+ <properties>
+ <test.coverage.skip>true</test.coverage.skip>
+ </properties>
<modules>
<module>openejb-standalone</module>
<module>openejb-lite</module>
Modified: tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/pom.xml
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/pom.xml?rev=1598596&r1=1598595&r2=1598596&view=diff
==============================================================================
--- tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/pom.xml
(original)
+++ tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/pom.xml Fri
May 30 13:40:55 2014
@@ -29,6 +29,10 @@
<artifactId>openejb-concurrency-utilities-ee</artifactId>
<name>OpenEJB :: Container :: Concurrency Utilities EE</name>
+ <properties>
+ <test.complexity.coverage.minimun>0.68</test.complexity.coverage.minimun>
+ <test.branch.coverage.minimun>0.4</test.branch.coverage.minimun>
+ </properties>
<dependencies>
<dependency>
<groupId>org.apache.openejb</groupId>
Added:
tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedScheduledExecutorServiceImplFactoryTest.java
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedScheduledExecutorServiceImplFactoryTest.java?rev=1598596&view=auto
==============================================================================
---
tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedScheduledExecutorServiceImplFactoryTest.java
(added)
+++
tomee/tomee/trunk/container/openejb-concurrency-utilities-ee/src/test/java/org/apache/openejb/concurrencyutilities/test/ManagedScheduledExecutorServiceImplFactoryTest.java
Fri May 30 13:40:55 2014
@@ -0,0 +1,45 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+
+package org.apache.openejb.concurrencyutilities.test;
+
+import
org.apache.openejb.concurrencyutilities.ee.factory.ManagedScheduledExecutorServiceImplFactory;
+import
org.apache.openejb.concurrencyutilities.ee.impl.ManagedScheduledExecutorServiceImpl;
+import
org.apache.openejb.concurrencyutilities.ee.impl.ManagedThreadFactoryImpl;
+import org.junit.Assert;
+import org.junit.Test;
+
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+
+public class ManagedScheduledExecutorServiceImplFactoryTest {
+
+ @Test
+ public void createServiceTest() {
+ final ManagedScheduledExecutorServiceImplFactory factory = new
ManagedScheduledExecutorServiceImplFactory();
+ factory.setThreadFactory(MyThreadFactory.class.getName());
+ final ManagedScheduledExecutorServiceImpl executorService =
factory.create();
+ final ScheduledThreadPoolExecutor poolExecutor =
(ScheduledThreadPoolExecutor) executorService.getDelegate();
+ Assert.assertEquals(poolExecutor.getThreadFactory().getClass(),
ManagedThreadFactoryImpl.class);
+ }
+
+ public static class MyThreadFactory {
+ public MyThreadFactory() {
+ throw new RuntimeException("Ooops!");
+ }
+ }
+
+}
Modified: tomee/tomee/trunk/itests/pom.xml
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/itests/pom.xml?rev=1598596&r1=1598595&r2=1598596&view=diff
==============================================================================
--- tomee/tomee/trunk/itests/pom.xml (original)
+++ tomee/tomee/trunk/itests/pom.xml Fri May 30 13:40:55 2014
@@ -32,6 +32,10 @@
<packaging>pom</packaging>
<name>OpenEJB :: iTests</name>
+ <properties>
+ <test.coverage.skip>true</test.coverage.skip>
+ </properties>
+
<modules>
<module>failover</module>
<module>failover-ejb</module>
Modified: tomee/tomee/trunk/pom.xml
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/pom.xml?rev=1598596&r1=1598595&r2=1598596&view=diff
==============================================================================
--- tomee/tomee/trunk/pom.xml (original)
+++ tomee/tomee/trunk/pom.xml Fri May 30 13:40:55 2014
@@ -93,7 +93,9 @@
</scm>
<properties>
-
+ <test.complexity.coverage.minimun>0</test.complexity.coverage.minimun>
+ <test.branch.coverage.minimun>0</test.branch.coverage.minimun>
+ <test.coverage.skip>false</test.coverage.skip>
<openejb.version>4.7.0-SNAPSHOT</openejb.version>
<tomee.version>1.7.0-SNAPSHOT</tomee.version>
@@ -422,6 +424,59 @@
<module>utils</module>
<module>tomee</module>
</modules>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco-maven-plugin</artifactId>
+ <version>0.7.1.201405082137</version>
+ <executions>
+ <execution>
+ <id>default-prepare-agent</id>
+ <goals>
+ <goal>prepare-agent</goal>
+ </goals>
+ <configuration>
+ <skip>${test.coverage.skip}</skip>
+ </configuration>
+ </execution>
+ <execution>
+ <id>default-report</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>report</goal>
+ </goals>
+ </execution>
+ <execution>
+ <id>default-check</id>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <rule>
+ <element>BUNDLE</element>
+ <limits>
+ <limit>
+ <counter>COMPLEXITY</counter>
+ <value>COVEREDRATIO</value>
+
<minimum>${test.complexity.coverage.minimun}</minimum>
+ </limit>
+ <limit>
+ <counter>BRANCH</counter>
+ <value>COVEREDRATIO</value>
+ <minimum>${test.branch.coverage.minimun}</minimum>
+ </limit>
+
+ </limits>
+ </rule>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
</profile>
<profile>
<id>quick</id>
Modified: tomee/tomee/trunk/tck/pom.xml
URL:
http://svn.apache.org/viewvc/tomee/tomee/trunk/tck/pom.xml?rev=1598596&r1=1598595&r2=1598596&view=diff
==============================================================================
--- tomee/tomee/trunk/tck/pom.xml (original)
+++ tomee/tomee/trunk/tck/pom.xml Fri May 30 13:40:55 2014
@@ -26,6 +26,9 @@
<packaging>pom</packaging>
<name>OpenEJB :: TCK</name>
+ <properties>
+ <test.coverage.skip>true</test.coverage.skip>
+ </properties>
<modules>
<module>cdi-embedded</module>