Package org.jboss.test.microcontainer.support

Examples of org.jboss.test.microcontainer.support.SimpleBean


   public void testInterceptorWithAnnotationDependencyCorrectOrder() throws Exception
   {
      deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml");
      try
      {
         SimpleBean dependency = (SimpleBean) getBean("Dependency");
         assertNotNull(dependency);
         deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml");
         try
         {
            validate();
View Full Code Here


        
         deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml");
         try
         {
            validate();
            SimpleBean dependency = (SimpleBean) getBean("Dependency");
            assertNotNull(dependency);

            checkInterceptedAndInjected("Intercepted", dependency);
            checkInterceptedAndInjected("AnnotatedIntercepted", dependency);
            checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency);
View Full Code Here

        
         deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml");
         try
         {
            validate();
            SimpleBean dependency = (SimpleBean) getBean("Dependency");
            assertNotNull(dependency);

            checkInterceptedAndInjected("Intercepted", dependency);
            checkInterceptedAndInjected("AnnotatedIntercepted", dependency);
            checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency);

            checkInterceptedAndInjectedMethodAnnotatedXml(dependency);
         }
         finally
         {
            undeploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml");
         }
        
         checkNotInstalledAndDescribed("Intercepted");
         checkNotInstalledAndDescribed("AnnotatedIntercepted");
         checkNotInstalledAndDescribed("MethodIntercepted");
         checkNotInstalledAndDescribed("MethodAnnotatedIntercepted");
        
         deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml");
         try
         {
            validate();
            SimpleBean dependency = (SimpleBean) getBean("Dependency");
            assertNotNull(dependency);
           
            checkInterceptedAndInjected("Intercepted", dependency);
            checkInterceptedAndInjected("AnnotatedIntercepted", dependency);
            checkInterceptedAndInjected("MethodAnnotatedIntercepted", dependency);
View Full Code Here

   public void testInterceptorWithAnnotationDependencyRedeploy2() throws Exception
   {
      deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic0.xml");
      try
      {
         SimpleBean dependency = (SimpleBean) getBean("Dependency");
         assertNotNull(dependency);
         deploy("InterceptorWithAnnotationDependencyTestCaseNotAutomatic1.xml");
         try
         {
            validate();
View Full Code Here


   private void checkInterceptedAndInjected(String name, SimpleBean dependency)
   {
      InterceptorWithAnnotationDependency.intercepted = null;
      SimpleBean bean = (SimpleBean) getBean(name);
      assertNotNull(bean);
      bean.someMethod();
      assertTrue(dependency + "==" + InterceptorWithAnnotationDependency.intercepted, dependency == InterceptorWithAnnotationDependency.intercepted);
   }  
View Full Code Here

      assertTrue(dependency == InterceptorWithAnnotationDependency.intercepted);
   }  

   private void checkNotInstalledAndNotDescribed(String name)
   {
      SimpleBean bean;
      try
      {
         bean = (SimpleBean) getBean(name);
         fail("'" + name + "' should not be installed yet");
      }
View Full Code Here

      super(name);
   }
  
   public void testMixin() throws Exception
   {
      SimpleBean bean = (SimpleBean) getBean("Bean");

      assertTrue(bean instanceof SomeMixin);
      assertTrue(bean instanceof OtherMixin);
     
      SomeMixinImpl.invoked = false;
View Full Code Here

   }
  
  
   public void testNoMixin() throws Exception
   {
      SimpleBean bean = (SimpleBean) getBean("Bean1");
      assertFalse(bean instanceof SomeMixin);
      assertFalse(bean instanceof OtherMixin);
   }
View Full Code Here

   public void testInterceptorWithDependencyCorrectOrder() throws Exception
   {
      deploy("IntroductionDependencyTestCaseNotAutomatic0.xml");
      try
      {
         SimpleBean dependency = (SimpleBean) getBean("Dependency");
         assertNotNull(dependency);
         deploy("IntroductionDependencyTestCaseNotAutomatic1.xml");
         try
         {
            validate();
View Full Code Here

   public void testInterceptorWithDependencyWrongOrder() throws Exception
   {
      deploy("IntroductionDependencyTestCaseNotAutomatic1.xml");
      try
      {
         SimpleBean bean;
         try
         {
            bean = (SimpleBean) getBean("Intercepted");
            fail("'Interceped' should not be installed yet");
         }
         catch (IllegalStateException expected)
         {
         }
        
         checkPlainBean();
        
         bean = (SimpleBean) getBean("Intercepted", ControllerState.DESCRIBED);
         assertNull("This should not be deployed until the interceptor is", bean);
        
         deploy("IntroductionDependencyTestCaseNotAutomatic0.xml");
         try
         {
            validate();
            SimpleBean dependency = (SimpleBean) getBean("Dependency");
            checkInterceptedBean(dependency);
         }
         finally
         {
            undeploy("IntroductionDependencyTestCaseNotAutomatic0.xml");
View Full Code Here

TOP

Related Classes of org.jboss.test.microcontainer.support.SimpleBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.