Author: marius.bogoevici
Date: 2009-12-19 00:09:55 -0500 (Sat, 19 Dec 2009)
New Revision: 5361
Added:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/StringPartialDecorator.java
Removed:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/AnotherPartialDecorator.java
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/decoratedTypes/PartialDecoratorTest.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/PartialDecorator.java
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/PartialDecoratorTest.java
core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/generic/beans.xml
Log:
Enabling unit tests for WELD-333.
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/decoratedTypes/PartialDecoratorTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/decoratedTypes/PartialDecoratorTest.java 2009-12-19
04:53:36 UTC (rev 5360)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/decoratedTypes/PartialDecoratorTest.java 2009-12-19
05:09:55 UTC (rev 5361)
@@ -30,7 +30,7 @@
public class PartialDecoratorTest extends AbstractWeldTest
{
- @Test(groups = "broken")
+ @Test
public void testDecoratorDoesNotDecorateOutsideDecoratedTypes()
{
TestBean testBean = getCurrentManager().getInstanceByType(TestBean.class);
Deleted:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/AnotherPartialDecorator.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/AnotherPartialDecorator.java 2009-12-19
04:53:36 UTC (rev 5360)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/AnotherPartialDecorator.java 2009-12-19
05:09:55 UTC (rev 5361)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright <Year>, 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.tests.decorators.generic;
-
-import javax.decorator.Decorator;
-import javax.decorator.Delegate;
-import javax.inject.Inject;
-
-/**
- * @author Marius Bogoevici
- */
-@Decorator
-public class AnotherPartialDecorator implements Decorated<String>
-{
- @Inject
- @Delegate
- GenericBean<String> delegate;
-
- static boolean invoked = true;
-
- public String decoratedEcho(String parameter)
- {
- invoked = true;
- return delegate.decoratedEcho(parameter);
- }
-}
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/PartialDecorator.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/PartialDecorator.java 2009-12-19
04:53:36 UTC (rev 5360)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/PartialDecorator.java 2009-12-19
05:09:55 UTC (rev 5361)
@@ -30,9 +30,9 @@
@Inject @Delegate GenericBean<T> delegate;
- static boolean decoratedInvoked;
+ static boolean decoratedInvoked = false;
- static boolean notDecoratedInvoked;
+ static boolean notDecoratedInvoked = false;
public T decoratedEcho(T parameter)
{
Modified:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/PartialDecoratorTest.java
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/PartialDecoratorTest.java 2009-12-19
04:53:36 UTC (rev 5360)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/PartialDecoratorTest.java 2009-12-19
05:09:55 UTC (rev 5361)
@@ -30,7 +30,7 @@
public class PartialDecoratorTest extends AbstractWeldTest
{
- @Test(groups = "broken")
+ @Test
public void testDecoratorDoesNotDecorateOutsideDecoratedTypes()
{
TestBean testBean = getCurrentManager().getInstanceByType(TestBean.class);
@@ -38,7 +38,8 @@
assert PartialDecorator.decoratedInvoked;
assert !PartialDecorator.notDecoratedInvoked;
- assert AnotherPartialDecorator.invoked;
+ assert StringPartialDecorator.invoked;
+ assert !IntegerPartialDecorator.invoked;
assert GenericBean.decoratedInvoked;
assert GenericBean.notDecoratedInvoked;
}
Copied:
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/StringPartialDecorator.java
(from rev 5360,
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/AnotherPartialDecorator.java)
===================================================================
---
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/StringPartialDecorator.java
(rev 0)
+++
core/trunk/tests/src/test/java/org/jboss/weld/tests/decorators/generic/StringPartialDecorator.java 2009-12-19
05:09:55 UTC (rev 5361)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright <Year>, 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.tests.decorators.generic;
+
+import javax.decorator.Decorator;
+import javax.decorator.Delegate;
+import javax.inject.Inject;
+
+/**
+ * @author Marius Bogoevici
+ */
+@Decorator
+public class StringPartialDecorator implements Decorated<String>
+{
+ @Inject
+ @Delegate
+ GenericBean<String> delegate;
+
+ static boolean invoked = false;
+
+ public String decoratedEcho(String parameter)
+ {
+ invoked = true;
+ return delegate.decoratedEcho(parameter);
+ }
+}
Modified:
core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/generic/beans.xml
===================================================================
---
core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/generic/beans.xml 2009-12-19
04:53:36 UTC (rev 5360)
+++
core/trunk/tests/src/test/resources/org/jboss/weld/tests/decorators/generic/beans.xml 2009-12-19
05:09:55 UTC (rev 5361)
@@ -1,6 +1,6 @@
<beans>
<decorators>
<decorator>org.jboss.weld.tests.decorators.generic.PartialDecorator</decorator>
-
<decorator>org.jboss.weld.tests.decorators.generic.AnotherPartialDecorator</decorator>
+
<decorator>org.jboss.weld.tests.decorators.generic.StringPartialDecorator</decorator>
</decorators>
</beans>
\ No newline at end of file