From 224112fd4b56f0f2e529eed2f10f6196fb3688f6 Mon Sep 17 00:00:00 2001 From: Adam Wisniewski Date: Mon, 26 Jun 2023 14:49:04 -0400 Subject: [PATCH] Update copyright Signed-off-by: Adam Wisniewski --- .../io.openliberty.tools.update/category.xml | 2 +- tests/pom.xml | 12 +++++++++++- .../src/main/liberty/config/server.xml | 2 +- .../src/main/liberty/config/server.xml | 2 +- .../LibertyPluginSWTBotLSP4JakartaTest.java | 19 +++++++++++++++++-- .../test/it/utils/SWTBotPluginOperations.java | 10 ++++++++++ 6 files changed, 41 insertions(+), 6 deletions(-) diff --git a/releng/io.openliberty.tools.update/category.xml b/releng/io.openliberty.tools.update/category.xml index 3b89c2e2..6e767068 100644 --- a/releng/io.openliberty.tools.update/category.xml +++ b/releng/io.openliberty.tools.update/category.xml @@ -17,7 +17,7 @@ - + diff --git a/tests/pom.xml b/tests/pom.xml index b673d7d6..fadc17bd 100755 --- a/tests/pom.xml +++ b/tests/pom.xml @@ -26,7 +26,7 @@ 60000 - + @@ -100,6 +100,16 @@ org.eclipse.lsp4e.jdt 0.0.0 + + p2-installable-unit + org.eclipse.lsp4jakarta.jdt.core + 0.0.0 + + + p2-installable-unit + org.eclipse.jdt.ls.core + 0.0.0 + diff --git a/tests/resources/applications/maven/liberty-maven-test-app/src/main/liberty/config/server.xml b/tests/resources/applications/maven/liberty-maven-test-app/src/main/liberty/config/server.xml index c867a518..fe30b81d 100644 --- a/tests/resources/applications/maven/liberty-maven-test-app/src/main/liberty/config/server.xml +++ b/tests/resources/applications/maven/liberty-maven-test-app/src/main/liberty/config/server.xml @@ -13,7 +13,7 @@ --> - jakartaee-10.0 + jsp-3.1 diff --git a/tests/resources/applications/maven/liberty-maven-test-wrapper-app/src/main/liberty/config/server.xml b/tests/resources/applications/maven/liberty-maven-test-wrapper-app/src/main/liberty/config/server.xml index 5e93abd2..569f1b54 100644 --- a/tests/resources/applications/maven/liberty-maven-test-wrapper-app/src/main/liberty/config/server.xml +++ b/tests/resources/applications/maven/liberty-maven-test-wrapper-app/src/main/liberty/config/server.xml @@ -13,7 +13,7 @@ --> - jakartaee-10.0 + jsp-3.1 diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotLSP4JakartaTest.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotLSP4JakartaTest.java index 93be2785..1c651f07 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotLSP4JakartaTest.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/LibertyPluginSWTBotLSP4JakartaTest.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2022, 2023 IBM Corporation and others. +* Copyright (c) 2023 IBM Corporation and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v. 2.0 which is available at @@ -13,6 +13,7 @@ package io.openliberty.tools.eclipse.test.it; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.io.File; import java.nio.file.Path; @@ -74,9 +75,11 @@ public class LibertyPluginSWTBotLSP4JakartaTest extends AbstractLibertyPluginSWT /** * Setup. + * + * @throws Exception */ @BeforeAll - public static void setup() { + public static void setup() throws Exception { commonSetup(); @@ -111,6 +114,7 @@ public void testClassLevelSnippets() { // Get type-ahead list List typeAheadOptions = SWTBotPluginOperations.getTypeAheadList(bot, "MyClass.java", "", 0, 0); + System.out.println("INFO: Type-ahead options found = " + Arrays.toString(typeAheadOptions.toArray())); boolean allFound = true; List missingOptions = new ArrayList(); @@ -123,10 +127,14 @@ public void testClassLevelSnippets() { assertTrue(allFound, "Missing type-ahead options: " + Arrays.toString(missingOptions.toArray())); + } catch (Exception e) { + fail("Unexpected exception was thrown: " + e); } finally { // Delete new file + System.out.println("INFO: Deleting MyClass.java file"); LibertyPluginTestUtils.deleteFile(new File(wrapperProjectPath + "/src/main/java/test/maven/liberty/web/app/MyClass.java")); + } } @@ -142,6 +150,7 @@ public void testInClassSnippets() { // Get type-ahead list List typeAheadOptions = SWTBotPluginOperations.getTypeAheadList(bot, "MyClass.java", "", 3, 0); + System.out.println("INFO: Type-ahead options found = " + Arrays.toString(typeAheadOptions.toArray())); boolean allFound = true; List missingOptions = new ArrayList(); @@ -154,9 +163,12 @@ public void testInClassSnippets() { assertTrue(allFound, "Missing type-ahead options: " + Arrays.toString(missingOptions.toArray())); + } catch (Exception e) { + fail("Unexpected exception was thrown: " + e); } finally { // Delete new file + System.out.println("INFO: Deleting MyClass.java file"); LibertyPluginTestUtils.deleteFile(new File(wrapperProjectPath + "/src/main/java/test/maven/liberty/web/app/MyClass.java")); } } @@ -193,9 +205,12 @@ public void testDiagnosticsAndQuickFixes() { assertTrue(allFound, "Missing quick-fixes: " + Arrays.toString(missingFixes.toArray())); + } catch (Exception e) { + fail("Unexpected exception was thrown: " + e); } finally { // Delete new file + System.out.println("INFO: Deleting MyClass.java file"); LibertyPluginTestUtils.deleteFile(new File(wrapperProjectPath + "/src/main/java/test/maven/liberty/web/app/MyClass.java")); } } diff --git a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java index ba692b17..58eeb6a4 100644 --- a/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java +++ b/tests/src/main/java/io/openliberty/tools/eclipse/test/it/utils/SWTBotPluginOperations.java @@ -934,6 +934,8 @@ public boolean matches(Object object) { */ public static void createNewClass(SWTWorkbenchBot bot, String appName, String className, boolean clearContent) { + System.out.println("INFO: Creating new Java class: " + className); + Object project = getAppInPackageExplorerTree(appName); context(project, "New", "Class"); @@ -967,6 +969,9 @@ public static void createNewClass(SWTWorkbenchBot bot, String appName, String cl */ public static List getTypeAheadList(SWTWorkbenchBot bot, String editorFileName, String insertText, int cursorRow, int cursorColumn) { + + System.out.println("INFO: Getting type-ahead list"); + SWTBotPreferences.PLAYBACK_DELAY = 1000; SWTBotEditor editor = searchForEditor(bot, editorFileName); @@ -992,6 +997,9 @@ public static List getTypeAheadList(SWTWorkbenchBot bot, String editorFi */ public static void selectTypeAheadOption(SWTWorkbenchBot bot, String editorFileName, String option, int cursorRow, int cursorColumn) { + + System.out.println("INFO: Selecting type-ahead option: " + option); + SWTBotPreferences.PLAYBACK_DELAY = 1000; SWTBotEditor editor = searchForEditor(bot, editorFileName); SWTBotEclipseEditor e = editor.toTextEditor(); @@ -1009,6 +1017,8 @@ public static void selectTypeAheadOption(SWTWorkbenchBot bot, String editorFileN * @return */ public static List getQuickFixList(SWTWorkbenchBot bot, String editorFileName) { + System.out.println("INFO: Getting quick-fix list for class: " + editorFileName); + SWTBotPreferences.PLAYBACK_DELAY = 1000; SWTBotEditor editor = searchForEditor(bot, editorFileName);