TestClassCalibration3.java :  » Byte-Code » PROSE » measurements » suites » Java Open Source

Java Open Source » Byte Code » PROSE 
PROSE » measurements » suites » TestClassCalibration3.java

package measurements.suites;

public class TestClassCalibration3 extends TestClass
{

    // fields
    static int staticInt;
    static long staticLong;
    static Object staticObj;

    private static int privateStaticInt;
    private static long privateStaticLong;
    private static Object privateStaticObject;

    public int instanceInt;
    public long instanceLong;
    public Object instanceObj;

    private int privateInstanceInt;
    private long privateInstanceLong;
    private Object privateInstanceObj;


    // methods
    public void interfaceMethodShort() {}
    public void interfaceMethodLong(Object x, Object o) {}
    public void instanceMethodShort() {}
    public void instanceMethodLong(Object x, Object o) {}
    public static void staticMethodShort() {}
    public static void staticMethodLong(Object x, Object o) {}
    private static void privateStaticMethodShort() {}
    private static void privateStaticMethodLong(Object x, Object o) {}
    public synchronized void syncInstanceMethodShort() {}
    public synchronized void syncInstanceMethodLong(Object x, Object o) {}
    private void privateInstanceMethodShort() {}
    private void privateInstanceMethodLong(Object x, Object o){}

   public void testPutField(int runs)
    {
  Object localObj  = new Object();
  for (int i=0; i < runs; i++);
    }

    public void testGetField(int runs)
    {
  Object localObj  = new Object();
  instanceObj = localObj;
  for (int i=0; i < runs; i++);
    }


    public void testNonJPOperations()
    {
  int i = 1;
  int ii = 1;
  int localInt = 1;
  long localLong = 1;
  Object localObj = new Object();
  int[] localArr = new int[10];
  Object oo = new TestClass1();

  byte b1 = 1;
  byte b2 = 1;
  short s1 = 1;
  short s2 = 1;
  int i1 = 1;
  int i2 = 1;
  long l1 = 1;
  long l2 = 1;

  final Object tcObject = new TestClass1();
  final int[] aa = new int[10];


  // loop tests

  // check casts
  for(i=TestFrequency.CHECKCAST;--i >= 0;)
      {
      }

  // local operation
  for(i=TestFrequency.LOCALVAR;--i >= 0;)
      {
      }

  // local additions
  for (i=TestFrequency.LOCALADD;--i >= 0;)
      {
      }

    }


    public void testFieldOperations()
    {
  int i;
  int localInt = 1;
  long localLong = 1;
  Object localObj = new Object();
  TestClass obj = new TestClass1();

  // static puts
  for(i=TestFrequency.PUTSTATIC/6;--i >= 0;)
      {
      }


  // static puts
  for(i=TestFrequency.GET_ARGSSTATIC/6;--i >= 0;)
      {
      }


  // instance sets
  for(i=TestFrequency.PUTFIELD/9;--i >= 0;)
      {
      }


  // getfields
  for(i=TestFrequency.GET_ARGSFIELD/9;--i >= 0;)
      {
      }
    }


    public void testMethodOperations()
    {
  TestInterface localInterface = new TestClass1();
  TestClass     obj = new TestClass1();
  int localInt = 1;
  Object localObj = new Object();
  int i;


  // invokeinterface
  for(i=TestFrequency.INVOKEINTERFACE/2;--i >= 0;)
      {
      }

  for(i=TestFrequency.INVOKESPECIAL/2;--i >= 0;)
      {
      }

  // invoke virtual
  for(i=TestFrequency.INVOKEVIRTUAL/6;--i >= 0;)
      {
      }

  // invoke static
  for(i=TestFrequency.INVOKESTATIC/4;--i >= 0;)
      {
      }

    }
  }
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.