Package javax.tools.diagnostics.runtime.java

Examples of javax.tools.diagnostics.runtime.java.JavaField


   
  }
 
  public void testFloatValue() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField floatValueField = getJavaField(thisJavaObject, "floatValue");

    try{
      int aFloatValue = floatValueField.getInt(thisJavaObject);
      fail("Missing illegal argument exception from JavaField.getInt(floatValue)");
    } catch (IllegalArgumentException e) {
      // expected
   
  }
View Full Code Here


   
  }
 
  public void testLongValue() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField longValueField = getJavaField(thisJavaObject, "longValue");

    try{
      int aLongValue = longValueField.getInt(thisJavaObject);
      fail("Missing illegal argument exception from JavaField.getInt(longValue)");
    } catch (IllegalArgumentException e) {
      // expected
   
  }
View Full Code Here

   
  }
 
  public void testByteValue() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField byteValueField = getJavaField(thisJavaObject, "byteValue");

    try{
      int aByteValue = byteValueField.getInt(thisJavaObject);
    } catch (IllegalArgumentException e) {
      fail("Unexpected illegal argument exception from JavaField.getInt(byteValue)");
   
  }
View Full Code Here

   
  }
 
  public void testCharValue() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField charValueField = getJavaField(thisJavaObject, "charValue");

    try{
      int aCharValue = charValueField.getInt(thisJavaObject);
    } catch (IllegalArgumentException e) {
      fail("Unexpected illegal argument exception from JavaField.getInt(charValue)");
   
  }
View Full Code Here

   
  }
 
  public void testShortValue() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField shortValueField = getJavaField(thisJavaObject, "shortValue");

    try{
      int aShortValue = shortValueField.getInt(thisJavaObject);
    } catch (IllegalArgumentException e) {
      fail("Unexpected illegal argument exception from JavaField.getInt(shortValue)");
   
  }
View Full Code Here

   
  }
 
  public void testBooleanValue() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField booleanValueField = getJavaField(thisJavaObject, "booleanValue");
   
    try{
      int aBooleanValue = booleanValueField.getInt(thisJavaObject);
      fail("Missing illegal argument exception from JavaField.getInteger(booleanValue)");
    } catch (IllegalArgumentException e) {
      // expected
    }
  }
View Full Code Here

    }
  }
 
  public void testObjectReference() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField objectReferenceField = getJavaField(thisJavaObject, "objectReference");
   
    try{
      int anObjectReference = objectReferenceField.getInt(thisJavaObject);
      fail("Missing illegal argument exception from JavaField.getInteger(objectReference)");
    } catch (IllegalArgumentException e) {
      // expected
    }
  }
View Full Code Here

    return thisObject;   
  }
 
  public void testIncompatibleClass() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField trueBooleanField = getJavaField(thisJavaObject, "trueBoolean");
    JavaObject incompatibleClass = getJavaObjectByClassname(setup.incompatibleClassName);
   
    assertNotNull("Couldn't find "+setup.incompatibleClassName,incompatibleClass);
    try{
      boolean trueBooleanValue = trueBooleanField.getBoolean(incompatibleClass);
      fail("JavaField.getBoolean() didn't fail when passed Object of wrong class");
    }catch (IllegalArgumentException e) {
      // expected
    }
  }
View Full Code Here

  }
 
 
  public void testNullObjectInstanceField() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField trueBooleanField = getJavaField(thisJavaObject, "trueBoolean");
   
    try{
      boolean trueBooleanValue = trueBooleanField.getBoolean(null);
      fail("JavaField.getBoolean(null) on instance field didn't throw null pointer exception.");
    }catch(NullPointerException e) {
      // expected.
    }
       
View Full Code Here

       
  }

  public void testNonNullObjectInstanceStaticField() throws Exception {
    JavaObject thisJavaObject = getScenerioReference();
    JavaField trueBooleanField = getJavaField(thisJavaObject, "trueStaticBoolean");
   
    boolean trueBooleanValue = trueBooleanField.getBoolean(thisJavaObject);
   
    assertEquals(SetupJavaField_getBoolean.trueStaticBoolean, trueBooleanValue);   
  }
View Full Code Here

TOP

Related Classes of javax.tools.diagnostics.runtime.java.JavaField

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.