Package javax.management.openmbean

Examples of javax.management.openmbean.CompositeType


      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };

      boolean caught = false;
      try
      {
         new CompositeType(null, "description", itemNames, itemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for null typeName");

      caught = false;
      try
      {
         new CompositeType("", "description", itemNames, itemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for empty typeName");

      caught = false;
      try
      {
         new CompositeType("typeName", null, itemNames, itemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for null description");

      caught = false;
      try
      {
         new CompositeType("typeName", "", itemNames, itemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for empty description");

      caught = false;
      try
      {
         new CompositeType("typeName", "description", null, itemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for null item names");

      caught = false;
      try
      {
         new CompositeType("typeName", "description", itemNames, null, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for null item descriptions");

      caught = false;
      try
      {
         new CompositeType("typeName", "description", itemNames, itemDescriptions, null);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for null item types");

      String[] nullItemNames = new String[] { "name1", null };
      caught = false;
      try
      {
         new CompositeType("typeName", "description", nullItemNames, itemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for null element of item names");

      String[] nullItemDescriptions = new String[] { "desc1", null };
      caught = false;
      try
      {
         new CompositeType("typeName", "description", itemNames, nullItemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for null element of item descriptions");

      OpenType[] nullItemTypes = new OpenType[] { SimpleType.STRING, null };
      caught = false;
      try
      {
         new CompositeType("typeName", "description", itemNames, itemDescriptions, nullItemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for null element of item types");

      String[] wrongItemNames = new String[] { "name1" };
      caught = false;
      try
      {
         new CompositeType("typeName", "description", wrongItemNames, itemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for wrong number of elements for item names");

      String[] wrongItemDescriptions = new String[] { "desc1"};
      caught = false;
      try
      {
         new CompositeType("typeName", "description", itemNames, wrongItemDescriptions, itemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for wrong number of elements for item descriptions");

      OpenType[] wrongItemTypes = new OpenType[] { SimpleType.STRING };
      caught = false;
      try
      {
         new CompositeType("typeName", "description", itemNames, itemDescriptions, wrongItemTypes);
      }
      catch (IllegalArgumentException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted IllegalArgumentException for wrong number of elements for item types");

      String[] duplicateItemNames = new String[] { "desc1", "desc1" };
      caught = false;
      try
      {
         new CompositeType("typeName", "description", duplicateItemNames, itemDescriptions, itemTypes);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
      if (caught == false)
         fail("Excepted OpenDataException for duplicate item names");

      duplicateItemNames = new String[] { "desc1", " desc1 " };
      caught = false;
      try
      {
         new CompositeType("typeName", "description", duplicateItemNames, itemDescriptions, itemTypes);
      }
      catch (OpenDataException e)
      {
         caught = true;
      }
View Full Code Here


      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
View Full Code Here

      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
View Full Code Here

      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
View Full Code Here

      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
View Full Code Here

      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
View Full Code Here

      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);

      TabularDataSupport data = new TabularDataSupport(tabularType);

      assertTrue("Didn't expect containsValue null", data.containsValue(null) == false);

      itemNames = new String[] { "name1", "name2" };
      itemDescriptions = new String[] { "desc1", "desc2" };
      itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType2 = new CompositeType("rowTypeName2", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      HashMap map = new HashMap();
      map.put("name1", "value1");
      map.put("name2", new Integer(2));
View Full Code Here

      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);

      TabularDataSupport data = new TabularDataSupport(tabularType);

      assertTrue("Didn't expect containsValue null", data.containsValue(null) == false);

      itemNames = new String[] { "name1", "name2" };
      itemDescriptions = new String[] { "desc1", "desc2" };
      itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType2 = new CompositeType("rowTypeName2", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      HashMap map = new HashMap();
      map.put("name1", "value1");
      map.put("name2", new Integer(2));
View Full Code Here

      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
View Full Code Here

      throws Exception
   {
      String[] itemNames = new String[] { "name1", "name2" };
      String[] itemDescriptions = new String[] { "desc1", "desc2" };
      OpenType[] itemTypes = new OpenType[] { SimpleType.STRING, SimpleType.INTEGER };
      CompositeType rowType = new CompositeType("rowTypeName", "rowDescription",
         itemNames, itemDescriptions, itemTypes);

      String[] indexNames = new String[] { "name1", "name2" };
      TabularType tabularType = new TabularType("typeName", "description", rowType, indexNames);
View Full Code Here

TOP

Related Classes of javax.management.openmbean.CompositeType

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.