Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
tests/src/test/java/org/jboss/weld/tests/ejb/singleton/Foo.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
@Singleton | ||
@Startup | ||
@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; | ||
} | ||
|
||
} |
22 changes: 22 additions & 0 deletions
22
tests/src/test/java/org/jboss/weld/tests/ejb/singleton/SingletonStartupTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
|
||
@Artifact | ||
@IntegrationTest | ||
@Packaging(PackagingType.EAR) | ||
public class SingletonStartupTest extends AbstractWeldTest | ||
{ | ||
|
||
@Test(enabled=false) // JBAS-8107 | ||
public void testSingletonStartup() | ||
{ | ||
assert Foo.isPostConstructCalled(); | ||
} | ||
|
||
} |