[weld-commits] Weld SVN: r5251 - in java-se/trunk/src/test/java/org/jboss/weld/environment/se/test: scopes and 1 other directory.

weld-commits at lists.jboss.org weld-commits at lists.jboss.org
Wed Dec 9 07:49:07 EST 2009


Author: pete.muir at jboss.org
Date: 2009-12-09 07:49:07 -0500 (Wed, 09 Dec 2009)
New Revision: 5251

Added:
   java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java
   java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/
   java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java
   java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java
Log:
WELD-322

Added: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java	                        (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java	2009-12-09 12:49:07 UTC (rev 5251)
@@ -0,0 +1,56 @@
+/**
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat, Inc. and/or its affiliates, and individual
+ * contributors by the @authors tag. See the copyright.txt in the
+ * distribution for a full listing of individual contributors.
+ *
+ * Licensed 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.jboss.weld.environment.se.test;
+
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.environment.se.ShutdownManager;
+import org.jboss.weld.environment.se.Weld;
+import org.jboss.weld.environment.se.WeldContainer;
+import org.jboss.weld.environment.se.test.scopes.Bar;
+import org.jboss.weld.environment.se.test.scopes.Foo;
+import org.testng.annotations.Test;
+
+/**
+ * 
+ * @author Peter Royle
+ */
+public class ScopesTest
+{
+
+   /**
+    * Test that decorators work as expected in SE.
+    */
+   @Test(description="WELD-322")
+   public void testScopes()
+   {
+
+      WeldContainer weld = new Weld().initialize();
+      BeanManager manager = weld.getBeanManager();
+
+      assert manager.getBeans(Bar.class).size() == 1;
+      assert manager.getBeans(Foo.class).size() == 2;
+
+      shutdownManager(weld);
+   }
+
+   private void shutdownManager(WeldContainer weld)
+   {
+      ShutdownManager shutdownManager = weld.instance().select(ShutdownManager.class).get();
+      shutdownManager.shutdown();
+   }
+}


Property changes on: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/ScopesTest.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java	                        (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java	2009-12-09 12:49:07 UTC (rev 5251)
@@ -0,0 +1,8 @@
+package org.jboss.weld.environment.se.test.scopes;
+
+import javax.enterprise.context.Dependent;
+
+ at Dependent
+public class Bar extends Foo
+{
+}
\ No newline at end of file


Property changes on: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Bar.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native

Added: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java
===================================================================
--- java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java	                        (rev 0)
+++ java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java	2009-12-09 12:49:07 UTC (rev 5251)
@@ -0,0 +1,8 @@
+package org.jboss.weld.environment.se.test.scopes;
+
+import javax.enterprise.context.RequestScoped;
+
+ at RequestScoped
+public class Foo
+{
+}
\ No newline at end of file


Property changes on: java-se/trunk/src/test/java/org/jboss/weld/environment/se/test/scopes/Foo.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain
Name: svn:eol-style
   + native



More information about the weld-commits mailing list