You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltaspike.apache.org by st...@apache.org on 2012/09/30 22:20:54 UTC

git commit: DELTASPIKE-274 enable unit test for AbstractContext

Updated Branches:
  refs/heads/master 0e47ca62d -> 82d032941


DELTASPIKE-274 enable unit test for AbstractContext

This contains a dirty hack by adding the test Extension
via the test classpath for all tests


Project: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/commit/82d03294
Tree: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/tree/82d03294
Diff: http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/diff/82d03294

Branch: refs/heads/master
Commit: 82d0329412d3841247766ae10283ef4cdc9d3f8e
Parents: 0e47ca6
Author: Mark Struberg <st...@apache.org>
Authored: Sun Sep 30 22:20:11 2012 +0200
Committer: Mark Struberg <st...@apache.org>
Committed: Sun Sep 30 22:20:11 2012 +0200

----------------------------------------------------------------------
 .../test/core/api/context/AbstractContextTest.java |   11 ++++---
 .../services/javax.enterprise.inject.spi.Extension |   23 +++++++++++++++
 2 files changed, 29 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/82d03294/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/context/AbstractContextTest.java
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/context/AbstractContextTest.java b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/context/AbstractContextTest.java
index 2db0ab4..1fcb910 100644
--- a/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/context/AbstractContextTest.java
+++ b/deltaspike/core/impl/src/test/java/org/apache/deltaspike/test/core/api/context/AbstractContextTest.java
@@ -15,7 +15,6 @@ import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.Test;
 import org.junit.Assert;
-import org.junit.Ignore;
 
 /**
  * We test the AbstractContext by implementing a simple dummy context.
@@ -45,11 +44,12 @@ public class AbstractContextTest
     }
 
 
+    // This test is a hack yet due to a bug in the owb-arquillian and weld-arquillian containers
+    // which needs to get fixed first. All tested containers so far do NOT respect the Extensions
+    // from the ShrinkWrap archive but only the ones from the classpath.
+    // Thus we had to add the Extension on the test-classpath. This means it will also
+    // be available for all other tests (but only for 'embedded' containers.
     @Test
-    @Ignore
-    //X Test is disabled out due to a bug in the owb-arquillian and weld-arquillian containers
-    //X which needs to get fixed first. All tested containers so far do NOT respect the Extensions
-    //X from the ShrinkWrap archive but only the ones from the classpath.
     public void testDummyContext()
     {
         DummyBean dummyBean = BeanProvider.getContextualReference(DummyBean.class);
@@ -60,5 +60,6 @@ public class AbstractContextTest
 
         DummyBean dummyBean2 = BeanProvider.getContextualReference(DummyBean.class);
         Assert.assertEquals(4712, dummyBean.getI());
+
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-deltaspike/blob/82d03294/deltaspike/core/impl/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
----------------------------------------------------------------------
diff --git a/deltaspike/core/impl/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension b/deltaspike/core/impl/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
new file mode 100644
index 0000000..bdceba7
--- /dev/null
+++ b/deltaspike/core/impl/src/test/resources/META-INF/services/javax.enterprise.inject.spi.Extension
@@ -0,0 +1,23 @@
+# 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.
+
+# We need to register the Extension on the classpath
+# as many Arquillian containers do not yet pickup
+# Extensions from a ShrinkWrap archive.
+
+# registers the DummyScope for the AbstractContextTest
+org.apache.deltaspike.test.core.api.context.DummyScopeExtension