[weld-commits] Weld SVN: r6447 - in core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb: singleton and 1 other directory.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Jun 16 13:55:12 EDT 2010


Author: pete.muir at jboss.org
Date: 2010-06-16 13:55:12 -0400 (Wed, 16 Jun 2010)
New Revision: 6447

Added:
   core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/
   core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/Foo.java
   core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/SingletonStartupTest.java
Log:
Tests for JBAS-8107

Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/Foo.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/Foo.java	                        (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/Foo.java	2010-06-16 17:55:12 UTC (rev 6447)
@@ -0,0 +1,32 @@
+package org.jboss.weld.tests.ejb.singleton;
+
+import javax.annotation.PostConstruct;
+import javax.ejb.Singleton;
+import javax.ejb.Startup;
+import javax.enterprise.context.ApplicationScoped;
+
+ at Singleton
+ at Startup
+ at ApplicationScoped
+public class Foo
+{
+   
+   private static boolean postConstructCalled;
+   
+   public static boolean isPostConstructCalled()
+   {
+      return postConstructCalled;
+   }
+   
+   public static void reset()
+   {
+      postConstructCalled = false;
+   }
+   
+   @PostConstruct
+   public void postConstruct()
+   {
+      postConstructCalled = true;
+   }
+
+}


Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/Foo.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/SingletonStartupTest.java
===================================================================
--- core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/SingletonStartupTest.java	                        (rev 0)
+++ core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/SingletonStartupTest.java	2010-06-16 17:55:12 UTC (rev 6447)
@@ -0,0 +1,22 @@
+package org.jboss.weld.tests.ejb.singleton;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+ at Artifact
+ at IntegrationTest
+ at Packaging(PackagingType.EAR)
+public class SingletonStartupTest extends AbstractWeldTest
+{
+ 
+   @Test(enabled=false) // JBAS-8107
+   public void testSingletonStartup()
+   {
+      assert Foo.isPostConstructCalled();
+   }
+
+}


Property changes on: core/trunk/tests/src/test/java/org/jboss/weld/tests/ejb/singleton/SingletonStartupTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native



More information about the weld-commits mailing list