Package org.jboss.ejb3.test.common.registrar

Examples of org.jboss.ejb3.test.common.registrar.SimplePojo


      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
      // Ensure that an @Clustered annotation is visible to AOP if the XML says the bean is  clustered.
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new ClusteredMetaDataBridge());
   }
View Full Code Here


    * @throws Throwable
    */
   @Test
   public void testRegistrarLookup() throws Throwable
   {
      SimplePojo pojo = (SimplePojo) Ejb3RegistrarLocator.locateRegistrar().lookup(
            Ejb3RegistrarTestCaseBase.REGISTRY_NAME_POJO);
      TestCase.assertNotNull("Retrieved POJO from Registry was null", pojo);
   }
View Full Code Here

   public void testRegistrarBindAndLookup() throws Throwable
   {
      // Initialize
      String bindName = "org.jboss.ejb3.TestBind" + UUID.randomUUID();
      String propertyValue = "propValue";
      SimplePojo pojo = new SimplePojo();
      pojo.setProperty(propertyValue);

      // Bind
      Ejb3RegistrarLocator.locateRegistrar().bind(bindName, pojo);

      // Lookup
      SimplePojo retrieved = (SimplePojo) Ejb3RegistrarLocator.locateRegistrar().lookup(bindName);

      // Test
      TestCase
            .assertTrue("Retrieved value is not equal by reference to what was put in to registry", pojo == retrieved);
      TestCase.assertEquals("Set property was not equal to that which was put into Registry", propertyValue, retrieved
            .getProperty());
   }
View Full Code Here

   {
      // Initialize
      String bindName = Ejb3RegistrarTestCaseBase.REGISTRY_NAME_POJO;

      // Lookup the default pojo
      SimplePojo pojoExisting = (SimplePojo) Ejb3RegistrarLocator.locateRegistrar().lookup(bindName);
      TestCase.assertNotNull("Retrieved POJO from Registry was null", pojoExisting);

      // Make a new POJO
      SimplePojo pojoNew = new SimplePojo();

      // Rebind into existing address
      Ejb3RegistrarLocator.locateRegistrar().rebind(bindName, pojoNew);

      // Lookup
      SimplePojo retrieved = (SimplePojo) Ejb3RegistrarLocator.locateRegistrar().lookup(bindName);

      // Test
      TestCase.assertTrue("Old value and retrieved from registry should not be equal by reference",
            pojoExisting != retrieved);
      TestCase.assertTrue("Placed value and retrieved from registry must be equal by reference", pojoNew == retrieved);
View Full Code Here

   {
      // Initialize
      String bindName = Ejb3RegistrarTestCaseBase.REGISTRY_NAME_POJO;

      // Make a new POJO
      SimplePojo pojoNew = new SimplePojo();

      // Attempt to bind into existing address
      try
      {
         Ejb3RegistrarLocator.locateRegistrar().bind(bindName, pojoNew);
View Full Code Here

   {

      // Initialize new POJO
      String bindName = "org.jboss.ejb3.TestBind" + UUID.randomUUID();
      String oldValue = "oldValue";
      SimplePojo pojo = new SimplePojo();
      pojo.setProperty(oldValue);

      // Bind
      Ejb3RegistrarLocator.locateRegistrar().bind(bindName, pojo);

      // Lookup
      SimplePojo retrieved = (SimplePojo) Ejb3RegistrarLocator.locateRegistrar().lookup(bindName);

      // Ensure set value is intact
      TestCase.assertEquals(
            "Property value set before placing in Registry was not equal to property value obtained from registry",
            oldValue, retrieved.getProperty());

      // Invoke to change property value
      String newValue = "newValue";
      Ejb3RegistrarLocator.locateRegistrar().invoke(bindName, "setProperty", new String[]
      {newValue}, new String[]
      {String.class.getName()});

      // Ensure the value has changed
      TestCase.assertEquals("Invocation did not have affect on retrived instance from Registry", newValue, retrieved
            .getProperty());

   }
View Full Code Here

    * @return
    */
   private TimerService createTimerService()
   {
      // get the TimedObjectInvoker
      TimedObjectInvoker timedObjectInvoker = this.getTimedObjectInvoker();
      // if there's no TimedObjectInvoker, we can't do anything, so just
      // throw an exception
      if (timedObjectInvoker == null)
      {
         throw new IllegalStateException("Cannot create timerservice for EJB " + this.getEjbName()
View Full Code Here

      try
      {
         Thread.currentThread().setContextClassLoader(classloader);
         try
         {
            Util.rebind(getEnc(), "UserTransaction", new UserTransactionImpl());
         }
         catch (NamingException e)
         {
            NamingException namingException = new NamingException("Could not bind user transaction for ejb name " + ejbName + " into JNDI under jndiName: " + getEnc().getNameInNamespace() + "/" + "UserTransaction");
            namingException.setRootCause(e);
View Full Code Here

      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new AdditiveBeanInterceptorMetaDataBridge(this.beanClass, this.classloader, this.xml));
     
      List<MetaDataBridge<ApplicationExceptionMetaData>> appExceptionBridges = new ArrayList<MetaDataBridge<ApplicationExceptionMetaData>>();
      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
      // Ensure that an @Clustered annotation is visible to AOP if the XML says the bean is  clustered.
View Full Code Here

      interceptorBridges.add(new InterceptorMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new InterceptorComponentMetaDataLoaderFactory(interceptorBridges));
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new AdditiveBeanInterceptorMetaDataBridge(this.beanClass, this.classloader, this.xml));
     
      List<MetaDataBridge<ApplicationExceptionMetaData>> appExceptionBridges = new ArrayList<MetaDataBridge<ApplicationExceptionMetaData>>();
      appExceptionBridges.add(new ApplicationExceptionMetaDataBridge());
      this.metadataBasedAnnotationRepo.addComponentMetaDataLoaderFactory(new ApplicationExceptionComponentMetaDataLoaderFactory(appExceptionBridges));
     
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new RunAsMetaDataBridge());
      //Add a security domain bridge
      this.metadataBasedAnnotationRepo.addMetaDataBridge(new SecurityDomainMetaDataBridge());
View Full Code Here

TOP

Related Classes of org.jboss.ejb3.test.common.registrar.SimplePojo

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.