openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gerdo...@apache.org
Subject svn commit: r742082 - in /incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test: component/inject/ component/inject/broken/ component/pfield/ component/pfield/broken/ unittests/ unittests/inject/ unittests/inject/broken/ uni...
Date Sun, 08 Feb 2009 12:51:52 GMT
Author: gerdogdu
Date: Sun Feb  8 12:51:52 2009
New Revision: 742082

URL: http://svn.apache.org/viewvc?rev=742082&view=rev
Log:
Adding tests for OWB-24 and OWB-52

Added:
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/InstanceInjectedComponent.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent1.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent2.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent3.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent4.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldDefinitionComponent.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldInjectedComponent.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/broken/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/broken/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/broken/InjectedInstanceBrokenComponentTest.java
  (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
  (with props)
Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/PaymentProcessorComponentTest.java

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/InstanceInjectedComponent.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/InstanceInjectedComponent.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/InstanceInjectedComponent.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/InstanceInjectedComponent.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,48 @@
+/*
+ *  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.component.inject;
+
+import java.lang.annotation.Annotation;
+
+import javax.context.RequestScoped;
+import javax.inject.Current;
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+import org.apache.webbeans.test.component.PaymentProcessorComponent;
+
+@RequestScoped
+public class InstanceInjectedComponent
+{
+    @Obtains @Current Instance<PaymentProcessorComponent> instance;
+    
+    public InstanceInjectedComponent()
+    {
+        
+    }
+    
+    public Instance<PaymentProcessorComponent> getInstance()
+    {
+        return instance;
+    }
+    
+    public PaymentProcessorComponent getPaymentComponent()
+    {
+        return instance.get(new Annotation[]{});
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/InstanceInjectedComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent1.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent1.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent1.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent1.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,26 @@
+/*
+ *  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.component.inject.broken;
+
+import javax.inject.Obtains;
+
+import org.apache.webbeans.test.component.IPayment;
+
+public class InstanceInjectedBrokenComponent1
+{
+    @Obtains IPayment payment;
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent1.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent2.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent2.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent2.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent2.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,27 @@
+/*
+ *  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.component.inject.broken;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+import org.apache.webbeans.test.component.ITypeLiteralComponent;
+
+public class InstanceInjectedBrokenComponent2
+{
+    @Obtains Instance<ITypeLiteralComponent<?>> instance;
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent2.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent3.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent3.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent3.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent3.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,26 @@
+/*
+ *  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.component.inject.broken;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+
+public class InstanceInjectedBrokenComponent3
+{
+    @Obtains Instance<?> instance;
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent3.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent4.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent4.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent4.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent4.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,26 @@
+/*
+ *  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.component.inject.broken;
+
+import javax.inject.Instance;
+import javax.inject.Obtains;
+
+@SuppressWarnings("unchecked")
+public class InstanceInjectedBrokenComponent4
+{
+    @Obtains Instance instance;
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/inject/broken/InstanceInjectedBrokenComponent4.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldDefinitionComponent.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldDefinitionComponent.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldDefinitionComponent.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldDefinitionComponent.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,47 @@
+/*
+ *  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.component.pfield;
+
+import javax.context.RequestScoped;
+import javax.inject.Current;
+import javax.inject.Initializer;
+import javax.inject.Produces;
+
+import org.apache.webbeans.test.annotation.binding.Synchronous;
+import org.apache.webbeans.test.component.PaymentProcessorComponent;
+
+@RequestScoped
+public class ProducerFieldDefinitionComponent
+{
+    @Produces @RequestScoped @Synchronous PaymentProcessorComponent paymentProcessor;
+    
+    public ProducerFieldDefinitionComponent()
+    {
+        
+    }
+    
+    @Initializer
+    public ProducerFieldDefinitionComponent(@Current PaymentProcessorComponent paymentProcessor)
+    {
+        this.paymentProcessor = paymentProcessor;
+    }
+    
+    public boolean isExist()
+    {
+        return paymentProcessor != null ? true : false;
+    }
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldDefinitionComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldInjectedComponent.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldInjectedComponent.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldInjectedComponent.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldInjectedComponent.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,39 @@
+/*
+ *  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.component.pfield;
+
+import javax.context.RequestScoped;
+
+import org.apache.webbeans.test.annotation.binding.Synchronous;
+import org.apache.webbeans.test.component.PaymentProcessorComponent;
+
+@RequestScoped
+public class ProducerFieldInjectedComponent
+{
+    private @Synchronous PaymentProcessorComponent paymentProcessor;
+    
+    public ProducerFieldInjectedComponent()
+    {
+        
+    }
+    
+    public PaymentProcessorComponent getPaymentProcessorName()
+    {
+        return this.paymentProcessor;
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/component/pfield/ProducerFieldInjectedComponent.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/PaymentProcessorComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/PaymentProcessorComponentTest.java?rev=742082&r1=742081&r2=742082&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/PaymentProcessorComponentTest.java
(original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/PaymentProcessorComponentTest.java
Sun Feb  8 12:51:52 2009
@@ -32,6 +32,7 @@
 import org.junit.Before;
 import org.junit.Test;
 
+@SuppressWarnings("unchecked")
 public class PaymentProcessorComponentTest extends TestContext
 {
     Manager container = null;

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,63 @@
+/*
+ *  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.inject;
+
+import javax.inject.Instance;
+import javax.inject.manager.Bean;
+
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.test.component.PaymentProcessorComponent;
+import org.apache.webbeans.test.component.inject.InstanceInjectedComponent;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class InjectedInstanceComponentTest extends TestContext
+{
+    public InjectedInstanceComponentTest()
+    {
+        super(InjectedInstanceComponentTest.class.getName());
+    }
+
+    @Before
+    public void init()
+    {
+        initDefaultDeploymentTypes();
+    }
+    
+    @Test
+    public void testInstanceInjectedComponent()
+    {
+        ContextFactory.initRequestContext(null);
+        Bean<PaymentProcessorComponent> bean =  defineSimpleWebBean(PaymentProcessorComponent.class);
+        
+        getManager().getInstance(bean);
+        
+        Bean<InstanceInjectedComponent> injectedBean = defineSimpleWebBean(InstanceInjectedComponent.class);
+        InstanceInjectedComponent instance = getManager().getInstance(injectedBean);
+        
+        Assert.assertNotNull(instance);
+        Assert.assertNotNull(instance.getInstance());
+        Assert.assertNotNull(instance.getPaymentComponent());
+        
+        Instance<PaymentProcessorComponent> ins = instance.getInstance();
+        
+        System.out.println(ins.toString());
+        
+    }
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/InjectedInstanceComponentTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/broken/InjectedInstanceBrokenComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/broken/InjectedInstanceBrokenComponentTest.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/broken/InjectedInstanceBrokenComponentTest.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/broken/InjectedInstanceBrokenComponentTest.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,114 @@
+/*
+ *  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.inject.broken;
+
+import org.apache.webbeans.test.component.inject.broken.InstanceInjectedBrokenComponent1;
+import org.apache.webbeans.test.component.inject.broken.InstanceInjectedBrokenComponent2;
+import org.apache.webbeans.test.component.inject.broken.InstanceInjectedBrokenComponent3;
+import org.apache.webbeans.test.component.inject.broken.InstanceInjectedBrokenComponent4;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class InjectedInstanceBrokenComponentTest extends TestContext
+{
+    public InjectedInstanceBrokenComponentTest()
+    {
+        super(InjectedInstanceBrokenComponentTest.class.getName());
+    }
+
+    @Before
+    public void init()
+    {
+        initDefaultDeploymentTypes();        
+    }
+    
+    @Test
+    public void testInjectedInstanceBrokenComponent1()
+    {
+        Exception e = null;
+        
+        try
+        {
+            defineSimpleWebBean(InstanceInjectedBrokenComponent1.class);
+            
+        }catch(Exception e1)
+        {
+            e = e1;
+            System.out.println(e.getMessage());
+        }
+        
+        Assert.assertNotNull(e);
+    }
+    
+    @Test
+    public void testInjectedInstanceBrokenComponent2()
+    {
+        Exception e = null;
+        
+        try
+        {
+            defineSimpleWebBean(InstanceInjectedBrokenComponent2.class);
+            
+        }catch(Exception e1)
+        {
+            e = e1;
+            System.out.println(e.getMessage());
+        }
+        
+        Assert.assertNotNull(e);
+    }
+
+    @Test
+    public void testInjectedInstanceBrokenComponent3()
+    {
+        Exception e = null;
+        
+        try
+        {
+            defineSimpleWebBean(InstanceInjectedBrokenComponent3.class);
+            
+        }catch(Exception e1)
+        {
+            e = e1;
+            System.out.println(e.getMessage());
+        }
+        
+        Assert.assertNotNull(e);
+    }
+
+    @Test
+    public void testInjectedInstanceBrokenComponent4()
+    {
+        Exception e = null;
+        
+        try
+        {
+            defineSimpleWebBean(InstanceInjectedBrokenComponent4.class);
+            
+        }
+        catch(Exception e1)
+        {
+            e = e1;
+            System.out.println(e.getMessage());
+        }
+        
+        Assert.assertNotNull(e);
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/inject/broken/InjectedInstanceBrokenComponentTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java?rev=742082&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
(added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
Sun Feb  8 12:51:52 2009
@@ -0,0 +1,76 @@
+/*
+ *  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.pfield;
+
+import javax.inject.manager.Bean;
+
+import org.apache.webbeans.context.ContextFactory;
+import org.apache.webbeans.test.component.CheckWithCheckPayment;
+import org.apache.webbeans.test.component.CheckWithMoneyPayment;
+import org.apache.webbeans.test.component.PaymentProcessorComponent;
+import org.apache.webbeans.test.component.pfield.ProducerFieldDefinitionComponent;
+import org.apache.webbeans.test.component.pfield.ProducerFieldInjectedComponent;
+import org.apache.webbeans.test.servlet.TestContext;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ProducerFieldComponentTest extends TestContext
+{
+    public ProducerFieldComponentTest()
+    {
+        super(ProducerFieldComponentTest.class.getName());
+    }
+    
+    @Before
+    public void init()
+    {
+        initDefaultDeploymentTypes();
+    }
+    
+    
+    @Test
+    public void testInjectedProducerField()
+    {
+        ContextFactory.initRequestContext(null);
+        
+        defineSimpleWebBean(CheckWithCheckPayment.class);
+        defineSimpleWebBean(CheckWithMoneyPayment.class);
+        
+        Bean<PaymentProcessorComponent> pc = defineSimpleWebBean(PaymentProcessorComponent.class);
+        Object obj = getManager().getInstance(pc);
+        
+        Assert.assertTrue(obj instanceof PaymentProcessorComponent);
+        
+        Bean<ProducerFieldDefinitionComponent> beanDefine = defineSimpleWebBean(ProducerFieldDefinitionComponent.class);
+        Bean<ProducerFieldInjectedComponent> beanInjected = defineSimpleWebBean(ProducerFieldInjectedComponent.class);
+        
+        ProducerFieldDefinitionComponent defineComponentInstance = getManager().getInstance(beanDefine);
+        
+        Assert.assertNotNull(defineComponentInstance);
+        Assert.assertTrue(defineComponentInstance.isExist());
+        
+        ProducerFieldInjectedComponent injectedComponentInstance = getManager().getInstance(beanInjected);
+        
+        Assert.assertNotNull(injectedComponentInstance);
+        
+        Assert.assertNotNull(injectedComponentInstance.getPaymentProcessorName());
+        
+        
+    }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/pfield/ProducerFieldComponentTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message