Package org.sonar.api.impl.utils
Class AlwaysIncreasingSystem2
java.lang.Object
org.sonar.api.utils.System2
org.sonar.api.impl.utils.AlwaysIncreasingSystem2
public class AlwaysIncreasingSystem2
extends org.sonar.api.utils.System2
A subclass of
System2
which implementation of System2.now()
always return a bigger value than the
previous returned value.
This class is intended to be used in Unit tests.
-
Field Summary
Fields inherited from class org.sonar.api.utils.System2
INSTANCE
-
Constructor Summary
ConstructorsConstructorDescriptionValues returned bynow()
will start with a random value and increment by 100.AlwaysIncreasingSystem2
(long increment) AlwaysIncreasingSystem2
(long initialValue, int increment) -
Method Summary
Methods inherited from class org.sonar.api.utils.System2
close, envVariable, envVariables, getDefaultTimeZone, getResource, isOsMac, isOsWindows, println, properties, property, setProperty
-
Constructor Details
-
AlwaysIncreasingSystem2
public AlwaysIncreasingSystem2(long increment) -
AlwaysIncreasingSystem2
public AlwaysIncreasingSystem2(long initialValue, int increment) -
AlwaysIncreasingSystem2
public AlwaysIncreasingSystem2()Values returned bynow()
will start with a random value and increment by 100.
-
-
Method Details
-
now
public long now()- Overrides:
now
in classorg.sonar.api.utils.System2
-