[webbeans-commits] Webbeans SVN: r1987 - in ri/trunk/impl/src: test/java/org/jboss/webbeans/test/unit/implementation and 2 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-13 19:26:57 -0400 (Fri, 13 Mar 2009)
New Revision: 1987
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd
Modified:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java
Log:
Fix core tests in container
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd 2009-03-13 23:26:57 UTC (rev 1987)
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ elementFormDefault="qualified"
+ targetNamespace="http://jboss.com/products/webbeans/tck/audit"
+ xmlns:audit="http://jboss.com/products/webbeans/tck/audit"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema.xsd"
+ >
+
+ <xs:element name="specification">
+ <xs:annotation>
+ <xs:documentation> The specification tag is the root element for tck-audit.xml. </xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence maxOccurs="unbounded">
+ <xs:element ref="audit:section"/>
+ </xs:sequence>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="version" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="section">
+ <xs:annotation>
+ <xs:documentation>Each section of the specification should be identified and entered</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="audit:assertion"/>
+ </xs:sequence>
+ <xs:attributeGroup ref="audit:attlist.section"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:attributeGroup name="attlist.section">
+ <xs:attribute name="id" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The section number</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="title" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>The section title</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:attributeGroup>
+
+ <xs:element name="assertion">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="1" maxOccurs="1" ref="audit:text">
+ <xs:annotation>
+ <xs:documentation>The specification text that this assertion represents. You can include highlighting such as _highlight_ or ~score out~.</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element minOccurs="0" maxOccurs="1" ref="audit:note">
+ <xs:annotation>
+ <xs:documentation>A note on the assertion, for example a justifaction for marking this assertion untestable</xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attributeGroup ref="audit:attlist.assertion"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:attributeGroup name="attlist.assertion">
+ <xs:attribute name="id" type="xs:string"/>
+ <xs:attribute name="testable" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation>By default true, set to false if this test is untestable. The coverage report will then not count it as untested.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="implied" type="xs:boolean" default="true">
+ <xs:annotation>
+ <xs:documentation>Some assertions are often implied by the specification (for example inversions of statments), mark an assertion as implied using this attribute.</xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:attributeGroup>
+
+ <xs:element name="text">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string"/>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="note">
+ <xs:complexType>
+ <xs:simpleContent>
+ <xs:extension base="xs:string"/>
+ </xs:simpleContent>
+ </xs:complexType>
+ </xs:element>
+
+</xs:schema>
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/sample-schema.xsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-03-13 23:23:27 UTC (rev 1986)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-03-13 23:26:57 UTC (rev 1987)
@@ -14,7 +14,6 @@
import org.jboss.webbeans.literal.NewLiteral;
import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
import org.jboss.webbeans.util.Proxies.TypeInfo;
-import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
@Artifact
@@ -24,31 +23,32 @@
private static final New NEW_LITERAL = new NewLiteral();
- private EnterpriseBean<WrappedEnterpriseBean> wrappedEnterpriseBean;
- private NewEnterpriseBean<WrappedEnterpriseBean> newEnterpriseBean;
+ private EnterpriseBean<WrappedEnterpriseBeanLocal> wrappedEnterpriseBean;
+ private NewEnterpriseBean<WrappedEnterpriseBeanLocal> newEnterpriseBean;
- @BeforeMethod
public void initNewBean() {
- assert manager.resolveByType(WrappedEnterpriseBean.class).size() == 1;
- assert manager.resolveByType(WrappedEnterpriseBean.class).iterator().next() instanceof EnterpriseBean;
- wrappedEnterpriseBean = (EnterpriseBean<WrappedEnterpriseBean>) manager.resolveByType(WrappedEnterpriseBean.class).iterator().next();
+ assert manager.resolveByType(WrappedEnterpriseBeanLocal.class).size() == 1;
+ assert manager.resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next() instanceof EnterpriseBean;
+ wrappedEnterpriseBean = (EnterpriseBean<WrappedEnterpriseBeanLocal>) manager.resolveByType(WrappedEnterpriseBeanLocal.class).iterator().next();
- assert manager.resolveByType(WrappedEnterpriseBean.class, NEW_LITERAL).size() == 1;
- assert manager.resolveByType(WrappedEnterpriseBean.class, NEW_LITERAL).iterator().next() instanceof NewEnterpriseBean;
- newEnterpriseBean = (NewEnterpriseBean<WrappedEnterpriseBean>) manager.resolveByType(WrappedEnterpriseBean.class, NEW_LITERAL).iterator().next();
+ assert manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).size() == 1;
+ assert manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).iterator().next() instanceof NewEnterpriseBean;
+ newEnterpriseBean = (NewEnterpriseBean<WrappedEnterpriseBeanLocal>) manager.resolveByType(WrappedEnterpriseBeanLocal.class, NEW_LITERAL).iterator().next();
}
@Test(groups = { "new", "broken" })
public void testNewBeanHasImplementationClassOfInjectionPointType()
{
- assert newEnterpriseBean.getType().equals(WrappedEnterpriseBean.class);
+ initNewBean();
+ assert newEnterpriseBean.getType().equals(WrappedEnterpriseBeanLocal.class);
}
@Test(groups = { "new" })
public void testNewBeanIsEnterpriseWebBeanIfParameterTypeIsEnterpriseWebBean()
{
+ initNewBean();
assert wrappedEnterpriseBean.getType().equals(newEnterpriseBean.getType());
assert manager.getEjbDescriptorCache().containsKey(newEnterpriseBean.getType());
}
@@ -56,12 +56,14 @@
@Test(groups = { "new" })
public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
{
+ initNewBean();
assert newEnterpriseBean.getInitializerMethods().equals(wrappedEnterpriseBean.getInitializerMethods());
}
@Test(groups = { "new" })
public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
{
+ initNewBean();
Set<? extends AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedEnterpriseBean.getInjectionPoints();
Set<? extends AnnotatedItem<?, ?>> newBeanInjectionPoints = newEnterpriseBean.getInjectionPoints();
assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
@@ -70,6 +72,7 @@
@Test(groups = { "new" })
public void testNewBeanHasNoDisposalMethods()
{
+ initNewBean();
Class<?> type = TypeInfo.ofTypes(newEnterpriseBean.getTypes()).getSuperClass();
assert manager.resolveDisposalMethods(type, newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
}
Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java 2009-03-13 23:23:27 UTC (rev 1986)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java 2009-03-13 23:26:57 UTC (rev 1987)
@@ -18,7 +18,7 @@
assert Food.success;
}
- @Test(timeOut=1000)
+ @Test
public void testCircularInjectionOnOneNormalAndOneDependentBean() throws Exception
{
//deployBeans(Car.class, Petrol.class);
@@ -37,7 +37,7 @@
}
- @Test(timeOut=1000)
+ @Test
public void testCircularInjectionOnOneDependentAndOneNormalBean() throws Exception
{
//deployBeans(Car.class, Petrol.class);
@@ -57,7 +57,7 @@
}
- @Test(timeOut=1000)
+ @Test
public void testCircularInjectionOnTwoSimpleDependentBeans() throws Exception
{
//deployBeans(Foo.class, Bar.class);
@@ -75,7 +75,7 @@
}.run();
}
- @Test(timeOut=1000)
+ @Test
public void testDependentProducerMethodDeclaredOnDependentBeanWhichInjectsProducedBean() throws Exception
{
//deployBeans(DependentSelfConsumingDependentProducer.class);
@@ -91,7 +91,7 @@
}.run();
}
- @Test(timeOut=1000)
+ @Test
public void testNormalProducerMethodDeclaredOnNormalBeanWhichInjectsProducedBean() throws Exception
{
//deployBeans(NormalSelfConsumingNormalProducer.class);
@@ -107,7 +107,7 @@
}.run();
}
- @Test(timeOut=1000)
+ @Test
public void testNormalProducerMethodDeclaredOnDependentBeanWhichInjectsProducedBean() throws Exception
{
//deployBeans(DependentSelfConsumingNormalProducer.class);
@@ -123,7 +123,7 @@
}.run();
}
- @Test(timeOut=1000)
+ @Test
public void testDependentProducerMethodDeclaredOnNormalBeanWhichInjectsProducedBean() throws Exception
{
//deployBeans(NormalSelfConsumingDependentProducer.class);
@@ -139,7 +139,7 @@
}.run();
}
- @Test(timeOut=1000)
+ @Test
public void testNormalSelfConsumingProducer() throws Exception
{
//deployBeans(NormalLoopingProducer.class);
@@ -187,7 +187,7 @@
}.run();
}
- @Test(timeOut=1000)
+ @Test
public void testNormalCircularConstructors() throws Exception
{
//deployBeans(Bird.class, Air.class);
@@ -203,7 +203,7 @@
}.run();
}
- @Test(timeOut=1000)
+ @Test
public void testNormalAndDependentCircularConstructors() throws Exception
{
//deployBeans(Space.class, Planet.class);
@@ -235,7 +235,7 @@
}.run();
}
- @Test(timeOut=1000)
+ @Test
public void testSelfConsumingConstructorsOnNormalBean() throws Exception
{
//deployBeans(House.class);
Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java 2009-03-13 23:23:27 UTC (rev 1986)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/xml/BeansXmlParserTest.java 2009-03-13 23:26:57 UTC (rev 1987)
@@ -8,6 +8,8 @@
import javax.inject.Standard;
import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Resource;
+import org.jboss.testharness.impl.packaging.Resources;
import org.jboss.webbeans.bootstrap.BeansXmlParser;
import org.jboss.webbeans.mock.MockResourceLoader;
import org.jboss.webbeans.resources.spi.ResourceLoader;
@@ -15,6 +17,11 @@
import org.testng.annotations.Test;
@Artifact
+@Resources({
+ @Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/default-beans.xml", source="/org/jboss/webbeans/test/unit/xml/default-beans.xml"),
+ @Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml", source="/org/jboss/webbeans/test/unit/xml/duplicate-deployments-beans.xml"),
+ @Resource(destination="WEB-INF/classes/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml", source="/org/jboss/webbeans/test/unit/xml/user-defined-beans.xml")
+})
public class BeansXmlParserTest extends AbstractWebBeansTest
{
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1986 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-13 19:23:27 -0400 (Fri, 13 Mar 2009)
New Revision: 1986
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java
Log:
Fix aassertion mapping
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-13 23:18:31 UTC (rev 1985)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/definition/deployment/DeploymentTypeDefinitionTest.java 2009-03-13 23:23:27 UTC (rev 1986)
@@ -126,7 +126,7 @@
}
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "ca")
+ @SpecAssertion(section = "4.1", id = "cc")
public void testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeNotMarkedInherited()
{
assert getCurrentManager().resolveByType(GoldenRetriever.class).size() == 1;
@@ -134,7 +134,7 @@
}
@Test(groups = { "deploymentType" })
- @SpecAssertion(section = "4.1", id = "ca")
+ @SpecAssertion(section = "4.1", id = "cc")
public void testDeploymentTypeDeclaredInheritedIsBlockedByIntermediateDeploymentTypeMarkedInherited()
{
assert getCurrentManager().resolveByType(GoldenLabrador.class).size() == 1;
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1985 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-13 19:18:31 -0400 (Fri, 13 Mar 2009)
New Revision: 1985
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
Log:
call method on bean before destroy
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-03-13 21:45:50 UTC (rev 1984)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/dependent/DependentContextTest.java 2009-03-13 23:18:31 UTC (rev 1985)
@@ -288,6 +288,7 @@
assert getCurrentManager().resolveByType(Farm.class).size() == 1;
Bean<Farm> farmBean = getCurrentManager().resolveByType(Farm.class).iterator().next();
Farm farm = getCurrentManager().getInstanceByType(Farm.class);
+ farm.open();
Stable.destroyed = false;
Horse.destroyed = false;
farmBean.destroy(farm);
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1984 - in ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd: helpers and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: nickarls
Date: 2009-03-13 17:45:50 -0400 (Fri, 13 Mar 2009)
New Revision: 1984
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java
Log:
docs for xsd
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-13 18:12:03 UTC (rev 1983)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/PackageSchemaGenerator.java 2009-03-13 21:45:50 UTC (rev 1984)
@@ -1,3 +1,20 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.jboss.webbeans.xsd;
import java.util.ArrayList;
@@ -20,10 +37,18 @@
import org.jboss.webbeans.xsd.helpers.XSDHelper;
import org.jboss.webbeans.xsd.model.ClassModel;
+/**
+ * An annotation processor that updates the package-level XSD for the packages
+ * that have had their files compiled.
+ *
+ * @author Nicklas Karlsson
+ *
+ */
@SupportedSourceVersion(SourceVersion.RELEASE_6)
@SupportedAnnotationTypes("*")
public class PackageSchemaGenerator extends AbstractProcessor
{
+ // A helper for the XSD operations
XSDHelper helper;
@Override
@@ -37,45 +62,62 @@
public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)
{
List<ClassModel> workingSet = new ArrayList<ClassModel>();
+ // Iterates over the classes compiled, creates a model of the classes and add them
+ // to a working set
for (Element element : roundEnv.getRootElements())
{
workingSet.add(inspectClass(element));
}
if (!roundEnv.processingOver())
{
+ // Update the packge XSDs for the files changed
helper.updatePackageXSDs(workingSet);
+ // And flush the changes to disk
helper.flushPackageXSDs();
}
return false;
}
+ /**
+ * Creates a class model from a class element
+ *
+ * @param element The element to analyze
+ * @return The class model
+ */
private ClassModel inspectClass(Element element)
{
TypeElement typeElement = (TypeElement) element;
ClassModel classModel = new ClassModel();
+ // If the class has superclass's, scan them recursively
if (typeElement.getSuperclass().getKind() != TypeKind.NONE)
{
inspectClass(((DeclaredType) typeElement.getSuperclass()).asElement());
}
+ // Gets the parent from the cache. We know it's there since we has scanned the
+ // hierarchy already
ClassModel parent = helper.getCachedClassModel(typeElement.getSuperclass().toString());
+ // Populate the class level info (name, parent etc)
DataSetter.populateClassModel(classModel, element, parent);
+ // Filter out the fields and populate the model
for (Element field : ElementFilter.fieldsIn(element.getEnclosedElements()))
{
DataSetter.populateFieldModel(classModel, field);
}
+ // Filter out the methods and populate the model
for (Element method : ElementFilter.methodsIn(element.getEnclosedElements()))
{
DataSetter.populateMethodModel(classModel, method);
}
+ // Filter out the constructors and populate the model
for (Element constructor : ElementFilter.constructorsIn(element.getEnclosedElements()))
{
DataSetter.populateMethodModel(classModel, constructor);
}
- helper.setCachedClassModel(classModel.getName(), classModel);
+ // Place the new class model in the cache
+ helper.cacheClassModel(classModel);
return classModel;
}
-
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java 2009-03-13 18:12:03 UTC (rev 1983)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/DataSetter.java 2009-03-13 21:45:50 UTC (rev 1984)
@@ -1,3 +1,20 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.jboss.webbeans.xsd.helpers;
import javax.lang.model.element.Element;
@@ -11,14 +28,33 @@
import org.jboss.webbeans.xsd.model.MethodModel;
import org.jboss.webbeans.xsd.model.ParameterModel;
+/**
+ * Helper for examining classes and members and populating the model
+ *
+ * @author Nicklas Karlsson
+ *
+ */
public class DataSetter
{
+ /**
+ * Checks if an element is public
+ *
+ * @param element The element to check
+ * @return True if public, false otherwise
+ */
private static boolean isPublic(Element element)
{
return element.getModifiers().contains(Modifier.PUBLIC);
}
+ /**
+ * Inspects a type element and populates a class model
+ *
+ * @param classModel The class model to populate
+ * @param element The element to inspect
+ * @param parent The parent of the class
+ */
public static void populateClassModel(ClassModel classModel, Element element, ClassModel parent)
{
TypeElement typeElement = (TypeElement) element;
@@ -26,6 +62,12 @@
classModel.setParent(parent);
}
+ /**
+ * Inspects a field element and populates a class model
+ *
+ * @param classModel The class model to populate
+ * @param element The element to inspect
+ */
public static void populateFieldModel(ClassModel classModel, Element element)
{
if (!isPublic(element))
@@ -37,6 +79,12 @@
classModel.addField(new FieldModel(name, type));
}
+ /**
+ * Inspects a method or constructor and populates a class model
+ *
+ * @param classModel The class model to populate
+ * @param element The element to inspect
+ */
public static void populateMethodModel(ClassModel classModel, Element element)
{
if (!isPublic(element))
@@ -56,6 +104,7 @@
ParameterModel parameter = new ParameterModel(paramName, paramType);
method.addParameter(parameter);
}
+ // OK, checting a little with a common model for methods and constructors
if ("<init>".equals(name))
{
classModel.addConstructor(method);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-13 18:12:03 UTC (rev 1983)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/helpers/XSDHelper.java 2009-03-13 21:45:50 UTC (rev 1984)
@@ -1,3 +1,20 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.jboss.webbeans.xsd.helpers;
import java.io.IOException;
@@ -23,17 +40,36 @@
import org.jboss.webbeans.xsd.model.ClassModel;
import org.xml.sax.SAXException;
+/**
+ * Helper for XSD related operations
+ *
+ * @author Nicklas Karlsson
+ *
+ */
public class XSDHelper
{
+ // The annotation processing environment
private ProcessingEnvironment processingEnvironment;
+ // The cache of already processed classes
private Map<String, ClassModel> classModelCache = new HashMap<String, ClassModel>();
+ // The XSD documents of the affected packages
private Map<String, Document> packageXSDs = new HashMap<String, Document>();
+ /**
+ * Creates a new helper
+ *
+ * @param processingEnvironment The processing environment
+ */
public XSDHelper(ProcessingEnvironment processingEnvironment)
{
this.processingEnvironment = processingEnvironment;
}
+ /**
+ * Updates the XSD for the affected packages
+ *
+ * @param classModels The list of class models in the batch
+ */
public void updatePackageXSDs(List<ClassModel> classModels)
{
for (ClassModel classModel : classModels)
@@ -43,6 +79,9 @@
}
}
+ /**
+ * Writes the XSD documents back to disk
+ */
public void flushPackageXSDs()
{
for (Entry<String, Document> entry : packageXSDs.entrySet())
@@ -62,13 +101,22 @@
}
}
+ /**
+ * Gets the XSD document for a package
+ *
+ * @param packageName The package name of the XSD
+ * @return The document
+ */
private Document getPackageXSD(String packageName)
{
+ // Tries to get the document from the cache
Document packageXSD = packageXSDs.get(packageName);
if (packageXSD == null)
{
+ // If this is the first modification to a package
try
{
+ // Read it from disk
packageXSD = readPackageXSD(packageName);
}
catch (IOException e)
@@ -79,25 +127,45 @@
{
throw new RuntimeException("Could not parse schema for package " + packageName);
}
+ // If it was not on disk
if (packageXSD == null)
{
+ // Create a new document
packageXSD = createPackageXSD(packageName);
}
+ // And cache it
packageXSDs.put(packageName, packageXSD);
}
return packageXSD;
}
+ /**
+ * Updates a package XSD with XSD from a file model
+ *
+ * @param packageXSD The package XSD
+ * @param classModel The class model
+ */
private void updateClass(Document packageXSD, ClassModel classModel)
{
Node oldClassModel = packageXSD.selectSingleNode("//" + classModel.getSimpleName());
if (oldClassModel != null)
{
+ // Remove the old class definition
packageXSD.getRootElement().remove(oldClassModel);
}
+ // Create a new one
packageXSD.getRootElement().addElement(classModel.getSimpleName());
}
+ /**
+ * Read the package XSD for a package
+ *
+ * @param packageName The package name
+ *
+ * @return The document
+ * @throws IOException If a file could not be read
+ * @throws DocumentException If a document could not be parsed
+ */
private Document readPackageXSD(String packageName) throws IOException, DocumentException
{
InputStream in = null;
@@ -119,6 +187,12 @@
}
}
+ /**
+ * Creates a new XSD document for a package
+ *
+ * @param packageName The name of the package
+ * @return The document
+ */
private Document createPackageXSD(String packageName)
{
Document packageXSD = DocumentHelper.createDocument();
@@ -127,12 +201,26 @@
return packageXSD;
}
+ /**
+ * Gets the short name of a package (the last part)
+ *
+ * @param packageName The package name
+ * @return A short name
+ */
private String getShortName(String packageName)
{
int lastDot = packageName.lastIndexOf(".");
return lastDot < 0 ? packageName : packageName.substring(lastDot + 1);
}
+ /**
+ * Writes a package XSD back to disk
+ *
+ * @param packageName The name of the package
+ * @param packageXSD The document
+ * @throws IOException If the file could not be written
+ * @throws SAXException If the document was badly formatted
+ */
private void writePackageXSD(String packageName, Document packageXSD) throws IOException, SAXException
{
OutputStream out = null;
@@ -154,13 +242,24 @@
}
}
- public ClassModel getCachedClassModel(String packageName)
+ /**
+ * Gets a cached class model
+ *
+ * @param FQN The FQN of the class
+ * @return The class model (or null if not cached)
+ */
+ public ClassModel getCachedClassModel(String FQN)
{
- return classModelCache.get(packageName);
+ return classModelCache.get(FQN);
}
- public void setCachedClassModel(String packageName, ClassModel classModel)
+ /**
+ * Puts a class model in the cache
+ *
+ * @param classModel The class model
+ */
+ public void cacheClassModel(ClassModel classModel)
{
- classModelCache.put(packageName, classModel);
+ classModelCache.put(classModel.getName(), classModel);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-13 18:12:03 UTC (rev 1983)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ClassModel.java 2009-03-13 21:45:50 UTC (rev 1984)
@@ -1,3 +1,20 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.jboss.webbeans.xsd.model;
import java.util.ArrayList;
@@ -5,28 +22,56 @@
import java.util.List;
import java.util.Set;
+/**
+ * A model of a class
+ *
+ * @author Nicklas Karlsson
+ *
+ */
public class ClassModel extends NamedModel
{
+ // The parent (or null if top-level)
private ClassModel parent;
+ // The fields of the class
private List<FieldModel> fields = new ArrayList<FieldModel>();
+ // The methods of the class
private List<MethodModel> methods = new ArrayList<MethodModel>();
+ // The constructors of the class
private List<MethodModel> constructors = new ArrayList<MethodModel>();
+ /**
+ * Creates a new class model
+ */
public ClassModel()
{
}
+ /**
+ * Adds a field to the class model
+ *
+ * @param fieldModel The field to add
+ */
public void addField(FieldModel fieldModel)
{
fields.add(fieldModel);
}
+ /**
+ * Adds a constructor to the model
+ *
+ * @param constructorModel The constructor to add
+ */
public void addConstructor(MethodModel constructorModel)
{
constructors.add(constructorModel);
}
+ /**
+ * Adds a method to the model
+ *
+ * @param methodModel The method to add
+ */
public void addMethod(MethodModel methodModel)
{
methods.add(methodModel);
@@ -43,38 +88,74 @@
return buffer.toString();
}
+ /**
+ * Gets the parent class model of the class
+ *
+ * @return The parent or null if none present
+ */
public ClassModel getParent()
{
return parent;
}
+ /**
+ * Sets the parent
+ *
+ * @param parent The new parent class model
+ */
public void setParent(ClassModel parent)
{
this.parent = parent;
}
+ /**
+ * Gets the package of the file
+ *
+ * @return The package
+ */
public String getPackage()
{
int lastDot = name.lastIndexOf(".");
return lastDot < 0 ? name : name.substring(0, lastDot);
}
+ /**
+ * Gets the simple name of the class
+ *
+ * @return The simple name
+ */
public String getSimpleName()
{
int lastDot = name.lastIndexOf(".");
return lastDot < 0 ? name : name.substring(lastDot + 1);
}
+ /**
+ * Gets the merged hierarchy of available constructors. Returns the constructors
+ * of this class since constructors aren't inherited
+ *
+ * @return The set of constructors available
+ */
public Set<MethodModel> getMergedConstructors()
{
return new HashSet<MethodModel>(constructors);
}
+ /**
+ * Gets the public field of the class
+ *
+ * @return The public fields
+ */
public List<FieldModel> getFields()
{
return fields;
}
+ /**
+ * Gets the merged hierarchy of available fields.
+ *
+ * @return The set of public fields available
+ */
public Set<FieldModel> getMergedFields()
{
Set<FieldModel> mergedFields = new HashSet<FieldModel>(fields);
@@ -87,11 +168,21 @@
return mergedFields;
}
+ /**
+ * Gets the public methods of the class
+ *
+ * @return The public methods
+ */
public List<MethodModel> getMethods()
{
return methods;
}
+ /**
+ * Gets the merged hierarchy of available fields.
+ *
+ * @return The set of public fields available
+ */
public Set<MethodModel> getMergedMethods()
{
Set<MethodModel> mergedMethods = new HashSet<MethodModel>(methods);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java 2009-03-13 18:12:03 UTC (rev 1983)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/FieldModel.java 2009-03-13 21:45:50 UTC (rev 1984)
@@ -1,5 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.jboss.webbeans.xsd.model;
+/**
+ * A model of a field
+ *
+ * @author Nicklas Karlsosn
+ *
+ */
public class FieldModel extends NamedModel
{
protected String type;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-13 18:12:03 UTC (rev 1983)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/MethodModel.java 2009-03-13 21:45:50 UTC (rev 1984)
@@ -1,3 +1,20 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.jboss.webbeans.xsd.model;
import java.util.ArrayList;
@@ -3,4 +20,10 @@
import java.util.List;
+/**
+ * The model of a method
+ *
+ * @author Nicklas Karlsson
+ *
+ */
public class MethodModel extends NamedModel
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-13 18:12:03 UTC (rev 1983)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/NamedModel.java 2009-03-13 21:45:50 UTC (rev 1984)
@@ -1,5 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.jboss.webbeans.xsd.model;
+/**
+ * A superclass for named models
+ *
+ * @author Nicklas Karlsson
+ *
+ */
public class NamedModel
{
protected String name;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java 2009-03-13 18:12:03 UTC (rev 1983)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/xsd/model/ParameterModel.java 2009-03-13 21:45:50 UTC (rev 1984)
@@ -1,5 +1,28 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package org.jboss.webbeans.xsd.model;
+/**
+ * The model of a method or constrcutor parameter
+ *
+ * @author Nicklas Karlsson
+ *
+ */
public class ParameterModel extends FieldModel
{
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1983 - in ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation: annotatedItem and 3 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-13 14:12:03 -0400 (Fri, 13 Mar 2009)
New Revision: 1983
Added:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java
Removed:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Animal.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Antelope.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/ClassAnnotatedItemTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewSimpleBeanTest.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Order.java
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedSimpleBean.java
Modified:
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java
Log:
Start to fix i/c errors
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Animal.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Animal.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Animal.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-interface Animal
-{
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Antelope.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Antelope.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Antelope.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -1,6 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-class Antelope implements Animal
-{
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/ClassAnnotatedItemTest.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/ClassAnnotatedItemTest.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -1,51 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import java.lang.annotation.Annotation;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.annotation.Stereotype;
-import javax.inject.DeploymentType;
-import javax.inject.Production;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-@Artifact
-public class ClassAnnotatedItemTest extends AbstractWebBeansTest
-{
-
- @Test
- public void testDeclaredAnnotations()
- {
- AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
- assert annotatedElement.getAnnotationsAsSet().size() == 1;
- assert annotatedElement.getAnnotation(Production.class) != null;
- assert annotatedElement.getType().equals(Order.class);
- }
-
- @Test
- public void testMetaAnnotations()
- {
- AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
- Set<Annotation> annotations = annotatedElement.getMetaAnnotations(DeploymentType.class);
- assert annotations.size() == 1;
- Iterator<Annotation> it = annotations.iterator();
- Annotation production = it.next();
- assert Production.class.equals(production.annotationType());
- }
-
- @Test
- public void testEmpty()
- {
- AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
- assert annotatedElement.getAnnotation(Stereotype.class) == null;
- assert annotatedElement.getMetaAnnotations(Stereotype.class).size() == 0;
- AnnotatedClass<Antelope> classWithNoAnnotations = AnnotatedClassImpl.of(Antelope.class);
- assert classWithNoAnnotations.getAnnotationsAsSet().size() == 0;
- }
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -1,37 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import javassist.util.proxy.ProxyObject;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.Test;
-
-@Artifact
-(a)Packaging(PackagingType.EAR)
-public class EnterpriseBeanProxyTest extends AbstractWebBeansTest
-{
-
- /**
- * <a href="https://jira.jboss.org/jira/browse/WBRI-109">WBRI-109</a>
- */
- @Test
- public void testNoInterfaceView() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- Object mouse = manager.getInstanceByType(Mouse.class);
- assert mouse instanceof ProxyObject;
- assert mouse instanceof Mouse;
- }
-
- }.run();
-
- }
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import javax.ejb.Stateless;
-
-@Stateless
-public class Mouse
-{
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewSimpleBeanTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewSimpleBeanTest.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewSimpleBeanTest.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -1,68 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import java.util.Set;
-
-import javax.inject.New;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.bean.NewSimpleBean;
-import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.literal.NewLiteral;
-import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-@Artifact
-public class NewSimpleBeanTest extends AbstractWebBeansTest
-{
- private SimpleBean<WrappedSimpleBean> wrappedSimpleBean;
- private NewSimpleBean<WrappedSimpleBean> newSimpleBean;
-
- private static final New NEW_LITERAL = new NewLiteral();
-
- @BeforeMethod
- public void initNewBean() {
-
- assert manager.resolveByType(WrappedSimpleBean.class).size() == 1;
- assert manager.resolveByType(WrappedSimpleBean.class).iterator().next() instanceof SimpleBean;
- wrappedSimpleBean = (SimpleBean<WrappedSimpleBean>) manager.resolveByType(WrappedSimpleBean.class).iterator().next();
-
- assert manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).size() == 1;
- assert manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next() instanceof NewSimpleBean;
- newSimpleBean = (NewSimpleBean<WrappedSimpleBean>) manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next();
- }
-
- @Test(groups = { "new" })
- public void testNewBeanHasImplementationClassOfInjectionPointType()
- {
- assert newSimpleBean.getType().equals(WrappedSimpleBean.class);
- }
-
- @Test(groups = { "new" })
- public void testNewBeanIsSimpleWebBeanIfParameterTypeIsSimpleWebBean()
- {
- assert newSimpleBean.getType().equals(wrappedSimpleBean.getType());
- }
-
- @Test(groups = { "new" })
- public void testNewBeanHasSameConstructorAsWrappedBean()
- {
- assert wrappedSimpleBean.getConstructor().equals(newSimpleBean.getConstructor());
- }
-
- @Test(groups = { "new" })
- public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
- {
- assert newSimpleBean.getInitializerMethods().equals(wrappedSimpleBean.getInitializerMethods());
- }
-
- @Test(groups = { "new" })
- public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
- {
- Set<? extends AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedSimpleBean.getInjectionPoints();
- Set<? extends AnnotatedItem<?, ?>> newBeanInjectionPoints = newSimpleBean.getInjectionPoints();
- assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
- }
-
-}
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Order.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Order.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Order.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -1,9 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import javax.inject.Production;
-
-@Production
-class Order
-{
-
-}
Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBean.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -8,7 +8,7 @@
@SessionScoped
@Stateful
@Named("John")
-class WrappedEnterpriseBean
+class WrappedEnterpriseBean implements WrappedEnterpriseBeanLocal
{
@Remove
public void bye() {
Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation;
+
+import javax.ejb.Local;
+
+@Local
+public interface WrappedEnterpriseBeanLocal
+{
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedEnterpriseBeanLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedSimpleBean.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedSimpleBean.java 2009-03-13 17:59:48 UTC (rev 1982)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedSimpleBean.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -1,15 +0,0 @@
-package org.jboss.webbeans.test.unit.implementation;
-
-import java.io.Serializable;
-
-import javax.annotation.Named;
-import javax.context.SessionScoped;
-
-@SessionScoped
-@Named("Fred")
-class WrappedSimpleBean implements Serializable
-{
- public WrappedSimpleBean() {
-
- }
-}
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java (from rev 1971, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Animal.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,6 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+interface Animal
+{
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Animal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java (from rev 1971, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Antelope.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,7 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+
+class Antelope implements Animal
+{
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Antelope.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java (from rev 1973, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/ClassAnnotatedItemTest.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,51 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+import java.lang.annotation.Annotation;
+import java.util.Iterator;
+import java.util.Set;
+
+import javax.annotation.Stereotype;
+import javax.inject.DeploymentType;
+import javax.inject.Production;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class ClassAnnotatedItemTest extends AbstractWebBeansTest
+{
+
+ @Test
+ public void testDeclaredAnnotations()
+ {
+ AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
+ assert annotatedElement.getAnnotationsAsSet().size() == 1;
+ assert annotatedElement.getAnnotation(Production.class) != null;
+ assert annotatedElement.getType().equals(Order.class);
+ }
+
+ @Test
+ public void testMetaAnnotations()
+ {
+ AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
+ Set<Annotation> annotations = annotatedElement.getMetaAnnotations(DeploymentType.class);
+ assert annotations.size() == 1;
+ Iterator<Annotation> it = annotations.iterator();
+ Annotation production = it.next();
+ assert Production.class.equals(production.annotationType());
+ }
+
+ @Test
+ public void testEmpty()
+ {
+ AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class);
+ assert annotatedElement.getAnnotation(Stereotype.class) == null;
+ assert annotatedElement.getMetaAnnotations(Stereotype.class).size() == 0;
+ AnnotatedClass<Antelope> classWithNoAnnotations = AnnotatedClassImpl.of(Antelope.class);
+ assert classWithNoAnnotations.getAnnotationsAsSet().size() == 0;
+ }
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java (from rev 1971, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Order.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.annotatedItem;
+
+import javax.inject.Production;
+
+@Production
+class Order
+{
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/Order.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java (from rev 1973, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/NewSimpleBeanTest.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,71 @@
+package org.jboss.webbeans.test.unit.implementation.newsimple;
+
+import java.util.Set;
+
+import javax.inject.New;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.bean.NewSimpleBean;
+import org.jboss.webbeans.bean.SimpleBean;
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.literal.NewLiteral;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class NewSimpleBeanTest extends AbstractWebBeansTest
+{
+ private SimpleBean<WrappedSimpleBean> wrappedSimpleBean;
+ private NewSimpleBean<WrappedSimpleBean> newSimpleBean;
+
+ private static final New NEW_LITERAL = new NewLiteral();
+
+ public void initNewBean() {
+
+ assert manager.resolveByType(WrappedSimpleBean.class).size() == 1;
+ assert manager.resolveByType(WrappedSimpleBean.class).iterator().next() instanceof SimpleBean;
+ wrappedSimpleBean = (SimpleBean<WrappedSimpleBean>) manager.resolveByType(WrappedSimpleBean.class).iterator().next();
+
+ assert manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).size() == 1;
+ assert manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next() instanceof NewSimpleBean;
+ newSimpleBean = (NewSimpleBean<WrappedSimpleBean>) manager.resolveByType(WrappedSimpleBean.class, NEW_LITERAL).iterator().next();
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasImplementationClassOfInjectionPointType()
+ {
+ initNewBean();
+ assert newSimpleBean.getType().equals(WrappedSimpleBean.class);
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanIsSimpleWebBeanIfParameterTypeIsSimpleWebBean()
+ {
+ initNewBean();
+ assert newSimpleBean.getType().equals(wrappedSimpleBean.getType());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameConstructorAsWrappedBean()
+ {
+ initNewBean();
+ assert wrappedSimpleBean.getConstructor().equals(newSimpleBean.getConstructor());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInitializerMethodsAsWrappedBean()
+ {
+ initNewBean();
+ assert newSimpleBean.getInitializerMethods().equals(wrappedSimpleBean.getInitializerMethods());
+ }
+
+ @Test(groups = { "new" })
+ public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
+ {
+ initNewBean();
+ Set<? extends AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedSimpleBean.getInjectionPoints();
+ Set<? extends AnnotatedItem<?, ?>> newBeanInjectionPoints = newSimpleBean.getInjectionPoints();
+ assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
+ }
+
+}
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java (from rev 1971, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/WrappedSimpleBean.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,15 @@
+package org.jboss.webbeans.test.unit.implementation.newsimple;
+
+import java.io.Serializable;
+
+import javax.annotation.Named;
+import javax.context.SessionScoped;
+
+@SessionScoped
+@Named("Fred")
+class WrappedSimpleBean implements Serializable
+{
+ public WrappedSimpleBean() {
+
+ }
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/WrappedSimpleBean.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java (from rev 1973, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,37 @@
+package org.jboss.webbeans.test.unit.implementation.proxy.enterprise;
+
+import javassist.util.proxy.ProxyObject;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.Packaging;
+import org.jboss.testharness.impl.packaging.PackagingType;
+import org.jboss.webbeans.test.unit.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+@Artifact
+(a)Packaging(PackagingType.EAR)
+public class EnterpriseBeanProxyTest extends AbstractWebBeansTest
+{
+
+ /**
+ * <a href="https://jira.jboss.org/jira/browse/WBRI-109">WBRI-109</a>
+ */
+ @Test
+ public void testNoInterfaceView() throws Exception
+ {
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Object mouse = manager.getInstanceByType(MouseLocal.class);
+ assert mouse instanceof ProxyObject;
+ assert mouse instanceof MouseLocal;
+ }
+
+ }.run();
+
+ }
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/EnterpriseBeanProxyTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java (from rev 1971, ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java)
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.proxy.enterprise;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class Mouse implements MouseLocal
+{
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/Mouse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java (rev 0)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java 2009-03-13 18:12:03 UTC (rev 1983)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation.proxy.enterprise;
+
+import javax.ejb.Local;
+
+@Local
+public interface MouseLocal
+{
+
+}
Property changes on: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/implementation/proxy/enterprise/MouseLocal.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1982 - tck/trunk.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-13 13:59:48 -0400 (Fri, 13 Mar 2009)
New Revision: 1982
Modified:
tck/trunk/pom.xml
Log:
switch to use snapshot of harness
Modified: tck/trunk/pom.xml
===================================================================
--- tck/trunk/pom.xml 2009-03-13 17:59:25 UTC (rev 1981)
+++ tck/trunk/pom.xml 2009-03-13 17:59:48 UTC (rev 1982)
@@ -148,7 +148,7 @@
<dependency>
<groupId>org.jboss.test-harness</groupId>
<artifactId>jboss-test-harness</artifactId>
- <version>1.0.0.BETA1</version>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1981 - ri/trunk/impl/src/test and 17 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-03-13 13:59:25 -0400 (Fri, 13 Mar 2009)
New Revision: 1981
Added:
ri/trunk/impl/src/test/debug-resources/
ri/trunk/impl/src/test/debug-resources/META-INF/
ri/trunk/impl/src/test/debug-resources/META-INF/web-beans-tck.properties
ri/trunk/impl/src/test/resources/jndi.properties
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/HarnessServletListener.java
test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/JBossASConnector.java
test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceContainersImpl.java
Removed:
ri/trunk/impl/src/test/resources/log4j.xml
ri/trunk/jboss-tck-runner/src/test/resources/log4j.xml
test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/AbstractContainersImpl.java
test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceContainersImpl.java
Modified:
ri/trunk/impl/pom.xml
ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
ri/trunk/impl/src/test/resources/META-INF/web-beans-tck.properties
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationTestPhaseListener.java
tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/conversation/client/web.xml
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/PropertiesBasedConfigurationBuilder.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/TCKArtifactDescriptor.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/TestRunner.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/ServletTestRunner.java
test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/DeploymentProperties.java
test-harness/trunk/impl/src/main/resources/org/jboss/testharness/impl/packaging/war/web.xml
test-harness/trunk/jboss/src/main/resources/log4j.xml
Log:
Improvements to harness,
Modified: ri/trunk/impl/pom.xml
===================================================================
--- ri/trunk/impl/pom.xml 2009-03-13 17:32:51 UTC (rev 1980)
+++ ri/trunk/impl/pom.xml 2009-03-13 17:59:25 UTC (rev 1981)
@@ -117,6 +117,12 @@
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness-jboss-as-5</artifactId>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
@@ -150,4 +156,129 @@
</plugin>
</plugins>
</build>
+
+ <profiles>
+ <profile>
+ <id>incontainer</id>
+ <activation>
+ <property>
+ <name>incontainer</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <stripVersion>true</stripVersion>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.test-harness</groupId>
+ <artifactId>jboss-test-harness</artifactId>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
+ </artifactItem>
+ <artifactItem>
+ <groupId>javax.el</groupId>
+ <artifactId>el-ri</artifactId>
+ <overWrite>true</overWrite>
+ <outputDirectory>${project.build.directory}/dependency/lib</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <suiteXmlFiles>
+ <suiteXmlFile>unit-tests.xml</suiteXmlFile>
+ </suiteXmlFiles>
+ <systemProperties>
+ <property>
+ <name>org.jboss.testharness.standalone</name>
+ <value>false</value>
+ </property>
+ <property>
+ <name>jboss-as.dir</name>
+ <value>../jboss-as</value>
+ </property>
+ <property>
+ <name>jboss.force.restart</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>org.jboss.testharness.runIntegrationTests</name>
+ <value>true</value>
+ </property>
+ <property>
+ <name>org.jboss.testharness.libraryDirectory</name>
+ <value>target/dependency/lib</value>
+ </property>
+ <property>
+ <name>org.jboss.testharness.outputDirectory</name>
+ <value>target</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>write-artifacts-to-disk</id>
+ <activation>
+ <property>
+ <name>dumpArtifacts</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-test-artifacts</id>
+ <phase>generate-test-sources</phase>
+ <goals>
+ <goal>java</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <mainClass>org.jboss.testharness.api.TCK</mainClass>
+ <classpathScope>test</classpathScope>
+ <systemProperties>
+ <systemProperty>
+ <key>dumpArtifacts</key>
+ <value>true</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.testharness.outputDirectory</key>
+ <value>target/test-artifacts</value>
+ </systemProperty>
+ <systemProperty>
+ <key>org.jboss.testharness.libraryDirectory</key>
+ <value>target/dependency/lib</value>
+ </systemProperty>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+
</project>
Added: ri/trunk/impl/src/test/debug-resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/impl/src/test/debug-resources/META-INF/web-beans-tck.properties (rev 0)
+++ ri/trunk/impl/src/test/debug-resources/META-INF/web-beans-tck.properties 2009-03-13 17:59:25 UTC (rev 1981)
@@ -0,0 +1,7 @@
+# Configuration for running incontainer tests from your IDE
+# Alter the path webbeans accordingly (relative from the tck/impl dir)
+org.jboss.testharness.standalone=false
+jboss-as.dir=../../webbeans/jboss-as
+jboss.force.restart=false
+org.jboss.testharness.libraryDirectory=../../webbeans/impl/target/dependency/lib
+org.jboss.testharness.runIntegrationTests=true
\ No newline at end of file
Property changes on: ri/trunk/impl/src/test/debug-resources/META-INF/web-beans-tck.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ ri/trunk/impl/src/test/java/org/jboss/webbeans/test/unit/AbstractWebBeansTest.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -17,6 +17,7 @@
import org.testng.ITestContext;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
public abstract class AbstractWebBeansTest extends AbstractTest
{
@@ -58,9 +59,15 @@
public static boolean visited = false;
@Override
+ @BeforeSuite
public void beforeSuite(ITestContext context) throws Exception
{
- getCurrentConfiguration().setStandaloneContainers(new StandaloneContainersImpl());
+ if (!isInContainer())
+ {
+ getCurrentConfiguration().setStandaloneContainers(new StandaloneContainersImpl());
+ getCurrentConfiguration().getExtraPackages().add(AbstractWebBeansTest.class.getPackage().getName());
+ }
+ super.beforeSuite(context);
}
@BeforeMethod
Modified: ri/trunk/impl/src/test/resources/META-INF/web-beans-tck.properties
===================================================================
--- ri/trunk/impl/src/test/resources/META-INF/web-beans-tck.properties 2009-03-13 17:32:51 UTC (rev 1980)
+++ ri/trunk/impl/src/test/resources/META-INF/web-beans-tck.properties 2009-03-13 17:59:25 UTC (rev 1981)
@@ -1 +1,3 @@
-org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.unit.StandaloneContainersImpl
\ No newline at end of file
+org.jboss.testharness.spi.StandaloneContainers=org.jboss.webbeans.test.unit.StandaloneContainersImpl
+org.jboss.testharness.api.TestLauncher=org.jboss.testharness.impl.runner.servlet.ServletTestLauncher
+org.jboss.testharness.testPackage=org.jboss.webbeans.test
\ No newline at end of file
Added: ri/trunk/impl/src/test/resources/jndi.properties
===================================================================
--- ri/trunk/impl/src/test/resources/jndi.properties (rev 0)
+++ ri/trunk/impl/src/test/resources/jndi.properties 2009-03-13 17:59:25 UTC (rev 1981)
@@ -0,0 +1,4 @@
+#jboss JNDI properties
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
\ No newline at end of file
Property changes on: ri/trunk/impl/src/test/resources/jndi.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/test/resources/log4j.xml
===================================================================
--- ri/trunk/impl/src/test/resources/log4j.xml 2009-03-13 17:32:51 UTC (rev 1980)
+++ ri/trunk/impl/src/test/resources/log4j.xml 2009-03-13 17:59:25 UTC (rev 1981)
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out"/>
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%-5p [%c{6}] %m%n"/>
- </layout>
- </appender>
-
- <!-- ############### Embedded EJB3 ################# -->
- <category name="org.jboss">
- <priority value="ERROR"/>
- </category>
- <category name="com.arjuna">
- <priority value="ERROR"/>
- </category>
-
- <!-- ############### Hibernate logging ################# -->
-
- <category name="org.hibernate">
- <priority value="ERROR"/>
- </category>
-
- <!--
- <category name="org.hibernate.SQL">
- <priority value="TRACE"/>
- </category>
-
- <category name="org.hibernate.type">
- <priority value="TRACE"/>
- </category>
-
- <category name="org.hibernate.loader">
- <priority value="TRACE"/>
- </category>
- <category name="org.hibernate.cache">
- <priority value="TRACE"/>
- </category>
- -->
-
- <!-- ############### Web Beans logging ################### -->
-
- <category name="org.jboss.webbeans">
- <priority value="WARN"/>
- </category>
-
- <root>
- <priority value="INFO"/>
- <appender-ref ref="CONSOLE"/>
- </root>
-
-</log4j:configuration>
Deleted: ri/trunk/jboss-tck-runner/src/test/resources/log4j.xml
===================================================================
--- ri/trunk/jboss-tck-runner/src/test/resources/log4j.xml 2009-03-13 17:32:51 UTC (rev 1980)
+++ ri/trunk/jboss-tck-runner/src/test/resources/log4j.xml 2009-03-13 17:59:25 UTC (rev 1981)
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
- <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
- <param name="Target" value="System.out"/>
- <layout class="org.apache.log4j.PatternLayout">
- <!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{6}] %m%n"/>
- </layout>
- <filter class="org.apache.log4j.varia.StringMatchFilter">
- <param name="AcceptOnMatch" value="false" />
- <param name="StringToMatch" value="Failure while notifying an observer of event [a]" />
- </filter>
- </appender>
-
- <!-- ############### Embedded EJB3 ################# -->
- <category name="org.jboss">
- <priority value="ERROR"/>
- </category>
-
- <category name="org.jboss.test">
- <priority value="ERROR"/>
- </category>
-
- <category name="com.arjuna">
- <priority value="ERROR"/>
- </category>
-
- <!-- ############### Hibernate logging ################# -->
-
- <category name="org.hibernate">
- <priority value="ERROR"/>
- </category>
-
- <!--
- <category name="org.hibernate.SQL">
- <priority value="TRACE"/>
- </category>
-
- <category name="org.hibernate.type">
- <priority value="TRACE"/>
- </category>
-
- <category name="org.hibernate.loader">
- <priority value="TRACE"/>
- </category>
- <category name="org.hibernate.cache">
- <priority value="TRACE"/>
- </category>
- -->
-
- <!-- ############### Web Beans logging ################### -->
-
- <category name="org.jboss.webbeans">
- <priority value="WARN"/>
- </category>
-
- <category name="org.jboss.webbeans.tck">
- <priority value="INFO"/>
- </category>
-
- <category name="org.jboss.jsr299">
- <priority value="INFO"/>
- </category>
-
- <root>
- <priority value="INFO"/>
- <appender-ref ref="CONSOLE"/>
- </root>
-
-</log4j:configuration>
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationTestPhaseListener.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationTestPhaseListener.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/context/conversation/client/ConversationTestPhaseListener.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -23,6 +23,15 @@
public void beforePhase(PhaseEvent event)
{
+ try
+ {
+ JSR299ConfigurationImpl.get();
+ }
+ catch (NoClassDefFoundError e)
+ {
+ e.printStackTrace();
+ e.getCause().printStackTrace();
+ }
if (event.getPhaseId().equals(PhaseId.APPLY_REQUEST_VALUES))
{
try
Modified: tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/conversation/client/web.xml
===================================================================
--- tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/conversation/client/web.xml 2009-03-13 17:32:51 UTC (rev 1980)
+++ tck/trunk/impl/src/main/resources/org/jboss/jsr299/tck/tests/context/conversation/client/web.xml 2009-03-13 17:59:25 UTC (rev 1981)
@@ -34,6 +34,10 @@
<servlet-name>Conversation Status Servlet</servlet-name>
<url-pattern>/conversation-status</url-pattern>
</servlet-mapping>
+
+ <listener>
+ <listener-class>org.jboss.testharness.impl.runner.servlet.HarnessServletListener</listener-class>
+ </listener>
<session-config>
<session-timeout>10</session-timeout>
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/PropertiesBasedConfigurationBuilder.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/PropertiesBasedConfigurationBuilder.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/PropertiesBasedConfigurationBuilder.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -14,6 +14,7 @@
import static org.jboss.testharness.api.Configuration.STANDALONE_PROPERTY_NAME;
import static org.jboss.testharness.api.Configuration.TEST_PACKAGE_PROPERTY_NAME;
+import org.jboss.testharness.AbstractTest;
import org.jboss.testharness.api.Configurable;
import org.jboss.testharness.api.Configuration;
import org.jboss.testharness.api.ConfigurationBuilder;
@@ -47,10 +48,12 @@
*/
public ConfigurationBuilder init()
{
- configuration.setInContainerTestLauncher(getInstanceValue(TestLauncher.PROPERTY_NAME, TestLauncher.class, configuration.isRunIntegrationTests() || !configuration.isStandalone()));
- configuration.setContainers(getInstanceValue(Containers.PROPERTY_NAME, Containers.class, !configuration.isStandalone() || configuration.isRunIntegrationTests()));
- configuration.setStandaloneContainers(getInstanceValue(StandaloneContainers.PROPERTY_NAME, StandaloneContainers.class, configuration.isStandalone()));
-
+ if (!AbstractTest.isInContainer())
+ {
+ configuration.setInContainerTestLauncher(getInstanceValue(TestLauncher.PROPERTY_NAME, TestLauncher.class, configuration.isRunIntegrationTests() || !configuration.isStandalone()));
+ configuration.setContainers(getInstanceValue(Containers.PROPERTY_NAME, Containers.class, !configuration.isStandalone() || configuration.isRunIntegrationTests()));
+ configuration.setStandaloneContainers(getInstanceValue(StandaloneContainers.PROPERTY_NAME, StandaloneContainers.class, configuration.isStandalone()));
+ }
return this;
}
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/ArtifactGenerator.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -239,6 +239,10 @@
public void dumpArtifacts(String basePackageName)
{
+ if (basePackageName == null)
+ {
+ throw new IllegalArgumentException("Cannot dump artifacts as no package to dump from set. Specify org.jboss.testharness.testPackage");
+ }
List<ArtifactDescriptor> artifacts = createArtifacts(basePackageName);
File file = new File(configuration.getOutputDirectory());
if (!file.exists())
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/TCKArtifactDescriptor.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/TCKArtifactDescriptor.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/packaging/jsr299/TCKArtifactDescriptor.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -8,6 +8,7 @@
import java.io.Writer;
import org.apache.log4j.Logger;
+import org.jboss.testharness.api.Configuration;
import org.jboss.testharness.impl.ConfigurationImpl;
import org.jboss.testharness.impl.packaging.ArtifactDescriptor;
import org.jboss.testharness.impl.packaging.ResourceDescriptorImpl;
@@ -71,6 +72,8 @@
{
Writer writer = new PrintWriter(os);
writer.write("className=" + declaringClass.getName() + "\n");
+ writer.write(Configuration.STANDALONE_PROPERTY_NAME + "=false\n");
+
for (String line : ConfigurationImpl.get().getExtraDeploymentProperties())
{
writer.write(line + "\n");
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/TestRunner.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/TestRunner.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/TestRunner.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -5,7 +5,6 @@
import java.util.List;
import java.util.Set;
-import org.jboss.testharness.AbstractTest;
import org.jboss.testharness.impl.testng.RemoveExpectedExceptionsAnnotationTransformer;
import org.jboss.testharness.impl.util.DeploymentProperties;
import org.testng.ITestContext;
@@ -43,7 +42,6 @@
public void run(boolean ignoreExpectedExceptions)
{
- AbstractTest.setInContainer(true);
if (classNames.size() == 0)
{
DeploymentProperties deploymentProperties = new DeploymentProperties();
Added: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/HarnessServletListener.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/HarnessServletListener.java (rev 0)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/HarnessServletListener.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -0,0 +1,22 @@
+package org.jboss.testharness.impl.runner.servlet;
+
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import org.jboss.testharness.AbstractTest;
+
+public class HarnessServletListener implements ServletContextListener
+{
+
+ public void contextDestroyed(ServletContextEvent sce)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void contextInitialized(ServletContextEvent sce)
+ {
+ AbstractTest.setInContainer(true);
+ }
+
+}
Property changes on: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/HarnessServletListener.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/ServletTestRunner.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/ServletTestRunner.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/runner/servlet/ServletTestRunner.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -10,7 +10,6 @@
import javax.servlet.http.HttpServletResponse;
import org.jboss.testharness.api.TestResult;
-import org.jboss.testharness.impl.ConfigurationImpl;
import org.jboss.testharness.impl.runner.TestResultImpl;
import org.jboss.testharness.impl.runner.TestRunner;
import org.testng.ITestResult;
@@ -23,7 +22,6 @@
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
{
- ConfigurationImpl.get().setStandalone(false);
TestRunner runner = new TestRunner();
String methodName = null;
if (req.getParameter("methodName") != null)
Modified: test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/DeploymentProperties.java
===================================================================
--- test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/DeploymentProperties.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/impl/src/main/java/org/jboss/testharness/impl/util/DeploymentProperties.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -166,7 +166,7 @@
}
else if (classes.size() > 1)
{
- throw new IllegalArgumentException("More than one implementation of " + expectedType.getSimpleName() + " specified by " + propertyName + ", not sure which one to use!");
+ throw new IllegalArgumentException("More than one implementation of " + expectedType.getSimpleName() + " specified by " + propertyName + ", not sure which one to use!" + classes);
}
return classes.iterator().next();
}
@@ -218,7 +218,7 @@
{
if (required)
{
- throw new IllegalArgumentException("Cannot find required property " + propertyName + ", check that it is specified");
+ throw new IllegalArgumentException("Cannot find required property " + propertyName + ", check that it is specified ");
}
else
{
@@ -227,7 +227,7 @@
}
else if (values.size() > 1)
{
- throw new IllegalArgumentException("More than one value given for " + propertyName + ", not sure which one to use!");
+ throw new IllegalArgumentException("More than one value given for " + propertyName + ", not sure which one to use! " + values);
}
else
{
Modified: test-harness/trunk/impl/src/main/resources/org/jboss/testharness/impl/packaging/war/web.xml
===================================================================
--- test-harness/trunk/impl/src/main/resources/org/jboss/testharness/impl/packaging/war/web.xml 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/impl/src/main/resources/org/jboss/testharness/impl/packaging/war/web.xml 2009-03-13 17:59:25 UTC (rev 1981)
@@ -7,6 +7,10 @@
<display-name>JBoss Test Harness</display-name>
+ <listener>
+ <listener-class>org.jboss.testharness.impl.runner.servlet.HarnessServletListener</listener-class>
+ </listener>
+
<servlet>
<servlet-name>JBoss Test Harness Test Runner</servlet-name>
<servlet-class>org.jboss.testharness.impl.runner.servlet.ServletTestRunner</servlet-class>
Deleted: test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/AbstractContainersImpl.java
===================================================================
--- test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/AbstractContainersImpl.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/AbstractContainersImpl.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -1,288 +0,0 @@
-package org.jboss.testharness.integration.jbossas;
-
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-import java.net.URLConnection;
-
-import org.apache.log4j.Logger;
-import org.jboss.testharness.api.Configurable;
-import org.jboss.testharness.api.Configuration;
-import org.jboss.testharness.integration.jbossas.util.DeploymentProperties;
-import org.jboss.testharness.spi.Containers;
-
-/**
- *
- * @author jeffgenender
- * @author Pete Muir
- *
- */
-public abstract class AbstractContainersImpl implements Configurable, Containers
-{
-
- public static String JAVA_OPTS = " -ea";
-
- public static final String JBOSS_HOME_PROPERTY_NAME = "jboss.home";
- public static final String JAVA_OPTS_PROPERTY_NAME = "java.opts";
- public static final String JBOSS_AS_DIR_PROPERTY_NAME = "jboss-as.dir";
- public static final String JBOSS_BOOT_TIMEOUT_PROPERTY_NAME = "jboss.boot.timeout";
- public static final String FORCE_RESTART_PROPERTY_NAME = "jboss.force.restart";
- public static final String MAX_DEPLOYMENTS_PROPERTY_NAME = "jboss.deployments.restart";
- public static final String SHUTDOWN_DELAY_PROPERTY_NAME = "jboss.shutdown.delay";
- public static final String JBOSS_BIND_ADDRESS_PROPERTY_NAME = "jboss.bind.address";
-
- private static Logger log = Logger.getLogger(AbstractContainersImpl.class);
-
- private final DeploymentProperties properties;
-
- private Configuration configuration;
- protected String jbossHome;
- private String jbossHttpUrl;
- private boolean jbossWasStarted;
- private long bootTimeout;
- private String javaOpts;
-
- private boolean forceRestart;
-
- protected int maxDeployments;
-
- private int jbossShutdownDelay;
-
- private String jbossBindAddress;
-
- public AbstractContainersImpl()
- {
- this.properties = new DeploymentProperties();
- }
-
- protected static void copy(InputStream inputStream, File file) throws IOException
- {
- OutputStream os = new FileOutputStream(file);
- try
- {
- byte[] buf = new byte[1024];
- int i = 0;
- while ((i = inputStream.read(buf)) != -1)
- {
- os.write(buf, 0, i);
- }
- }
- finally
- {
- os.close();
- }
- }
-
- public void setConfiguration(Configuration configuration)
- {
- this.configuration = configuration;
- }
-
- protected boolean isJBossUp()
- {
- // Check that JBoss is up!
- try
- {
- URLConnection connection = new URL(jbossHttpUrl).openConnection();
- if (!(connection instanceof HttpURLConnection))
- {
- throw new IllegalStateException("Not an http connection! " + connection);
- }
- HttpURLConnection httpConnection = (HttpURLConnection) connection;
- httpConnection.connect();
- if (httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK)
- {
- return false;
- }
- }
- catch (Exception e)
- {
- return false;
- }
- log.info("Successfully connected to JBoss AS at " + jbossHttpUrl);
- return true;
- }
-
- public void setup() throws IOException
- {
- String jbossAsPath = properties.getStringValue(JBOSS_AS_DIR_PROPERTY_NAME, "../jboss-as", false);
- if (jbossAsPath != null)
- {
- File jbossAsDir = new File(jbossAsPath);
- if (jbossAsDir.isDirectory())
- {
- File buildProperties = new File(jbossAsDir, "build.properties");
- if (buildProperties.exists())
- {
- loadProperties(buildProperties);
- }
- File localBuildProperties = new File(jbossAsDir, "local.build.properties");
- if (localBuildProperties.exists())
- {
- loadProperties(localBuildProperties);
- }
- }
- }
- jbossHome = properties.getStringValue(JBOSS_HOME_PROPERTY_NAME, null, true);
- jbossBindAddress = properties.getStringValue(JBOSS_BIND_ADDRESS_PROPERTY_NAME, "localhost", false);
- configuration.setHost(jbossBindAddress + ":8080");
- this.jbossHttpUrl = "http://" + configuration.getHost() + "/";
- javaOpts = properties.getStringValue(JAVA_OPTS_PROPERTY_NAME, "", false);
- javaOpts = javaOpts + JAVA_OPTS;
- File jbossHomeFile = new File(jbossHome);
- jbossHome = jbossHomeFile.getPath();
- log.info("Using JBoss instance in " + jbossHome + " at URL " + jbossHttpUrl);
- this.bootTimeout = properties.getLongValue(JBOSS_BOOT_TIMEOUT_PROPERTY_NAME, 240000, false);
- this.forceRestart = properties.getBooleanValue(FORCE_RESTART_PROPERTY_NAME, false, false);
- this.maxDeployments = properties.getIntValue(MAX_DEPLOYMENTS_PROPERTY_NAME, 25, false);
- this.jbossShutdownDelay = properties.getIntValue(SHUTDOWN_DELAY_PROPERTY_NAME, 15000, false);
- restartJboss();
- }
-
- protected void restartJboss() throws IOException
- {
- if (forceRestart)
- {
- if (isJBossUp())
- {
- log.info("Shutting down JBoss instance as in force-restart mode");
- shutDownJBoss();
- try
- {
- Thread.sleep(jbossShutdownDelay);
- }
- catch (InterruptedException e)
- {
- Thread.currentThread().interrupt();
- }
- }
- }
- if (!isJBossUp())
- {
- jbossWasStarted = true;
- launch("run", "--host=" + jbossBindAddress);
- log.info("Starting JBoss instance");
- // Wait for JBoss to come up
- long timeoutTime = System.currentTimeMillis() + bootTimeout;
- boolean interrupted = false;
- while (timeoutTime > System.currentTimeMillis())
- {
- if (isJBossUp())
- {
- log.info("Started JBoss instance");
- return;
- }
- try
- {
- Thread.sleep(200);
- }
- catch (InterruptedException e)
- {
- interrupted = true;
- }
- }
- if (interrupted)
- {
- Thread.currentThread().interrupt();
- }
- // If we got this far something went wrong
- log.warn("Unable to connect to JBoss instance after " + bootTimeout + "ms, giving up!");
- launch("shutdown", "-S");
- throw new IllegalStateException("Error connecting to JBoss instance");
- }
- }
-
- protected void loadProperties(File file) throws IOException
- {
- InputStream is = new FileInputStream(file);
- try
- {
- System.getProperties().load(is);
- }
- finally
- {
- is.close();
- }
- }
-
- public String getJbossHome()
- {
- return jbossHome;
- }
-
- public void cleanup() throws IOException
- {
- if (jbossWasStarted)
- {
- log.info("Shutting down JBoss instance");
- shutDownJBoss();
- }
- }
-
- private void shutDownJBoss() throws IOException
- {
- launch("shutdown", "-S");
- log.info("Shut down JBoss AS");
- }
-
- private void launch(String scriptFileName, String params) throws IOException
- {
- String osName = System.getProperty("os.name");
- Runtime runtime = Runtime.getRuntime();
-
- Process p = null;
- if (osName.startsWith("Windows"))
- {
- String command[] = {
- "cmd.exe",
- "/C",
- "set JAVA_OPTS=" + javaOpts + " & cd /D " + jbossHome + "\\bin & " + scriptFileName + ".bat " + params
- };
- p = runtime.exec(command);
- }
- else
- {
- String command[] = {
- "sh",
- "-c",
- "cd " + jbossHome + "/bin;JAVA_OPTS=\"" + javaOpts + "\" ./" + scriptFileName + ".sh " + params
- };
- p = runtime.exec(command);
- }
- dump(p.getErrorStream());
- dump(p.getInputStream());
- }
-
- protected void dump(final InputStream is)
- {
- new Thread(new Runnable()
- {
- public void run()
- {
- try
- {
- DataOutputStream out = new DataOutputStream(new FileOutputStream(configuration.getOutputDirectory() + File.separator + "jboss.log"));
- int c;
- while((c = is.read()) != -1)
- {
- out.writeByte(c);
- }
- is.close();
- out.close();
- }
- catch(IOException e)
- {
- System.err.println("Error Writing/Reading Streams.");
- }
- }
- }).start();
- }
-
-
-}
\ No newline at end of file
Copied: test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/JBossASConnector.java (from rev 1975, test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/AbstractContainersImpl.java)
===================================================================
--- test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/JBossASConnector.java (rev 0)
+++ test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/JBossASConnector.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -0,0 +1,287 @@
+package org.jboss.testharness.integration.jbossas;
+
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URL;
+import java.net.URLConnection;
+
+import org.apache.log4j.Logger;
+import org.jboss.testharness.api.Configurable;
+import org.jboss.testharness.api.Configuration;
+import org.jboss.testharness.integration.jbossas.util.DeploymentProperties;
+import org.jboss.testharness.spi.Containers;
+
+/**
+ *
+ * @author jeffgenender
+ * @author Pete Muir
+ *
+ */
+public abstract class JBossASConnector implements Configurable, Containers
+{
+
+ public static String JAVA_OPTS = " -ea";
+
+ public static final String JBOSS_HOME_PROPERTY_NAME = "jboss.home";
+ public static final String JAVA_OPTS_PROPERTY_NAME = "java.opts";
+ public static final String JBOSS_AS_DIR_PROPERTY_NAME = "jboss-as.dir";
+ public static final String JBOSS_BOOT_TIMEOUT_PROPERTY_NAME = "jboss.boot.timeout";
+ public static final String FORCE_RESTART_PROPERTY_NAME = "jboss.force.restart";
+ public static final String MAX_DEPLOYMENTS_PROPERTY_NAME = "jboss.deployments.restart";
+ public static final String SHUTDOWN_DELAY_PROPERTY_NAME = "jboss.shutdown.delay";
+ public static final String JBOSS_BIND_ADDRESS_PROPERTY_NAME = "jboss.bind.address";
+
+ private static Logger log = Logger.getLogger(JBossASConnector.class);
+
+ private final DeploymentProperties properties;
+
+ private Configuration configuration;
+ protected String jbossHome;
+ private String jbossHttpUrl;
+ private boolean jbossWasStarted;
+ private long bootTimeout;
+ private String javaOpts;
+
+ private boolean forceRestart;
+
+ protected int maxDeployments;
+
+ private int jbossShutdownDelay;
+
+ private String jbossBindAddress;
+
+ public JBossASConnector()
+ {
+ this.properties = new DeploymentProperties();
+ }
+
+ protected static void copy(InputStream inputStream, File file) throws IOException
+ {
+ OutputStream os = new FileOutputStream(file);
+ try
+ {
+ byte[] buf = new byte[1024];
+ int i = 0;
+ while ((i = inputStream.read(buf)) != -1)
+ {
+ os.write(buf, 0, i);
+ }
+ }
+ finally
+ {
+ os.close();
+ }
+ }
+
+ public void setConfiguration(Configuration configuration)
+ {
+ this.configuration = configuration;
+ }
+
+ protected boolean isJBossUp()
+ {
+ // Check that JBoss is up!
+ try
+ {
+ URLConnection connection = new URL(jbossHttpUrl).openConnection();
+ if (!(connection instanceof HttpURLConnection))
+ {
+ throw new IllegalStateException("Not an http connection! " + connection);
+ }
+ HttpURLConnection httpConnection = (HttpURLConnection) connection;
+ httpConnection.connect();
+ if (httpConnection.getResponseCode() != HttpURLConnection.HTTP_OK)
+ {
+ return false;
+ }
+ }
+ catch (Exception e)
+ {
+ return false;
+ }
+ log.info("Connected to JBoss instance over http");
+ return true;
+ }
+
+ public void setup() throws IOException
+ {
+ String jbossAsPath = properties.getStringValue(JBOSS_AS_DIR_PROPERTY_NAME, "../jboss-as", false);
+ if (jbossAsPath != null)
+ {
+ File jbossAsDir = new File(jbossAsPath);
+ if (jbossAsDir.isDirectory())
+ {
+ File buildProperties = new File(jbossAsDir, "build.properties");
+ if (buildProperties.exists())
+ {
+ loadProperties(buildProperties);
+ }
+ File localBuildProperties = new File(jbossAsDir, "local.build.properties");
+ if (localBuildProperties.exists())
+ {
+ loadProperties(localBuildProperties);
+ }
+ }
+ }
+ jbossHome = properties.getStringValue(JBOSS_HOME_PROPERTY_NAME, null, true);
+ jbossBindAddress = properties.getStringValue(JBOSS_BIND_ADDRESS_PROPERTY_NAME, "localhost", false);
+ configuration.setHost(jbossBindAddress + ":8080");
+ this.jbossHttpUrl = "http://" + configuration.getHost() + "/";
+ javaOpts = properties.getStringValue(JAVA_OPTS_PROPERTY_NAME, "", false);
+ javaOpts = javaOpts + JAVA_OPTS;
+ File jbossHomeFile = new File(jbossHome);
+ jbossHome = jbossHomeFile.getPath();
+ log.info("Using JBoss instance " + jbossHome + " (" + jbossHttpUrl + ")");
+ this.bootTimeout = properties.getLongValue(JBOSS_BOOT_TIMEOUT_PROPERTY_NAME, 240000, false);
+ this.forceRestart = properties.getBooleanValue(FORCE_RESTART_PROPERTY_NAME, false, false);
+ this.maxDeployments = properties.getIntValue(MAX_DEPLOYMENTS_PROPERTY_NAME, 25, false);
+ this.jbossShutdownDelay = properties.getIntValue(SHUTDOWN_DELAY_PROPERTY_NAME, 15000, false);
+ restartJboss();
+ }
+
+ protected void restartJboss() throws IOException
+ {
+ if (forceRestart)
+ {
+ if (isJBossUp())
+ {
+ log.info("Shutting down JBoss instance as in force-restart mode");
+ shutDownJBoss();
+ try
+ {
+ Thread.sleep(jbossShutdownDelay);
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ }
+ }
+ if (!isJBossUp())
+ {
+ jbossWasStarted = true;
+ launch("run", "--host=" + jbossBindAddress);
+ log.info("Starting JBoss instance");
+ // Wait for JBoss to come up
+ long timeoutTime = System.currentTimeMillis() + bootTimeout;
+ boolean interrupted = false;
+ while (timeoutTime > System.currentTimeMillis())
+ {
+ if (isJBossUp())
+ {
+ log.info("Started JBoss instance");
+ return;
+ }
+ try
+ {
+ Thread.sleep(200);
+ }
+ catch (InterruptedException e)
+ {
+ interrupted = true;
+ }
+ }
+ if (interrupted)
+ {
+ Thread.currentThread().interrupt();
+ }
+ // If we got this far something went wrong
+ log.warn("Unable to connect to JBoss instance after " + bootTimeout + "ms, giving up!");
+ launch("shutdown", "-S");
+ throw new IllegalStateException("Error connecting to JBoss instance");
+ }
+ }
+
+ protected void loadProperties(File file) throws IOException
+ {
+ InputStream is = new FileInputStream(file);
+ try
+ {
+ System.getProperties().load(is);
+ }
+ finally
+ {
+ is.close();
+ }
+ }
+
+ public String getJbossHome()
+ {
+ return jbossHome;
+ }
+
+ public void cleanup() throws IOException
+ {
+ if (jbossWasStarted)
+ {
+ log.info("Shutting down JBoss instance");
+ shutDownJBoss();
+ }
+ }
+
+ private void shutDownJBoss() throws IOException
+ {
+ launch("shutdown", "-S");
+ }
+
+ private void launch(String scriptFileName, String params) throws IOException
+ {
+ String osName = System.getProperty("os.name");
+ Runtime runtime = Runtime.getRuntime();
+
+ Process p = null;
+ if (osName.startsWith("Windows"))
+ {
+ String command[] = {
+ "cmd.exe",
+ "/C",
+ "set JAVA_OPTS=" + javaOpts + " & cd /D " + jbossHome + "\\bin & " + scriptFileName + ".bat " + params
+ };
+ p = runtime.exec(command);
+ }
+ else
+ {
+ String command[] = {
+ "sh",
+ "-c",
+ "cd " + jbossHome + "/bin;JAVA_OPTS=\"" + javaOpts + "\" ./" + scriptFileName + ".sh " + params
+ };
+ p = runtime.exec(command);
+ }
+ dump(p.getErrorStream());
+ dump(p.getInputStream());
+ }
+
+ protected void dump(final InputStream is)
+ {
+ new Thread(new Runnable()
+ {
+ public void run()
+ {
+ try
+ {
+ DataOutputStream out = new DataOutputStream(new FileOutputStream(configuration.getOutputDirectory() + File.separator + "jboss.log"));
+ int c;
+ while((c = is.read()) != -1)
+ {
+ out.writeByte(c);
+ }
+ is.close();
+ out.close();
+ }
+ catch(IOException e)
+ {
+ System.err.println("Error Writing/Reading Streams.");
+ }
+ }
+ }).start();
+ }
+
+
+}
\ No newline at end of file
Deleted: test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceContainersImpl.java
===================================================================
--- test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceContainersImpl.java 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceContainersImpl.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -1,219 +0,0 @@
-package org.jboss.testharness.integration.jbossas;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map.Entry;
-
-import javax.naming.InitialContext;
-
-import org.apache.log4j.Logger;
-import org.jboss.deployers.client.spi.IncompleteDeploymentException;
-import org.jboss.deployers.spi.management.deploy.DeploymentManager;
-import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
-import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
-import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
-import org.jboss.profileservice.spi.ProfileKey;
-import org.jboss.profileservice.spi.ProfileService;
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.virtual.VFS;
-
-public class ProfileServiceContainersImpl extends AbstractContainersImpl
-{
-
- private Logger log = Logger.getLogger(ProfileServiceContainersImpl.class);
-
- private final List<String> failedUndeployments;
-
- private DeploymentManager deploymentManager;
- private final File tmpdir;
- private int deploymentCounter = 0;
-
-
- public ProfileServiceContainersImpl() throws Exception
- {
- tmpdir = new File(System.getProperty("java.io.tmpdir"), "org.jboss.webbeans.tck.integration.jbossas");
- tmpdir.mkdir();
- tmpdir.deleteOnExit();
- this.failedUndeployments = new ArrayList<String>();
- }
-
-
- @Override
- public void setup() throws IOException
- {
- super.setup();
- try
- {
- initDeploymentManager();
- }
- catch (Exception e)
- {
- IOException ioe = new IOException();
- ioe.initCause(e);
- throw ioe;
- }
- }
-
- public void deploy(InputStream archiveStream, String name) throws DeploymentException, IOException
- {
- if (deploymentManager == null)
- {
- throw new IllegalStateException("setup() has not been called!");
- }
- Exception failure = null;
- try
- {
- File archive = new File(tmpdir, name);
- archive.deleteOnExit();
- copy(archiveStream, archive);
- DeploymentProgress distribute = deploymentManager.distribute(name, DeploymentPhase.APPLICATION, archive.toURI().toURL(), true);
- distribute.run();
- DeploymentProgress progress = deploymentManager.start(DeploymentPhase.APPLICATION, name);
- progress.run();
- DeploymentStatus status = progress.getDeploymentStatus();
- if (status.isFailed())
- {
- failure = status.getFailure();
- doUndeploy(name);
- }
- }
- catch (Exception e)
- {
- IOException ioe = new IOException();
- ioe.initCause(e);
- throw ioe;
- }
- if (failure != null)
- {
- if (failure.getCause() instanceof IncompleteDeploymentException)
- {
- IncompleteDeploymentException incompleteDeploymentException = (IncompleteDeploymentException) failure.getCause();
- for (Entry<String, Throwable> entry : incompleteDeploymentException.getIncompleteDeployments().getContextsInError().entrySet())
- {
- if (entry.getKey().endsWith(name + "/_WebBeansBootstrap"))
- {
- throw new DeploymentException(entry.getValue());
- }
- }
- }
- throw new DeploymentException(failure);
- }
- }
-
- private void doUndeploy(String name) throws IOException
- {
- try
- {
- DeploymentProgress stopProgress = deploymentManager.stop(DeploymentPhase.APPLICATION, name);
- stopProgress.run();
-
- DeploymentProgress undeployProgress = deploymentManager.undeploy(DeploymentPhase.APPLICATION, name);
- undeployProgress.run();
- if (undeployProgress.getDeploymentStatus().isFailed())
- {
- failedUndeployments.add(name);
- }
- else
- {
- deploymentCounter++;
- }
- }
- catch (Exception e)
- {
- IOException ioe = new IOException();
- ioe.initCause(e);
- throw ioe;
- }
- }
-
- public void undeploy(String name) throws IOException
- {
- try
- {
- doUndeploy(name);
- }
- finally
- {
- if (deploymentCounter >= maxDeployments)
- {
- deploymentCounter = 0;
- // Let everything stablise
- removeFailedUnDeployments();
- try
- {
- Thread.sleep(5000);
- }
- catch (InterruptedException e)
- {
- Thread.currentThread().interrupt();
- }
- restartJboss();
- try
- {
- initDeploymentManager();
- }
- catch (Exception e)
- {
- IOException ioe = new IOException();
- ioe.initCause(e);
- throw ioe;
- }
- }
- }
- }
-
- /**
- * Obtain the Deployment Manager
- * @throws Exception
- */
- protected void initDeploymentManager() throws Exception
- {
- String profileName = "default";
- InitialContext ctx = new InitialContext();
- ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
- deploymentManager = ps.getDeploymentManager();
- ProfileKey defaultKey = new ProfileKey(profileName);
- deploymentManager.loadProfile(defaultKey, false);
- // Init the VFS to setup the vfs* protocol handlers
- VFS.init();
- }
-
- @Override
- public void cleanup() throws IOException
- {
- removeFailedUnDeployments();
- super.cleanup();
- }
-
- private void removeFailedUnDeployments() throws IOException
- {
- List<String> remainingDeployments = new ArrayList<String>();
- for (String name : failedUndeployments)
- {
- try
- {
- DeploymentProgress undeployProgress = deploymentManager.undeploy(DeploymentPhase.APPLICATION, name);
- undeployProgress.run();
- if (undeployProgress.getDeploymentStatus().isFailed())
- {
- remainingDeployments.add(name);
- }
- }
- catch (Exception e)
- {
- IOException ioe = new IOException();
- ioe.initCause(e);
- throw ioe;
- }
- }
- if (remainingDeployments.size() > 0)
- {
- //log.error("Failed to undeploy these artifacts: " + remainingDeployments);
- }
- failedUndeployments.clear();
- }
-
-}
Added: test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceContainersImpl.java
===================================================================
--- test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceContainersImpl.java (rev 0)
+++ test-harness/trunk/jboss/src/main/java/org/jboss/testharness/integration/jbossas/ProfileServiceContainersImpl.java 2009-03-13 17:59:25 UTC (rev 1981)
@@ -0,0 +1,219 @@
+package org.jboss.testharness.integration.jbossas;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map.Entry;
+
+import javax.naming.InitialContext;
+
+import org.apache.log4j.Logger;
+import org.jboss.deployers.client.spi.IncompleteDeploymentException;
+import org.jboss.deployers.spi.management.deploy.DeploymentManager;
+import org.jboss.deployers.spi.management.deploy.DeploymentProgress;
+import org.jboss.deployers.spi.management.deploy.DeploymentStatus;
+import org.jboss.managed.api.ManagedDeployment.DeploymentPhase;
+import org.jboss.profileservice.spi.ProfileKey;
+import org.jboss.profileservice.spi.ProfileService;
+import org.jboss.testharness.api.DeploymentException;
+import org.jboss.virtual.VFS;
+
+public class ProfileServiceContainersImpl extends JBossASConnector
+{
+
+ private Logger log = Logger.getLogger(ProfileServiceContainersImpl.class);
+
+ private final List<String> failedUndeployments;
+
+ private DeploymentManager deploymentManager;
+ private final File tmpdir;
+ private int deploymentCounter = 0;
+
+
+ public ProfileServiceContainersImpl() throws Exception
+ {
+ tmpdir = new File(System.getProperty("java.io.tmpdir"), "org.jboss.webbeans.tck.integration.jbossas");
+ tmpdir.mkdir();
+ tmpdir.deleteOnExit();
+ this.failedUndeployments = new ArrayList<String>();
+ }
+
+
+ @Override
+ public void setup() throws IOException
+ {
+ super.setup();
+ try
+ {
+ initDeploymentManager();
+ }
+ catch (Exception e)
+ {
+ IOException ioe = new IOException();
+ ioe.initCause(e);
+ throw ioe;
+ }
+ }
+
+ public void deploy(InputStream archiveStream, String name) throws DeploymentException, IOException
+ {
+ if (deploymentManager == null)
+ {
+ throw new IllegalStateException("setup() has not been called!");
+ }
+ Exception failure = null;
+ try
+ {
+ File archive = new File(tmpdir, name);
+ archive.deleteOnExit();
+ copy(archiveStream, archive);
+ DeploymentProgress distribute = deploymentManager.distribute(name, DeploymentPhase.APPLICATION, archive.toURI().toURL(), true);
+ distribute.run();
+ DeploymentProgress progress = deploymentManager.start(DeploymentPhase.APPLICATION, name);
+ progress.run();
+ DeploymentStatus status = progress.getDeploymentStatus();
+ if (status.isFailed())
+ {
+ failure = status.getFailure();
+ doUndeploy(name);
+ }
+ }
+ catch (Exception e)
+ {
+ IOException ioe = new IOException();
+ ioe.initCause(e);
+ throw ioe;
+ }
+ if (failure != null)
+ {
+ if (failure.getCause() instanceof IncompleteDeploymentException)
+ {
+ IncompleteDeploymentException incompleteDeploymentException = (IncompleteDeploymentException) failure.getCause();
+ for (Entry<String, Throwable> entry : incompleteDeploymentException.getIncompleteDeployments().getContextsInError().entrySet())
+ {
+ if (entry.getKey().endsWith(name + "/_WebBeansBootstrap"))
+ {
+ throw new DeploymentException(entry.getValue());
+ }
+ }
+ }
+ throw new DeploymentException(failure);
+ }
+ }
+
+ private void doUndeploy(String name) throws IOException
+ {
+ try
+ {
+ DeploymentProgress stopProgress = deploymentManager.stop(DeploymentPhase.APPLICATION, name);
+ stopProgress.run();
+
+ DeploymentProgress undeployProgress = deploymentManager.undeploy(DeploymentPhase.APPLICATION, name);
+ undeployProgress.run();
+ if (undeployProgress.getDeploymentStatus().isFailed())
+ {
+ failedUndeployments.add(name);
+ }
+ else
+ {
+ deploymentCounter++;
+ }
+ }
+ catch (Exception e)
+ {
+ IOException ioe = new IOException();
+ ioe.initCause(e);
+ throw ioe;
+ }
+ }
+
+ public void undeploy(String name) throws IOException
+ {
+ try
+ {
+ doUndeploy(name);
+ }
+ finally
+ {
+ if (deploymentCounter >= maxDeployments)
+ {
+ deploymentCounter = 0;
+ // Let everything stablise
+ removeFailedUnDeployments();
+ try
+ {
+ Thread.sleep(5000);
+ }
+ catch (InterruptedException e)
+ {
+ Thread.currentThread().interrupt();
+ }
+ restartJboss();
+ try
+ {
+ initDeploymentManager();
+ }
+ catch (Exception e)
+ {
+ IOException ioe = new IOException();
+ ioe.initCause(e);
+ throw ioe;
+ }
+ }
+ }
+ }
+
+ /**
+ * Obtain the Deployment Manager
+ * @throws Exception
+ */
+ protected void initDeploymentManager() throws Exception
+ {
+ String profileName = "default";
+ InitialContext ctx = new InitialContext();
+ ProfileService ps = (ProfileService) ctx.lookup("ProfileService");
+ deploymentManager = ps.getDeploymentManager();
+ ProfileKey defaultKey = new ProfileKey(profileName);
+ deploymentManager.loadProfile(defaultKey, false);
+ // Init the VFS to setup the vfs* protocol handlers
+ VFS.init();
+ }
+
+ @Override
+ public void cleanup() throws IOException
+ {
+ removeFailedUnDeployments();
+ super.cleanup();
+ }
+
+ private void removeFailedUnDeployments() throws IOException
+ {
+ List<String> remainingDeployments = new ArrayList<String>();
+ for (String name : failedUndeployments)
+ {
+ try
+ {
+ DeploymentProgress undeployProgress = deploymentManager.undeploy(DeploymentPhase.APPLICATION, name);
+ undeployProgress.run();
+ if (undeployProgress.getDeploymentStatus().isFailed())
+ {
+ remainingDeployments.add(name);
+ }
+ }
+ catch (Exception e)
+ {
+ IOException ioe = new IOException();
+ ioe.initCause(e);
+ throw ioe;
+ }
+ }
+ if (remainingDeployments.size() > 0)
+ {
+ //log.error("Failed to undeploy these artifacts: " + remainingDeployments);
+ }
+ failedUndeployments.clear();
+ }
+
+}
Modified: test-harness/trunk/jboss/src/main/resources/log4j.xml
===================================================================
--- test-harness/trunk/jboss/src/main/resources/log4j.xml 2009-03-13 17:32:51 UTC (rev 1980)
+++ test-harness/trunk/jboss/src/main/resources/log4j.xml 2009-03-13 17:59:25 UTC (rev 1981)
@@ -6,7 +6,7 @@
<param name="Target" value="System.out"/>
<layout class="org.apache.log4j.PatternLayout">
<!-- The default pattern: Date Priority [Category] Message\n -->
- <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{6}] %m%n"/>
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{2}] %m%n"/>
</layout>
<filter class="org.apache.log4j.varia.StringMatchFilter">
<param name="AcceptOnMatch" value="false" />
@@ -60,7 +60,7 @@
<priority value="INFO"/>
</category>
- <category name="org.jboss.jsr299">
+ <category name="org.jboss.testharness">
<priority value="INFO"/>
</category>
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1980 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation: producer/method/disposal/definition and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-13 13:32:51 -0400 (Fri, 13 Mar 2009)
New Revision: 1980
Added:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.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/FrankfurtAmMain.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java
Log:
Finished EJB lifecycle tests that can work w/current RI
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-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/EnterpriseBeanLifecycleTest.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -67,7 +67,7 @@
Set<Class<?>> interfaces = new HashSet<Class<?>>(Arrays.asList(stadtInstance.getClass().getInterfaces()));
assert interfaces.contains(KleinStadt.class);
assert interfaces.contains(SchoeneStadt.class);
- frankfurt.dispose();
+ //frankfurt.dispose();
}
@Test(groups = { "enterpriseBeans", "clientProxy", "lifecycle", "integration", "ri-broken" })
@@ -83,11 +83,12 @@
Context requestContext = getCurrentManager().getContext(RequestScoped.class);
CreationalContext<KleinStadt> creationalContext = new MockCreationalContext<KleinStadt>();
KleinStadt kassel = requestContext.get(stadtBean, creationalContext);
- kassel.zustandVergessen();
- //assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
+ stadtBean.destroy(kassel);
+
+ assert frankfurt.isKleinStadtDestroyed() : "Expected SFSB bean to be destroyed";
kassel = requestContext.get(stadtBean);
assert kassel == null : "SFSB bean should not exist after being destroyed";
- frankfurt.dispose();
+ //frankfurt.dispose();
}
@Test(groups = { "enterpriseBeans", "lifecycle", "integration" })
@@ -159,11 +160,16 @@
assert false;
}
- @Test(groups = { "enterpriseBeans", "lifecycle", "stub" })
+ @Test(groups = { "enterpriseBeans", "lifecycle", "ri-broken" })
@SpecAssertion(section = "6.11", id = "f")
public void testDependentObjectsDestroyed()
{
- assert false;
+ UniStadt marburg = getCurrentManager().getInstanceByType(UniStadt.class);
+ assert marburg != null : "Couldn't find the main SFSB";
+ Bean<UniStadt> uniStadtBean = getCurrentManager().resolveByType(UniStadt.class).iterator().next();
+ uniStadtBean.destroy(marburg);
+ GrossStadt frankfurt = getCurrentManager().getInstanceByType(GrossStadt.class);
+ assert frankfurt.isSchlossDestroyed();
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java 2009-03-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/FrankfurtAmMain.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -47,4 +47,16 @@
{
}
+ private boolean schlossDestroyed = false;
+
+ public boolean isSchlossDestroyed()
+ {
+ return schlossDestroyed;
+ }
+
+ public void schlossDestroyed()
+ {
+ schlossDestroyed = true;
+ }
+
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java 2009-03-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/GrossStadt.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -18,4 +18,8 @@
public void resetDestroyedFlags();
public void dispose();
+
+ public void schlossDestroyed();
+
+ public boolean isSchlossDestroyed();
}
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -0,0 +1,27 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.annotation.PreDestroy;
+import javax.context.Dependent;
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Current;
+
+@Stateful
+@Dependent
+public class LandgraffenSchloss implements Schloss
+{
+ @Current
+ private GrossStadt biggerCity;
+
+ @PreDestroy
+ public void destructionCallback()
+ {
+ biggerCity.schlossDestroyed();
+ }
+
+ @Remove
+ public void remove()
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/LandgraffenSchloss.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java 2009-03-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Mainz.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -23,8 +23,8 @@
@PostConstruct
public void performPostConstructChecks()
{
- assert placeOfInterest != null : "Injected field is missing";
- name = placeOfInterest.getName();
+ if ( placeOfInterest != null )
+ name = placeOfInterest.getName();
}
@Initializer
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+import javax.inject.Current;
+
+@Stateful
+public class Marburg implements UniStadt
+{
+ @Current
+ private Schloss theCastle;
+
+ @Remove
+ public void removeBean()
+ {
+ }
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Marburg.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -0,0 +1,11 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Local;
+
+@Local
+public interface Schloss
+{
+ public void destructionCallback();
+
+ public void remove();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/Schloss.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -0,0 +1,9 @@
+package org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle;
+
+import javax.ejb.Local;
+
+@Local
+public interface UniStadt
+{
+ public void removeBean();
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/enterprise/lifecycle/UniStadt.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java 2009-03-13 17:32:21 UTC (rev 1979)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/producer/method/disposal/definition/DisposalMethodDefinitionTest.java 2009-03-13 17:32:51 UTC (rev 1980)
@@ -22,8 +22,7 @@
@Test(groups = { "stub", "disposalMethod" })
@SpecAssertions({
@SpecAssertion(section = "3.4.6", id = "a"),
- @SpecAssertion(section = "3.4.6", id = "c"),
- @SpecAssertion(section = "3.4.6", id = "e")
+ @SpecAssertion(section = "3.4.6", id = "c")
})
public void testDisposalMethodCanBeOfSimpleOrSessionBean()
{
@@ -35,7 +34,7 @@
*/
@Test(groups = { "stub", "disposalMethod" })
@SpecAssertion(section = "3.4.6", id = "b")
- public void testDisposalMethodCanBeStaticOrNonStatic()
+ public void testDisposalMethodCanBeStatic()
{
assert false;
}
@@ -44,7 +43,7 @@
* A bean may declare multiple disposal methods
*/
@Test(groups = { "stub", "disposalMethod" })
- @SpecAssertion(section = "3.4.6", id = "d")
+ @SpecAssertion(section = "3.4.6", id = "e")
public void testBeanCanDeclareMultipleDisposalMethods()
{
assert false;
15 years, 10 months
[webbeans-commits] Webbeans SVN: r1979 - ri/trunk/impl/src/main/java/org/jboss/webbeans/event.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-03-13 13:32:21 -0400 (Fri, 13 Mar 2009)
New Revision: 1979
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
Log:
Finished EJB lifecycle tests that can work w/current RI
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-03-13 16:04:22 UTC (rev 1978)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-03-13 17:32:21 UTC (rev 1979)
@@ -123,7 +123,7 @@
List<AnnotatedParameter<?>> disposeParams = this.observerMethod.getAnnotatedParameters(Disposes.class);
if (disposeParams.size() > 0)
{
- throw new DefinitionException(this + " cannot have any parameters annotated with @Dispose");
+ throw new DefinitionException(this + " cannot have any parameters annotated with @Disposes");
}
// Check annotations on the method to make sure this is not a producer
// method, initializer method, or destructor method.
15 years, 10 months