Package org.jboss.metatype.api.types

Examples of org.jboss.metatype.api.types.CompositeMetaType


   public void testIsValueTable() throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      MetaType[] itemTypes = new MetaType[] { SimpleMetaType.STRING, SimpleMetaType.INTEGER };
      CompositeMetaType compositeType = new ImmutableCompositeMetaType("typeName", "description", itemNames, itemDescriptions, itemTypes);
      TableMetaType tableType = new ImmutableTableMetaType("typeName", "description", compositeType, new String[] { "name1" });
      TableValue tv = new MockTableValue(tableType);
      TableValue[][] tabData1 = new TableValue[][]
      {
         { tv, null }, { tv, tv }
View Full Code Here


   {
      Method method = getClass().getMethod(methodName);
      Type type = method.getGenericReturnType();
     
      CollectionMetaType arrayType = assertInstanceOf(resolve(type), CollectionMetaType.class);
      CompositeMetaType compositeType = assertInstanceOf(resolve(TestSimpleComposite.class), CompositeMetaType.class);
      String[] itemNames = { "something" };
      MetaValue[] itemValues = { SimpleValueSupport.wrap("Hello") };
      CompositeValue helloValue = new CompositeValueSupport(compositeType, itemNames, itemValues);
      itemValues = new MetaValue[] { SimpleValueSupport.wrap("Goodbye") };
      CompositeValue goodbyeValue = new CompositeValueSupport(compositeType, itemNames, itemValues);
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testCompositeValueSupport() throws Exception
   {
      CompositeMetaType compositeMetaType = initCompositeMetaType();
      Map<String, MetaValue> map = initMapValues();
      String[] keys = initKeys();
      MetaValue[] values = initValues();
      new CompositeValueSupport(compositeMetaType, map);
      new CompositeValueSupport(compositeMetaType, keys, values);
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testGetCompositeMetaType() throws Exception
   {
      CompositeMetaType compositeMetaType = initCompositeMetaType();
      Map<String, MetaValue> map = initMapValues();
      CompositeValue v = new CompositeValueSupport(compositeMetaType, map);
      assertEquals(compositeMetaType, v.getMetaType());
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testGet()throws Exception
   {
      CompositeMetaType compositeMetaType = initCompositeMetaType();
      Map<String, MetaValue> map = initMapValues();
      CompositeValue v = new CompositeValueSupport(compositeMetaType, map);

      assertEquals(initStringValue1(), v.get("name1"));
      assertEquals(initInteger2(), v.get("name2"));
View Full Code Here

    */
   public void testGetAll() throws Exception
   {
      SimpleValue value1 = initStringValue1();
      SimpleValue integer2 = initInteger2();
      CompositeMetaType compositeMetaType = initCompositeMetaType();
      Map<String, MetaValue> map = initMapValues();
      CompositeValue v = new CompositeValueSupport(compositeMetaType, map);

      MetaValue[] result = v.getAll(new String[] { "name1", "name2" });
      assertEquals(value1, result[0]);
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testContainsKey() throws Exception
   {
      CompositeMetaType compositeMetaType = initCompositeMetaType();
      Map<String, MetaValue> map = initMapValues();
      CompositeValue v = new CompositeValueSupport(compositeMetaType, map);
      assertTrue("data should contain key name1", v.containsKey("name1"));
      assertTrue("data should contain key name2", v.containsKey("name2"));
      assertFalse("data should not contain key nameX", v.containsKey("nameX"));
View Full Code Here

      SimpleValue integer2 = initInteger2();
      SimpleValue name1 = initStringName1();
      SimpleValue nullString = initStringNull();
      SimpleValue emptyString = initStringEmpty();
      SimpleValue nullInteger = initIntegerNull();
      CompositeMetaType compositeMetaType = initCompositeMetaType();
      Map<String, MetaValue> map = initMapValues();
      CompositeValue v = new CompositeValueSupport(compositeMetaType, map);

      assertTrue("data should contain value value1", v.containsValue(value1));
      assertTrue("data should contain value 2", v.containsValue(integer2));
View Full Code Here

      SimpleValue name1 = initStringName1();
      SimpleValue nullString = initStringNull();
      SimpleValue emptyString = initStringEmpty();
      SimpleValue nullInteger = initIntegerNull();

      CompositeMetaType compositeMetaType = initCompositeMetaType();
      Map<String, MetaValue> map = initMapValues();
      CompositeValue v = new CompositeValueSupport(compositeMetaType, map);
      Collection<?> values = v.values();
      assertTrue("data values contain 2 elements", values.size() == 2);
      assertTrue("data values should have value1", values.contains(value1));
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testEquals() throws Exception
   {
      CompositeMetaType compositeMetaType = initCompositeMetaType();
      Map<String, MetaValue> map = initMapValues();
      CompositeValue v = new CompositeValueSupport(compositeMetaType, map);

      assertEquals("data should equal itself", v, v);
      assertNotSame("data should not equal null", v, null);
      assertNotSame("data should not equal non CompositeData", v, new Object());

      CompositeValue v2 = new CompositeValueSupport(compositeMetaType, map);

      assertEquals("data should equal with data2 with different instance of the same composite type", v, v2);
      assertEquals("data should equal with data2 with different instance of the same composite type", v2, v);

      CompositeMetaType compositeMetaType2 = initCompositeMetaType2();
      v2 = new CompositeValueSupport(compositeMetaType2, map);

      assertNotSame("data should not be equal with data2 with different composite type", v, v2);
      assertNotSame("data2 should not be equal with data with different composite type", v2, v);

View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.types.CompositeMetaType

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.