1
1
package com .devonfw .tools .ide .context ;
2
2
3
+ import java .nio .file .Files ;
4
+ import java .nio .file .Path ;
5
+ import java .util .List ;
6
+
7
+ import org .assertj .core .api .Assertions ;
8
+ import org .assertj .core .api .Condition ;
9
+ import org .assertj .core .api .ListAssert ;
10
+
3
11
import com .devonfw .tools .ide .io .FileAccess ;
4
12
import com .devonfw .tools .ide .io .FileAccessImpl ;
5
13
import com .devonfw .tools .ide .io .FileCopyMode ;
6
14
import com .devonfw .tools .ide .io .IdeProgressBarTestImpl ;
7
15
import com .devonfw .tools .ide .log .IdeLogLevel ;
8
16
import com .devonfw .tools .ide .log .IdeTestLogger ;
9
17
import com .devonfw .tools .ide .repo .ToolRepositoryMock ;
10
- import org .assertj .core .api .Assertions ;
11
- import org .assertj .core .api .Condition ;
12
- import org .assertj .core .api .ListAssert ;
13
-
14
- import java .nio .file .Files ;
15
- import java .nio .file .Path ;
16
- import java .util .List ;
17
18
18
19
/**
19
20
* Abstract base class for tests that need mocked instances of {@link IdeContext}.
@@ -37,7 +38,7 @@ public abstract class AbstractIdeContextTest extends Assertions {
37
38
38
39
/**
39
40
* @param testProject the (folder)name of the project test case, in this folder a 'project' folder represents the test
40
- * project in {@link #TEST_PROJECTS}. E.g. "basic".
41
+ * project in {@link #TEST_PROJECTS}. E.g. "basic".
41
42
* @return the {@link IdeTestContext} pointing to that project.
42
43
*/
43
44
protected IdeTestContext newContext (String testProject ) {
@@ -47,7 +48,7 @@ protected IdeTestContext newContext(String testProject) {
47
48
48
49
/**
49
50
* @param testProject the (folder)name of the project test case, in this folder a 'project' folder represents the test
50
- * project in {@link #TEST_PROJECTS}. E.g. "basic".
51
+ * project in {@link #TEST_PROJECTS}. E.g. "basic".
51
52
* @param projectPath the relative path inside the test project where to create the context.
52
53
* @return the {@link IdeTestContext} pointing to that project.
53
54
*/
@@ -58,15 +59,16 @@ protected static IdeTestContext newContext(String testProject, String projectPat
58
59
59
60
/**
60
61
* @param testProject the (folder)name of the project test case, in this folder a 'project' folder represents the test
61
- * project in {@link #TEST_PROJECTS}. E.g. "basic".
62
+ * project in {@link #TEST_PROJECTS}. E.g. "basic".
62
63
* @param projectPath the relative path inside the test project where to create the context.
63
64
* @param copyForMutation - {@code true} to create a copy of the project that can be modified by the test,
64
- * {@code false} otherwise (only to save resources if you are 100% sure that your test never modifies anything in that
65
- * project.)
65
+ * {@code false} otherwise (only to save resources if you are 100% sure that your test never modifies anything
66
+ * in that project.)
66
67
* @param answers the answers to use for the {@link IdeTestContext}.
67
68
* @return the {@link IdeTestContext} pointing to that project.
68
69
*/
69
- protected static IdeTestContext newContext (String testProject , String projectPath , boolean copyForMutation ) {
70
+ protected static IdeTestContext newContext (String testProject , String projectPath , boolean copyForMutation ,
71
+ String ... answers ) {
70
72
71
73
Path ideRoot = TEST_PROJECTS .resolve (testProject );
72
74
if (copyForMutation ) {
@@ -87,7 +89,7 @@ protected static IdeTestContext newContext(String testProject, String projectPat
87
89
if (Files .isDirectory (repositoryFolder )) {
88
90
toolRepository = new ToolRepositoryMock (repositoryFolder );
89
91
}
90
- IdeTestContext context = new IdeTestContext (ideHome , toolRepository );
92
+ IdeTestContext context = new IdeTestContext (ideHome , toolRepository , answers );
91
93
if (toolRepository != null ) {
92
94
toolRepository .setContext (context );
93
95
}
0 commit comments