Examples of SimpleBean


Examples of org.jboss.test.kernel.config.support.SimpleBean

      return (SimpleBean) instantiateAndConfigure(configurator, bmd);
   }

   public void testMapWithValueTypeOverride() throws Throwable
   {
      SimpleBean bean = mapWithValueTypeOverride();
      assertNotNull(bean);
     
      Map result = bean.getMap();
      assertNotNull("Should be a map", result);
      assertTrue("Not a CustomMap: " + result.getClass(), result instanceof CustomMap);
     
      HashMap expected = new HashMap();
      expected.put(string1, string2);
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

      super(name, xmltest);
   }

   public void testConfigure() throws Throwable
   {
      SimpleBean bean = configure();
     
      assertEquals(stringValue, bean.getAString());
      assertEquals(byteValue, bean.getAByte());
      assertEquals(booleanValue, bean.getABoolean());
      // TODO character
      // assertEquals(characterValue, bean.getACharacter());
      assertEquals(shortValue, bean.getAShort());
      assertEquals(integerValue, bean.getAnInt());
      assertEquals(longValue, bean.getALong());
      assertEquals(floatValue, bean.getAFloat());
      assertEquals(doubleValue, bean.getADouble());
      assertEquals(dateValue, bean.getADate());
      assertEquals(bigDecimalValue, bean.getABigDecimal());
      assertEquals(bigIntegerValue, bean.getABigInteger());
      assertEquals(byteValue.byteValue(), bean.getAbyte());
      assertEquals(booleanValue.booleanValue(), bean.isAboolean());
      // TODO character
      // assertEquals(characterValue.charValue(), bean.getAchar());
      assertEquals(shortValue.shortValue(), bean.getAshort());
      assertEquals(integerValue.intValue(), bean.getAnint());
      assertEquals(longValue.longValue(), bean.getAlong());
      assertEquals(floatValue.floatValue(), bean.getAfloat());
      assertEquals(doubleValue.doubleValue(), bean.getAdouble());
      Number number = bean.getANumber();
      assertEquals(Long.class, number.getClass());
      assertEquals(longValue, number);
      assertEquals(stringValue, bean.getOverloadedProperty());

      unconfigure(bean);

      assertEquals(null, bean.getAString());
      assertEquals(null, bean.getAByte());
      assertEquals(null, bean.getABoolean());
      // TODO character
      // assertEquals(null, bean.getACharacter());
      assertEquals(null, bean.getAShort());
      assertEquals(null, bean.getAnInt());
      assertEquals(null, bean.getALong());
      assertEquals(null, bean.getAFloat());
      assertEquals(null, bean.getADouble());
      assertEquals(null, bean.getADate());
      assertEquals(null, bean.getABigDecimal());
      assertEquals(null, bean.getABigInteger());
      assertEquals(byteValue.byteValue(), bean.getAbyte());
      assertEquals(booleanValue.booleanValue(), bean.isAboolean());
      // TODO character
      // assertEquals(characterValue.charValue(), bean.getAchar());
      assertEquals(shortValue.shortValue(), bean.getAshort());
      assertEquals(integerValue.intValue(), bean.getAnint());
      assertEquals(longValue.longValue(), bean.getAlong());
      assertEquals(floatValue.floatValue(), bean.getAfloat());
      assertEquals(doubleValue.doubleValue(), bean.getAdouble());
      assertEquals(null, bean.getANumber());
      assertEquals(null, bean.getOverloadedProperty());
   }
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

   protected SimpleBean configure() throws Throwable
   {
      Kernel kernel = bootstrap();
      configurator = kernel.getConfigurator();
      info = configurator.getBeanInfo(SimpleBean.class);
      SimpleBean bean = (SimpleBean) instantiate(configurator, info);

      metaData = new AbstractBeanMetaData();
      HashSet attributes = new HashSet();
      attributes.add(new AbstractPropertyMetaData("aString", stringValue.toString()));
      attributes.add(new AbstractPropertyMetaData("aByte", byteValue.toString()));
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

      smd.add(vmd3); // tests duplicates

      AbstractPropertyMetaData pmd = new AbstractPropertyMetaData("collection", smd);
      properties.add(pmd);
     
      SimpleBean bean = (SimpleBean) instantiateAndConfigure(bmd);
      assertNotNull(bean);
     
      Collection result = bean.getCollection();
      assertNotNull("Should be a collection", result);
     
      ArrayList expected = new ArrayList();
      expected.add(object1);
      expected.add(object2);
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

      assertEquals(expected, result);
   }

   public void testSimpleCollectionFromStrings() throws Throwable
   {
      SimpleBean bean = simpleCollectionFromStrings();
      assertNotNull(bean);
     
      Collection result = bean.getCollection();
      assertNotNull("Should be a collection", result);
     
      ArrayList expected = new ArrayList();
      expected.add(string1);
      expected.add(string2);
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

      return (SimpleBean) instantiateAndConfigure(configurator, bmd);
   }

   public void testCustomCollectionExplicit() throws Throwable
   {
      SimpleBean bean = customCollectionExplicit();
      assertNotNull(bean);
     
      Collection result = bean.getCollection();
      assertNotNull("Should be a collection", result);
      assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection);
     
      ArrayList expected = new ArrayList();
      expected.add(string1);
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

      return (SimpleBean) instantiateAndConfigure(configurator, bmd);
   }

   public void testCustomCollectionFromSignature() throws Throwable
   {
      SimpleBean bean = customCollectionFromSignature();
      assertNotNull(bean);
     
      Collection result = bean.getCustomCollection();
      assertNotNull("Should be a collection", result);
      assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection);
     
      ArrayList expected = new ArrayList();
      expected.add(string1);
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

   /*
    * FIXME TODO - allow retrieval of collection instance from the bean
    */
   public void TODOtestCustomCollectionPreInstantiated() throws Throwable
   {
      SimpleBean bean = customCollectionPreInstantiated();
      assertNotNull(bean);
     
      Collection result = bean.getPreInstantiatedCollection();
      assertNotNull("Should be a collection", result);
      assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection);
      assertTrue("Not preinstantiated", ((CustomCollection) result).getPreInstantiated());
     
      ArrayList expected = new ArrayList();
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

      return (SimpleBean) instantiateAndConfigure(configurator, bmd);
   }

   public void testCollectionWithValueTypeOverride() throws Throwable
   {
      SimpleBean bean = collectionWithValueTypeOverride();
      assertNotNull(bean);
     
      Collection result = bean.getCollection();
      assertNotNull("Should be a collection", result);
      assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof CustomCollection);
     
      ArrayList expected = new ArrayList();
      expected.add(string1);
View Full Code Here

Examples of org.jboss.test.kernel.config.support.SimpleBean

      return (SimpleBean) instantiateAndConfigure(configurator, bmd);
   }

   public void testCollectionInjectOnObject() throws Throwable
   {
      SimpleBean bean = collectionInjectOnObject();
      assertNotNull(bean);
     
      Object result = bean.getAnObject();
      assertNotNull("Should be a collection", result);
      assertTrue("Not a CustomCollection: " + result.getClass(), result instanceof ArrayList);
     
      ArrayList expected = new ArrayList();
      expected.add(string1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.