Convert to annotations, minor cleanup.
Patch by: jat
Review by: tobyr
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@2065 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/test/com/google/gwt/emultest/java/util/ArraySortBenchmark.java b/user/test/com/google/gwt/emultest/java/util/ArraySortBenchmark.java
index abc1495..2167aa7 100644
--- a/user/test/com/google/gwt/emultest/java/util/ArraySortBenchmark.java
+++ b/user/test/com/google/gwt/emultest/java/util/ArraySortBenchmark.java
@@ -18,6 +18,8 @@
import com.google.gwt.benchmarks.client.Benchmark;
import com.google.gwt.benchmarks.client.IntRange;
import com.google.gwt.benchmarks.client.Operator;
+import com.google.gwt.benchmarks.client.RangeField;
+import com.google.gwt.benchmarks.client.Setup;
import java.util.Arrays;
@@ -29,12 +31,9 @@
private static class TestObject implements Comparable<TestObject> {
private int value;
- @SuppressWarnings("unused")
- private int index;
-
- public TestObject(int value, int index) {
+
+ public TestObject(int value) {
this.value = value;
- this.index = index;
}
public int compareTo(TestObject o) {
@@ -58,10 +57,6 @@
final IntRange sizeRange = new IntRange(128, MAX_ARRAY_SIZE, Operator.ADD,
256);
- public String getModuleName() {
- return "com.google.gwt.emultest.EmulSuite";
- }
-
public void beginByteArray(Integer size) {
byteArray = new byte[size.intValue()];
System.arraycopy(initByteArray, 0, byteArray, 0, size.intValue());
@@ -82,16 +77,19 @@
System.arraycopy(initByteArray, 0, byteArray, 0, size.intValue());
}
+ public String getModuleName() {
+ return "com.google.gwt.emultest.EmulSuite";
+ }
+
// Required for JUnit
public void testByteArray() {
}
/**
* Sorts <code>size</code> byte entries.
- *
- * @gwt.benchmark.param size -limit = sizeRange
*/
- public void testByteArray(Integer size) {
+ @Setup("beginByteArray")
+ public void testByteArray(@RangeField("sizeRange") Integer size) {
Arrays.sort(byteArray);
}
@@ -101,10 +99,9 @@
/**
* Sorts <code>size</code> int entries.
- *
- * @gwt.benchmark.param size -limit = sizeRange
*/
- public void testIntArray(Integer size) {
+ @Setup("beginIntArray")
+ public void testIntArray(@RangeField("sizeRange") Integer size) {
Arrays.sort(intArray);
}
@@ -114,10 +111,9 @@
/**
* Sorts <code>size</code> object entries.
- *
- * @gwt.benchmark.param size -limit = sizeRange
*/
- public void testObjectArray(Integer size) {
+ @Setup("beginObjectArray")
+ public void testObjectArray(@RangeField("sizeRange") Integer size) {
Arrays.sort(objectArray);
}
@@ -127,10 +123,9 @@
/**
* Sorts <code>size</code> byte entries as a subarray.
- *
- * @gwt.benchmark.param size -limit = sizeRange
*/
- public void testSubarray(Integer size) {
+ @Setup("beginSubarray")
+ public void testSubarray(@RangeField("sizeRange") Integer size) {
Arrays.sort(byteArray, SUBARRAY_SKIP, size);
}
@@ -152,8 +147,7 @@
}
initObjectArray = new TestObject[MAX_ARRAY_SIZE + SUBARRAY_SKIP];
for (int i = 0; i < MAX_ARRAY_SIZE + SUBARRAY_SKIP; i++) {
- initObjectArray[i] = new TestObject((i * 31 + 17) % 500, i);
+ initObjectArray[i] = new TestObject((i * 31 + 17) % 500);
}
}
-
}