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/12/22 00:55:16 UTC

svn commit: r728557 - in /incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test: annotation/binding/ unittests/xml/definition/ xml/definition/

Author: gerdogdu
Date: Sun Dec 21 15:55:15 2008
New Revision: 728557

URL: http://svn.apache.org/viewvc?rev=728557&view=rev
Log:
XML configuration test is added.

Added:
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Asynchronous.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Mock.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/PayBy.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Service.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Synchronous.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/MockAsynchronousCreditCardPaymentProcessor.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/PaymentProcessor.java   (with props)
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/SystemConfig.java   (with props)
Modified:
    incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/definition/XMLDefinitionTest.java

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Asynchronous.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Asynchronous.java?rev=728557&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Asynchronous.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Asynchronous.java Sun Dec 21 15:55:15 2008
@@ -0,0 +1,32 @@
+/*
+ *  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.annotation.binding;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@BindingType
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD,ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER})
+public @interface Asynchronous
+{
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Asynchronous.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Mock.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Mock.java?rev=728557&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Mock.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Mock.java Sun Dec 21 15:55:15 2008
@@ -0,0 +1,32 @@
+/*
+ *  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.annotation.binding;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@BindingType
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD,ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER})
+public @interface Mock
+{
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Mock.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/PayBy.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/PayBy.java?rev=728557&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/PayBy.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/PayBy.java Sun Dec 21 15:55:15 2008
@@ -0,0 +1,32 @@
+/*
+ *  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.annotation.binding;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@BindingType
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD,ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER})
+public @interface PayBy
+{
+	String value();
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/PayBy.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Service.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Service.java?rev=728557&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Service.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Service.java Sun Dec 21 15:55:15 2008
@@ -0,0 +1,32 @@
+/*
+ *  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.annotation.binding;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@BindingType
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD,ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER})
+public @interface Service
+{
+	boolean transactional();
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Service.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Synchronous.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Synchronous.java?rev=728557&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Synchronous.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Synchronous.java Sun Dec 21 15:55:15 2008
@@ -0,0 +1,32 @@
+/*
+ *  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.annotation.binding;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import javax.webbeans.BindingType;
+
+@BindingType
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.FIELD,ElementType.METHOD, ElementType.TYPE, ElementType.PARAMETER})
+public @interface Synchronous
+{
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/annotation/binding/Synchronous.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/definition/XMLDefinitionTest.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/definition/XMLDefinitionTest.java?rev=728557&r1=728556&r2=728557&view=diff
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/definition/XMLDefinitionTest.java (original)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/unittests/xml/definition/XMLDefinitionTest.java Sun Dec 21 15:55:15 2008
@@ -116,4 +116,32 @@
 		
 	}
 	
+	@Test
+	public void testDefinition3()
+	{
+		Throwable e = null;
+		try
+		{
+			InputStream stream = XMLTest.class.getClassLoader().getResourceAsStream("org/apache/webbeans/test/xml/definition/definition3.xml");			
+			Assert.assertNotNull(stream);
+			
+			clear();
+			
+			Element rootElement = XMLUtil.getRootElement(stream);
+			Element beanElement = (Element)rootElement.elements().get(0);
+			
+			Class<?> clazz = XMLUtil.getElementJavaType(beanElement);
+			
+			defineXMLSimpleWebBeans(clazz, beanElement);
+			
+			
+		}catch(Throwable e1)
+		{
+			e1.printStackTrace();
+			e = e1;
+		}
+		
+		Assert.assertNull(e);
+	}
+	
 }

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/MockAsynchronousCreditCardPaymentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/MockAsynchronousCreditCardPaymentProcessor.java?rev=728557&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/MockAsynchronousCreditCardPaymentProcessor.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/MockAsynchronousCreditCardPaymentProcessor.java Sun Dec 21 15:55:15 2008
@@ -0,0 +1,24 @@
+/*
+ *  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.definition;
+
+public class MockAsynchronousCreditCardPaymentProcessor
+{
+	PaymentProcessor synchronousProcessor;
+	void init(SystemConfig config) { }
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/MockAsynchronousCreditCardPaymentProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/PaymentProcessor.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/PaymentProcessor.java?rev=728557&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/PaymentProcessor.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/PaymentProcessor.java Sun Dec 21 15:55:15 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.definition;
+
+public class PaymentProcessor
+{
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/PaymentProcessor.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/SystemConfig.java
URL: http://svn.apache.org/viewvc/incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/SystemConfig.java?rev=728557&view=auto
==============================================================================
--- incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/SystemConfig.java (added)
+++ incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/SystemConfig.java Sun Dec 21 15:55:15 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.definition;
+
+public class SystemConfig
+{
+
+}

Propchange: incubator/openwebbeans/trunk/webbeans-impl/src/test/java/org/apache/webbeans/test/xml/definition/SystemConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native