Examples of ArrayType


Examples of javax.management.openmbean.ArrayType

System.out.println("=>"+text);
    mbsc.invoke(this.osgiON, "install", new Object[] {text}, new String[]{String.class.getName()});
  }

  public void startButtonAction(Long id) throws Exception {
    mbsc.invoke(this.osgiON, "startService", new Object[] {new Long [] {id}} , new String[]{new ArrayType(1, SimpleType.LONG).getTypeName()});
  }
View Full Code Here

Examples of javax.management.openmbean.ArrayType

  public void startButtonAction(Long id) throws Exception {
    mbsc.invoke(this.osgiON, "startService", new Object[] {new Long [] {id}} , new String[]{new ArrayType(1, SimpleType.LONG).getTypeName()});
  }

  public void stopButtonAction(Long id) throws Exception {
    mbsc.invoke(this.osgiON, "stopService",new Object[] {new Long [] {id}} , new String[]{new ArrayType(1, SimpleType.LONG).getTypeName()});
  }
View Full Code Here

Examples of javax.management.openmbean.ArrayType

  public void stopButtonAction(Long id) throws Exception {
    mbsc.invoke(this.osgiON, "stopService",new Object[] {new Long [] {id}} , new String[]{new ArrayType(1, SimpleType.LONG).getTypeName()});
  }

  public void updateButtonAction(Long id) throws Exception {
    mbsc.invoke(this.osgiON, "update", new Object[] {new Long [] {id}} , new String[]{new ArrayType(1, SimpleType.LONG).getTypeName()});
  }
View Full Code Here

Examples of javax.management.openmbean.ArrayType

  public void refreshButtonAction() throws Exception {
    this.insertRows();
  }

  public void uninstallButtonAction(Long id) throws Exception {
    mbsc.invoke(this.osgiON, "uninstall", new Object[] {new Long [] {id}} , new String[]{new ArrayType(1, SimpleType.LONG).getTypeName()});
  }
View Full Code Here

Examples of javax.management.openmbean.ArrayType

 
  public void test(TestHarness h)
  {
    try
      {
  ArrayType type = new ArrayType(0, SimpleType.INTEGER);
  h.fail("Didn't catch dimensions < 1");
      }
    catch (IllegalArgumentException e)
      {
  h.check(true, "Threw exception for dimensions of 0");
      }
    catch (OpenDataException e)
      {
  h.debug(e);
      }
    try
      {
  ArrayType type = new ArrayType(-1, SimpleType.INTEGER);
  h.fail("Didn't catch dimensions < 1");
      }
    catch (IllegalArgumentException e)
      {
  h.check(true, "Threw exception for dimensions of -1");
      }
    catch (OpenDataException e)
      {
  h.debug(e);
      }
    try
      {
  h.checkPoint("1-dimensional String array");
  ArrayType type = new ArrayType(1, SimpleType.STRING);
  h.check(type.getClassName(), "[Ljava.lang.String;");
  h.check(type.getTypeName(), "[Ljava.lang.String;");
  h.check(type.getElementOpenType().getClassName(), "java.lang.String");
  h.check(type.getDescription(), "1-dimension array of java.lang.String");
  h.checkPoint("2-dimensional String array");
  ArrayType type2 = new ArrayType(2, SimpleType.STRING);
  h.check(type2.getClassName(), "[[Ljava.lang.String;");
  h.check(type2.getTypeName(), "[[Ljava.lang.String;");
  h.check(type2.getElementOpenType().getClassName(), "java.lang.String");
  h.check(type2.getDescription(), "2-dimension array of java.lang.String");
  h.checkPoint("4-dimensional String array (one constructor)");
  ArrayType type3 = new ArrayType(4, SimpleType.STRING);
  h.check(type3.getClassName(), "[[[[Ljava.lang.String;");
  h.check(type3.getTypeName(), "[[[[Ljava.lang.String;");
  h.check(type3.getElementOpenType().getClassName(), "java.lang.String");
  h.check(type3.getDescription(), "4-dimension array of java.lang.String");
  h.checkPoint("4-dimensional String array (two constructors)");
  ArrayType type4 = new ArrayType(2, type2);
  h.check(type4.getClassName(), "[[[[Ljava.lang.String;");
  h.check(type4.getTypeName(), "[[[[Ljava.lang.String;");
  h.check(type4.getElementOpenType().getClassName(), "java.lang.String");
  h.check(type4.getDescription(), "4-dimension array of java.lang.String");
  h.checkPoint("Composite Type Array");
  CompositeType ctype = new CompositeType("Test","Test",new String[]{"name"},
            new String[]{"Name"},
            new OpenType[] { SimpleType.STRING});
  ArrayType type5 = new ArrayType(1, ctype);
  String className = CompositeData.class.getName();
  h.check(type5.getClassName(), "[L" + className + ";");
  h.check(type5.getTypeName(), "[L" + className + ";");
  h.check(type5.getElementOpenType().getClassName(), className);
  h.check(type5.getDescription(), "1-dimension array of " + className);
  h.checkPoint("Tabular Type Array");
  TabularType ttype = new TabularType("Test","Test",ctype,new String[]{"name"});
  ArrayType type6 = new ArrayType(1, ttype);
  className = TabularData.class.getName();
  h.check(type6.getClassName(), "[L" + className + ";");
  h.check(type6.getTypeName(), "[L" + className + ";");
  h.check(type6.getElementOpenType().getClassName(), className);
  h.check(type6.getDescription(), "1-dimension array of " + className)
      }
    catch (OpenDataException e)
      {
  h.debug(e);
      }
    try
      {
  ArrayType type = new ArrayType(-1, new OpenType("Mauve","Mauve","Mauve")
    {
      public boolean equals(Object obj)
      {
        return false;
      }
View Full Code Here

Examples of javax.management.openmbean.ArrayType

  implements Testlet
{
 
  public void test(TestHarness h)
  {
    ArrayType type1 = ArrayType.getPrimitiveArrayType(int[].class);
    h.check(type1.isPrimitiveArray(), "int[] true check");
    try
      {
  ArrayType type2 = new ArrayType(SimpleType.INTEGER, true);
  h.check(type2.isPrimitiveArray(), "Wrapped masked true check");
  ArrayType type3 = new ArrayType(SimpleType.INTEGER, false);
  h.check(!type3.isPrimitiveArray(), "Wrapped not masked false check");
  ArrayType type4 = new ArrayType(1, SimpleType.INTEGER);
  h.check(!type4.isPrimitiveArray(), "Normal wrapped false check");
  ArrayType type5 = new ArrayType(1, SimpleType.STRING);
  h.check(!type5.isPrimitiveArray(), "String false check");
  CompositeType ctype = new CompositeType("Test","Test",new String[]{"name"},
            new String[]{"Name"},
            new OpenType[] { SimpleType.STRING});
  ArrayType type6 = new ArrayType(1, ctype);
  h.check(!type6.isPrimitiveArray(), "Composite type false check");
  TabularType ttype = new TabularType("Test","Test",ctype,new String[]{"name"});
  ArrayType type7 = new ArrayType(1, ttype);
  h.check(!type7.isPrimitiveArray(), "Tabular type false check");
  ArrayType type8 = new ArrayType(1, type1);
  h.check(type8.isPrimitiveArray(), "Carry through true check");
  ArrayType type9 = new ArrayType(1, type2);
  h.check(type9.isPrimitiveArray());
  ArrayType type10 = new ArrayType(1, type3);
  h.check(!type10.isPrimitiveArray(), "Carry through false check");

      }
    catch (OpenDataException e)
      {
  h.debug(e);
View Full Code Here

Examples of javax.management.openmbean.ArrayType

  implements Testlet
{
 
  public void test(TestHarness h)
  {
    ArrayType type = null;
    h.checkPoint("1-dimensional integer array");
    type = ArrayType.getPrimitiveArrayType(int[].class);
    h.check(type.getClassName(), "[I");
    h.check(type.getTypeName(), "[I");
    h.check(type.getElementOpenType().getClassName(), "java.lang.Integer");
    h.check(type.getDescription(), "1-dimension array of int");
    h.checkPoint("2-dimensional integer array");
    type = ArrayType.getPrimitiveArrayType(int[][].class);
    h.check(type.getClassName(), "[[I");
    h.check(type.getTypeName(), "[[I");
    h.check(type.getElementOpenType().getClassName(), "java.lang.Integer");
    h.check(type.getDescription(), "2-dimension array of int");
    h.checkPoint("3-dimensional integer array");
    type = ArrayType.getPrimitiveArrayType(int[][][].class);
    h.check(type.getClassName(), "[[[I");
    h.check(type.getTypeName(), "[[[I");
    h.check(type.getElementOpenType().getClassName(), "java.lang.Integer");
    h.check(type.getDescription(), "3-dimension array of int");
    try
      {
  ArrayType.getPrimitiveArrayType(int.class);
  h.fail("int.class allowed.");
      }
View Full Code Here

Examples of javax.management.openmbean.ArrayType

  implements Testlet
{
 
  public void test(TestHarness h)
  {
    ArrayType type = ArrayType.getPrimitiveArrayType(int[].class);
    h.check(!type.isValue(null), "Null value check");
    h.check(!type.isValue(3), "Non-array value check");
    h.check(type.isValue(new int[]{3}), "Primitive int array value check");
    h.check(!type.isValue(new Integer[]{3}), "Integer array value check");
    try
      {
  CompositeType ctype = new CompositeType("Test","Test",new String[]{"name"},
            new String[]{"Name"},
            new OpenType[] { SimpleType.STRING});
  Map<String,String> data = new HashMap<String,String>();
  data.put("name", "Bob");
  CompositeData cdata = new CompositeDataSupport(ctype, data);
  CompositeData[] cdataarr = new CompositeData[] { cdata };
  ArrayType type2 = new ArrayType(1, ctype);
  h.check(type2.isValue(cdataarr), "Composite data check");
  TabularType ttype = new TabularType("Test","Test",ctype,new String[]{"name"});
  TabularData tdata = new TabularDataSupport(ttype);
  tdata.put(cdata);
  TabularData[] tdataarr = new TabularData[] {tdata};
  ArrayType type3 = new ArrayType(1, ttype);
  h.check(type3.isValue(tdataarr), "Tabular data check");
      }
    catch (OpenDataException e)
      {
  h.debug(e);
      }
View Full Code Here

Examples of javax.management.openmbean.ArrayType

  implements Testlet
{
 
  public void test(TestHarness h)
  {
    ArrayType type = ArrayType.getPrimitiveArrayType(int[].class);
    h.check(type.equals(type), "Reflection test");
    h.check(type.equals(type), "Consistency test");
    ArrayType type2 = ArrayType.getPrimitiveArrayType(int[].class);
    h.check(type.equals(type2), "Equality over creation test");
    h.check(type2.equals(type), "Symmetric test");
    ArrayType type3 = null;
    try
      {
  type3 = new ArrayType(SimpleType.INTEGER, true);
      }
    catch (OpenDataException e)
      {
  h.debug(e);
      }
View Full Code Here

Examples of javax.management.openmbean.ArrayType

  implements Testlet
{
 
  public void test(TestHarness h)
  {
    ArrayType type = ArrayType.getPrimitiveArrayType(int[].class);
    h.check(type.hashCode(), type.hashCode(), "Reflection test");
    h.check(type.hashCode(), type.hashCode(), "Consistency test");
    ArrayType type2 = ArrayType.getPrimitiveArrayType(int[].class);
    h.check(type.hashCode(), type2.hashCode(), "Equality over creation test");
    ArrayType type3 = null;
    try
      {
  type3 = new ArrayType(SimpleType.INTEGER, true);
      }
    catch (OpenDataException e)
      {
  h.debug(e);
      }
    h.check(type3.hashCode(), type2.hashCode(), "Equality over different creation test");
    h.check(type.hashCode(), type3.hashCode(), "Transitivity test");
  }
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.