Package org.jboss.metatype.api.types

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


      return result;
   }

   public MetaValue buildMetaValue(MetaType metaType, TestOverrideComposite object)
   {
      CompositeMetaType compositeType = (CompositeMetaType) metaType;
      CompositeValueSupport result = new CompositeValueSupport(compositeType);
      result.set("somethingElse", SimpleValueSupport.wrap(object.getSomething()));
      return result;
   }
View Full Code Here


      TableValueSupport data = new TableValueSupport(tableType);

      assertFalse("Didn't expect containsValue null", data.containsValue(null));

      CompositeMetaType rowType2 = initCompositeMetaType2();

      CompositeValue compData2 = initCompositeValue(rowType2);

      assertFalse("Didn't expect containsValue wrong composite type", data.containsValue(compData2));
View Full Code Here

    *
    * @return the type
    */
   protected TableMetaType initTableType()
   {
      CompositeMetaType rowType = initCompositeMetaType();

      String[] indexNames = new String[] { "name1", "name2" };
      TableMetaType tableType = new ImmutableTableMetaType("typeName", "description", rowType, indexNames);
      return tableType;
   }
View Full Code Here

    *
    * @return the type
    */
   protected TableMetaType initTableType2()
   {
      CompositeMetaType rowType = initCompositeMetaType();

      String[] indexNames = new String[] { "name1", "name2" };
      TableMetaType tableType = new ImmutableTableMetaType("typeName2", "description", rowType, indexNames);
      return tableType;
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testCompositeMetaTypeMetaType() throws Exception
   {
      CompositeMetaType compositeType = initCompositeMetaType();
      assertEquals(CompositeValue.class.getName(), compositeType.getClassName());
      assertEquals("description", compositeType.getDescription());
      assertEquals("typeName", compositeType.getTypeName());
      assertTrue("Composite meta type should not be an array", compositeType.isArray() == false);
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testContainsItem() throws Exception
   {
      CompositeMetaType compositeType = initCompositeMetaType();
      assertTrue("Composite type should contain key name1", compositeType.containsItem("name1") == true);
      assertTrue("Composite type should contain key name2", compositeType.containsItem("name2") == true);
      assertTrue("Composite type should not contain key nameX", compositeType.containsItem("nameX") == false);
      assertTrue("Composite type should not contain key null", compositeType.containsItem(null) == false);
      assertTrue("Composite type should not contain key <empty>", compositeType.containsItem("") == false);
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testGetDescriptionForItemName() throws Exception
   {
      CompositeMetaType compositeType = initCompositeMetaType();
      assertEquals("desc1", compositeType.getDescription("name1"));
      assertEquals("desc2", compositeType.getDescription("name2"));
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testGetTypeForItemName() throws Exception
   {
      CompositeMetaType compositeType = initCompositeMetaType();
      assertEquals(SimpleMetaType.STRING, compositeType.getType("name1"));
      assertEquals(SimpleMetaType.INTEGER, compositeType.getType("name2"));
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testKeySet() throws Exception
   {
      CompositeMetaType compositeType = initCompositeMetaType();
      Set<String> keys = compositeType.keySet();
      assertTrue("Should be 2 items", keys.size() == 2);
      assertTrue("Should contain name1", keys.contains("name1"));
      assertTrue("Should contain name2", keys.contains("name2"));
   }
View Full Code Here

    *
    * @throws Exception for any problem
    */
   public void testEquals() throws Exception
   {
      CompositeMetaType compositeType = initCompositeMetaType();;

      assertTrue("null is not equal composite type", compositeType.equals(null) == false);
      assertTrue("object is not equal composite type", compositeType.equals(new Object()) == false);

      CompositeMetaType compositeType2 = initCompositeMetaType();
      assertTrue("compositeType2 should be equal composite type, even though not the same object instance",
         compositeType.equals(compositeType2));
      assertTrue("compositeType2 should be equal composite type, even though not the same object instance",
         compositeType2.equals(compositeType));

      compositeType2 = initCompositeMetaTypeDifferentItemTypes();
      assertTrue("compositeType2 should not be equal composite type, it has different types",
         compositeType.equals(compositeType2) == false);
      assertTrue("compositeType2 should not be equal composite type, it has different types",
         compositeType2.equals(compositeType) == false);

      compositeType2 = initCompositeMetaTypeDifferentTypeName();
      assertTrue("compositeType2 should not be equal composite type, it has a different type name",
         compositeType.equals(compositeType2) == false);
      assertTrue("compositeType2 should not be equal composite type, it has a different type name",
         compositeType2.equals(compositeType) == false);

      compositeType2 = initCompositeMetaTypeDifferentItemNames();
      assertTrue("compositeType2 should not be equal composite type, it has different item names",
         compositeType.equals(compositeType2) == false);
      assertTrue("compositeType2 should not be equal composite type, it has different item names",
         compositeType2.equals(compositeType) == false);
   }
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.