From portal-commits at lists.jboss.org Thu Oct 11 11:40:01 2007 Content-Type: multipart/mixed; boundary="===============4690331660586721852==" MIME-Version: 1.0 From: portal-commits at lists.jboss.org To: portal-commits at lists.jboss.org Subject: [portal-commits] JBoss Portal SVN: r8605 - in modules/test/trunk/mc/src/main/org/jboss: unit/mc and 1 other directories. Date: Thu, 11 Oct 2007 11:40:00 -0400 Message-ID: --===============4690331660586721852== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: julien(a)jboss.com Date: 2007-10-11 11:40:00 -0400 (Thu, 11 Oct 2007) New Revision: 8605 Modified: modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootstr= ap.java Log: added support on the @Bootstrap annotation to specify the name under which = the annotated bean will be available in the kernel Modified: modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.ja= va =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java 200= 7-10-11 15:24:17 UTC (rev 8604) +++ modules/test/trunk/mc/src/main/org/jboss/test/unit/mc/SomeTest.java 200= 7-10-11 15:40:00 UTC (rev 8605) @@ -30,7 +30,7 @@ * @author Julien Viet * @version $Revision: 1.1 $ */ -(a)Bootstrap(id=3D"/blah/toto.xml") +(a)Bootstrap(resourceName =3D"/blah/toto.xml") public class SomeTest { = Modified: modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.= java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java 2= 007-10-11 15:24:17 UTC (rev 8604) +++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/MCTestLifeCycle.java 2= 007-10-11 15:40:00 UTC (rev 8605) @@ -73,16 +73,16 @@ Class testClass =3D testCase.getPOJO().getClass(); = // - Bootstrap blah =3D testClass.getAnnotation(Bootstrap.class); - if (blah =3D=3D null) + Bootstrap bootstrapAnnotation =3D testClass.getAnnotation(Bootstrap.= class); + if (bootstrapAnnotation =3D=3D null) { throw new TestCaseLifeCycleException("No Bootstrap annotation fou= nd"); } = - URL url =3D testClass.getResource(blah.id()); + URL url =3D testClass.getResource(bootstrapAnnotation.resourceName()= ); if (url =3D=3D null) { - throw new TestCaseLifeCycleException("No URL found for bean xml "= + blah.id()); + throw new TestCaseLifeCycleException("No URL found for bean xml "= + bootstrapAnnotation.resourceName()); } = // setup MC @@ -90,7 +90,10 @@ = try { - AbstractBeanMetaData bmd =3D new AbstractBeanMetaData("TestCase",= testClass.getName()); + String beanName =3D bootstrapAnnotation.beanName(); + + // + AbstractBeanMetaData bmd =3D new AbstractBeanMetaData(beanName, t= estClass.getName()); AbstractConstructorMetaData cmd =3D new AbstractConstructorMetaDa= ta(); bmd.setConstructor(cmd); TestCaseFactory factory =3D new TestCaseFactory(testCase.getPOJO(= )); Modified: modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/= Bootstrap.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootst= rap.java 2007-10-11 15:24:17 UTC (rev 8604) +++ modules/test/trunk/mc/src/main/org/jboss/unit/mc/api/annotations/Bootst= rap.java 2007-10-11 15:40:00 UTC (rev 8605) @@ -31,7 +31,7 @@ import java.lang.annotation.ElementType; = /** - * Annotate + * Annotate a bean that will trigger the bootstrap of a micro container ke= rnel. * * @author Julien Viet * @version $Revision: 1.1 $ @@ -41,5 +41,17 @@ @Provider(MCTestProvider.class) public @interface Bootstrap { - String id(); + /** + * Returns the resource name by which the bean definition file can be l= oaded. + * + * @return the resource name + */ + String resourceName(); + + /** + * Returns the name under which the annotated bean will be available in= the kernel. The default value is TestCase. + * + * @return the bean name + */ + String beanName() default "TestCase"; } --===============4690331660586721852==--