Skip to content

Commit

Permalink
TestReport/TestTask: added more static factory methods
Browse files Browse the repository at this point in the history
  • Loading branch information
virgo47 committed Feb 17, 2023
1 parent 14b3ab8 commit f7925fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ private TestReport(
this.defaultParameterNames = defaultParameterNames;
}

public static TestReport classPath(@NotNull String dir, @NotNull String name, String oid) {
return classPath(dir, name, oid, List.of());
}

public static TestReport classPath(@NotNull String dir, @NotNull String name, String oid, List<String> defaultParameterNames) {
return new TestReport(
new ClassPathBasedTestObjectSource(dir, name), oid, DEFAULT_TIMEOUT, defaultParameterNames);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2010-2021 Evolveum and contributors
* Copyright (C) 2010-2023 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
Expand All @@ -10,17 +10,16 @@
import java.io.File;
import java.io.IOException;

import com.evolveum.midpoint.test.asserter.TaskAsserter;
import com.evolveum.midpoint.util.MiscUtil;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;

import org.jetbrains.annotations.NotNull;

import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.test.asserter.TaskAsserter;
import com.evolveum.midpoint.util.MiscUtil;
import com.evolveum.midpoint.util.annotation.Experimental;
import com.evolveum.midpoint.util.exception.CommonException;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;

/**
Expand Down Expand Up @@ -66,6 +65,10 @@ public static TestTask of(@NotNull TaskType task) {
return of(task, DEFAULT_TIMEOUT);
}

public static TestTask file(@NotNull File dir, @NotNull String fileName, String oid) {
return new TestTask(dir, fileName, oid);
}

/**
* Initializes the task - i.e. imports it into repository (via model).
* This may or may not start the task, depending on the execution state in the file.
Expand Down

0 comments on commit f7925fc

Please sign in to comment.