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

    Constructors
    Constructor
    Description
    Values returned by now() will start with a random value and increment by 100.
    AlwaysIncreasingSystem2(long increment)
     
    AlwaysIncreasingSystem2(long initialValue, int increment)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    now()
     

    Methods inherited from class org.sonar.api.utils.System2

    close, envVariable, envVariables, getDefaultTimeZone, getResource, isOsMac, isOsWindows, println, properties, property, setProperty

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AlwaysIncreasingSystem2

      public AlwaysIncreasingSystem2(long increment)
    • AlwaysIncreasingSystem2

      public AlwaysIncreasingSystem2(long initialValue, int increment)
    • AlwaysIncreasingSystem2

      public AlwaysIncreasingSystem2()
      Values returned by now() will start with a random value and increment by 100.
  • Method Details

    • now

      public long now()
      Overrides:
      now in class org.sonar.api.utils.System2