Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long now()  
      • Methods inherited from class org.sonar.api.utils.System2

        close, envVariable, envVariables, getDefaultTimeZone, getResource, isJavaAtLeast17, 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 Detail

      • 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 Detail

      • now

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