You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwebbeans.apache.org by ge...@apache.org on 2008/11/22 19:09:48 UTC
svn commit: r719890 [14/14] - in
/incubator/openwebbeans/trunk/webbeans-impl: ./ src/ src/main/
src/main/java/ src/main/java/META-INF/ src/main/java/org/
src/main/java/org/apache/ src/main/java/org/apache/webbeans/
src/main/java/org/apache/webbeans/ann...
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,585 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.exception;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.manager.Bean;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.AbstractComponent;
+import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.apache.webbeans.test.component.exception.AroundInvokeWithFinalMethodComponent;
+import org.apache.webbeans.test.component.exception.AroundInvokeWithSameMethodNameComponent;
+import org.apache.webbeans.test.component.exception.AroundInvokeWithStaticMethodComponent;
+import org.apache.webbeans.test.component.exception.AroundInvokeWithWrongReturnTypeComponent;
+import org.apache.webbeans.test.component.exception.AroundInvokeWithoutExceptionComponent;
+import org.apache.webbeans.test.component.exception.AroundInvokeWithoutParameterComponent;
+import org.apache.webbeans.test.component.exception.AroundInvokeWithoutReturnTypeComponent;
+import org.apache.webbeans.test.component.exception.ComponentTypeExceptionComponent;
+import org.apache.webbeans.test.component.exception.FinalComponent;
+import org.apache.webbeans.test.component.exception.HasFinalMethodComponent;
+import org.apache.webbeans.test.component.exception.MoreThanOneAroundInvokeComponent;
+import org.apache.webbeans.test.component.exception.MoreThanOneConstructureComponent;
+import org.apache.webbeans.test.component.exception.MoreThanOneConstructureComponent2;
+import org.apache.webbeans.test.component.exception.MoreThanOnePostConstructComponent;
+import org.apache.webbeans.test.component.exception.MultipleDisposalMethodComponent;
+import org.apache.webbeans.test.component.exception.NewComponentBindingComponent;
+import org.apache.webbeans.test.component.exception.NewComponentInterfaceComponent;
+import org.apache.webbeans.test.component.exception.NewMethodComponentBindingComponent;
+import org.apache.webbeans.test.component.exception.NoConstructureComponent;
+import org.apache.webbeans.test.component.exception.PostContructMethodHasCheckedExceptionComponent;
+import org.apache.webbeans.test.component.exception.PostContructMethodHasParameterComponent;
+import org.apache.webbeans.test.component.exception.PostContructMethodHasReturnTypeComponent;
+import org.apache.webbeans.test.component.exception.PostContructMethodHasStaticComponent;
+import org.apache.webbeans.test.component.exception.ProducerTypeExceptionComponent;
+import org.apache.webbeans.test.component.exception.ProducerTypeStaticComponent;
+import org.apache.webbeans.test.component.exception.InnerComponent.InnerInnerComponent;
+import org.apache.webbeans.test.component.intercept.NoArgConstructorInterceptorComponent;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.apache.webbeans.util.WebBeansUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class ExceptionComponentTest extends TestContext
+{
+
+ public ExceptionComponentTest()
+ {
+ super(ExceptionComponentTest.class.getName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+
+ }
+
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @Test
+ public void testComponentTypeException()
+ {
+ WebBeansConfigurationException exc = null;
+
+ try
+ {
+ defineSimpleWebBean(ComponentTypeExceptionComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNotNull(exc);
+ }
+
+ @Test
+ public void testProducerMethodComponentTypeException()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(ProducerTypeExceptionComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+
+ }
+
+ @Test
+ public void testFinal()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(FinalComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testAbstract()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(AbstractComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testInner()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(InnerInnerComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testHasFinalMethod()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(HasFinalMethodComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void constructorTest()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(MoreThanOneConstructureComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+ exc = null;
+
+ try
+ {
+ defineSimpleWebBean(MoreThanOneConstructureComponent2.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+ Assert.assertNotNull(exc);
+ exc = null;
+
+ try
+ {
+ defineSimpleWebBean(NoConstructureComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+ Assert.assertNull(exc);
+ }
+
+
+ @Test
+ public void testStaticProducerMethod()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(ProducerTypeStaticComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testDisposeMethod()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(MultipleDisposalMethodComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+
+ @Test
+ public void testNewInterface()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(NewComponentInterfaceComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+ @Test
+ public void testNewBinding()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(NewComponentBindingComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testNewMethod()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(NewMethodComponentBindingComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testMoreThanOnePostConstruct()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(MoreThanOnePostConstructComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testPostConstructHasParameter()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(PostContructMethodHasParameterComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testPostConstructHasReturnType()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(PostContructMethodHasReturnTypeComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testPostConstructHasCheckedException()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(PostContructMethodHasCheckedExceptionComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testPostConstructHasStatic()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(PostContructMethodHasStaticComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testMoreThanOneAroundInvoke()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(MoreThanOneAroundInvokeComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testAroundInvokeWithSameMethodName()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(AroundInvokeWithSameMethodNameComponent.class);
+ Bean<?> comp =getComponents().get(0);
+
+ Assert.assertEquals(0, ((AbstractComponent<?>)comp).getInterceptorStack().size());
+
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNull(exc);
+
+ }
+
+ @Test
+ public void testAroundInvokeWithoutParameter()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(AroundInvokeWithoutParameterComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testAroundInvokeWithoutReturnType()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(AroundInvokeWithoutReturnTypeComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testAroundInvokeWithWrongReturnType()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(AroundInvokeWithWrongReturnTypeComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testAroundInvokeWithoutException()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(AroundInvokeWithoutExceptionComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testAroundInvokeWithStatic()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(AroundInvokeWithStaticMethodComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testAroundInvokeWithFinal()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(AroundInvokeWithFinalMethodComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+ @Test
+ public void testNoArgConstructorInterceptor()
+ {
+ WebBeansConfigurationException exc = null;
+ try
+ {
+ defineSimpleWebBean(NoArgConstructorInterceptorComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+ }
+
+ Assert.assertNotNull(exc);
+
+ }
+
+
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ExceptionComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ScopeTypeExceptionComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ScopeTypeExceptionComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ScopeTypeExceptionComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ScopeTypeExceptionComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,249 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.exception;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.Dependent;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.SessionScoped;
+import javax.webbeans.manager.Bean;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.container.ManagerImpl;
+import org.apache.webbeans.deployment.StereoTypeManager;
+import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.apache.webbeans.test.component.exception.stero.ComponentDefaultScopeWithDifferentScopeSteros;
+import org.apache.webbeans.test.component.exception.stero.ComponentDefaultScopeWithNonScopeStero;
+import org.apache.webbeans.test.component.exception.stero.ComponentNonDefaultScopeWithDifferentScopeSteros;
+import org.apache.webbeans.test.component.exception.stero.ComponentWithDefaultScopeStero;
+import org.apache.webbeans.test.component.exception.stero.ComponentWithDifferentScopeSteros;
+import org.apache.webbeans.test.component.exception.stero.ComponentWithNonScopeStero;
+import org.apache.webbeans.test.component.exception.stero.ComponentWithSameScopeSteros;
+import org.apache.webbeans.test.component.exception.stero.ComponentWithoutScopeStero;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.apache.webbeans.test.sterotype.StereoWithNonScope;
+import org.apache.webbeans.test.sterotype.StereoWithRequestScope;
+import org.apache.webbeans.test.sterotype.StereoWithSessionScope;
+import org.apache.webbeans.test.sterotype.StereoWithSessionScope2;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+public class ScopeTypeExceptionComponentTest extends TestContext
+{
+
+ public ScopeTypeExceptionComponentTest()
+ {
+ super(ScopeTypeExceptionComponentTest.class.getName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+ }
+
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @Test
+ public void testComponentWithNonScopeStero()
+ {
+ WebBeansConfigurationException exc = null;
+ clear();
+ try
+ {
+ defineSimpleWebBean(ComponentWithNonScopeStero.class);
+ Bean<?> bean = getComponents().get(0);
+
+ Assert.assertEquals(Dependent.class, bean.getScopeType());
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNull(exc);
+ }
+
+ @Test
+ public void testComponentDefaultScopeWithNonScopeStero()
+ {
+ WebBeansConfigurationException exc = null;
+ clear();
+ try
+ {
+ defineSimpleWebBean(ComponentDefaultScopeWithNonScopeStero.class);
+ Bean<?> bean = getComponents().get(0);
+
+ Assert.assertEquals(SessionScoped.class, bean.getScopeType());
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNull(exc);
+ }
+
+ @Test
+ public void testComponentWithDefaultScopeStero()
+ {
+ WebBeansConfigurationException exc = null;
+ clear();
+ try
+ {
+ defineSimpleWebBean(ComponentWithDefaultScopeStero.class);
+ Bean<?> bean = getComponents().get(0);
+
+ Assert.assertEquals(RequestScoped.class, bean.getScopeType());
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNull(exc);
+ }
+
+
+ @Test
+ public void testComponentWithDifferentScopeSteros()
+ {
+ WebBeansConfigurationException exc = null;
+ clear();
+ try
+ {
+ defineSimpleWebBean(ComponentWithDifferentScopeSteros.class);
+
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNotNull(exc);
+ }
+
+ @Test
+ public void testComponentWithoutScopeStero()
+ {
+ WebBeansConfigurationException exc = null;
+ clear();
+ try
+ {
+ defineSimpleWebBean(ComponentWithoutScopeStero.class);
+ Bean<?> bean = getComponents().get(0);
+
+ Assert.assertEquals(Dependent.class, bean.getScopeType());
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNull(exc);
+ }
+
+
+ @Test
+ public void testComponentWithSameScopeSteros()
+ {
+ WebBeansConfigurationException exc = null;
+ clear();
+ try
+ {
+ defineSimpleWebBean(ComponentWithSameScopeSteros.class);
+ Bean<?> bean = getComponents().get(0);
+
+ Assert.assertEquals(SessionScoped.class, bean.getScopeType());
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNull(exc);
+ }
+
+
+ @Test
+ public void testComponentDefaultScopeWithDifferentScopeSteros()
+ {
+ WebBeansConfigurationException exc = null;
+ clear();
+ try
+ {
+ defineSimpleWebBean(ComponentDefaultScopeWithDifferentScopeSteros.class);
+ Bean<?> bean = getComponents().get(0);
+
+ Assert.assertEquals(SessionScoped.class, bean.getScopeType());
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNull(exc);
+ }
+
+ @Test
+ public void testComponentNonDefaultScopeWithDifferentScopeSteros()
+ {
+ WebBeansConfigurationException exc = null;
+ clear();
+ try
+ {
+ defineSimpleWebBean(ComponentNonDefaultScopeWithDifferentScopeSteros.class);
+
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNotNull(exc);
+ }
+
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/exception/ScopeTypeExceptionComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,207 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.intercept;
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.RequestScoped;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.AbstractComponent;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.apache.webbeans.test.component.intercept.InterceptedComponent;
+import org.apache.webbeans.test.component.intercept.InterceptorWithSuperClassInterceptedComponent;
+import org.apache.webbeans.test.component.intercept.MultipleInterceptedComponent;
+import org.apache.webbeans.test.component.intercept.MultipleListOfInterceptedComponent;
+import org.apache.webbeans.test.component.intercept.MultipleListOfInterceptedWithExcludeClassComponent;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class EJBInterceptComponentTest extends TestContext
+{
+
+ public EJBInterceptComponentTest()
+ {
+ super(EJBInterceptComponentTest.class.getName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+ }
+
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @Test
+ public void testInterceptedComponent()
+ {
+ WebBeansConfigurationException exc = null;
+
+ try
+ {
+ defineSimpleWebBean(InterceptedComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNull(exc);
+ }
+
+ @Test
+ public void testInterceptorCalls()
+ {
+ clear();
+ defineSimpleWebBean(InterceptedComponent.class);
+
+ ContextFactory.initRequestContext(null);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ Object object = getContext(RequestScoped.class).get(comps.get(0), true);
+
+ Assert.assertTrue(object instanceof InterceptedComponent);
+
+ InterceptedComponent comp = (InterceptedComponent)object;
+ Object s = comp.hello(null);
+
+ Assert.assertEquals(new Integer(5), s);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+ @Test
+ public void testMultipleInterceptedComponent()
+ {
+ clear();
+ defineSimpleWebBean(MultipleInterceptedComponent.class);
+
+ ContextFactory.initRequestContext(null);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ Object object = getContext(RequestScoped.class).get(comps.get(0), true);
+
+ Assert.assertTrue(object instanceof MultipleInterceptedComponent);
+
+ MultipleInterceptedComponent comp = (MultipleInterceptedComponent)object;
+ Object obj = comp.intercepted();
+
+ Assert.assertTrue(obj instanceof String[]);
+
+ String[] arr = (String[])obj;
+
+ Assert.assertEquals(2, arr.length);
+ Assert.assertEquals("key", arr[0]);
+ Assert.assertEquals("key2", arr[1]);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+ @Test
+ public void testInterceptorWithSuperClassComponent()
+ {
+ clear();
+ defineSimpleWebBean(InterceptorWithSuperClassInterceptedComponent.class);
+
+ ContextFactory.initRequestContext(null);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ Object object = getContext(RequestScoped.class).get(comps.get(0), true);
+
+ Assert.assertTrue(object instanceof InterceptorWithSuperClassInterceptedComponent);
+
+ InterceptorWithSuperClassInterceptedComponent comp = (InterceptorWithSuperClassInterceptedComponent)object;
+ Object obj = comp.intercepted();
+
+ Assert.assertTrue(obj instanceof String[]);
+
+ String[] arr = (String[])obj;
+
+ Assert.assertEquals(2, arr.length);
+ Assert.assertEquals("key", arr[0]);
+ Assert.assertEquals("key0", arr[1]);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+ @Test
+ public void testMultipleListOfInterceptedComponent()
+ {
+ clear();
+ defineSimpleWebBean(MultipleListOfInterceptedComponent.class);
+
+ ContextFactory.initRequestContext(null);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ Object object = getContext(RequestScoped.class).get(comps.get(0), true);
+
+ Assert.assertTrue(object instanceof MultipleListOfInterceptedComponent);
+
+ MultipleListOfInterceptedComponent comp = (MultipleListOfInterceptedComponent)object;
+ Object obj = comp.intercepted();
+
+ Assert.assertTrue(obj instanceof String);
+
+
+ Assert.assertEquals("ok", (String)obj);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+
+ @Test
+ public void testMultipleListOfInterceptedWithExcludeClassComponent()
+ {
+ clear();
+ defineSimpleWebBean(MultipleListOfInterceptedWithExcludeClassComponent.class);
+
+ ContextFactory.initRequestContext(null);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ Object object = getContext(RequestScoped.class).get(comps.get(0), true);
+
+ Assert.assertTrue(object instanceof MultipleListOfInterceptedWithExcludeClassComponent);
+
+ MultipleListOfInterceptedWithExcludeClassComponent comp = (MultipleListOfInterceptedWithExcludeClassComponent)object;
+ Object obj = comp.intercepted();
+
+ Assert.assertTrue(obj instanceof String);
+
+
+ Assert.assertEquals("value2", (String)obj);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,75 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.intercept;
+
+import javax.servlet.ServletContext;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.apache.webbeans.test.component.intercept.MultpleInterceptor;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class EJBInterceptorExceptionComponentTest extends TestContext
+{
+
+ public EJBInterceptorExceptionComponentTest()
+ {
+ super(EJBInterceptorExceptionComponentTest.class.getName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+ }
+
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @Test
+ public void testComponentTypeException()
+ {
+ WebBeansConfigurationException exc = null;
+
+ try
+ {
+ defineSimpleWebBean(MultpleInterceptor.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNotNull(exc);
+ }
+
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/EJBInterceptorExceptionComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.intercept;
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.manager.Manager;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.AbstractComponent;
+import org.apache.webbeans.component.ComponentImpl;
+import org.apache.webbeans.container.ManagerImpl;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.intercept.InterceptorData;
+import org.apache.webbeans.test.component.CheckWithCheckPayment;
+import org.apache.webbeans.test.component.PostConstructDoubleInterceptorComponent;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class PostConstructDoubleInterceptorComponentTest extends TestContext
+{
+
+ public PostConstructDoubleInterceptorComponentTest()
+ {
+ super(PostConstructDoubleInterceptorComponentTest.class.getSimpleName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+ }
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testTypedComponent() throws Throwable
+ {
+ clear();
+
+ defineSimpleWebBean(CheckWithCheckPayment.class);
+ defineSimpleWebBean(PostConstructDoubleInterceptorComponent.class);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ ContextFactory.initRequestContext(null);
+
+ Assert.assertEquals(2, comps.size());
+
+ Object object = ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(0), true);
+ Object object2 = ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(1), true);
+
+ Assert.assertTrue(object instanceof CheckWithCheckPayment);
+ Assert.assertTrue(object2 instanceof PostConstructDoubleInterceptorComponent);
+
+ PostConstructDoubleInterceptorComponent pcc = (PostConstructDoubleInterceptorComponent)object2;
+
+ ComponentImpl<PostConstructDoubleInterceptorComponent> s = (ComponentImpl<PostConstructDoubleInterceptorComponent>) comps.get(1);
+ List<InterceptorData> stack = s.getInterceptorStack();
+
+ Assert.assertEquals(5, stack.size());
+
+
+ Assert.assertNotNull(pcc.getP());
+ Assert.assertEquals(object, pcc.getP());
+
+ Assert.assertNotNull(PostConstructDoubleInterceptorComponent.setininterceptor2);
+ Assert.assertEquals("value1", PostConstructDoubleInterceptorComponent.setininterceptor2);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructDoubleInterceptorComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,96 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.intercept;
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.manager.Manager;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.AbstractComponent;
+import org.apache.webbeans.component.ComponentImpl;
+import org.apache.webbeans.container.ManagerImpl;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.intercept.InterceptorData;
+import org.apache.webbeans.test.component.CheckWithCheckPayment;
+import org.apache.webbeans.test.component.PostConstructInterceptorComponent;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class PostConstructInterceptorComponentTest extends TestContext
+{
+ public PostConstructInterceptorComponentTest()
+ {
+ super(PostConstructInterceptorComponentTest.class.getSimpleName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+ }
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @SuppressWarnings("unchecked")
+ @Test
+ public void testTypedComponent() throws Throwable
+ {
+ clear();
+
+ defineSimpleWebBean(CheckWithCheckPayment.class);
+ defineSimpleWebBean(PostConstructInterceptorComponent.class);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ ContextFactory.initRequestContext(null);
+
+ Assert.assertEquals(2, comps.size());
+
+ Object object = ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(0), true);
+ Object object2 = ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(1), true);
+
+ Assert.assertTrue(object instanceof CheckWithCheckPayment);
+ Assert.assertTrue(object2 instanceof PostConstructInterceptorComponent);
+
+ PostConstructInterceptorComponent pcc = (PostConstructInterceptorComponent)object2;
+
+ ComponentImpl<PostConstructInterceptorComponent> s = (ComponentImpl<PostConstructInterceptorComponent>) comps.get(1);
+ List<InterceptorData> stack = s.getInterceptorStack();
+
+ Assert.assertEquals(2, stack.size());
+
+
+ Assert.assertNotNull(pcc.getP());
+ Assert.assertEquals(object, pcc.getP());
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/PostConstructInterceptorComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,136 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.intercept.webbeans;
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.RequestScoped;
+
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.AbstractComponent;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.exception.WebBeansConfigurationException;
+import org.apache.webbeans.test.component.intercept.webbeans.WInterceptorComponent;
+import org.apache.webbeans.test.component.intercept.webbeans.WMetaInterceptorComponent;
+import org.apache.webbeans.test.component.intercept.webbeans.WebBeansInterceptor;
+import org.apache.webbeans.test.component.intercept.webbeans.WebBeanswithMetaInterceptor;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class WebBeansInterceptComponentTest extends TestContext
+{
+ boolean init = false;
+
+ public WebBeansInterceptComponentTest()
+ {
+ super(WebBeansInterceptComponentTest.class.getName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+ }
+
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @Test
+ public void testInterceptedComponent()
+ {
+ WebBeansConfigurationException exc = null;
+
+ try
+ {
+ defineSimpleWebBeanInterceptor(WebBeansInterceptor.class);
+ defineSimpleWebBean(WInterceptorComponent.class);
+
+ }catch(WebBeansConfigurationException e)
+ {
+ System.out.println(e.getMessage());
+ exc = e;
+
+ }
+
+ Assert.assertNull(exc);
+ }
+
+ @Test
+ public void testInterceptorCalls()
+ {
+ getComponents().clear();
+
+ defineSimpleWebBeanInterceptor(WebBeansInterceptor.class);
+ defineSimpleWebBean(WInterceptorComponent.class);
+
+ ContextFactory.initRequestContext(null);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ Object object = getContext(RequestScoped.class).get(comps.get(0), true);
+
+ Assert.assertTrue(object instanceof WInterceptorComponent);
+
+ WInterceptorComponent comp = (WInterceptorComponent)object;
+ int s = comp.hello();
+
+ Assert.assertEquals(5, s);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+ @Test
+ public void testMetaInterceptorCalls()
+ {
+ getComponents().clear();
+
+ defineSimpleWebBeanInterceptor(WebBeansInterceptor.class);
+ defineSimpleWebBeanInterceptor(WebBeanswithMetaInterceptor.class);
+ defineSimpleWebBean(WMetaInterceptorComponent.class);
+
+ ContextFactory.initRequestContext(null);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ Object object =getContext(RequestScoped.class).get(comps.get(0), true);
+
+ Assert.assertTrue(object instanceof WMetaInterceptorComponent);
+
+ WMetaInterceptorComponent comp = (WMetaInterceptorComponent)object;
+ int s = comp.hello();
+
+ Assert.assertEquals(5, s);
+
+ s = comp.hello2();
+
+ Assert.assertEquals(10, s);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/intercept/webbeans/WebBeansInterceptComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.library;
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.manager.Manager;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.annotation.RequestedScopeLiteral;
+import org.apache.webbeans.component.AbstractComponent;
+import org.apache.webbeans.container.ManagerImpl;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.test.component.InjectedTypeLiteralComponent;
+import org.apache.webbeans.test.component.TypeLiteralComponent;
+import org.apache.webbeans.test.component.library.BookShop;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class LibraryComponentTest extends TestContext
+{
+ public LibraryComponentTest()
+ {
+ super(LibraryComponentTest.class.getSimpleName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+ }
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @Test
+ public void testTypedComponent() throws Throwable
+ {
+ clear();
+
+ defineSimpleWebBean(BookShop.class);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ ContextFactory.initRequestContext(null);
+
+ Assert.assertEquals(1, comps.size());
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/library/LibraryComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,106 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.newcomp;
+
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.RequestScoped;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.AbstractComponent;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.test.component.CheckWithCheckPayment;
+import org.apache.webbeans.test.component.IPayment;
+import org.apache.webbeans.test.component.dependent.DependentComponent;
+import org.apache.webbeans.test.component.dependent.DependentOwnerComponent;
+import org.apache.webbeans.test.component.newcomp.NewComponent;
+import org.apache.webbeans.test.component.newcomp.ProducerNewComponent;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class NewComponentTest extends TestContext
+{
+ public NewComponentTest()
+ {
+ super(NewComponentTest.class.getName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+
+ }
+
+ public void startTests(ServletContext ctx)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Test
+ public void testDependent()
+ {
+ clear();
+
+ defineSimpleWebBean(DependentComponent.class);
+ defineSimpleWebBean(DependentOwnerComponent.class);
+ defineSimpleWebBean(NewComponent.class);
+
+ ContextFactory.initRequestContext(null);
+
+ List<AbstractComponent<?>> comps = getComponents();
+
+ Assert.assertEquals(3,comps.size());
+
+ NewComponent comp = (NewComponent)getContext(RequestScoped.class).get(comps.get(2), true);
+
+ DependentOwnerComponent own = comp.owner();
+
+ Assert.assertNotNull(own);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+ @Test
+ public void testDepedent2()
+ {
+ clear();
+ defineSimpleWebBean(CheckWithCheckPayment.class);
+ defineSimpleWebBean(ProducerNewComponent.class);
+
+ ContextFactory.initRequestContext(null);
+ Assert.assertEquals(3,getDeployedComponents());
+
+ IPayment payment = (IPayment) getManager().getInstanceByName("paymentProducer");
+ Assert.assertNotNull(payment);
+
+ IPayment payment2 = (IPayment) getManager().getInstanceByName("paymentProducer");
+
+ Assert.assertNotSame(payment, payment2);
+ }
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/newcomp/NewComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/resolution/ManagerResolutionTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/resolution/ManagerResolutionTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/resolution/ManagerResolutionTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/resolution/ManagerResolutionTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,58 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.resolution;
+
+import javax.webbeans.manager.Manager;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.ManagerComponentImpl;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.apache.webbeans.util.WebBeansUtil;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ManagerResolutionTest extends TestContext
+{
+ public ManagerResolutionTest()
+ {
+ super(ManagerResolutionTest.class.getName());
+ }
+
+ @Before
+ public void beforeTest()
+ {
+ super.init();
+ getManager().addBean(WebBeansUtil.getManagerComponent());
+ }
+
+ @Test
+ public void testManagerResolution()
+ {
+ ManagerComponentImpl component = WebBeansUtil.getManagerComponent();
+ Manager manager = getManager().getInstance(component);
+
+ Assert.assertNotNull(manager);
+ }
+
+ @Test
+ public void test2()
+ {
+
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/resolution/ManagerResolutionTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypedLiteralComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypedLiteralComponentTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypedLiteralComponentTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypedLiteralComponentTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,117 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.typedliteral;
+
+import java.lang.annotation.Annotation;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.AnnotationLiteral;
+import javax.webbeans.Current;
+import javax.webbeans.RequestScoped;
+import javax.webbeans.TypeLiteral;
+import javax.webbeans.manager.Bean;
+import javax.webbeans.manager.Manager;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.component.AbstractComponent;
+import org.apache.webbeans.container.ManagerImpl;
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.test.component.ITypeLiteralComponent;
+import org.apache.webbeans.test.component.InjectedTypeLiteralComponent;
+import org.apache.webbeans.test.component.TypeLiteralComponent;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class TypedLiteralComponentTest extends TestContext
+{
+ public TypedLiteralComponentTest()
+ {
+ super(TypedLiteralComponentTest.class.getSimpleName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ super.init();
+ }
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @Test
+ public void testTypedComponent() throws Throwable
+ {
+ clear();
+
+ defineSimpleWebBean(TypeLiteralComponent.class);
+ defineSimpleWebBean(InjectedTypeLiteralComponent.class);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ ContextFactory.initRequestContext(null);
+
+ Assert.assertEquals(2, comps.size());
+
+ TypeLiteralComponent userComponent = (TypeLiteralComponent) ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(0), true);
+ InjectedTypeLiteralComponent tc = (InjectedTypeLiteralComponent) ManagerImpl.getManager().getContext(RequestScoped.class).get(comps.get(1), true);
+
+ Assert.assertNotNull(tc.getComponent());
+ Assert.assertNotNull(userComponent);
+
+ Assert.assertTrue(tc.getComponent() instanceof TypeLiteralComponent);
+
+ Assert.assertEquals("GURKAN", TypeLiteralComponent.STR);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+ @Test
+ public void testTypedLiteralComponent() throws Throwable
+ {
+ clear();
+
+ defineSimpleWebBean(TypeLiteralComponent.class);
+ List<AbstractComponent<?>> comps = getComponents();
+
+ ContextFactory.initRequestContext(null);
+
+ Assert.assertEquals(1, comps.size());
+
+ TypeLiteral<ITypeLiteralComponent<List<String>>> tl = new TypeLiteral<ITypeLiteralComponent<List<String>>>(){};
+
+ Annotation[] anns = new Annotation[1];
+ anns[0] = new AnnotationLiteral<Current>(){
+
+ };
+
+ Bean<ITypeLiteralComponent<List<String>>> s = ManagerImpl.getManager().resolveByType(tl, anns).iterator().next();
+ Assert.assertNotNull(s);
+
+ ContextFactory.destroyRequestContext(null);
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/typedliteral/TypedLiteralComponentTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLFieldTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLFieldTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLFieldTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLFieldTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,78 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.xml;
+
+import java.io.InputStream;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.manager.Manager;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.container.ManagerImpl;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.apache.webbeans.xml.WebBeansXMLConfigurator;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class XMLFieldTest extends TestContext
+{
+ Manager container = null;
+
+ public XMLFieldTest()
+ {
+ super(XMLFieldTest.class.getSimpleName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ this.container = ManagerImpl.getManager();
+ }
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+
+ @Test
+ public void nameSpacesNotDeclared()
+ {
+ Throwable e = null;
+ try
+ {
+ InputStream stream = XMLFieldTest.class.getClassLoader().getResourceAsStream("org/apache/webbeans/test/xml/fieldTest.xml");
+ Assert.assertNotNull(stream);
+
+ WebBeansXMLConfigurator.configure(stream,"fieldTest.xml");
+
+ }catch(Throwable e1)
+ {
+ e = e1;
+ }
+
+ Assert.assertNull(e);
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLFieldTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,100 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.unittests.xml;
+
+import java.io.InputStream;
+
+import javax.servlet.ServletContext;
+import javax.webbeans.manager.Manager;
+
+import junit.framework.Assert;
+
+import org.apache.webbeans.container.ManagerImpl;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.apache.webbeans.xml.XMLUtil;
+import org.dom4j.Element;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class XMLTest extends TestContext
+{
+ Manager container = null;
+
+ public XMLTest()
+ {
+ super(XMLTest.class.getSimpleName());
+ }
+
+ public void endTests(ServletContext ctx)
+ {
+
+ }
+
+ @Before
+ public void init()
+ {
+ this.container = ManagerImpl.getManager();
+ }
+
+ public void startTests(ServletContext ctx)
+ {
+
+ }
+
+ @Test
+ public void nameSpacesIsDefined()
+ {
+ Throwable e = null;
+ try
+ {
+ InputStream stream = XMLTest.class.getClassLoader().getResourceAsStream("org/apache/webbeans/test/xml/web-beans2.xml");
+ Assert.assertNotNull(stream);
+
+ Element root = XMLUtil.getRootElement(stream);
+
+ Assert.assertNotNull(root);
+
+ }catch(Throwable e1)
+ {
+ e1.printStackTrace();
+ e = e1;
+ }
+
+ Assert.assertNull(e);
+ }
+
+ @Test
+ public void nameSpacesNotDeclared()
+ {
+ Throwable e = null;
+ try
+ {
+ InputStream stream = XMLTest.class.getClassLoader().getResourceAsStream("org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml");
+ Assert.assertNotNull(stream);
+
+ XMLUtil.getRootElement(stream);
+
+ }catch(Throwable e1)
+ {
+ e = e1;
+ }
+
+ Assert.assertNotNull(e);
+ }
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/XMLTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/Component1.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/Component1.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/Component1.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/Component1.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.xml;
+
+public class Component1
+{
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/Component1.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/ComponentForField.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/ComponentForField.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/ComponentForField.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/ComponentForField.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,302 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.xml;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+public class ComponentForField
+{
+ private int intField;
+
+ private float floatField;
+
+ private double doubleField;
+
+ private char charField;
+
+ private long longField;
+
+ private byte byteField;
+
+ private short shortField;
+
+ private boolean booleanField;
+
+ private XEnum enum1Field;
+
+ private String strField;
+
+ private Date dateField;
+
+ private Calendar calendarField;
+
+ private Class<?> clazzField;
+
+ private List<String> listStrField;
+
+ private List<XEnum> listEnumField;
+
+ public ComponentForField()
+ {
+
+ }
+
+ /**
+ * @return the intField
+ */
+ public int getIntField()
+ {
+ return intField;
+ }
+
+ /**
+ * @param intField the intField to set
+ */
+ public void setIntField(int intField)
+ {
+ this.intField = intField;
+ }
+
+ /**
+ * @return the floatField
+ */
+ public float getFloatField()
+ {
+ return floatField;
+ }
+
+ /**
+ * @param floatField the floatField to set
+ */
+ public void setFloatField(float floatField)
+ {
+ this.floatField = floatField;
+ }
+
+ /**
+ * @return the doubleField
+ */
+ public double getDoubleField()
+ {
+ return doubleField;
+ }
+
+ /**
+ * @param doubleField the doubleField to set
+ */
+ public void setDoubleField(double doubleField)
+ {
+ this.doubleField = doubleField;
+ }
+
+ /**
+ * @return the charField
+ */
+ public char getCharField()
+ {
+ return charField;
+ }
+
+ /**
+ * @param charField the charField to set
+ */
+ public void setCharField(char charField)
+ {
+ this.charField = charField;
+ }
+
+ /**
+ * @return the longField
+ */
+ public long getLongField()
+ {
+ return longField;
+ }
+
+ /**
+ * @param longField the longField to set
+ */
+ public void setLongField(long longField)
+ {
+ this.longField = longField;
+ }
+
+ /**
+ * @return the byteField
+ */
+ public byte getByteField()
+ {
+ return byteField;
+ }
+
+ /**
+ * @param byteField the byteField to set
+ */
+ public void setByteField(byte byteField)
+ {
+ this.byteField = byteField;
+ }
+
+ /**
+ * @return the shortField
+ */
+ public short getShortField()
+ {
+ return shortField;
+ }
+
+ /**
+ * @param shortField the shortField to set
+ */
+ public void setShortField(short shortField)
+ {
+ this.shortField = shortField;
+ }
+
+ /**
+ * @return the booleanField
+ */
+ public boolean isBooleanField()
+ {
+ return booleanField;
+ }
+
+ /**
+ * @param booleanField the booleanField to set
+ */
+ public void setBooleanField(boolean booleanField)
+ {
+ this.booleanField = booleanField;
+ }
+
+ /**
+ * @return the enum1
+ */
+ public XEnum getEnum1()
+ {
+ return enum1Field;
+ }
+
+ /**
+ * @param enum1 the enum1 to set
+ */
+ public void setEnum1(XEnum enum1)
+ {
+ this.enum1Field = enum1;
+ }
+
+ /**
+ * @return the strField
+ */
+ public String getStrField()
+ {
+ return strField;
+ }
+
+ /**
+ * @param strField the strField to set
+ */
+ public void setStrField(String strField)
+ {
+ this.strField = strField;
+ }
+
+ /**
+ * @return the dateField
+ */
+ public Date getDateField()
+ {
+ return dateField;
+ }
+
+ /**
+ * @param dateField the dateField to set
+ */
+ public void setDateField(Date dateField)
+ {
+ this.dateField = dateField;
+ }
+
+ /**
+ * @return the calendarField
+ */
+ public Calendar getCalendarField()
+ {
+ return calendarField;
+ }
+
+ /**
+ * @param calendarField the calendarField to set
+ */
+ public void setCalendarField(Calendar calendarField)
+ {
+ this.calendarField = calendarField;
+ }
+
+ /**
+ * @return the clazzField
+ */
+ public Class<?> getClazzField()
+ {
+ return clazzField;
+ }
+
+ /**
+ * @param clazzField the clazzField to set
+ */
+ public void setClazzField(Class<?> clazzField)
+ {
+ this.clazzField = clazzField;
+ }
+
+ /**
+ * @return the listStrField
+ */
+ public List<String> getListStrField()
+ {
+ return listStrField;
+ }
+
+ /**
+ * @param listStrField the listStrField to set
+ */
+ public void setListStrField(List<String> listStrField)
+ {
+ this.listStrField = listStrField;
+ }
+
+ /**
+ * @return the listEnumField
+ */
+ public List<XEnum> getListEnumField()
+ {
+ return listEnumField;
+ }
+
+ /**
+ * @param listEnumField the listEnumField to set
+ */
+ public void setListEnumField(List<XEnum> listEnumField)
+ {
+ this.listEnumField = listEnumField;
+ }
+
+
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/ComponentForField.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/XEnum.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/XEnum.java?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/XEnum.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/XEnum.java Sat Nov 22 10:09:38 2008
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+package org.apache.webbeans.test.xml;
+
+import org.junit.Test;
+
+public enum XEnum
+{
+ ENUM1;
+
+ XEnum()
+ {
+
+ }
+
+
+}
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/XEnum.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/fieldTest.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/fieldTest.xml?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/fieldTest.xml (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/fieldTest.xml Sat Nov 22 10:09:38 2008
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebBeans xmlns="urn:java:javax.webbeans"
+ xmlns:myapp="urn:java:org.apache.webbeans.test.xml"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:java:javax.webbeans http://java.sun.com/jee/web-beans-1.0.xsd">
+
+ <myapp:ComponentForField>
+
+ <myapp:intField>35</myapp:intField>
+ <myapp:floatField>35.3f</myapp:floatField>
+ <myapp:doubleField>35.5d</myapp:doubleField>
+ <myapp:charField>a</myapp:charField>
+ <myapp:longField>35</myapp:longField>
+ <myapp:byteField>0</myapp:byteField>
+ <myapp:shortField>5</myapp:shortField>
+ <myapp:booleanField>true</myapp:booleanField>
+ <myapp:enum1Field>ENUM1</myapp:enum1Field>
+ <myapp:strField>dskfj</myapp:strField>
+ <myapp:dateField>September 30, 1998 10:45:30 PM CST</myapp:dateField>
+ <myapp:calendarField>September 30, 1998 10:45:30 PM CST</myapp:calendarField>
+ <myapp:clazzField>org.apache.webbeans.test.xml.ComponentForField</myapp:clazzField>
+ <myapp:listStrField>
+ <value>gurkan</value>
+ </myapp:listStrField>
+ <myapp:listEnumField>
+ <value>ENUM1</value>
+ </myapp:listEnumField>
+
+ </myapp:ComponentForField>
+
+</WebBeans>
\ No newline at end of file
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/fieldTest.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml Sat Nov 22 10:09:38 2008
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebBeans
+ xmlns:myapp="urn:java:org.apache.webbeans.test.xml"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:java:javax.webbeans http://java.sun.com/jee/web-beans-1.0.xsd">
+
+ <Component1>
+
+ </Component1>
+
+</WebBeans>
\ No newline at end of file
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/nameSpaceNotDeclared.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/web-beans2.xml
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/web-beans2.xml?rev=719890&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/web-beans2.xml (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/web-beans2.xml Sat Nov 22 10:09:38 2008
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<WebBeans xmlns="urn:java:javax.webbeans"
+ xmlns:myapp="urn:java:org.apache.webbeans.test.xml"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:java:javax.webbeans http://java.sun.com/jee/web-beans-1.0.xsd">
+
+ <Component1>
+
+ </Component1>
+
+</WebBeans>
\ No newline at end of file
Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/web-beans2.xml
------------------------------------------------------------------------------
svn:eol-style = native