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
5 changes: 2 additions & 3 deletions com.avaloq.tools.ddk.test.ui.test/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ Bundle-Version: 16.3.0.qualifier
Bundle-ActivationPolicy: lazy
Bundle-Vendor: Avaloq Group AG
Bundle-RequiredExecutionEnvironment: JavaSE-21
Require-Bundle: org.junit,
org.eclipse.swtbot.eclipse.finder,
Require-Bundle: org.eclipse.swtbot.eclipse.finder,
org.eclipse.swt,
com.avaloq.tools.ddk.test.core,
com.avaloq.tools.ddk.test.ui,
junit-jupiter-api,
junit-jupiter-engine,
junit-vintage-engine
junit-platform-suite-api
Import-Package: org.eclipse.core.runtime,
org.eclipse.core.runtime.jobs
Automatic-Module-Name: com.avaloq.tools.ddk.test.ui.test
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
*******************************************************************************/
package com.avaloq.tools.ddk.test.ui.test;

import org.junit.runner.RunWith;
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;

import com.avaloq.tools.ddk.test.core.junit.runners.DiscerningSuite;
import com.avaloq.tools.ddk.test.ui.test.swtbot.DeChKeyboardLayoutTest;
import com.avaloq.tools.ddk.test.ui.test.swtbot.SwtBotRadioTest;


/**
* Empty class serving only as holder for JUnit4 annotations.
*/
@RunWith(DiscerningSuite.class)
@DiscerningSuite.SuiteClasses({
@Suite
@SelectClasses({
// @Format-Off
DeChKeyboardLayoutTest.class,
SwtBotRadioTest.class
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
*******************************************************************************/
package com.avaloq.tools.ddk.test.ui.test.logging;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.jobs.Job;
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;

import com.avaloq.tools.ddk.test.core.util.ErrorLogListener;

Expand All @@ -32,7 +32,7 @@ public class ErrorLogListenerTest {
/**
* Sets up the {@link ErrorLogListener} under test.
*/
@Before
@BeforeEach
public void setUp() {
errorLogListener = new ErrorLogListener();
errorLogListener.register();
Expand All @@ -41,7 +41,7 @@ public void setUp() {
/**
* Tears down the {@link ErrorLogListener} under test.
*/
@After
@AfterEach
public void tearDown() {
errorLogListener.unregister();
}
Expand All @@ -55,7 +55,7 @@ public void tearDown() {
@Test
@SuppressWarnings("nls")
public void testIgnoringExceptionLocations() throws InterruptedException {
assertFalse("NullPointerException must not have been logged.", errorLogListener.isExceptionLogged(NullPointerException.class));
assertFalse(errorLogListener.isExceptionLogged(NullPointerException.class), "NullPointerException must not have been logged.");
errorLogListener.ignoreException(NullPointerException.class, "com.avaloq.tools.ddk.test.core.util.ErrorLogListenerTest");

final Job job = new Job("testIgnoringExceptionLocations") {
Expand All @@ -70,6 +70,6 @@ protected IStatus run(final IProgressMonitor monitor) {
job.schedule();
job.join();

assertTrue("NullPointerException must have been logged.", errorLogListener.isExceptionLogged(NullPointerException.class));
assertTrue(errorLogListener.isExceptionLogged(NullPointerException.class), "NullPointerException must have been logged.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*******************************************************************************/
package com.avaloq.tools.ddk.test.ui.test.swtbot;

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

import org.eclipse.swtbot.eclipse.finder.widgets.SWTBotEclipseEditor;
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
import org.junit.Test;
import org.junit.jupiter.api.Test;

import com.avaloq.tools.ddk.test.ui.swtbot.SwtWorkbenchBot;

Expand Down Expand Up @@ -43,6 +43,6 @@ public void testDeChKeyboardLayout() {
String actualResult = editor.getText();
bot.closeAllEditors();

assertEquals("Written and read characters must exactly match", EXPECTED_RESULT, actualResult);
assertEquals(EXPECTED_RESULT, actualResult, "Written and read characters must exactly match");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
*******************************************************************************/
package com.avaloq.tools.ddk.test.ui.test.swtbot;

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

import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
import org.junit.Rule;
import org.junit.Test;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.RegisterExtension;

import com.avaloq.tools.ddk.test.core.Issue;
import com.avaloq.tools.ddk.test.core.IssueAwareRule;
import com.avaloq.tools.ddk.test.core.jupiter.IssueAwareRule;
import com.avaloq.tools.ddk.test.ui.swtbot.SwtWorkbenchBot;
import com.avaloq.tools.ddk.test.ui.swtbot.util.PreferenceUtil;

Expand All @@ -29,7 +29,7 @@
@SuppressWarnings("nls")
public class SwtBotRadioTest {

@Rule
@RegisterExtension
// CHECKSTYLE:CHECK-OFF VisibilityModifier
public final IssueAwareRule rule = IssueAwareRule.getInstance();
// CHECKSTYLE:CHECK-ON VisibilityModifier
Expand Down Expand Up @@ -97,17 +97,17 @@ private void testRadioButtonClick(final SWTWorkbenchBot bot) {
}

// Assert that the buttons were found.
assertNotNull("previouslySelectedRadio must not be null.", previouslySelectedRadio);
assertNotNull("radioToSelect must not be null.", radioToSelect);
assertNotNull(previouslySelectedRadio, "previouslySelectedRadio must not be null.");
assertNotNull(radioToSelect, "radioToSelect must not be null.");

// Select radio button and check if it was actually selected.
bot.radio(radioToSelect.getText()).click();
assertTrue(String.format("\"%s\" must be selected.", radioToSelect.getText()), bot.radio(radioToSelect.getText()).isSelected());
assertTrue(bot.radio(radioToSelect.getText()).isSelected(), String.format("\"%s\" must be selected.", radioToSelect.getText()));

// Close and re-open preference page and check again.
PreferenceUtil.closePreferenceDialog(bot);
PreferenceUtil.openPreferenceDialog(bot, PREFERENCES_PATH);
assertTrue(String.format("\"%s\" must not be de-selected again.", radioToSelect.getText()), bot.radio(radioToSelect.getText()).isSelected());
assertTrue(bot.radio(radioToSelect.getText()).isSelected(), String.format("\"%s\" must not be de-selected again.", radioToSelect.getText()));

// Reset
bot.radio(previouslySelectedRadio.getText()).click();
Expand Down