/** * Creates a new instance. * @param callerClass the caller class (for detecting testing resources) */ public BatchTestTool(Class<?> callerClass) { this.callerClass = callerClass; this.classLoader = callerClass.getClassLoader(); this.batchArguments = new LinkedHashMap<>(); this.environmentVariables = new LinkedHashMap<>(System.getenv()); this.tools = new TestToolRepository(classLoader); }
/** * Creates a new instance. * @param callerClass the caller class (for detecting testing resources) * @param context the current testing context */ public BatchTestTool(Class<?> callerClass, TestContext context) { this(callerClass, context, new TestToolRepository(context.getClassLoader())); }
@Override protected TestDataToolProvider getTestTools() { TestToolRepository result = testTools; if (result == null) { Class<?> caller = getCallerClass(); result = new TestToolRepository(caller.getClassLoader()); testTools = result; } return result; }
/** * Creates a new instance. * @param contextClass context class (will use to detect test resources) * @throws IllegalArgumentException if some parameters were {@code null} */ public TestDriverContext(Class<?> contextClass) { if (contextClass == null) { throw new IllegalArgumentException("contextClass must not be null"); //$NON-NLS-1$ } this.callerClass = contextClass; this.repository = new TestToolRepository(contextClass.getClassLoader()); this.extraConfigurations = new TreeMap<>(); this.batchArgs = new TreeMap<>(); this.environmentVariables = new HashMap<>(System.getenv()); this.compilerOptions = new LinkedHashMap<>(); this.extensionMap = new LinkedHashMap<>(); this.skipPhases = EnumSet.noneOf(TestExecutionPhase.class); }
/** * Creates a new instance. * @param callerClass the caller class (for detecting testing resources) * @param context the current testing context * @param tools the testing tools */ protected BatchTestTool(Class<?> callerClass, TestContext context, TestToolRepository tools) { this.classLoader = context.getClassLoader(); this.batchArguments = new LinkedHashMap<>(context.getArguments()); this.environmentVariables = new LinkedHashMap<>(context.getEnvironmentVariables()); this.callerClass = callerClass; this.tools = new TestToolRepository(classLoader); }