[webbeans-commits] Webbeans SVN: r2177 - ri/trunk/impl/src/main/java/org/jboss/webbeans/xml.
by webbeans-commits@lists.jboss.org
Author: vitold
Date: 2009-03-24 06:09:28 -0400 (Tue, 24 Mar 2009)
New Revision: 2177
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/ParseXmlHelper.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
Log:
add methods and stubs for Produces tag
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/ParseXmlHelper.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/ParseXmlHelper.java 2009-03-24 08:38:34 UTC (rev 2176)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/ParseXmlHelper.java 2009-03-24 10:09:28 UTC (rev 2177)
@@ -15,28 +15,30 @@
import org.dom4j.Attribute;
import org.dom4j.Element;
import org.dom4j.Namespace;
+import org.dom4j.QName;
import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.resources.spi.ResourceLoadingException;
public class ParseXmlHelper
-{
+{
public static boolean isJavaEeNamespace(Element element)
{
return element.getNamespace().getURI().equalsIgnoreCase(XmlConstants.JAVA_EE_NAMESPACE);
}
-
+
public static <T> AnnotatedClass<? extends T> loadElementClass(Element element, Class<T> expectedType, XmlEnvironment environment, Map<String, Set<String>> packagesMap)
{
List<AnnotatedClass<? extends T>> classesList = new ArrayList<AnnotatedClass<? extends T>>();
String className = element.getName();
String prefix = element.getNamespacePrefix();
-
- for(Map.Entry<String, Set<String>> packagesEntry : packagesMap.entrySet())
+
+ for (Map.Entry<String, Set<String>> packagesEntry : packagesMap.entrySet())
{
- if(prefix.equalsIgnoreCase(packagesEntry.getKey()))
+ if (prefix.equalsIgnoreCase(packagesEntry.getKey()))
{
Set<String> packages = packagesEntry.getValue();
- for(String packageName : packages)
+ for (String packageName : packages)
{
String classPath = packageName + "." + element.getName();
try
@@ -44,68 +46,73 @@
AnnotatedClass<? extends T> classType = environment.loadClass(classPath, expectedType);
classesList.add(classType);
}
- catch(ResourceLoadingException e){}
+ catch (ResourceLoadingException e)
+ {
+ }
}
}
}
-
- if(classesList.size() == 0)
+
+ if (classesList.size() == 0)
throw new DefinitionException("Could not find '" + className + "'");
-
- if(classesList.size() == 1)
+
+ if (classesList.size() == 1)
return classesList.get(0);
-
+
throw new DefinitionException("There are multiple packages containing a Java type with the same name '" + className + "'");
}
-
+
+ public static void checkProduces(Element element, AnnotatedClass<?> beanClass)
+ {
+ }
+
public static void checkRootAttributes(Element root, Map<String, Set<String>> packagesMap)
{
Iterator<?> rootAttrIterator = root.attributeIterator();
- while(rootAttrIterator.hasNext())
+ while (rootAttrIterator.hasNext())
{
Set<String> packagesSet = new HashSet<String>();
- Attribute attribute = (Attribute)rootAttrIterator.next();
- String attrPrefix = attribute.getNamespacePrefix();
+ Attribute attribute = (Attribute) rootAttrIterator.next();
+ String attrPrefix = attribute.getNamespacePrefix();
String attrData = attribute.getStringValue();
-
+
String urn = "";
- for(String attrVal : attrData.split(" "))
+ for (String attrVal : attrData.split(" "))
{
- if(attrVal.startsWith(XmlConstants.URN_PREFIX))
+ if (attrVal.startsWith(XmlConstants.URN_PREFIX))
{
urn = attrVal;
URL namespaceFile = loadFile(urn, XmlConstants.NAMESPACE_FILE_NAME);
- if(namespaceFile == null)
+ if (namespaceFile == null)
throw new DefinitionException("Could not find '" + XmlConstants.NAMESPACE_FILE_NAME + "' file according to specified URN '" + urn + "'");
packagesSet.addAll(parseNamespaceFile(namespaceFile));
}
- if(attribute.getName().equalsIgnoreCase(XmlConstants.SCHEMA_LOCATION) &&
- attrVal.startsWith(XmlConstants.HTTP_PREFIX) && urn.trim().length() > 0)
+ if (attribute.getName().equalsIgnoreCase(XmlConstants.SCHEMA_LOCATION) && attrVal.startsWith(XmlConstants.HTTP_PREFIX) && urn.trim().length() > 0)
{
URL schemaFile = loadFile(urn, XmlConstants.SCHEMA_FILE_NAME);
- if(schemaFile == null)
+ if (schemaFile == null)
throw new DefinitionException("Could not find '" + XmlConstants.SCHEMA_FILE_NAME + "' file according to specified URN '" + urn + "'");
}
}
-
+
addElementToPackagesMap(packagesMap, attrPrefix, packagesSet);
}
}
-
+
public static void checkRootDeclaredNamespaces(Element root, Map<String, Set<String>> packagesMap)
{
Iterator<?> namespacesIterator = root.declaredNamespaces().iterator();
- while(namespacesIterator.hasNext())
+ while (namespacesIterator.hasNext())
{
- Namespace namespace = (Namespace)namespacesIterator.next();
+ Namespace namespace = (Namespace) namespacesIterator.next();
String prefix = namespace.getPrefix();
String uri = namespace.getURI();
- if(uri.startsWith(XmlConstants.URN_PREFIX))
+ if (uri.startsWith(XmlConstants.URN_PREFIX))
{
Set<String> packagesSet = new HashSet<String>();
-
+
URL namespaceFile = loadFile(uri, XmlConstants.NAMESPACE_FILE_NAME);
- if(namespaceFile != null)
+ if (namespaceFile != null)
{
packagesSet.addAll(parseNamespaceFile(namespaceFile));
}
@@ -113,23 +120,62 @@
{
String packageName = uri.replaceFirst(XmlConstants.URN_PREFIX, "");
packagesSet.add(packageName);
- }
-
+ }
+
addElementToPackagesMap(packagesMap, prefix, packagesSet);
}
}
}
+
+ public static List<Element> findElementsInEeNamespace(Element elementParent, String elementName)
+ {
+ String elementPrefix = "";
+ String elementUri = XmlConstants.JAVA_EE_NAMESPACE;
+
+ return findElements(elementParent, elementName, elementPrefix, elementUri);
+ }
+ public static List<Element> findElements(Element elementParent, String elementName, String elementPrefix, String elementUri)
+ {
+ List<Element> elements = new ArrayList<Element>();
+ Namespace elementNamespace = new Namespace(elementPrefix, elementUri);
+ QName qName = new QName(elementName, elementNamespace);
+ Iterator<?> elementIterator = elementParent.elementIterator(qName);
+ while(elementIterator.hasNext())
+ {
+ Element element = (Element)elementIterator.next();
+ elements.add(element);
+ }
+
+ return elements;
+ }
+
+ public static boolean isField(Element element, AnnotatedClass<?> beanClass, AnnotatedClass<?> expectedType)
+ {
+ //TODO
+ String fieldName = element.getParent().getName();
+ AnnotatedField<?> beanField = beanClass.getDeclaredField(fieldName, expectedType);
+ if(beanField != null)
+ return true;
+ return false;
+ }
+
+ public static boolean isMethod(Element element, AnnotatedClass<?> beanClass, AnnotatedClass<?> expectedType)
+ {
+ //TODO
+ return false;
+ }
+
private static URL loadFile(String urn, String fileName)
{
char separator = '/';
String packageName = urn.replaceFirst(XmlConstants.URN_PREFIX, "");
String path = packageName.replace('.', separator);
String filePath = separator + path + separator + fileName;
- URL namespaceFile = ParseXmlHelper.class.getResource(filePath);
+ URL namespaceFile = ParseXmlHelper.class.getResource(filePath);
return namespaceFile;
}
-
+
private static Set<String> parseNamespaceFile(URL namespaceFile)
{
Set<String> packages = new HashSet<String>();
@@ -137,12 +183,12 @@
try
{
fileScanner = new Scanner(namespaceFile.openStream());
- while (fileScanner.hasNextLine() )
+ while (fileScanner.hasNextLine())
{
String line = fileScanner.nextLine();
Scanner lineScanner = new Scanner(line);
lineScanner.useDelimiter(XmlConstants.NAMESPACE_FILE_DELIMETER);
- while(lineScanner.hasNext())
+ while (lineScanner.hasNext())
{
packages.add(lineScanner.next());
}
@@ -154,12 +200,12 @@
catch (IOException e)
{
throw new RuntimeException("Error opening " + namespaceFile.toString());
- }
+ }
}
-
+
private static void addElementToPackagesMap(Map<String, Set<String>> packagesMap, String prefix, Set<String> packagesSet)
{
- if(packagesMap.containsKey(prefix))
+ if (packagesMap.containsKey(prefix))
{
Set<String> packages = packagesMap.get(prefix);
packages.addAll(packagesSet);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java 2009-03-24 08:38:34 UTC (rev 2176)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlConstants.java 2009-03-24 10:09:28 UTC (rev 2177)
@@ -49,4 +49,6 @@
public static final String SCHEMA_FILE_NAME = "schema.xsd";
public static final String NAMESPACE_FILE_DELIMETER = " ";
+
+ public static final String PRODUCES = "Produces";
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-03-24 08:38:34 UTC (rev 2176)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xml/XmlParser.java 2009-03-24 10:09:28 UTC (rev 2177)
@@ -14,12 +14,11 @@
import javax.inject.DefinitionException;
import javax.inject.DeploymentException;
+import javax.inject.manager.Bean;
import org.dom4j.Document;
import org.dom4j.DocumentException;
import org.dom4j.Element;
-import org.dom4j.Namespace;
-import org.dom4j.QName;
import org.dom4j.io.SAXReader;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.log.Log;
@@ -61,6 +60,7 @@
for (Element beanElement : beanElements)
{
AnnotatedClass<?> beanClass = ParseXmlHelper.loadElementClass(beanElement, Object.class, environment, packagesMap);
+ checkProduces(beanElement, beanClass);
beanClasses.add(beanClass);
}
@@ -168,13 +168,8 @@
if(deployElements.size() - deployElementsSet.size() != 0)
throw new DefinitionException("The same deployment type is declared more than once");
- String standardName = XmlConstants.STANDARD;
- String standardPrefix = "";
- String standardUri = XmlConstants.JAVA_EE_NAMESPACE;
- Namespace standardNamespace = new Namespace(standardPrefix, standardUri);
- QName qName = new QName(standardName, standardNamespace);
- Element standardElement = element.element(qName);
- if (standardElement == null)
+ List<Element> standardElements = ParseXmlHelper.findElementsInEeNamespace(element, XmlConstants.STANDARD);
+ if (standardElements.size() == 0)
throw new DeploymentException("The @Standard deployment type must be declared");
List<Class<? extends Annotation>> deploymentClasses = new ArrayList<Class<? extends Annotation>>();
@@ -192,6 +187,35 @@
return deploymentClasses;
}
+ public void checkProduces(Element beanElement, AnnotatedClass<?> beanClass)
+ {
+ Iterator<?> childIterator = beanElement.elementIterator();
+ while(childIterator.hasNext())
+ {
+ Element beanChild = (Element)childIterator.next();
+ List<Element> producesElements = ParseXmlHelper.findElementsInEeNamespace(beanChild, XmlConstants.PRODUCES);
+
+ if(producesElements.size() == 0)
+ continue;
+
+ if(producesElements.size() > 1)
+ throw new DefinitionException("There is more than one child <Produces> element for <" + beanChild.getName() + "> element");
+
+ Element producesElement = producesElements.get(0);
+
+ if(ParseXmlHelper.isField(producesElement, beanClass, beanClass))
+ {
+ if(beanChild.elements().size() > 1)
+ throw new DefinitionException("There is more than one direct child element for producer field <" + beanChild.getName() + ">");
+ }
+
+ if(ParseXmlHelper.isMethod(producesElement, beanClass, beanClass))
+ {}
+
+ throw new DefinitionException("A producer doesn't declared in class file as method or field");
+ }
+ }
+
private void fullFillPackagesMap(Document document)
{
Element root = document.getRootElement();
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2176 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method: enterprise and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-24 04:38:34 -0400 (Tue, 24 Mar 2009)
New Revision: 2176
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/Foo.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/FooProducer.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/FooProducerLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/ProducerMethodNotBusinessMethodTest.java
Log:
test for assertion 3.4.2.f
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/Foo.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/Foo.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/Foo.java 2009-03-24 08:38:34 UTC (rev 2176)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.enterprise.nonbusiness;
+
+public class Foo
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/FooProducer.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/FooProducer.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/FooProducer.java 2009-03-24 08:38:34 UTC (rev 2176)
@@ -0,0 +1,10 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.enterprise.nonbusiness;
+
+import javax.ejb.Stateful;
+import javax.inject.Produces;
+
+@Stateful
+public class FooProducer implements FooProducerLocal
+{
+ @Produces Foo createFoo() { return new Foo(); }
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/FooProducerLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/FooProducerLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/FooProducerLocal.java 2009-03-24 08:38:34 UTC (rev 2176)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.enterprise.nonbusiness;
+
+import javax.ejb.Local;
+
+@Local
+public interface FooProducerLocal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/ProducerMethodNotBusinessMethodTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/ProducerMethodNotBusinessMethodTest.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/enterprise/nonbusiness/ProducerMethodNotBusinessMethodTest.java 2009-03-24 08:38:34 UTC (rev 2176)
@@ -0,0 +1,24 @@
+package org.jboss.jsr299.tck.tests.implementation.producer.method.enterprise.nonbusiness;
+
+import javax.inject.DefinitionException;
+
+import org.hibernate.tck.annotations.SpecAssertion;
+import org.jboss.jsr299.tck.AbstractJSR299Test;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.ExpectedDeploymentException;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+(a)ExpectedDeploymentException(DefinitionException.class)
+public class ProducerMethodNotBusinessMethodTest extends AbstractJSR299Test
+{
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "3.4.2", id = "f")
+ public void testProducerMethodOnSessionBeanMustBeBusinessMethod()
+ {
+ assert false;
+ }
+}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2175 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-24 02:21:34 -0400 (Tue, 24 Mar 2009)
New Revision: 2175
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
Log:
tests for 4.2.bbb and 4.2.bbd
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-24 06:08:18 UTC (rev 2174)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-24 06:21:34 UTC (rev 2175)
@@ -208,4 +208,42 @@
}.run();
assert OrderProcessor.postConstructCalled;
}
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "4.2", id = "bbb")
+ public void testSubClassInheritsPreDestroyOnSuperclass() throws Exception
+ {
+ OrderProcessor.preDestroyCalled = false;
+ assert getCurrentManager().resolveByType(DirectOrderProcessorLocal.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<DirectOrderProcessorLocal> bean = getCurrentManager().resolveByType(DirectOrderProcessorLocal.class).iterator().next();
+ DirectOrderProcessorLocal instance = getCurrentManager().getInstanceByType(DirectOrderProcessorLocal.class);
+ bean.destroy(instance);
+ }
+ }.run();
+ assert OrderProcessor.preDestroyCalled;
+ }
+
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "4.2", id = "bbd")
+ public void testIndirectSubClassInheritsPreDestroyOnSuperclass() throws Exception
+ {
+ OrderProcessor.preDestroyCalled = false;
+ assert getCurrentManager().resolveByType(IndirectOrderProcessor.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ Bean<IndirectOrderProcessor> bean = getCurrentManager().resolveByType(IndirectOrderProcessor.class).iterator().next();
+ IndirectOrderProcessor instance = getCurrentManager().getInstanceByType(IndirectOrderProcessor.class);
+ bean.destroy(instance);
+ }
+ }.run();
+ assert OrderProcessor.preDestroyCalled;
+ }
}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2174 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-24 02:08:18 -0400 (Tue, 24 Mar 2009)
New Revision: 2174
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessorLocal.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java
Log:
fixed testIndirectSubClassInheritsPostConstructOnSuperclass(), added test for 4.2.bab
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessor.java 2009-03-24 06:08:18 UTC (rev 2174)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Stateful;
+
+@Stateful
+public class DirectOrderProcessor extends OrderProcessor implements DirectOrderProcessorLocal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessorLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessorLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/DirectOrderProcessorLocal.java 2009-03-24 06:08:18 UTC (rev 2174)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Local;
+
+@Local
+public interface DirectOrderProcessorLocal
+{
+ void order();
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-24 04:17:45 UTC (rev 2173)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-24 06:08:18 UTC (rev 2174)
@@ -175,7 +175,24 @@
assert frankfurt.isSchlossDestroyed();
}
- @Test(groups = "ri-broken")
+ @Test
+ @SpecAssertion(section = "4.2", id = "bab")
+ public void testDirectSubClassInheritsPostConstructOnSuperclass() throws Exception
+ {
+ OrderProcessor.postConstructCalled = false;
+ assert getCurrentManager().resolveByType(DirectOrderProcessorLocal.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(DirectOrderProcessorLocal.class).order();
+ }
+ }.run();
+ assert OrderProcessor.postConstructCalled;
+ }
+
+ @Test
@SpecAssertion(section = "4.2", id = "bad")
public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java 2009-03-24 04:17:45 UTC (rev 2173)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java 2009-03-24 06:08:18 UTC (rev 2174)
@@ -1,14 +1,9 @@
package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
-import javax.ejb.Remove;
import javax.ejb.Stateful;
@Stateful
public class IndirectOrderProcessor extends IntermediateOrderProcessor implements OrderProcessorLocal
{
- @Remove
- public void remove()
- {
-
- }
+
}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java 2009-03-24 04:17:45 UTC (rev 2173)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java 2009-03-24 06:08:18 UTC (rev 2174)
@@ -3,7 +3,7 @@
import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
-class OrderProcessor
+public class OrderProcessor
{
public static boolean postConstructCalled = false;
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2173 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-24 00:17:45 -0400 (Tue, 24 Mar 2009)
New Revision: 2173
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
Log:
minor
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-03-24 04:14:12 UTC (rev 2172)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/inheritance/specialization/simple/SimpleBeanSpecializationTest.java 2009-03-24 04:17:45 UTC (rev 2173)
@@ -27,7 +27,10 @@
@SuppressWarnings("unchecked")
@Test
- @SpecAssertions( { @SpecAssertion(section = "4.3.1", id = "c"), @SpecAssertion(section = "3.2.7", id = "a") })
+ @SpecAssertions( {
+ @SpecAssertion(section = "4.3.1", id = "c"),
+ @SpecAssertion(section = "3.2.7", id = "a")
+ })
public void testSpecializingBeanHasBindingsOfSpecializedAndSpecializingBean()
{
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).size() == 1;
@@ -38,16 +41,22 @@
}
@Test
- @SpecAssertions( { @SpecAssertion(section = "4.3.1", id = "d"), @SpecAssertion(section = "3.2.7", id = "a") })
+ @SpecAssertions( {
+ @SpecAssertion(section = "4.3.1", id = "d"),
+ @SpecAssertion(section = "3.2.7", id = "a")
+ })
public void testSpecializingBeanHasNameOfSpecializedBean()
{
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).size() == 1;
assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getTypes().contains(LazyFarmer.class);
- assert getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getName().equals("farmer");
+ assert "farmer".equals(getCurrentManager().resolveByType(Farmer.class, LANDOWNER_LITERAL).iterator().next().getName());
}
@Test
- @SpecAssertions( { @SpecAssertion(section = "4.3.1", id = "f"), @SpecAssertion(section = "3.2.7", id = "b") })
+ @SpecAssertions( {
+ @SpecAssertion(section = "4.3.1", id = "f"),
+ @SpecAssertion(section = "3.2.7", id = "b")
+ })
public void testSpecializedBeanNotInstantiated() throws Exception
{
new RunInDependentContext()
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2172 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-24 00:14:12 -0400 (Tue, 24 Mar 2009)
New Revision: 2172
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Bull.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/JerseyCow.java
Log:
fixed test
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Bull.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Bull.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Bull.java 2009-03-24 04:14:12 UTC (rev 2172)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.deployment;
+
+class Bull extends Bovine
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/JerseyCow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/JerseyCow.java 2009-03-24 03:53:36 UTC (rev 2171)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/JerseyCow.java 2009-03-24 04:14:12 UTC (rev 2172)
@@ -1,6 +1,6 @@
package org.jboss.jsr299.tck.tests.definition.deployment;
-class JerseyCow extends Cow
+class JerseyCow extends Bull
{
}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2171 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-23 23:53:36 -0400 (Mon, 23 Mar 2009)
New Revision: 2171
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
Log:
fix mapping
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-24 03:31:09 UTC (rev 2170)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-24 03:53:36 UTC (rev 2171)
@@ -176,7 +176,7 @@
}
@Test(groups = "ri-broken")
- @SpecAssertion(section = "4.2", id = "bac")
+ @SpecAssertion(section = "4.2", id = "bad")
public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
{
OrderProcessor.postConstructCalled = false;
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2170 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation: enterprise/lifecycle and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-23 23:31:09 -0400 (Mon, 23 Mar 2009)
New Revision: 2170
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IntermediateOrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessorLocal.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/session/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
Log:
consolidated
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-24 03:19:33 UTC (rev 2169)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-24 03:31:09 UTC (rev 2170)
@@ -175,4 +175,20 @@
assert frankfurt.isSchlossDestroyed();
}
+ @Test(groups = "ri-broken")
+ @SpecAssertion(section = "4.2", id = "bac")
+ public void testIndirectSubClassInheritsPostConstructOnSuperclass() throws Exception
+ {
+ OrderProcessor.postConstructCalled = false;
+ assert getCurrentManager().resolveByType(OrderProcessorLocal.class).size() == 1;
+ new RunInDependentContext()
+ {
+ @Override
+ protected void execute() throws Exception
+ {
+ getCurrentManager().getInstanceByType(OrderProcessorLocal.class).order();
+ }
+ }.run();
+ assert OrderProcessor.postConstructCalled;
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IndirectOrderProcessor.java 2009-03-24 03:31:09 UTC (rev 2170)
@@ -0,0 +1,14 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+@Stateful
+public class IndirectOrderProcessor extends IntermediateOrderProcessor implements OrderProcessorLocal
+{
+ @Remove
+ public void remove()
+ {
+
+ }
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IntermediateOrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IntermediateOrderProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/IntermediateOrderProcessor.java 2009-03-24 03:31:09 UTC (rev 2170)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+class IntermediateOrderProcessor extends OrderProcessor
+{
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessor.java 2009-03-24 03:31:09 UTC (rev 2170)
@@ -0,0 +1,30 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+
+class OrderProcessor
+{
+ public static boolean postConstructCalled = false;
+
+ public static boolean preDestroyCalled = true;
+
+ @PostConstruct
+ public void postConstruct()
+ {
+ postConstructCalled = true;
+ }
+
+ @PreDestroy
+ public void preDestroy()
+ {
+ preDestroyCalled = true;
+ }
+
+ public void order()
+ {
+
+ }
+
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessorLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessorLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/OrderProcessorLocal.java 2009-03-24 03:31:09 UTC (rev 2170)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Local;
+
+@Local
+public interface OrderProcessorLocal
+{
+ void order();
+}
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2169 - in tck/trunk/impl/src/main: java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-23 23:19:33 -0400 (Mon, 23 Mar 2009)
New Revision: 2169
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Bovine.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/JerseyCow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Bovine.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Bull.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/CowLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/HornedAnimalDeploymentType.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/HornedMammalStereotype.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/JerseyBull.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/JerseyBullLocal.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/EnterpriseDeploymentTypeDefinitionTest.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/beans.xml
Log:
implemented tests for 4.1.dab, 4.1.dcb, 4.1.dbb, 4.1.ddb
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Bovine.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Bovine.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Bovine.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.definition.deployment;
+
+@HornedMammalStereotype
+@AnotherDeploymentType
+class Bovine implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Cow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/Cow.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.deployment;
+
+class Cow extends Bovine
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-03-24 02:57:26 UTC (rev 2168)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -150,4 +150,20 @@
assert getCurrentManager().resolveByType(GoldenLabrador.class).iterator().next().getDeploymentType().equals(InheritedDeploymentType.class);
}
+ @Test
+ @SpecAssertion(section = "4.1", id = "dab")
+ public void testDeploymentTypeIsOverriddenByInheritedDeploymentType()
+ {
+ assert getCurrentManager().resolveByType(Cow.class).size() == 1;
+ assert getCurrentManager().resolveByType(Cow.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "4.1", id = "dcb")
+ public void testDeploymentTypeIsOverriddenByIndirectlyInheritedDeploymentType()
+ {
+ assert getCurrentManager().resolveByType(JerseyCow.class).size() == 1;
+ assert getCurrentManager().resolveByType(JerseyCow.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/JerseyCow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/JerseyCow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/JerseyCow.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.deployment;
+
+class JerseyCow extends Cow
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Animal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Animal.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+interface Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Bovine.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Bovine.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Bovine.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,8 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+@HornedMammalStereotype
+@AnotherDeploymentType
+class Bovine implements Animal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Bull.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Bull.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Bull.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+class Bull extends Bovine
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Cow.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/Cow.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+import javax.ejb.Stateful;
+
+@Stateful
+public class Cow extends Bovine implements CowLocal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/CowLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/CowLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/CowLocal.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface CowLocal
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/EnterpriseDeploymentTypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/EnterpriseDeploymentTypeDefinitionTest.java 2009-03-24 02:57:26 UTC (rev 2168)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/EnterpriseDeploymentTypeDefinitionTest.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -30,4 +30,20 @@
assert getCurrentManager().resolveByType(EnglishBorderCollieLocal.class).size() == 1;
assert getCurrentManager().resolveByType(EnglishBorderCollieLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
+
+ @Test
+ @SpecAssertion(section = "4.1", id = "dbb")
+ public void testDeploymentTypeIsOverriddenByInheritedDeploymentType()
+ {
+ assert getCurrentManager().resolveByType(CowLocal.class).size() == 1;
+ assert getCurrentManager().resolveByType(CowLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "4.1", id = "ddb")
+ public void testDeploymentTypeIsOverriddenByIndirectlyInheritedDeploymentType()
+ {
+ assert getCurrentManager().resolveByType(JerseyBullLocal.class).size() == 1;
+ assert getCurrentManager().resolveByType(JerseyBullLocal.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/HornedAnimalDeploymentType.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/HornedAnimalDeploymentType.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/HornedAnimalDeploymentType.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.inject.DeploymentType;
+
+@Target( { TYPE, METHOD })
+@Retention(RUNTIME)
+@Documented
+@DeploymentType
+@interface HornedAnimalDeploymentType
+{
+
+}
\ No newline at end of file
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/HornedMammalStereotype.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/HornedMammalStereotype.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/HornedMammalStereotype.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.annotation.Stereotype;
+
+(a)Stereotype(requiredTypes=Animal.class)
+@Target( { TYPE })
+@Retention(RUNTIME)
+@HornedAnimalDeploymentType
+@interface HornedMammalStereotype
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/JerseyBull.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/JerseyBull.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/JerseyBull.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+import javax.ejb.Stateful;
+
+@Stateful
+public class JerseyBull extends Bull implements JerseyBullLocal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/JerseyBullLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/JerseyBullLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/JerseyBullLocal.java 2009-03-24 03:19:33 UTC (rev 2169)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.deployment.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface JerseyBullLocal
+{
+
+}
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/beans.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/beans.xml 2009-03-24 02:57:26 UTC (rev 2168)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/definition/deployment/enterprise/beans.xml 2009-03-24 03:19:33 UTC (rev 2169)
@@ -4,5 +4,6 @@
<Standard />
<Production />
<test:AnotherDeploymentType />
+ <test:HornedAnimalDeploymentType />
</Deploy>
</Beans>
15 years, 9 months
[webbeans-commits] Webbeans SVN: r2168 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype: enterprise and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-03-23 22:57:26 -0400 (Mon, 23 Mar 2009)
New Revision: 2168
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/Chihuahua.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/MexicanChihuahua.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/ShortHairedDog.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/Chihuahua.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/ChihuahuaLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/MexicanChihuahua.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/MexicanChihuahuaLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/ShortHairedDog.java
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java
Log:
implemented tests for 4.1.daa, 4.1.dba, 4.1.dca, 4.1.dda
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/Chihuahua.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/Chihuahua.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/Chihuahua.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype;
+
+class Chihuahua extends ShortHairedDog
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/MexicanChihuahua.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/MexicanChihuahua.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/MexicanChihuahua.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype;
+
+class MexicanChihuahua extends Chihuahua
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/ShortHairedDog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/ShortHairedDog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/ShortHairedDog.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype;
+
+import java.io.Serializable;
+
+import javax.context.SessionScoped;
+
+@AnimalStereotype
+@SessionScoped
+class ShortHairedDog implements Animal, Serializable
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-03-24 02:26:39 UTC (rev 2167)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/StereotypeDefinitionTest.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -5,6 +5,7 @@
import javax.context.ApplicationScoped;
import javax.context.Dependent;
import javax.context.RequestScoped;
+import javax.context.SessionScoped;
import javax.inject.AnnotationLiteral;
import javax.inject.Production;
import javax.inject.manager.Bean;
@@ -165,5 +166,19 @@
{
assert getCurrentManager().resolveByType(EnglishBorderCollie.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
+
+ @Test
+ @SpecAssertion(section = "4.1", id = "daa")
+ public void testStereotypeScopeIsOverriddenByInheritedScope()
+ {
+ assert getCurrentManager().resolveByType(Chihuahua.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "4.1", id = "dca")
+ public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
+ {
+ assert getCurrentManager().resolveByType(MexicanChihuahua.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/Chihuahua.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/Chihuahua.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/Chihuahua.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype.enterprise;
+
+import javax.ejb.Stateful;
+
+@Stateful
+public class Chihuahua extends ShortHairedDog implements ChihuahuaLocal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/ChihuahuaLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/ChihuahuaLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/ChihuahuaLocal.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface ChihuahuaLocal
+{
+
+}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java 2009-03-24 02:26:39 UTC (rev 2167)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/EnterpriseStereotypeDefinitionTest.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -1,6 +1,7 @@
package org.jboss.jsr299.tck.tests.definition.stereotype.enterprise;
import javax.context.RequestScoped;
+import javax.context.SessionScoped;
import org.hibernate.tck.annotations.SpecAssertion;
import org.jboss.jsr299.tck.AbstractJSR299Test;
@@ -32,4 +33,18 @@
{
assert getCurrentManager().resolveByType(EnglishBorderCollieLocal.class).iterator().next().getScopeType().equals(RequestScoped.class);
}
+
+ @Test
+ @SpecAssertion(section = "4.1", id = "dba")
+ public void testStereotypeScopeIsOverriddenByInheritedScope()
+ {
+ assert getCurrentManager().resolveByType(ChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ }
+
+ @Test
+ @SpecAssertion(section = "4.1", id = "dda")
+ public void testStereotypeScopeIsOverriddenByIndirectlyInheritedScope()
+ {
+ assert getCurrentManager().resolveByType(MexicanChihuahuaLocal.class).iterator().next().getScopeType().equals(SessionScoped.class);
+ }
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/MexicanChihuahua.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/MexicanChihuahua.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/MexicanChihuahua.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype.enterprise;
+
+import javax.ejb.Stateful;
+
+@Stateful
+public class MexicanChihuahua extends Chihuahua implements MexicanChihuahuaLocal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/MexicanChihuahuaLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/MexicanChihuahuaLocal.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/MexicanChihuahuaLocal.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface MexicanChihuahuaLocal
+{
+
+}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/ShortHairedDog.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/ShortHairedDog.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/stereotype/enterprise/ShortHairedDog.java 2009-03-24 02:57:26 UTC (rev 2168)
@@ -0,0 +1,12 @@
+package org.jboss.jsr299.tck.tests.definition.stereotype.enterprise;
+
+import java.io.Serializable;
+
+import javax.context.SessionScoped;
+
+@AnimalStereotype
+@SessionScoped
+class ShortHairedDog implements Animal, Serializable
+{
+
+}
15 years, 9 months