public class Example extends Object
A few example test cases which all convert ints to strings in a slight different way.
General rules on how to write test cases:
Benchmark
annotation so that
the Runner
class can find
them.Constructor and Description |
---|
Example()
Initialize test data.
|
Modifier and Type | Method and Description |
---|---|
String |
emptyPlusI(int rounds)
Convert an int to a string by concatenating it with an empty
string.
|
String |
stringBuilderAppend(int rounds)
Convert an int to a string by reusing an
StringBuilder
object. |
String |
stringValueOf(int rounds)
Convert an int to a string using
String.valueOf(int) . |
public String stringValueOf(int rounds) throws Exception
String.valueOf(int)
.Exception
public String emptyPlusI(int rounds) throws Exception
Exception
public String stringBuilderAppend(int rounds) throws Exception
StringBuilder
object.Exception