Package org.jboss.managed.plugins.factory

Examples of org.jboss.managed.plugins.factory.AbstractManagedObjectFactory


   /**
    * Test overriding the AbstractManagedObjectFactory.defaultInstanceFactory
    */
   public void testDefaultInstanceFactory()
   {
      AbstractManagedObjectFactory mof = new AbstractManagedObjectFactory();
      mof.setDefaultInstanceFactory(new TestICF());
      TestSimpleICF icf = new TestSimpleICF();
      mof.setInstanceClassFactory(Simple.class, icf);
      testMOF = mof;

      BigDecimal bigDecimal = new BigDecimal(10);
      Simple simple = new Simple();
      simple.setBigDecimalValue(bigDecimal);
View Full Code Here


    * Test that the setDefaultManagedObjectPopulator overrides the MOF
    * default ManagedObjectPopulator
    */
   public void testDefaultManagedObjectPopulator()
   {
      AbstractManagedObjectFactory mof = new AbstractManagedObjectFactory();
      TestMOP mop = new TestMOP(mof.getConfiguration(), new TestSimpleICF(), mof.getInstanceFactories());
      mof.setDefaultManagedObjectPopulator(mop);
      testMOF = mof;

      BigDecimal bigDecimal = new BigDecimal(10);
      Simple simple = new Simple();
      simple.setBigDecimalValue(bigDecimal);
View Full Code Here

   }

   public void testInstanceClassFactoryAddition()
   {
      AbstractManagedObjectFactory mof = new AbstractManagedObjectFactory();
      testMOF = mof;

      BeanMetaDataICF bicf = new BeanMetaDataICF();
      mof.addInstanceClassFactory(bicf);
      LocalDSInstanceClassFactory dsicf = new LocalDSInstanceClassFactory();
      mof.addInstanceClassFactory(dsicf);
      NoTxICF nticf = new NoTxICF();
      mof.addInstanceClassFactory(nticf);

      InstanceClassFactory icf = mof.getInstanceClassFactory(IBeanMetaData.class);
      assertEquals("IBeanMetaData ICF", bicf, icf);
      icf = mof.getInstanceClassFactory(LocalDataSourceDeploymentMetaData.class);
      assertEquals("LocalDataSourceDeploymentMetaData ICF", dsicf, icf);
      icf = mof.getInstanceClassFactory(NoTxConnectionFactoryDeploymentMetaData.class);
      assertEquals("NoTxConnectionFactoryDeploymentMetaData ICF", nticf, icf);
   }
View Full Code Here

   @SuppressWarnings("unchecked")
   public void testGenericValueUpdate()
   {
      super.enableTrace("org.jboss.managed");
      AbstractManagedObjectFactory mof = new AbstractManagedObjectFactory();
      mof.setInstanceClassFactory(JmsDestination.class, new JmsDestinationICF(mof));
      testMOF = mof;

      JmsDestinations destinations = new JmsDestinations();
      List<JmsDestination> queues = new ArrayList<JmsDestination>();
      QueueDestination q1 = new QueueDestination();
View Full Code Here

    * Test the transformer value of the ManagementRuntimeRef annotation when
    * there is a custom ICF
    */
   public void testTransformer()
   {
      AbstractManagedObjectFactory mof = new AbstractManagedObjectFactory();
      mof.setInstanceClassFactory(ManagementObjectWithRuntimeRef.class, new ManagementObjectWithRuntimeRefICF());
      testMOF = mof;

      ManagementObjectWithRuntimeRef mowref = new ManagementObjectWithRuntimeRef();
      mowref.setRefName(new CustomName("jboss:test=testTransformer"));
      ManagedObject managedObject = initManagedObject(mowref);
View Full Code Here

      assertEquals(SimpleValueSupport.wrap("java.lang.String"), cvalue.get("type"));
   }

   public void testKernelDeployment()
   {
      AbstractManagedObjectFactory mof = new AbstractManagedObjectFactory();
      BeanMetaDataICF icf = new BeanMetaDataICF();
      icf.setDelegateICF(new DefaultInstanceClassFactory(mof));
      mof.setInstanceClassFactory(IBeanMetaData.class, icf);
      testMOF = mof;

      AKernelDeployment ad = new AKernelDeployment();
      ABeanMetaData bean1 = new ABeanMetaData();
      bean1.setBean(Simple.class.getName());
      bean1.setName("SimpleBean#1");
      ABeanMetaData bean2 = new ABeanMetaData();
      bean2.setBean(Simple.class.getName());
      bean2.setName("SimpleBean#2");
      ABeanMetaData bean3 = new ABeanMetaData();
      bean3.setBean(SimpleUnannotated.class.getName());
      bean3.setName("SimpleUnannotated#3");
      APropertyMetaData bean3P1 = new APropertyMetaData();
      bean3P1.setName("properties");
      bean3P1.setDescription("The bean properties");
      bean3P1.setPropertyType("java.util.Set<IPropertyMetaData>");
      bean3.addProperty(bean3P1);

      Simple simple1 = new Simple();
      simple1.setBigDecimalValue(new BigDecimal(123456));
      Simple simple2 = new Simple();
      simple2.setBigDecimalValue(new BigDecimal(222222));
      SimpleUnannotated simple3 = new SimpleUnannotated();
      simple3.setBigDecimalValue(new BigDecimal(333333));
      // Setup the bean name mappings
      BeanMetaDataICF.setBean("SimpleBean#1", simple1);
      BeanMetaDataICF.setBean("SimpleBean#2", simple2);
      BeanMetaDataICF.setBean("SimpleUnannotated#3", simple3);
      List<IBeanMetaDataFactory> beanFactories = new ArrayList<IBeanMetaDataFactory>();
      beanFactories.add(bean1);
      beanFactories.add(bean2);
      beanFactories.add(bean3);
      ad.setBeanFactories(beanFactories);

      ManagedObject mo = mof.initManagedObject(ad, "KernelDeployment", null);
      ManagedProperty beanFactoriesMP = mo.getProperty("beanFactories");
      assertNotNull("beanFactories MP", beanFactoriesMP);
      Object beanFactoriesMPValue = beanFactoriesMP.getValue();
      getLog().debug("beanFactories MP value: "+beanFactoriesMPValue);
      assertTrue(beanFactoriesMPValue instanceof CollectionValue);
View Full Code Here

TOP

Related Classes of org.jboss.managed.plugins.factory.AbstractManagedObjectFactory

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.