java.lang.Object
test.de.iip_ecosphere.platform.configuration.maven.DummyApp

public class DummyApp extends Object
A testing application for ProcessUnitTest.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • DummyApp

      public DummyApp()
  • Method Details

    • getArg

      public static String getArg(String[] args, String argName, String dflt)
      Emulates reading a Spring-like parameter if the configuration is not yet in place.
      Parameters:
      args - the arguments
      argName - the argument name (without PARAM_PREFIX or PARAM_VALUE_SEP)
      dflt - the default value if the argument cannot be found
      Returns:
      the value of argument or dflt
    • getIntArg

      public static int getIntArg(String[] args, String argName, int dflt)
      Returns an int command line argument.
      Parameters:
      args - the arguments
      argName - the argument name (without PARAM_PREFIX or PARAM_VALUE_SEP)
      dflt - the default value if the argument cannot be found
      Returns:
      the value of argument or dflt
    • sleep

      public static void sleep(int ms)
      Just sleeps for the given amount of milliseconds.
      Parameters:
      ms - the milliseconds to wait for
    • toList

      @SafeVarargs public static <T> List<T> toList(T... elements)
      Turns given elements into a list.
      Type Parameters:
      T - the element type
      Parameters:
      elements - the elements
      Returns:
      the list containing all elements
    • toArgs

      public static String[] toArgs(String args)
      Turns a command line string into arguments. Considers usual quotes.
      Parameters:
      args - the arguments as string
      Returns:
      the parsed arguments
    • addAll

      @SafeVarargs public static <T> List<T> addAll(List<T> list, T... elements)
      Turns given elements to list.
      Type Parameters:
      T - the element type
      Parameters:
      list - the list to be modified as a side effect
      elements - the elements
      Returns:
      the list with all elements added
    • main

      public static void main(String[] args)
      Simple test program.
      Parameters:
      args - command line arguments; --start=int indicates the first value to start counting at (default 1); --max=int indicates the maximum value to stop looping at (default 10); --modulo=int indicates the group size for the second output on the error stream (default 5)