Class InvokeMainTestCase

java.lang.Object
edu.pdx.cs.joy.InvokeMainTestCase
Direct Known Subclasses:
BuildPhonebookTest, InvokeMainTest, MovieDatabaseRmiTestCase

public abstract class InvokeMainTestCase extends Object
The superclass of test classes that invoke a main method to test a Java program.
Since:
Summer 2010
Author:
David Whitlock
  • Constructor Details

  • Method Details

    • invokeMain

      protected InvokeMainTestCase.MainMethodResult invokeMain(Class<?> mainClass, String... args)
      Invokes the main method of the given class with the given arguments and returns an object that represents the result of invoking that method.
      Parameters:
      mainClass - The class whose main method is invoked
      args - The arguments passed to the main method
      Returns:
      The result of the method invocation
    • invokeMainAllowingMutableStaticFields

      Invokes the main method of the given class with the given arguments and returns an object that represents the result of invoking that method. This method will not throw a MainClassContainsMutableStaticFields exception if the mainClass has mutable static fields.
      Parameters:
      mainClass - The class whose main method is invoked
      args - The arguments passed to the main method
      Returns:
      The result of the method invocation