1
1
/*******************************************************************************
2
- * Copyright (c) 2018, 2023 Red Hat, Inc. and others.
2
+ * Copyright (c) 2018, 2024 Red Hat, Inc. and others.
3
3
*
4
4
* This program and the accompanying materials
5
5
* are made available under the terms of the Eclipse Public License 2.0
@@ -51,10 +51,10 @@ public class ProjectSmartImportTest {
51
51
@ Parameters (name = "{0}" )
52
52
public static Object [][] projects () {
53
53
return new Object [][] { //
54
- { "JavaEclipseProject" , List .of ("org.eclipse.jdt.core.javanature" ) }, //
55
- { "FeatureProject" , List .of ("org.eclipse.pde.FeatureNature" ) }, //
56
- { "PlainEclipseProject" , List .of () }, //
57
- { "PlainJavaProject" , List .of ("org.eclipse.jdt.core.javanature" ) }, //
54
+ { "JavaEclipseProject" , List .of ("org.eclipse.jdt.core.javanature" ) }, //
55
+ { "FeatureProject" , List .of ("org.eclipse.pde.FeatureNature" ) }, //
56
+ { "PlainEclipseProject" , List .of () }, //
57
+ { "PlainJavaProject" , List .of ("org.eclipse.jdt.core.javanature" ) }, //
58
58
};
59
59
}
60
60
@@ -86,15 +86,15 @@ private static Path getErrorLogFile() {
86
86
}
87
87
88
88
@ Test
89
- public void testImport () throws CoreException , InterruptedException {
89
+ public void testImport () throws CoreException , InterruptedException , IOException {
90
90
File projectPath = new File (workingDirectory .getRoot (), projectName );
91
91
92
92
var job = new org .eclipse .ui .internal .wizards .datatransfer .SmartImportJob (projectPath , null , true , false );
93
93
job .run (new NullProgressMonitor ());
94
94
job .join ();
95
95
96
96
// check imported project
97
- assertThat (getErrorLogFile ()).isEmptyFile ();
97
+ assertThat (getErrorLogFile ()).as ( "Content: %s" , Files . readString ( getErrorLogFile ())). isEmptyFile ();
98
98
IWorkspaceRoot workspace = ResourcesPlugin .getWorkspace ().getRoot ();
99
99
assertThat (workspace .getProjects ()).hasSize (1 ).allMatch (p -> p .getName ().equals (projectName ));
100
100
IProject project = workspace .getProject (projectName );
@@ -116,7 +116,7 @@ private void checkProblemsView(IProject project) throws CoreException {
116
116
}).toList ();
117
117
assertTrue (
118
118
"There should be no errors in imported project: " + System .lineSeparator () + errorMarkers .stream ()
119
- .map (String ::valueOf ).collect (Collectors .joining (System .lineSeparator ())),
119
+ .map (String ::valueOf ).collect (Collectors .joining (System .lineSeparator ())),
120
120
errorMarkers .isEmpty ());
121
121
122
122
}
0 commit comments