Skip to content

Commit f78e55c

Browse files
committed
fix: fix unit test and integration test
Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
1 parent 2842ad8 commit f78e55c

File tree

6 files changed

+15
-39
lines changed

6 files changed

+15
-39
lines changed

.github/workflows/IJ-latest.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ jobs:
3333
- name: Build with Gradle
3434
run: |
3535
LATEST_EAP_SNAPSHOT=$(./gradlew printProductsReleases | grep 'IC-' | head -n 1 | cut -d'-' -f2)
36+
echo "building using latest EAP version $LATEST_EAP_SNAPSHOT"
3637
./gradlew check --continue -PplatformVersion=$LATEST_EAP_SNAPSHOT
3738
38-
3939
- name: Collect Tests Result
4040
uses: actions/upload-artifact@v4
4141
if: always()

build.gradle.kts

+5-27
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ sourceSets {
5757
java.srcDir("intellij-community/platform/external-system-impl/testSrc")
5858
java.srcDir("intellij-community/platform/lang-impl/testSources")
5959
java.srcDir("intellij-community/platform/testFramework/extensions/src")
60-
java.srcDir("intellij-community/plugins/gradle/src")
6160
java.srcDir("intellij-community/plugins/gradle/testSources")
6261
java.srcDir("intellij-community/plugins/gradle/tooling-extension-impl/testSources")
63-
java.srcDir("intellij-community/plugins/maven/src/test/java")
6462
java.srcDir("intellij-community/plugins/maven/testFramework/src")
6563
resources.srcDir("src/test/resources")
6664
}
@@ -69,7 +67,7 @@ sourceSets {
6967
java.srcDir("src/it/java")
7068
resources.srcDir("src/it/resources")
7169
compileClasspath += sourceSets.main.get().compileClasspath + sourceSets.test.get().compileClasspath
72-
runtimeClasspath += output + compileClasspath + sourceSets.test.get().runtimeClasspath + sourceSets.test.get().runtimeClasspath
70+
runtimeClasspath += output + compileClasspath + sourceSets.test.get().runtimeClasspath
7371
}
7472
}
7573

@@ -103,7 +101,6 @@ dependencies {
103101
println("bundledPlugins: $platformBundledPlugins")
104102
println("marketplacePlugins: $platformPlugins")
105103
pluginVerifier()
106-
instrumentationTools()
107104
testFramework(TestFrameworkType.Plugin.Java)
108105
}
109106

@@ -152,20 +149,6 @@ dependencies {
152149
builtBy("copyDeps")
153150
})
154151

155-
implementation(libs.annotations) // to build against platform <= 2023.2 and gradle intellij plugin > 2.0
156-
157-
// And now for some serious HACK!!!
158-
// Starting with 2023.1, all gradle tests fail importing projects with a:
159-
// com.intellij.openapi.externalSystem.model.ExternalSystemException: Unable to load class 'org.codehaus.plexus.logging.Logger'
160-
// Hence adding a jar containing the missing class, to the test classpath
161-
// The version matches the jar found in the IJ version used to compile the project
162-
// This is so wrong/ridiculous!
163-
testImplementation("org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.4")
164-
165-
testImplementation("org.assertj:assertj-core:3.19.0")
166-
167-
testImplementation("org.opentest4j:opentest4j:1.3.0")
168-
169152
testImplementation("junit:junit:4.13.2")
170153
}
171154

@@ -252,17 +235,13 @@ val integrationTest by intellijPlatformTesting.testIde.registering {
252235
classpath = sourceSets["integrationTest"].runtimeClasspath
253236
outputs.upToDateWhen { false }
254237
mustRunAfter(tasks["test"])
255-
systemProperty ("debug-retrofit", "enable")
256-
}
257-
plugins {
258-
robotServerPlugin("0.11.23")
259238
}
260239

261240
dependencies {
241+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.3")
242+
testImplementation("org.junit.platform:junit-platform-launcher:1.11.3")
243+
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.3")
262244
testImplementation("com.redhat.devtools.intellij:intellij-common-ui-test-library:0.4.4-SNAPSHOT")
263-
testImplementation("com.squareup.retrofit2:retrofit:2.11.0")
264-
testImplementation("com.squareup.retrofit2:converter-gson:2.11.0")
265-
testImplementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
266245
}
267246
}
268247

@@ -345,7 +324,6 @@ tasks {
345324
// https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-tasks.html#runIdeForUiTests
346325
val runIdeForUiTests by intellijPlatformTesting.runIde.registering {
347326
task {
348-
systemProperty ("debug-retrofit", "enable")
349327
jvmArgumentProviders += CommandLineArgumentProvider {
350328
listOf(
351329
"-Drobot-server.port=8580",
@@ -356,7 +334,7 @@ val runIdeForUiTests by intellijPlatformTesting.runIde.registering {
356334
}
357335
}
358336
plugins {
359-
robotServerPlugin("0.11.23")
337+
robotServerPlugin()
360338
}
361339
}
362340

src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
package org.jboss.tools.intellij.quarkus.tests;
1212

1313
import com.intellij.remoterobot.RemoteRobot;
14-
import com.intellij.remoterobot.fixtures.CommonContainerFixture;
1514
import com.intellij.remoterobot.fixtures.ComponentFixture;
1615
import com.intellij.remoterobot.fixtures.JButtonFixture;
1716
import com.intellij.remoterobot.fixtures.JTextFieldFixture;

src/test/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/MicroProfileForJavaAssert.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ public static SymbolInformation si(String name, Range range) {
360360
public static void assertWorkspaceSymbols(Module javaProject, IPsiUtils utils, SymbolInformation... expected) {
361361
List<SymbolInformation> actual = PropertiesManagerForJava.getInstance()
362362
.workspaceSymbols(PsiMicroProfileUtils.getProjectURI(javaProject), utils, new EmptyProgressIndicator());
363-
MicroProfileForJavaAssert.assertWorkspaceSymbols(Arrays.asList(expected), actual);
363+
assertWorkspaceSymbols(Arrays.asList(expected), actual);
364364
}
365365

366366
/**
@@ -390,6 +390,6 @@ public static void assertWorkspaceSymbols(List<SymbolInformation> expected, List
390390
*/
391391
public static void assertSymbolInformation(SymbolInformation expected, SymbolInformation actual) {
392392
assertEquals(expected.getName(), actual.getName());
393-
assertEquals(expected.getLocation().getRange(), actual.getLocation().getRange());
393+
assertEquals("Wrong location for " + expected.getName() + " at "+actual.getLocation(), expected.getLocation().getRange(), actual.getLocation().getRange());
394394
}
395395
}

src/test/java/com/redhat/devtools/intellij/quarkus/completion/MavenApplicationPropertiesCompletionTest.java

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
*/
3131
public class MavenApplicationPropertiesCompletionTest extends MavenEditorTest {
3232

33-
@Test
3433
public void testBooleanCompletion() throws Exception {
3534
Module module = loadMavenProject(MicroProfileMavenProjectName.config_quickstart, true);
3635
VirtualFile propertiesFile = LocalFileSystem.getInstance().refreshAndFindFileByPath(ModuleUtilCore.getModuleDirPath(module) + "/src/main/resources/application.properties");

src/test/java/com/redhat/microprofile/psi/quarkus/renarde/RenardeJaxRsTest.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ public void testWorkspaceSymbols() throws Exception {
8585
si("@/about: GET", r(25, 28, 33)), //
8686
si("@/play/id: GET", r(9, 18, 26)), //
8787
si("@/play/start: GET", r(13, 18, 23)), //
88-
// From Renarde JAR
89-
si("@/_renarde/security/login-{provider}: GET", r(24, 16, 30)),
90-
si("@/_renarde/security/logout: GET", r(27, 37, 43)),
91-
si("@/_renarde/security/github-success: GET", r(31, 16, 29)),
92-
si("@/_renarde/security/twitter-success: GET", r(35, 16, 30)),
93-
si("@/_renarde/security/oidc-success: GET", r(39, 16, 30)),
94-
si("@/_renarde/security/oidc-success: POST", r(44, 16, 31)));
88+
// From Renarde JAR (RenardeSecurityController)
89+
si("@/_renarde/security/login-{provider}: GET", r(41, 16, 30)),
90+
si("@/_renarde/security/logout: GET", r(52, 20, 26)),
91+
si("@/_renarde/security/github-success: GET", r(58, 16, 29)),
92+
si("@/_renarde/security/twitter-success: GET", r(65, 16, 30)),
93+
si("@/_renarde/security/oidc-success: GET", r(72, 16, 30)),
94+
si("@/_renarde/security/oidc-success: POST", r(79, 16, 31)));
9595
}
9696

9797
}

0 commit comments

Comments
 (0)