Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ Bundle-Version: 1.4.100.qualifier
Eclipse-BundleShape: dir
Bundle-Vendor: Eclipse.org
Fragment-Host: org.eclipse.ui.ide.application
Require-Bundle: org.junit
Require-Bundle: junit-jupiter-api;bundle-version="[5.14.1, 6.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-17
Automatic-Module-Name: org.eclipse.ui.ide.application.tests
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 Manumitting Technologies Inc and others
* Copyright (c) 2016, 2026 Manumitting Technologies Inc and others
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -13,15 +13,15 @@
*******************************************************************************/
package org.eclipse.ui.internal.ide.application;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;

import java.io.File;
import java.io.IOException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

/**
* Tests for {@link FileLocationDetails}, used to parse file names from
Expand All @@ -33,13 +33,13 @@ public class FileLocationDetailsTest {
File tempFile;
String path;

@Before
@BeforeEach
public void setUp() throws IOException {
tempFile = File.createTempFile(getClass().getSimpleName(), "java");
path = tempFile.getAbsolutePath().replace('\\', '/');
}

@After
@AfterEach
public void tearDown() {
tempFile.delete();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2016 InterSystems Corporation and others.
* Copyright (c) 2016, 2026 InterSystems Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -13,9 +13,10 @@
*******************************************************************************/
package org.eclipse.ui.internal.ide.application;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.Closeable;
import java.util.concurrent.atomic.AtomicInteger;
Expand All @@ -32,10 +33,9 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class IDEWorkbenchAdvisorTest {
private static final String PLUGIN_ID = "org.eclipse.ui.ide.application.tests";
Expand Down Expand Up @@ -79,15 +79,15 @@ public void close() {
}
}

@Before
@BeforeEach
public void setUp() {
assertNull(display);
display = PlatformUI.createDisplay();
assertNotNull(display);
rule = ResourcesPlugin.getWorkspace().getRoot();
}

@After
@AfterEach
public void tearDown() throws Exception {
try {
Job.getJobManager().endRule(rule);
Expand Down Expand Up @@ -127,14 +127,14 @@ public void postStartup() {
};

int returnCode = PlatformUI.createAndRunWorkbench(display, advisor);
Assert.assertEquals(PlatformUI.RETURN_OK, returnCode);
assertEquals(PlatformUI.RETURN_OK, returnCode);
dispatchDisplay();

Assert.assertNotNull(saveHook.prepareToSave);
Assert.assertNotNull(saveHook.saving);
Assert.assertNotNull(saveHook.prepareToSave);
Assert.assertNotNull(saveHook.doneSaving);
Assert.assertNull(saveHook.rollback);
assertNotNull(saveHook.prepareToSave);
assertNotNull(saveHook.saving);
assertNotNull(saveHook.prepareToSave);
assertNotNull(saveHook.doneSaving);
assertNull(saveHook.rollback);
}
}

Expand Down Expand Up @@ -185,16 +185,16 @@ public void postShutdown() {
};

int returnCode = PlatformUI.createAndRunWorkbench(display, advisor);
Assert.assertEquals(PlatformUI.RETURN_OK, returnCode);
assertEquals(PlatformUI.RETURN_OK, returnCode);
dispatchDisplay();

Assert.assertNull(saveHook.prepareToSave);
Assert.assertNull(saveHook.saving);
Assert.assertNull(saveHook.prepareToSave);
Assert.assertNull(saveHook.doneSaving);
Assert.assertNull(saveHook.rollback);
assertNull(saveHook.prepareToSave);
assertNull(saveHook.saving);
assertNull(saveHook.prepareToSave);
assertNull(saveHook.doneSaving);
assertNull(saveHook.rollback);
String message = "IDEWorkbenchAdvisor did not properly reported failed disconnect";
Assert.assertEquals(message, expectedLogs, logs.get());
assertEquals(expectedLogs, logs.get(), message);
} finally {
IDEWorkbenchPlugin.getDefault().getLog().removeLogListener(listener);
}
Expand All @@ -219,14 +219,14 @@ public void postStartup() {
}
};
int returnCode = PlatformUI.createAndRunWorkbench(display, advisor);
Assert.assertEquals(PlatformUI.RETURN_OK, returnCode);
assertEquals(PlatformUI.RETURN_OK, returnCode);
dispatchDisplay();

Assert.assertNotNull(saveHook.prepareToSave);
Assert.assertNotNull(saveHook.saving);
Assert.assertNotNull(saveHook.prepareToSave);
Assert.assertNotNull(saveHook.doneSaving);
Assert.assertNull(saveHook.rollback);
assertNotNull(saveHook.prepareToSave);
assertNotNull(saveHook.saving);
assertNotNull(saveHook.prepareToSave);
assertNotNull(saveHook.doneSaving);
assertNull(saveHook.rollback);
}

}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2021 SAP SE and others.
* Copyright (c) 2018, 2026 SAP SE and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
Expand All @@ -10,10 +10,11 @@
*******************************************************************************/
package org.eclipse.ui.internal.ide.application.dialogs;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.io.IOException;
import java.util.Arrays;
Expand Down Expand Up @@ -41,8 +42,8 @@
import org.eclipse.urischeme.ISchemeInformation;
import org.eclipse.urischeme.IUriSchemeExtensionReader;
import org.eclipse.urischeme.IUriSchemeHandler;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class UriSchemeHandlerPreferencePageTest {
private static final String NO_APPLICATION = IDEWorkbenchMessages.UrlHandlerPreferencePage_Handler_Text_No_Application;
Expand All @@ -64,7 +65,7 @@ public class UriSchemeHandlerPreferencePageTest {
private OperatingSystemRegistrationMock operatingSystemRegistration;
private MessageDialogWrapperSpy messageDialogSpy;

@Before
@BeforeEach
public void setup() {
this.page = createStandalonePreferencePage();
}
Expand Down Expand Up @@ -232,16 +233,16 @@ public void doesNotRegistersSchemesInOperatingSystemOnApplyWhenLoading() throws
waitForJob();
// tableItem[1] (hello1 scheme) is true (refer to members), but page is still
// loading
assertNotNull("Page is null", page);
assertNotNull(page, "Page is null");
page.performOk();

OperatingSystemRegistrationMock mock = (OperatingSystemRegistrationMock) page.operatingSystemRegistration;
assertNotNull("mock is null", mock);
assertNotNull(mock, "mock is null");

assertNotNull("addedSchemes is null", mock.addedSchemes);
assertNotNull(mock.addedSchemes, "addedSchemes is null");
assertEquals(0, mock.addedSchemes.size());

assertNotNull("removedSchemes is null", mock.removedSchemes);
assertNotNull(mock.removedSchemes, "removedSchemes is null");
assertEquals(0, mock.removedSchemes.size());
waitForJob();
}
Expand Down
Loading