[jboss-cvs] JBossAS SVN: r64400 - in projects/microcontainer/trunk/kernel/src: main/org/jboss/beans/metadata/plugins/annotations and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 1 11:43:33 EDT 2007
Author: alesj
Date: 2007-08-01 11:43:33 -0400 (Wed, 01 Aug 2007)
New Revision: 64400
Added:
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Demand.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanInstallSelf.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithComplicatedLifecycle.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithConstructorDependencyImpl.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithDependencyImpl.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithKernelControllerContextAware.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/DemandSimpleBeanImpl.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/DependSimpleBeanWithLifecycle.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/ExternalInstallSimpleBeanImpl.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/InstallSimpleBeanImpl.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/PlainDependecySimpleBeanImpl.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/PropertyDependecySimpleBeanImpl.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/SupplyPlainDependecySimpleBeanImpl.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyAnnotationTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ConstructorDependencyAnnotationTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DemandDependencyAnnotationTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/InstallDependencyAnnotationTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/InstallSelfDependencyAnnotationTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/KernelControllerContextAwareAnnotationTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainDependencyAnnotationTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyAnnotationTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PropertyDependencyAnnotationTestCase.java
Modified:
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/FromContext.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Demands.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/FromContext.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InstallMethod.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/UninstallMethod.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/DemandsAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InstallMethodParameterAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/UninstallMethodParameterAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/NamingBeanTestCase.xml
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/support/SimpleInject.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/SimpleBeanInstallSelf.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ConstructorDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DemandDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DependencyTestSuite.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryConstructorDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryDemandDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryOnDemandDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainLifecycleDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPropertyDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/OnDemandDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PropertyDependencyTestCase.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/NameAwareBean.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/NamingBeanTestCase.java
Log:
Dependency annotation tests.
Added fromContext="context" (see some old Juha's request with the @Context injection).
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/FromContext.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/FromContext.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/FromContext.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -77,6 +77,9 @@
/** id */
public static final FromContext ID = new IdFromContext("id");
+ /** context */
+ public static final FromContext CONTEXT = new ThisContext("context");
+
/** The type string */
protected final String fromString;
@@ -112,6 +115,8 @@
return SCOPE;
else if (ID.getFromString().equalsIgnoreCase(fromString))
return ID;
+ else if (CONTEXT.getFromString().equalsIgnoreCase(fromString))
+ return CONTEXT;
else
return new DynamicFromContext(fromString);
}
@@ -288,6 +293,22 @@
}
}
+ private static class ThisContext extends FromContext
+ {
+ private static final long serialVersionUID = 1L;
+
+ public ThisContext(String fromString)
+ {
+ super(fromString);
+ }
+
+ public ControllerContext internalExecute(ControllerContext context)
+ {
+ // todo - wrapper
+ return context;
+ }
+ }
+
private static class DynamicFromContext extends FromContext
{
private static final long serialVersionUID = 1L;
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Demand.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Demand.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Demand.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.ANNOTATION_TYPE})
+public @interface Demand
+{
+ String value();
+
+ String whenRequired() default "Instantiated";
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Demands.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Demands.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Demands.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -33,5 +33,5 @@
@Target({ElementType.TYPE})
public @interface Demands
{
- String[] value();
+ Demand[] value();
}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/FromContext.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/FromContext.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/FromContext.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -35,7 +35,8 @@
METADATA("metadata"),
BEANINFO("beaninfo"),
SCOPE("scope"),
- ID("id");
+ ID("id"),
+ CONTEXT("context");
private String typeString;
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InstallMethod.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InstallMethod.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/InstallMethod.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -33,7 +33,5 @@
@Target({ElementType.METHOD})
public @interface InstallMethod
{
- String bean() default "";
-
String dependantState() default "";
}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/UninstallMethod.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/UninstallMethod.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/UninstallMethod.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -33,7 +33,5 @@
@Target({ElementType.METHOD})
public @interface UninstallMethod
{
- String bean() default "";
-
String dependantState() default "";
}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/DemandsAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/DemandsAnnotationPlugin.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/DemandsAnnotationPlugin.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -25,6 +25,7 @@
import java.util.HashSet;
import org.jboss.beans.metadata.plugins.annotations.Demands;
+import org.jboss.beans.metadata.plugins.annotations.Demand;
import org.jboss.beans.metadata.plugins.AbstractDemandMetaData;
import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
import org.jboss.beans.metadata.spi.DemandMetaData;
@@ -32,6 +33,7 @@
import org.jboss.beans.metadata.spi.MetaDataVisitor;
import org.jboss.reflect.spi.ClassInfo;
import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.dependency.spi.ControllerState;
/**
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
@@ -53,9 +55,10 @@
((AbstractBeanMetaData)beanMetaData).setDemands(demands);
}
MetaDataVisitor visitor = getMetaDataVisitor(context);
- for(String demand : annotation.value())
+ for(Demand demand : annotation.value())
{
- AbstractDemandMetaData admd = new AbstractDemandMetaData(demand);
+ AbstractDemandMetaData admd = new AbstractDemandMetaData(demand.value());
+ admd.setWhenRequired(new ControllerState(demand.whenRequired()));
demands.add(admd);
admd.initialVisit(visitor);
admd.describeVisit(visitor);
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InstallMethodParameterAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InstallMethodParameterAnnotationPlugin.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InstallMethodParameterAnnotationPlugin.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -51,8 +51,6 @@
{
AbstractInstallMetaData install = new AbstractInstallMetaData();
install.setMethodName(info.getName());
- if (isAttributePresent(annotation.bean()))
- install.setBean(annotation.bean());
if (isAttributePresent(annotation.dependantState()))
install.setDependentState(new ControllerState(annotation.dependantState()));
return install;
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/UninstallMethodParameterAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/UninstallMethodParameterAnnotationPlugin.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/UninstallMethodParameterAnnotationPlugin.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -51,8 +51,6 @@
{
AbstractInstallMetaData uninstall = new AbstractInstallMetaData();
uninstall.setMethodName(info.getName());
- if (isAttributePresent(annotation.bean()))
- uninstall.setBean(annotation.bean());
if (isAttributePresent(annotation.dependantState()))
uninstall.setDependentState(new ControllerState(annotation.dependantState()));
return uninstall;
Modified: projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/NamingBeanTestCase.xml
===================================================================
--- projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/NamingBeanTestCase.xml 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/resources/tests/org/jboss/test/kernel/deployment/test/NamingBeanTestCase.xml 2007-08-01 15:43:33 UTC (rev 64400)
@@ -37,4 +37,8 @@
<property name="name"><inject bean="set_name_bean" fromContext="name"/></property>
</bean>
+ <bean name="context" class="org.jboss.test.kernel.deployment.support.NameAwareBean">
+ <property name="context"><inject bean="set_name_bean" fromContext="context"/></property>
+ </bean>
+
</deployment>
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/support/SimpleInject.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/support/SimpleInject.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/support/SimpleInject.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -42,12 +42,13 @@
import org.jboss.beans.metadata.plugins.annotations.UninstallMethod;
import org.jboss.beans.metadata.plugins.annotations.ListValue;
import org.jboss.beans.metadata.plugins.annotations.Value;
+import org.jboss.beans.metadata.plugins.annotations.Demand;
/**
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
@Aliases({"al", "test"})
- at Demands({"otherBean"})
+ at Demands({@Demand("otherBean")})
@Depends({"serviceBean"})
@Supplys({"txBean"})
public class SimpleInject
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanInstallSelf.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanInstallSelf.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanInstallSelf.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.InstallMethod;
+import org.jboss.beans.metadata.plugins.annotations.UninstallMethod;
+
+/**
+ * SimpleBeanInstallSelf.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AnnotatedSimpleBeanInstallSelf extends SimpleBeanInstallSelf
+{
+ @InstallMethod
+ public void install()
+ {
+ installed = true;
+ }
+
+ @UninstallMethod
+ public void uninstall()
+ {
+ installed = false;
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithComplicatedLifecycle.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithComplicatedLifecycle.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithComplicatedLifecycle.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,62 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Create;
+import org.jboss.beans.metadata.plugins.annotations.Start;
+import org.jboss.beans.metadata.plugins.annotations.Stop;
+import org.jboss.beans.metadata.plugins.annotations.Destroy;
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+
+/**
+ * A simple bean with a complicated lifecycle
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AnnotatedSimpleBeanWithComplicatedLifecycle extends SimpleBeanWithComplicatedLifecycle
+{
+ private static final long serialVersionUID = 3258132440433243443L;
+
+ @Create
+ public void notCreate(@Inject(bean = "Name1") SimpleBeanWithLifecycle bean)
+ {
+ super.notCreate(bean);
+ }
+
+ @Start
+ public void notStart(@Inject(bean = "Name2")SimpleBeanWithLifecycle bean)
+ {
+ super.notStart(bean);
+ }
+
+ @Stop
+ public void notStop(@Inject(bean = "Name3")SimpleBeanWithLifecycle bean)
+ {
+ super.notStop(bean);
+ }
+
+ @Destroy
+ public void notDestroy(@Inject(bean = "Name4")SimpleBeanWithLifecycle bean)
+ {
+ super.notDestroy(bean);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithConstructorDependencyImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithConstructorDependencyImpl.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithConstructorDependencyImpl.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,49 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Constructor;
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+
+/**
+ * A simple bean
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40438 $
+ */
+public class AnnotatedSimpleBeanWithConstructorDependencyImpl extends SimpleBeanWithConstructorDependencyImpl
+{
+ private static final long serialVersionUID = 3905240143387505464L;
+
+ @Constructor
+ public AnnotatedSimpleBeanWithConstructorDependencyImpl(@Inject(bean = "Name1") SimpleBean bean)
+ {
+ super(bean);
+ }
+
+ @StringValue("String2")
+ public void setString(String string)
+ {
+ super.setString(string);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithDependencyImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithDependencyImpl.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithDependencyImpl.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,48 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+
+/**
+ * A simple bean
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40439 $
+ */
+public class AnnotatedSimpleBeanWithDependencyImpl extends SimpleBeanWithDependencyImpl
+{
+ private static final long serialVersionUID = 3257004371517454132L;
+
+ @StringValue("String2")
+ public void setString(String string)
+ {
+ super.setString(string);
+ }
+
+ @Inject(bean = "Name1")
+ public void setSimpleBean(SimpleBean bean)
+ {
+ super.setSimpleBean(bean);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithKernelControllerContextAware.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithKernelControllerContextAware.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/AnnotatedSimpleBeanWithKernelControllerContextAware.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.kernel.spi.dependency.KernelControllerContext;
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+import org.jboss.beans.metadata.plugins.annotations.FromContext;
+
+/**
+ * A simple bean that is kernel controllercontext aware
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class AnnotatedSimpleBeanWithKernelControllerContextAware extends SimpleBeanWithKernelControllerContextAware
+{
+ @Inject(fromContext = FromContext.CONTEXT)
+ public void setKernelControllerContext(KernelControllerContext context) throws Exception
+ {
+ super.setKernelControllerContext(context);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/DemandSimpleBeanImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/DemandSimpleBeanImpl.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/DemandSimpleBeanImpl.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Demands;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Demand;
+
+/**
+ * A simple bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Demands({@Demand("WhatIWant")})
+public class DemandSimpleBeanImpl extends SimpleBeanImpl
+{
+ private static final long serialVersionUID = 3258132440433243443L;
+
+ @StringValue("String2")
+ public void setString(String string)
+ {
+ super.setString(string);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/DependSimpleBeanWithLifecycle.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/DependSimpleBeanWithLifecycle.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/DependSimpleBeanWithLifecycle.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Depends;
+
+/**
+ * A simple bean with a lifecycle
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Depends({"Name1"})
+public class DependSimpleBeanWithLifecycle extends SimpleBeanWithLifecycle
+{
+ private static final long serialVersionUID = 3258132440433243443L;
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/ExternalInstallSimpleBeanImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/ExternalInstallSimpleBeanImpl.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/ExternalInstallSimpleBeanImpl.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,73 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import java.io.Serializable;
+
+/**
+ * A simple bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ExternalInstallSimpleBeanImpl implements Serializable, SimpleBean
+{
+ // Constants -----------------------------------------------------
+
+ private static final long serialVersionUID = 3258132440433243443L;
+
+ // Attributes ----------------------------------------------------
+
+ private String constructorString;
+
+ private String string;
+
+ // Static --------------------------------------------------------
+
+ // Constructors --------------------------------------------------
+
+ public ExternalInstallSimpleBeanImpl()
+ {
+ constructorString = "()";
+ }
+
+ public ExternalInstallSimpleBeanImpl(String string)
+ {
+ constructorString = string;
+ }
+
+ // Public --------------------------------------------------------
+
+ public String getConstructorString()
+ {
+ return constructorString;
+ }
+
+ public String getString()
+ {
+ return string;
+ }
+
+ public void setString(String string)
+ {
+ this.string = string;
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/InstallSimpleBeanImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/InstallSimpleBeanImpl.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/InstallSimpleBeanImpl.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,31 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+/**
+ * A simple bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InstallSimpleBeanImpl extends SimpleBeanImpl
+{
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/PlainDependecySimpleBeanImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/PlainDependecySimpleBeanImpl.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/PlainDependecySimpleBeanImpl.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+
+/**
+ * A simple bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PlainDependecySimpleBeanImpl extends SimpleBeanImpl
+{
+ private static final long serialVersionUID = 3258132440433243443L;
+
+ @StringValue("String1")
+ public void setString(String string)
+ {
+ super.setString(string);
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/PropertyDependecySimpleBeanImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/PropertyDependecySimpleBeanImpl.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/PropertyDependecySimpleBeanImpl.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,40 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+
+/**
+ * A simple bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PropertyDependecySimpleBeanImpl extends SimpleBeanImpl
+{
+ private static final long serialVersionUID = 3258132440433243443L;
+
+ @Inject(bean = "Name1", property = "string")
+ public void setString(String string)
+ {
+ super.setString(string);
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/SimpleBeanInstallSelf.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/SimpleBeanInstallSelf.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/SimpleBeanInstallSelf.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -29,7 +29,7 @@
*/
public class SimpleBeanInstallSelf
{
- private boolean installed = false;
+ protected boolean installed = false;
public boolean getInstalled()
{
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/SupplyPlainDependecySimpleBeanImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/SupplyPlainDependecySimpleBeanImpl.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/support/SupplyPlainDependecySimpleBeanImpl.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.support;
+
+import org.jboss.beans.metadata.plugins.annotations.Supplys;
+
+/**
+ * A simple bean
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Supplys({"WhatIWant"})
+public class SupplyPlainDependecySimpleBeanImpl extends PlainDependecySimpleBeanImpl
+{
+ private static final long serialVersionUID = 3258132440433243443L;
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithComplicatedLifecycle;
+import org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle;
+
+/**
+ * Lifecycle Dependency Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ComplicatedLifecycleDependencyAnnotationTestCase extends ComplicatedLifecycleDependencyTestCase
+{
+ public static Test suite()
+ {
+ return suite(ComplicatedLifecycleDependencyAnnotationTestCase.class);
+ }
+
+ public ComplicatedLifecycleDependencyAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void buildMetaData()
+ {
+ AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
+ AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
+ AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("Name3", SimpleBeanWithLifecycle.class.getName());
+ AbstractBeanMetaData metaData4 = new AbstractBeanMetaData("Name4", SimpleBeanWithLifecycle.class.getName());
+ AbstractBeanMetaData metaData5 = new AbstractBeanMetaData("Name5", AnnotatedSimpleBeanWithComplicatedLifecycle.class.getName());
+
+ setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2, metaData3, metaData4, metaData5 });
+ }
+
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ComplicatedLifecycleDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -112,44 +112,7 @@
public void complicatedLifecycleDependencyCorrectOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("Name3", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData4 = new AbstractBeanMetaData("Name4", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData5 = new AbstractBeanMetaData("Name5", SimpleBeanWithComplicatedLifecycle.class.getName());
-
- AbstractLifecycleMetaData create = new AbstractLifecycleMetaData();
- create.setMethodName("notCreate");
- AbstractParameterMetaData parameter = new AbstractParameterMetaData(SimpleBeanWithLifecycle.class.getName(), new AbstractDependencyValueMetaData("Name1"));
- create.setParameters(Collections.singletonList((ParameterMetaData) parameter));
- metaData5.setCreate(create);
-
- AbstractLifecycleMetaData start = new AbstractLifecycleMetaData();
- start.setMethodName("notStart");
- parameter = new AbstractParameterMetaData();
- parameter.setValue(new AbstractDependencyValueMetaData("Name2"));
- start.setParameters(Collections.singletonList((ParameterMetaData) parameter));
- metaData5.setStart(start);
-
- AbstractLifecycleMetaData stop = new AbstractLifecycleMetaData();
- stop.setMethodName("notStop");
- parameter = new AbstractParameterMetaData();
- parameter.setValue(new AbstractDependencyValueMetaData("Name3"));
- stop.setParameters(Collections.singletonList((ParameterMetaData) parameter));
- metaData5.setStop(stop);
-
- AbstractLifecycleMetaData destroy = new AbstractLifecycleMetaData();
- destroy.setMethodName("notDestroy");
- parameter = new AbstractParameterMetaData();
- parameter.setValue(new AbstractDependencyValueMetaData("Name4"));
- destroy.setParameters(Collections.singletonList((ParameterMetaData) parameter));
- metaData5.setDestroy(destroy);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2, metaData3, metaData4, metaData5 });
+ buildMetaData();
}
public void testComplicatedLifecycleDependencyWrongOrder() throws Throwable
@@ -207,44 +170,7 @@
public void complicatedLifecycleDependencyWrongOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("Name3", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData4 = new AbstractBeanMetaData("Name4", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData5 = new AbstractBeanMetaData("Name5", SimpleBeanWithComplicatedLifecycle.class.getName());
-
- AbstractLifecycleMetaData create = new AbstractLifecycleMetaData();
- create.setMethodName("notCreate");
- AbstractParameterMetaData parameter = new AbstractParameterMetaData(SimpleBeanWithLifecycle.class.getName(), new AbstractDependencyValueMetaData("Name1"));
- create.setParameters(Collections.singletonList((ParameterMetaData) parameter));
- metaData5.setCreate(create);
-
- AbstractLifecycleMetaData start = new AbstractLifecycleMetaData();
- start.setMethodName("notStart");
- parameter = new AbstractParameterMetaData();
- parameter.setValue(new AbstractDependencyValueMetaData("Name2"));
- start.setParameters(Collections.singletonList((ParameterMetaData) parameter));
- metaData5.setStart(start);
-
- AbstractLifecycleMetaData stop = new AbstractLifecycleMetaData();
- stop.setMethodName("notStop");
- parameter = new AbstractParameterMetaData();
- parameter.setValue(new AbstractDependencyValueMetaData("Name3"));
- stop.setParameters(Collections.singletonList((ParameterMetaData) parameter));
- metaData5.setStop(stop);
-
- AbstractLifecycleMetaData destroy = new AbstractLifecycleMetaData();
- destroy.setMethodName("notDestroy");
- parameter = new AbstractParameterMetaData();
- parameter.setValue(new AbstractDependencyValueMetaData("Name4"));
- destroy.setParameters(Collections.singletonList((ParameterMetaData) parameter));
- metaData5.setDestroy(destroy);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2, metaData3, metaData4, metaData5 });
+ buildMetaData();
}
public void testComplicatedLifecycleDependencyReinstall() throws Throwable
@@ -615,14 +541,19 @@
public void complicatedLifecycleDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
+
AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
AbstractBeanMetaData metaData3 = new AbstractBeanMetaData("Name3", SimpleBeanWithLifecycle.class.getName());
-
+
AbstractBeanMetaData metaData4 = new AbstractBeanMetaData("Name4", SimpleBeanWithLifecycle.class.getName());
-
+
AbstractBeanMetaData metaData5 = new AbstractBeanMetaData("Name5", SimpleBeanWithComplicatedLifecycle.class.getName());
AbstractLifecycleMetaData create = new AbstractLifecycleMetaData();
@@ -630,7 +561,7 @@
AbstractParameterMetaData parameter = new AbstractParameterMetaData(SimpleBeanWithLifecycle.class.getName(), new AbstractDependencyValueMetaData("Name1"));
create.setParameters(Collections.singletonList((ParameterMetaData) parameter));
metaData5.setCreate(create);
-
+
AbstractLifecycleMetaData start = new AbstractLifecycleMetaData();
start.setMethodName("notStart");
parameter = new AbstractParameterMetaData();
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ConstructorDependencyAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ConstructorDependencyAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ConstructorDependencyAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithConstructorDependencyImpl;
+import org.jboss.test.kernel.dependency.support.PlainDependecySimpleBeanImpl;
+
+/**
+ * Constructor Dependency Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ConstructorDependencyAnnotationTestCase extends ConstructorDependencyTestCase
+{
+ public static Test suite()
+ {
+ return suite(ConstructorDependencyAnnotationTestCase.class);
+ }
+
+ public ConstructorDependencyAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void buildMetaData()
+ {
+ BeanMetaDataBuilder bmd1 = BeanMetaDataBuilderFactory.createBuilder("Name1", PlainDependecySimpleBeanImpl.class.getName());
+ BeanMetaDataBuilder bmd2 = BeanMetaDataBuilderFactory.createBuilder("Name2", AnnotatedSimpleBeanWithConstructorDependencyImpl.class.getName());
+ setBeanMetaDatas(new BeanMetaData[] { bmd1.getBeanMetaData(), bmd2.getBeanMetaData() });
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ConstructorDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ConstructorDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/ConstructorDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -83,22 +83,7 @@
public void constructorDependencyCorrectOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithConstructorDependencyImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", "String2"));
- metaData2.setProperties(attributes2);
- ArrayList<ParameterMetaData> constructor2 = new ArrayList<ParameterMetaData>();
- constructor2.add(new AbstractParameterMetaData(SimpleBean.class.getName(), new AbstractDependencyValueMetaData("Name1")));
- AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
- metaData2.setConstructor(cmd);
- cmd.setParameters(constructor2);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testConstructorDependencyWrongOrder() throws Throwable
@@ -122,22 +107,7 @@
public void constructorDependencyWrongOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithConstructorDependencyImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", "String2"));
- metaData2.setProperties(attributes2);
- ArrayList<ParameterMetaData> constructor2 = new ArrayList<ParameterMetaData>();
- constructor2.add(new AbstractParameterMetaData(SimpleBean.class.getName(), new AbstractDependencyValueMetaData("Name1")));
- AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
- metaData2.setConstructor(cmd);
- cmd.setParameters(constructor2);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testConstructorDependencyReinstall() throws Throwable
@@ -198,11 +168,16 @@
public void constructorDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
attributes1.add(new AbstractPropertyMetaData("string", "String1"));
metaData1.setProperties(attributes1);
-
+
AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithConstructorDependencyImpl.class.getName());
HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
attributes2.add(new AbstractPropertyMetaData("string", "String2"));
@@ -212,7 +187,7 @@
AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
metaData2.setConstructor(cmd);
cmd.setParameters(constructor2);
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DemandDependencyAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DemandDependencyAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DemandDependencyAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,60 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.test.kernel.dependency.support.DemandSimpleBeanImpl;
+import org.jboss.test.kernel.dependency.support.SupplyPlainDependecySimpleBeanImpl;
+import org.jboss.dependency.spi.ControllerState;
+
+/**
+ * Demand Dependency Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class DemandDependencyAnnotationTestCase extends DemandDependencyTestCase
+{
+ public static Test suite()
+ {
+ return suite(DemandDependencyAnnotationTestCase.class);
+ }
+
+ public DemandDependencyAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected ControllerState getWhenRequiredState()
+ {
+ return ControllerState.DESCRIBED;
+ }
+
+ protected void buildMetaData()
+ {
+ BeanMetaDataBuilder bmd1 = BeanMetaDataBuilderFactory.createBuilder("Name1", SupplyPlainDependecySimpleBeanImpl.class.getName());
+ BeanMetaDataBuilder bmd2 = BeanMetaDataBuilderFactory.createBuilder("Name2", DemandSimpleBeanImpl.class.getName());
+ setBeanMetaDatas(new BeanMetaData[] { bmd1.getBeanMetaData(), bmd2.getBeanMetaData() });
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DemandDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DemandDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DemandDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -78,30 +78,14 @@
public void demandDependencyCorrectOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
- HashSet<SupplyMetaData> supplies = new HashSet<SupplyMetaData>();
- supplies.add(new AbstractSupplyMetaData("WhatIWant"));
- metaData1.setSupplies(supplies);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", "String2"));
- metaData2.setProperties(attributes2);
- HashSet<DemandMetaData> demands = new HashSet<DemandMetaData>();
- demands.add(new AbstractDemandMetaData("WhatIWant"));
- metaData2.setDemands(demands);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testDemandDependencyWrongOrder() throws Throwable
{
demandDependencyWrongOrder();
- ControllerContext context2 = assertInstall(1, "Name2", ControllerState.PRE_INSTALL);
+ ControllerContext context2 = assertInstall(1, "Name2", getWhenRequiredState());
ControllerContext context1 = assertInstall(0, "Name1");
assertEquals(ControllerState.INSTALLED, context2.getState());
@@ -116,23 +100,7 @@
public void demandDependencyWrongOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
- HashSet<SupplyMetaData> supplies = new HashSet<SupplyMetaData>();
- supplies.add(new AbstractSupplyMetaData("WhatIWant"));
- metaData1.setSupplies(supplies);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", "String2"));
- metaData2.setProperties(attributes2);
- HashSet<DemandMetaData> demands = new HashSet<DemandMetaData>();
- demands.add(new AbstractDemandMetaData("WhatIWant"));
- metaData2.setDemands(demands);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testDemandDependencyReinstall() throws Throwable
@@ -152,10 +120,10 @@
assertUninstall("Name1");
assertEquals(ControllerState.ERROR, context1.getState());
- assertEquals(ControllerState.PRE_INSTALL, context2.getState());
+ assertEquals(getWhenRequiredState(), context2.getState());
assertNotInstalled("Name2");
- assertContext("Name2", ControllerState.PRE_INSTALL);
+ assertContext("Name2", getWhenRequiredState());
context1 = assertInstall(0, "Name1");
assertNotNull(context1);
@@ -190,6 +158,16 @@
public void demandDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected ControllerState getWhenRequiredState()
+ {
+ return ControllerState.PRE_INSTALL;
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
attributes1.add(new AbstractPropertyMetaData("string", "String1"));
@@ -197,7 +175,7 @@
HashSet<SupplyMetaData> supplies = new HashSet<SupplyMetaData>();
supplies.add(new AbstractSupplyMetaData("WhatIWant"));
metaData1.setSupplies(supplies);
-
+
AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName());
HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
attributes2.add(new AbstractPropertyMetaData("string", "String2"));
@@ -205,7 +183,7 @@
HashSet<DemandMetaData> demands = new HashSet<DemandMetaData>();
demands.add(new AbstractDemandMetaData("WhatIWant"));
metaData2.setDemands(demands);
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DependencyTestSuite.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DependencyTestSuite.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/DependencyTestSuite.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -44,6 +44,7 @@
suite.addTest(PlainDependencyTestCase.suite());
suite.addTest(PlainDependencyXMLTestCase.suite());
+ suite.addTest(PlainDependencyAnnotationTestCase.suite());
suite.addTest(GenericBeanFactoryPlainDependencyTestCase.suite());
suite.addTest(GenericBeanFactoryPlainDependencyXMLTestCase.suite());
suite.addTest(OnDemandDependencyTestCase.suite());
@@ -52,31 +53,38 @@
suite.addTest(GenericBeanFactoryOnDemandDependencyXMLTestCase.suite());
suite.addTest(PropertyDependencyTestCase.suite());
suite.addTest(PropertyDependencyXMLTestCase.suite());
+ suite.addTest(PropertyDependencyAnnotationTestCase.suite());
suite.addTest(GenericBeanFactoryPropertyDependencyTestCase.suite());
suite.addTest(GenericBeanFactoryPropertyDependencyXMLTestCase.suite());
suite.addTest(ConstructorDependencyTestCase.suite());
suite.addTest(ConstructorDependencyXMLTestCase.suite());
+ suite.addTest(ConstructorDependencyAnnotationTestCase.suite());
suite.addTest(GenericBeanFactoryConstructorDependencyTestCase.suite());
suite.addTest(GenericBeanFactoryConstructorDependencyXMLTestCase.suite());
suite.addTest(DemandDependencyTestCase.suite());
suite.addTest(DemandDependencyXMLTestCase.suite());
+ suite.addTest(DemandDependencyAnnotationTestCase.suite());
suite.addTest(GenericBeanFactoryDemandDependencyTestCase.suite());
suite.addTest(GenericBeanFactoryDemandDependencyXMLTestCase.suite());
suite.addTest(PlainLifecycleDependencyTestCase.suite());
suite.addTest(PlainLifecycleDependencyXMLTestCase.suite());
+ suite.addTest(PlainLifecycleDependencyAnnotationTestCase.suite());
suite.addTest(GenericBeanFactoryPlainLifecycleDependencyTestCase.suite());
suite.addTest(GenericBeanFactoryPlainLifecycleDependencyXMLTestCase.suite());
suite.addTest(ComplicatedLifecycleDependencyTestCase.suite());
suite.addTest(ComplicatedLifecycleDependencyXMLTestCase.suite());
+ suite.addTest(ComplicatedLifecycleDependencyAnnotationTestCase.suite());
suite.addTest(KernelControllerContextAwareTestCase.suite());
suite.addTest(KernelControllerContextAwareXMLTestCase.suite());
+ suite.addTest(KernelControllerContextAwareAnnotationTestCase.suite());
suite.addTest(InstallDependencyTestCase.suite());
suite.addTest(InstallDependencyXMLTestCase.suite());
+// suite.addTest(InstallDependencyAnnotationTestCase.suite()); // TODO
suite.addTest(GenericBeanFactoryInstallDependencyTestCase.suite());
suite.addTest(GenericBeanFactoryInstallDependencyXMLTestCase.suite());
suite.addTest(InstallSelfDependencyTestCase.suite());
suite.addTest(InstallSelfDependencyXMLTestCase.suite());
-
+ suite.addTest(InstallSelfDependencyAnnotationTestCase.suite());
return suite;
}
}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryConstructorDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryConstructorDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryConstructorDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -84,18 +84,7 @@
public void constructorDependencyCorrectOrder() throws Throwable
{
- GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithConstructorDependencyImpl.class.getName());
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
- AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
- ArrayList<ParameterMetaData> constructor2 = new ArrayList<ParameterMetaData>();
- constructor2.add(new AbstractParameterMetaData(GenericBeanFactory.class.getName(), new AbstractDependencyValueMetaData("Name1")));
- cmd.setParameters(constructor2);
- metaData2.setBeanConstructor(cmd);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryConstructorDependencyWrongOrder() throws Throwable
@@ -121,18 +110,7 @@
public void constructorDependencyWrongOrder() throws Throwable
{
- GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithConstructorDependencyImpl.class.getName());
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
- AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
- ArrayList<ParameterMetaData> constructor2 = new ArrayList<ParameterMetaData>();
- constructor2.add(new AbstractParameterMetaData(GenericBeanFactory.class.getName(), new AbstractDependencyValueMetaData("Name1")));
- cmd.setParameters(constructor2);
- metaData2.setBeanConstructor(cmd);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryConstructorDependencyReinstall() throws Throwable
@@ -199,9 +177,14 @@
public void constructorDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
-
+
GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithConstructorDependencyImpl.class.getName());
metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
AbstractConstructorMetaData cmd = new AbstractConstructorMetaData();
@@ -209,7 +192,7 @@
constructor2.add(new AbstractParameterMetaData(GenericBeanFactory.class.getName(), new AbstractDependencyValueMetaData("Name1")));
cmd.setParameters(constructor2);
metaData2.setBeanConstructor(cmd);
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryDemandDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryDemandDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryDemandDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -80,19 +80,7 @@
public void demandDependencyCorrectOrder() throws Throwable
{
- GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
- HashSet<SupplyMetaData> supplies = new HashSet<SupplyMetaData>();
- supplies.add(new AbstractSupplyMetaData("WhatIWant"));
- metaData1.setSupplies(supplies);
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName());
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
- HashSet<DemandMetaData> demands = new HashSet<DemandMetaData>();
- demands.add(new AbstractDemandMetaData("WhatIWant"));
- metaData2.setDemands(demands);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryDemandDependencyWrongOrder() throws Throwable
@@ -115,19 +103,7 @@
public void demandDependencyWrongOrder() throws Throwable
{
- GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
- HashSet<SupplyMetaData> supplies = new HashSet<SupplyMetaData>();
- supplies.add(new AbstractSupplyMetaData("WhatIWant"));
- metaData1.setSupplies(supplies);
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName());
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
- HashSet<DemandMetaData> demands = new HashSet<DemandMetaData>();
- demands.add(new AbstractDemandMetaData("WhatIWant"));
- metaData2.setDemands(demands);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryDemandDependencyReinstall() throws Throwable
@@ -190,18 +166,23 @@
public void demandDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
HashSet<SupplyMetaData> supplies = new HashSet<SupplyMetaData>();
supplies.add(new AbstractSupplyMetaData("WhatIWant"));
metaData1.setSupplies(supplies);
-
+
GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName());
metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
HashSet<DemandMetaData> demands = new HashSet<DemandMetaData>();
demands.add(new AbstractDemandMetaData("WhatIWant"));
metaData2.setDemands(demands);
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryOnDemandDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryOnDemandDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryOnDemandDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -81,15 +81,7 @@
public void onDemandDependencyOnDemandFirst() throws Throwable
{
- GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.setMode(ControllerMode.ON_DEMAND);
- metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
- metaData2.addBeanProperty(new AbstractPropertyMetaData("factory", new AbstractDependencyValueMetaData("Name1")));
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryOnDemandDependencyOnDemandSecond() throws Throwable
@@ -114,15 +106,7 @@
public void onDemandDependencyOnDemandSecond() throws Throwable
{
- GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.setMode(ControllerMode.ON_DEMAND);
- metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
- metaData2.addBeanProperty(new AbstractPropertyMetaData("factory", new AbstractDependencyValueMetaData("Name1")));
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryOnDemandDependencyReinstall() throws Throwable
@@ -190,14 +174,19 @@
public void onDemandDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
GenericBeanFactoryMetaData metaData1 = new GenericBeanFactoryMetaData("Name1", SimpleBeanImpl.class.getName());
metaData1.setMode(ControllerMode.ON_DEMAND);
metaData1.addBeanProperty(new AbstractPropertyMetaData("string", "String1"));
-
+
GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
metaData2.addBeanProperty(new AbstractPropertyMetaData("string", "String2"));
metaData2.addBeanProperty(new AbstractPropertyMetaData("factory", new AbstractDependencyValueMetaData("Name1")));
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -79,18 +79,7 @@
public void genericBeanFactoryDependencyCorrectOrder()
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("simple", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("aspect");
- metaData2.addProperty(new AbstractPropertyMetaData("bean", SimpleBeanWithDependencyImpl.class.getName()));
- metaData2.addProperty(new AbstractPropertyMetaData("constructor", new AbstractConstructorMetaData()));
- metaData2.addBeanProperty(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("simple")));
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", new AbstractValueMetaData("factory")));
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryDependencyWrongOrder() throws Throwable
@@ -109,18 +98,7 @@
public void genericBeanFactoryDependencyWrongOrder()
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("simple", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("aspect");
- metaData2.addProperty(new AbstractPropertyMetaData("bean", SimpleBeanWithDependencyImpl.class.getName()));
- metaData2.addProperty(new AbstractPropertyMetaData("constructor", new AbstractConstructorMetaData()));
- metaData2.addBeanProperty(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("simple")));
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", new AbstractValueMetaData("factory")));
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryDependencyReinstall() throws Throwable
@@ -161,6 +139,11 @@
public void genericBeanFactoryDependencyReinstall()
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("simple", SimpleBeanImpl.class.getName());
HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
attributes1.add(new AbstractPropertyMetaData("string", "String1"));
@@ -171,7 +154,7 @@
metaData2.addProperty(new AbstractPropertyMetaData("constructor", new AbstractConstructorMetaData()));
metaData2.addBeanProperty(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("simple")));
metaData2.addBeanProperty(new AbstractPropertyMetaData("string", new AbstractValueMetaData("factory")));
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainLifecycleDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainLifecycleDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPlainLifecycleDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -80,14 +80,7 @@
public void plainLifecycleDependencyCorrectOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
- HashSet<DependencyMetaData> depends = new HashSet<DependencyMetaData>();
- depends.add(new AbstractDependencyMetaData("Name1"));
- metaData2.setDepends(depends);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryPlainLifecycleDependencyWrongOrder() throws Throwable
@@ -113,14 +106,7 @@
public void plainLifecycleDependencyWrongOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
- HashSet<DependencyMetaData> depends = new HashSet<DependencyMetaData>();
- depends.add(new AbstractDependencyMetaData("Name1"));
- metaData2.setDepends(depends);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryPlainLifecycleDependencyReinstall() throws Throwable
@@ -178,8 +164,13 @@
public void plainLifecycleDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
+
GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
HashSet<DependencyMetaData> depends = new HashSet<DependencyMetaData>();
depends.add(new AbstractDependencyMetaData("Name1"));
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPropertyDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPropertyDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/GenericBeanFactoryPropertyDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -76,13 +76,7 @@
public void propertyDependencyCorrectOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.addProperty(new AbstractPropertyMetaData("string", "String1"));
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName());
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", new AbstractDependencyValueMetaData("Name1", "string")));
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryPropertyDependencyWrongOrder() throws Throwable
@@ -105,13 +99,7 @@
public void propertyDependencyWrongOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.addProperty(new AbstractPropertyMetaData("string", "String1"));
-
- GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName());
- metaData2.addBeanProperty(new AbstractPropertyMetaData("string", new AbstractDependencyValueMetaData("Name1", "string")));
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testGenericBeanFactoryPropertyDependencyReinstall() throws Throwable
@@ -171,12 +159,17 @@
public void propertyDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
metaData1.addProperty(new AbstractPropertyMetaData("string", "String1"));
-
+
GenericBeanFactoryMetaData metaData2 = new GenericBeanFactoryMetaData("Name2", SimpleBeanImpl.class.getName());
metaData2.addBeanProperty(new AbstractPropertyMetaData("string", new AbstractDependencyValueMetaData("Name1", "string")));
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/InstallDependencyAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/InstallDependencyAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/InstallDependencyAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+
+/**
+ * Install Dependency Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InstallDependencyAnnotationTestCase extends InstallDependencyTestCase
+{
+ public static Test suite()
+ {
+ return suite(InstallDependencyAnnotationTestCase.class);
+ }
+
+ public InstallDependencyAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+/*
+ protected void setupBeanMetaDatas() throws Throwable
+ {
+ AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanRepository.class.getName());
+ AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", ExternalInstallSimpleBeanImpl.class.getName());
+ setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ }
+*/
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/InstallSelfDependencyAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/InstallSelfDependencyAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/InstallSelfDependencyAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanInstallSelf;
+
+/**
+ * Install Dependency Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InstallSelfDependencyAnnotationTestCase extends InstallSelfDependencyTestCase
+{
+ public static Test suite()
+ {
+ return suite(InstallSelfDependencyAnnotationTestCase.class);
+ }
+
+ public InstallSelfDependencyAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void setupBeanMetaDatas() throws Throwable
+ {
+ AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", AnnotatedSimpleBeanInstallSelf.class.getName());
+ setBeanMetaDatas(new BeanMetaData[] { metaData1 });
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/KernelControllerContextAwareAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/KernelControllerContextAwareAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/KernelControllerContextAwareAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithKernelControllerContextAware;
+
+/**
+ * KernelControllerContextAware Test Case.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 40727 $
+ */
+public class KernelControllerContextAwareAnnotationTestCase extends KernelControllerContextAwareTestCase
+{
+ public static Test suite()
+ {
+ return suite(KernelControllerContextAwareAnnotationTestCase.class);
+ }
+
+ public KernelControllerContextAwareAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ public void kernelControllerContextAware() throws Throwable
+ {
+ AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", AnnotatedSimpleBeanWithKernelControllerContextAware.class.getName());
+ setBeanMetaDatas(new BeanMetaData[] { metaData1 });
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/OnDemandDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/OnDemandDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/OnDemandDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -81,19 +81,7 @@
public void onDemandDependencyOnDemandFirst() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.setMode(ControllerMode.ON_DEMAND);
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", "String2"));
- attributes2.add(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("Name1")));
- metaData2.setProperties(attributes2);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testOnDemandDependencyOnDemandSecond() throws Throwable
@@ -116,19 +104,7 @@
public void onDemandDependencyOnDemandSecond() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- metaData1.setMode(ControllerMode.ON_DEMAND);
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", "String2"));
- attributes2.add(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("Name1")));
- metaData2.setProperties(attributes2);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testOnDemandDependencyReinstall() throws Throwable
@@ -189,18 +165,23 @@
public void onDemandDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
metaData1.setMode(ControllerMode.ON_DEMAND);
HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
attributes1.add(new AbstractPropertyMetaData("string", "String1"));
metaData1.setProperties(attributes1);
-
+
AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
attributes2.add(new AbstractPropertyMetaData("string", "String2"));
attributes2.add(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("Name1")));
metaData2.setProperties(attributes2);
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainDependencyAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainDependencyAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainDependencyAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.test.kernel.dependency.support.PlainDependecySimpleBeanImpl;
+import org.jboss.test.kernel.dependency.support.AnnotatedSimpleBeanWithDependencyImpl;
+
+/**
+ * Plain Dependency Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PlainDependencyAnnotationTestCase extends PlainDependencyTestCase
+{
+ public static Test suite()
+ {
+ return suite(PlainDependencyAnnotationTestCase.class);
+ }
+
+ public PlainDependencyAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void buildMetaData()
+ {
+ BeanMetaDataBuilder bmd1 = BeanMetaDataBuilderFactory.createBuilder("Name1", PlainDependecySimpleBeanImpl.class.getName());
+ BeanMetaDataBuilder bmd2 = BeanMetaDataBuilderFactory.createBuilder("Name2", AnnotatedSimpleBeanWithDependencyImpl.class.getName());
+ setBeanMetaDatas(new BeanMetaData[] { bmd1.getBeanMetaData(), bmd2.getBeanMetaData() });
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -79,18 +79,7 @@
public void plainDependencyCorrectOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", "String2"));
- attributes2.add(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("Name1")));
- metaData2.setProperties(attributes2);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testPlainDependencyWrongOrder() throws Throwable
@@ -113,18 +102,7 @@
public void plainDependencyWrongOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", "String2"));
- attributes2.add(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("Name1")));
- metaData2.setProperties(attributes2);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testPlainDependencyReinstall() throws Throwable
@@ -184,17 +162,22 @@
public void plainDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
attributes1.add(new AbstractPropertyMetaData("string", "String1"));
metaData1.setProperties(attributes1);
-
+
AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithDependencyImpl.class.getName());
HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
attributes2.add(new AbstractPropertyMetaData("string", "String2"));
attributes2.add(new AbstractPropertyMetaData("simpleBean", new AbstractDependencyValueMetaData("Name1")));
metaData2.setProperties(attributes2);
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,53 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.test.kernel.dependency.support.DependSimpleBeanWithLifecycle;
+import org.jboss.test.kernel.dependency.support.SimpleBeanWithLifecycle;
+
+/**
+ * Lifecycle Dependency Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PlainLifecycleDependencyAnnotationTestCase extends PlainLifecycleDependencyTestCase
+{
+ public static Test suite()
+ {
+ return suite(PlainLifecycleDependencyAnnotationTestCase.class);
+ }
+
+ public PlainLifecycleDependencyAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void buildMetaData()
+ {
+ AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
+ AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", DependSimpleBeanWithLifecycle.class.getName());
+ setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PlainLifecycleDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -77,14 +77,7 @@
public void plainLifecycleDependencyCorrectOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
- HashSet<DependencyMetaData> depends = new HashSet<DependencyMetaData>();
- depends.add(new AbstractDependencyMetaData("Name1"));
- metaData2.setDepends(depends);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testPlainLifecycleDependencyWrongOrder() throws Throwable
@@ -109,14 +102,7 @@
public void plainLifecycleDependencyWrongOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
- HashSet<DependencyMetaData> depends = new HashSet<DependencyMetaData>();
- depends.add(new AbstractDependencyMetaData("Name1"));
- metaData2.setDepends(depends);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testPlainLifecycleDependencyReinstall() throws Throwable
@@ -178,8 +164,13 @@
public void plainLifecycleDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanWithLifecycle.class.getName());
-
+
AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanWithLifecycle.class.getName());
HashSet<DependencyMetaData> depends = new HashSet<DependencyMetaData>();
depends.add(new AbstractDependencyMetaData("Name1"));
Added: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PropertyDependencyAnnotationTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PropertyDependencyAnnotationTestCase.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PropertyDependencyAnnotationTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -0,0 +1,54 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.kernel.dependency.test;
+
+import junit.framework.Test;
+import org.jboss.beans.metadata.plugins.builder.BeanMetaDataBuilderFactory;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.spi.builder.BeanMetaDataBuilder;
+import org.jboss.test.kernel.dependency.support.PlainDependecySimpleBeanImpl;
+import org.jboss.test.kernel.dependency.support.PropertyDependecySimpleBeanImpl;
+
+/**
+ * Property Dependency Test Case.
+ *
+ * @author <a href="ales.justin at jboss.com">Ales Justin</a>
+ */
+public class PropertyDependencyAnnotationTestCase extends PropertyDependencyTestCase
+{
+ public static Test suite()
+ {
+ return suite(PropertyDependencyAnnotationTestCase.class);
+ }
+
+ public PropertyDependencyAnnotationTestCase(String name) throws Throwable
+ {
+ super(name);
+ }
+
+ protected void buildMetaData()
+ {
+ BeanMetaDataBuilder bmd1 = BeanMetaDataBuilderFactory.createBuilder("Name1", PlainDependecySimpleBeanImpl.class.getName());
+ BeanMetaDataBuilder bmd2 = BeanMetaDataBuilderFactory.createBuilder("Name2", PropertyDependecySimpleBeanImpl.class.getName());
+ setBeanMetaDatas(new BeanMetaData[] { bmd1.getBeanMetaData(), bmd2.getBeanMetaData() });
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PropertyDependencyTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PropertyDependencyTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/dependency/test/PropertyDependencyTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -76,17 +76,7 @@
public void propertyDependencyCorrectOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", new AbstractDependencyValueMetaData("Name1", "string")));
- metaData2.setProperties(attributes2);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testPropertyDependencyWrongOrder() throws Throwable
@@ -108,17 +98,7 @@
public void propertyDependencyWrongOrder() throws Throwable
{
- AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
- attributes1.add(new AbstractPropertyMetaData("string", "String1"));
- metaData1.setProperties(attributes1);
-
- AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName());
- HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
- attributes2.add(new AbstractPropertyMetaData("string", new AbstractDependencyValueMetaData("Name1", "string")));
- metaData2.setProperties(attributes2);
-
- setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
+ buildMetaData();
}
public void testPropertyDependencyReinstall() throws Throwable
@@ -175,16 +155,21 @@
public void propertyDependencyReinstall() throws Throwable
{
+ buildMetaData();
+ }
+
+ protected void buildMetaData()
+ {
AbstractBeanMetaData metaData1 = new AbstractBeanMetaData("Name1", SimpleBeanImpl.class.getName());
HashSet<PropertyMetaData> attributes1 = new HashSet<PropertyMetaData>();
attributes1.add(new AbstractPropertyMetaData("string", "String1"));
metaData1.setProperties(attributes1);
-
+
AbstractBeanMetaData metaData2 = new AbstractBeanMetaData("Name2", SimpleBeanImpl.class.getName());
HashSet<PropertyMetaData> attributes2 = new HashSet<PropertyMetaData>();
attributes2.add(new AbstractPropertyMetaData("string", new AbstractDependencyValueMetaData("Name1", "string")));
metaData2.setProperties(attributes2);
-
+
setBeanMetaDatas(new BeanMetaData[] { metaData1, metaData2 });
}
}
\ No newline at end of file
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/NameAwareBean.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/NameAwareBean.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/support/NameAwareBean.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -26,6 +26,7 @@
import org.jboss.metadata.spi.MetaData;
import org.jboss.metadata.spi.scope.ScopeKey;
import org.jboss.beans.info.spi.BeanInfo;
+import org.jboss.dependency.spi.ControllerContext;
/**
* A simple bean with name
@@ -40,6 +41,7 @@
private BeanInfo beaninfo;
private ScopeKey scopeKey;
private Object dynamic;
+ private ControllerContext context;
public String getName()
{
@@ -105,4 +107,14 @@
{
this.beaninfo = beaninfo;
}
+
+ public ControllerContext getContext()
+ {
+ return context;
+ }
+
+ public void setContext(ControllerContext context)
+ {
+ this.context = context;
+ }
}
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/NamingBeanTestCase.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/NamingBeanTestCase.java 2007-08-01 15:08:43 UTC (rev 64399)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/deployment/test/NamingBeanTestCase.java 2007-08-01 15:43:33 UTC (rev 64400)
@@ -88,5 +88,9 @@
NameAwareBean other = (NameAwareBean)getBean("other");
assertNotNull(other);
assertEquals("set_name_bean", other.getName());
+
+ NameAwareBean context = (NameAwareBean)getBean("context");
+ assertNotNull(context);
+ assertNotNull(context.getContext());
}
}
More information about the jboss-cvs-commits
mailing list