Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2014-04-07 09:55:05 +0000
committerAlexander Kurtakov2014-04-07 10:35:38 +0000
commita474fd01f0f9450a83e223277085f5c530bb273d (patch)
treed609b665731d686facb719c2acd91d8fbd41ce41
parentf9efc19ba33d3aaa6f0cf799c2f22ce4ecff0078 (diff)
downloadorg.eclipse.linuxtools-a474fd01f0f9450a83e223277085f5c530bb273d.tar.gz
org.eclipse.linuxtools-a474fd01f0f9450a83e223277085f5c530bb273d.tar.xz
org.eclipse.linuxtools-a474fd01f0f9450a83e223277085f5c530bb273d.zip
tests: Use more appropriate junit assert methods.
Improves readability: * assertTrue(!condition) -> assertFalse(condition) * assertTrue(a == b) -> assertEquals(a, b) and other similar Change-Id: Iea7478cac9eb0278b7dcfa5702c115004ba7b5ae Signed-off-by: Alexander Kurtakov <akurtako@redhat.com> Reviewed-on: https://git.eclipse.org/r/24530 Tested-by: Hudson CI
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/tests/fixtures/TestChangeLogTestProject.java4
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/CreateChangeLogFromHistorySWTBotTest.java4
-rw-r--r--changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/FormatChangeLogSWTBotTest.java3
-rw-r--r--gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java4
-rw-r--r--perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java8
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/LaunchTest.java2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/PreferencesTest.java4
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.core.tests/src/org/eclipse/linuxtools/rpm/core/tests/DownloadPrepareSourcesTest.java10
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java4
-rw-r--r--systemtap/org.eclipse.linuxtools.callgraph.tests/src/org/eclipse/linuxtools/callgraph/tests/StapGraphParserTest.java5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/AverageAggregateTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/CountAggregateTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MaxAggregateTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MinAggregateTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/SumAggregateTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/MatchFilterTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/RangeFilterTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/SortFilterTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/UniqueFilterTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.structures.tests/.settings/org.eclipse.jdt.ui.prefs57
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/LoggingStreamDaemonTest.java5
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/SortTest.java39
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/StringFormatterTest.java15
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java3
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java38
-rw-r--r--systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java91
-rw-r--r--valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/MultiProcessTest.java3
29 files changed, 303 insertions, 137 deletions
diff --git a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/tests/fixtures/TestChangeLogTestProject.java b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/tests/fixtures/TestChangeLogTestProject.java
index 12d61e6ffb..522f99f2a8 100644
--- a/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/tests/fixtures/TestChangeLogTestProject.java
+++ b/changelog/org.eclipse.linuxtools.changelog.tests/src/org/eclipse/linuxtools/changelog/tests/fixtures/TestChangeLogTestProject.java
@@ -125,7 +125,7 @@ public class TestChangeLogTestProject {
@Test
public void canAddCNature() throws Exception {
IProject cProject = this.project.getTestProject();
- assertTrue(!CoreModel.hasCNature(cProject));
+ assertFalse(CoreModel.hasCNature(cProject));
// Add C nature
this.project.addCNature();
cProject = this.project.getTestProject();
@@ -140,7 +140,7 @@ public class TestChangeLogTestProject {
@Test
public void canAddCCNature() throws Exception {
IProject ccProject = this.project.getTestProject();
- assertTrue(!CoreModel.hasCCNature(ccProject));
+ assertFalse(CoreModel.hasCCNature(ccProject));
// Add C++ nature
this.project.addCCNature();
ccProject = this.project.getTestProject();
diff --git a/changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/CreateChangeLogFromHistorySWTBotTest.java b/changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/CreateChangeLogFromHistorySWTBotTest.java
index 0dbb9f6811..5cc35ef759 100644
--- a/changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/CreateChangeLogFromHistorySWTBotTest.java
+++ b/changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/CreateChangeLogFromHistorySWTBotTest.java
@@ -10,8 +10,8 @@ package org.eclipse.linuxtools.changelog.ui.tests.swtbot;
import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
import static org.hamcrest.core.AllOf.allOf;
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 java.io.ByteArrayInputStream;
@@ -168,7 +168,7 @@ public class CreateChangeLogFromHistorySWTBotTest {
swtBoteditor.save();
// make sure some changelog like text was pasted
String text = eclipseEditor.getText();
- assertTrue(!text.equals(""));
+ assertFalse(text.isEmpty());
}
/**
diff --git a/changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/FormatChangeLogSWTBotTest.java b/changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/FormatChangeLogSWTBotTest.java
index f09a35626c..7d8b7192fa 100644
--- a/changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/FormatChangeLogSWTBotTest.java
+++ b/changelog/org.eclipse.linuxtools.changelog.ui.tests/src/org/eclipse/linuxtools/changelog/ui/tests/swtbot/FormatChangeLogSWTBotTest.java
@@ -10,6 +10,7 @@ package org.eclipse.linuxtools.changelog.ui.tests.swtbot;
import static org.eclipse.swtbot.eclipse.finder.matchers.WidgetMatcherFactory.withPartName;
import static org.hamcrest.core.AllOf.allOf;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -140,7 +141,7 @@ public class FormatChangeLogSWTBotTest {
String thirdLine = swtBotEclipseEditor.getTextOnLine(2);
// FIXME: These assertions are lame.
assertTrue(secondLine.isEmpty());
- assertTrue(!thirdLine.isEmpty());
+ assertFalse(thirdLine.isEmpty());
}
}
diff --git a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java
index 003aa4e78b..8f20fbe1aa 100644
--- a/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java
+++ b/gcov/org.eclipse.linuxtools.gcov.test/src/org/eclipse/linuxtools/internal/gcov/test/GcovTest.java
@@ -2,6 +2,7 @@ package org.eclipse.linuxtools.internal.gcov.test;
import static org.eclipse.swtbot.swt.finder.finders.ContextMenuHelper.contextMenu;
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withText;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertTrue;
import java.io.File;
@@ -46,7 +47,6 @@ import org.eclipse.swtbot.swt.finder.widgets.TimeoutException;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.hamcrest.Matcher;
-import org.junit.Assert;
import org.osgi.framework.FrameworkUtil;
public abstract class GcovTest {
@@ -360,7 +360,7 @@ public abstract class GcovTest {
break;
}
}
- Assert.assertTrue(treeBot.selectionCount() != 0);
+ assertNotEquals(treeBot.selectionCount(), 0);
String menuItem = "Profiling Tools";
String subMenuItem = "1 Profile Code Coverage";
click(contextMenu(treeBot, menuItem, subMenuItem));
diff --git a/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java b/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java
index 651a648d0c..045e88a784 100644
--- a/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java
+++ b/perf/org.eclipse.linuxtools.perf.tests/src/org/eclipse/linuxtools/internal/perf/tests/ModelTest.java
@@ -285,7 +285,7 @@ public class ModelTest extends AbstractTest {
String expectedFilePath = "/home/user/workspace/fibonacci/Debug/../src/fibonacci.cpp";
assertTrue(expectedDsoPath.equals(dso.getPath()));
- assertTrue(dso.getChildren().length == 2);
+ assertEquals(dso.getChildren().length, 2);
for (TreeParent dsoChild : dso.getChildren()) {
String filePath = ((PMFile) dsoChild).getPath();
@@ -295,18 +295,18 @@ public class ModelTest extends AbstractTest {
} else {
assertTrue(expectedFilePath.equals(filePath));
assertTrue(dsoChild.hasChildren());
- assertTrue(dsoChild.getChildren().length == 1);
+ assertEquals(dsoChild.getChildren().length, 1);
TreeParent curSym = dsoChild.getChildren()[0];
assertTrue(curSym.hasChildren());
- assertTrue(curSym.getChildren().length == 5);
+ assertEquals(curSym.getChildren().length, 5);
float percentCount = 0;
for (TreeParent symChild : curSym.getChildren()) {
percentCount += symChild.getPercent();
}
- assertTrue(Math.ceil(percentCount) == 100.0);
+ assertEquals(Math.ceil(percentCount), 100.0, 0.0);
}
}
diff --git a/profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/LaunchTest.java b/profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/LaunchTest.java
index f3cc9ced2c..b7699bb1a7 100644
--- a/profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/LaunchTest.java
+++ b/profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/LaunchTest.java
@@ -87,7 +87,7 @@ public class LaunchTest extends AbstractTest {
} catch (CoreException e) {
fail(e.getMessage());
}
- assertTrue(cfg.getChildren("class").length == 1); //$NON-NLS-1$
+ assertEquals(cfg.getChildren("class").length, 1); //$NON-NLS-1$
IConfigurationElement elem = cfg.getChildren("class")[0]; //$NON-NLS-1$
for (int i = 0; i < 2; i++) {
assertNotNull(elem.getChildren("parameter")[i].getAttribute("name")); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/PreferencesTest.java b/profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/PreferencesTest.java
index 76a68d619b..82948a2bd0 100644
--- a/profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/PreferencesTest.java
+++ b/profiling/org.eclipse.linuxtools.profiling.provider.tests/src/org/eclipse/linuxtools/profiling/provider/tests/PreferencesTest.java
@@ -137,7 +137,7 @@ public class PreferencesTest extends AbstractTest{
// Assert specified tool to select is what we expect and select it.
SWTBotRadio stubRadio = bot.radio(STUB_LABEL);
assertNotNull(stubRadio);
- assertTrue(STUB_TOOLTIP.equals(stubRadio.getToolTipText()));
+ assertEquals(STUB_TOOLTIP,stubRadio.getToolTipText());
stubRadio.click();
bot.button("Apply").click(); //$NON-NLS-1$
@@ -206,7 +206,7 @@ public class PreferencesTest extends AbstractTest{
// Assert default radio is as expected.
SWTBotRadio defaultRadio = bot.radio(defaultToolLabel);
assertNotNull(defaultRadio);
- assertTrue(defaultToolInfo.equals(defaultRadio.getToolTipText()));
+ assertEquals(defaultToolInfo, defaultRadio.getToolTipText());
bot.button("Apply").click(); //$NON-NLS-1$
bot.button("OK").click(); //$NON-NLS-1$
diff --git a/rpm/org.eclipse.linuxtools.rpm.core.tests/src/org/eclipse/linuxtools/rpm/core/tests/DownloadPrepareSourcesTest.java b/rpm/org.eclipse.linuxtools.rpm.core.tests/src/org/eclipse/linuxtools/rpm/core/tests/DownloadPrepareSourcesTest.java
index 6959c63d92..ca3cce6ef5 100644
--- a/rpm/org.eclipse.linuxtools.rpm.core.tests/src/org/eclipse/linuxtools/rpm/core/tests/DownloadPrepareSourcesTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.core.tests/src/org/eclipse/linuxtools/rpm/core/tests/DownloadPrepareSourcesTest.java
@@ -196,14 +196,14 @@ public class DownloadPrepareSourcesTest {
switch (layout) {
case RPMBUILD:
assertNotNull(sourcesFolder.getParent().findMember("SOURCES"));
- assertTrue(sourcesFolder.members().length == 1);
+ assertEquals(sourcesFolder.members().length, 1);
// check if the file exists under SOURCES folder
assertNotNull(sourcesFolder
.findMember(new Path("hello-2.8.tar.gz")));
break;
case FLAT:
// 4 = "hello-2.8.tar.gz" + ".project" + "hello-2.8-1.fc19.src.rpm" + "hello.spec"
- assertTrue(sourcesFolder.members().length == 4);
+ assertEquals(sourcesFolder.members().length, 4);
assertNotNull(sourcesFolder
.findMember(new Path("hello-2.8.tar.gz")));
break;
@@ -225,7 +225,7 @@ public class DownloadPrepareSourcesTest {
switch (layout) {
case RPMBUILD:
assertNotNull(buildFolder.getParent().findMember("BUILD"));
- assertTrue(buildFolder.members().length == 1);
+ assertEquals(buildFolder.members().length, 1);
// check if the file exists under BUILD folder
helloBuildFolder = buildFolder.getFolder(new Path("hello-2.8"));
assertTrue(helloBuildFolder.exists());
@@ -234,7 +234,7 @@ public class DownloadPrepareSourcesTest {
break;
case FLAT:
// 4 = "hello-2.8.tar.gz" + ".project" + "hello-2.8-1.fc19.src.rpm" + "hello.spec" + "hello-2.8/"
- assertTrue(buildFolder.members().length == 5);
+ assertEquals(buildFolder.members().length, 5);
helloBuildFolder = buildFolder.getFolder(new Path("hello-2.8"));
assertTrue(helloBuildFolder.exists());
// there should be some stuff within hello-2.8/ folder
@@ -265,7 +265,7 @@ public class DownloadPrepareSourcesTest {
downloadJob.setUser(true);
downloadJob.schedule();
downloadJob.join();
- assertTrue(downloadJob.getResult().equals(Status.OK_STATUS));
+ assertEquals(downloadJob.getResult(),Status.OK_STATUS);
}
/**
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/.settings/org.eclipse.jdt.ui.prefs b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..91b392e9a9
--- /dev/null
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java
index 7fca173d30..40e5d498e3 100644
--- a/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java
+++ b/rpm/org.eclipse.linuxtools.rpm.createrepo.tests/src/org/eclipse/linuxtools/internal/rpm/createrepo/tree/tests/CreaterepoTreeTest.java
@@ -10,12 +10,12 @@
*******************************************************************************/
package org.eclipse.linuxtools.internal.rpm.createrepo.tree.tests;
+import static org.junit.Assert.assertArrayEquals;
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 java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@@ -165,7 +165,7 @@ public class CreaterepoTreeTest {
CreaterepoTreeCategory category = (CreaterepoTreeCategory) treeItem.getData();
// only check 1 category's tags, as all are loaded the same way
if (category.getName().equals(CreaterepoPreferenceConstants.PREF_DISTRO_TAG)) {
- assertTrue(Arrays.equals(DISTRO_TAGS, category.getTags().toArray()));
+ assertArrayEquals(DISTRO_TAGS, category.getTags().toArray());
break;
}
}
diff --git a/systemtap/org.eclipse.linuxtools.callgraph.tests/src/org/eclipse/linuxtools/callgraph/tests/StapGraphParserTest.java b/systemtap/org.eclipse.linuxtools.callgraph.tests/src/org/eclipse/linuxtools/callgraph/tests/StapGraphParserTest.java
index 8a5cd5a5b9..c1ea25b893 100644
--- a/systemtap/org.eclipse.linuxtools.callgraph.tests/src/org/eclipse/linuxtools/callgraph/tests/StapGraphParserTest.java
+++ b/systemtap/org.eclipse.linuxtools.callgraph.tests/src/org/eclipse/linuxtools/callgraph/tests/StapGraphParserTest.java
@@ -11,6 +11,7 @@
package org.eclipse.linuxtools.callgraph.tests;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
@@ -48,8 +49,8 @@ public class StapGraphParserTest {
//ALL FUNCTIONS HAVE A CUMULATIVE TIME
for (int val : grph.serialMap.keySet()){
String fname = grph.serialMap.get(val);
- assertTrue(grph.timeMap.get(val) != null);
- assertTrue(grph.aggregateTimeMap.get(fname) != null);
+ assertNotNull(grph.timeMap.get(val));
+ assertNotNull(grph.aggregateTimeMap.get(fname));
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/.settings/org.eclipse.jdt.ui.prefs b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..4cf03a28bb
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/AverageAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/AverageAggregateTest.java
index e00cc92121..e82d937afd 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/AverageAggregateTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/AverageAggregateTest.java
@@ -13,7 +13,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.aggregates;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import org.eclipse.linuxtools.systemtap.graphing.core.aggregates.AverageAggregate;
import org.eclipse.linuxtools.systemtap.graphing.core.tests.MockDataSet;
@@ -55,7 +54,7 @@ public class AverageAggregateTest {
@Test
public void testGetID() {
AverageAggregate aa = new AverageAggregate();
- assertTrue(AverageAggregate.ID.equals(aa.getID()));
+ assertEquals(AverageAggregate.ID, aa.getID());
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/CountAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/CountAggregateTest.java
index d6aaef1487..5ac79b3643 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/CountAggregateTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/CountAggregateTest.java
@@ -13,7 +13,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.aggregates;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import org.eclipse.linuxtools.systemtap.graphing.core.aggregates.CountAggregate;
import org.eclipse.linuxtools.systemtap.graphing.core.tests.MockDataSet;
@@ -55,7 +54,7 @@ public class CountAggregateTest {
@Test
public void testGetID() {
CountAggregate aa = new CountAggregate();
- assertTrue(CountAggregate.ID.equals(aa.getID()));
+ assertEquals(CountAggregate.ID, aa.getID());
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MaxAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MaxAggregateTest.java
index 0f18cf20e7..4ba2611ae7 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MaxAggregateTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MaxAggregateTest.java
@@ -13,7 +13,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.aggregates;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import org.eclipse.linuxtools.systemtap.graphing.core.aggregates.MaxAggregate;
import org.eclipse.linuxtools.systemtap.graphing.core.tests.MockDataSet;
@@ -54,7 +53,7 @@ public class MaxAggregateTest {
@Test
public void testGetID() {
MaxAggregate aa = new MaxAggregate();
- assertTrue(MaxAggregate.ID.equals(aa.getID()));
+ assertEquals(MaxAggregate.ID, aa.getID());
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MinAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MinAggregateTest.java
index c73e228cb1..b0a3dd69a3 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MinAggregateTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/MinAggregateTest.java
@@ -13,7 +13,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.aggregates;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import org.eclipse.linuxtools.systemtap.graphing.core.aggregates.MinAggregate;
import org.eclipse.linuxtools.systemtap.graphing.core.tests.MockDataSet;
@@ -55,7 +54,7 @@ public class MinAggregateTest {
@Test
public void testGetID() {
MinAggregate aa = new MinAggregate();
- assertTrue(MinAggregate.ID.equals(aa.getID()));
+ assertEquals(MinAggregate.ID, aa.getID());
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/SumAggregateTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/SumAggregateTest.java
index e33faa6049..8ec07f4f16 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/SumAggregateTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/aggregates/SumAggregateTest.java
@@ -13,7 +13,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.aggregates;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import org.eclipse.linuxtools.systemtap.graphing.core.aggregates.SumAggregate;
import org.eclipse.linuxtools.systemtap.graphing.core.tests.MockDataSet;
@@ -55,7 +54,7 @@ public class SumAggregateTest {
@Test
public void testGetID() {
SumAggregate aa = new SumAggregate();
- assertTrue(SumAggregate.ID.equals(aa.getID()));
+ assertEquals(SumAggregate.ID, aa.getID());
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/MatchFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/MatchFilterTest.java
index fbe5709d42..b40704484d 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/MatchFilterTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/MatchFilterTest.java
@@ -14,7 +14,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.filters;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
@@ -61,7 +60,7 @@ public class MatchFilterTest {
@Test
public void testGetID() {
MatchFilter filter = new MatchFilter(0, "", MatchFilter.KEEP_MATCHING);
- assertTrue(MatchFilter.ID.equals(filter.getID()));
+ assertEquals(MatchFilter.ID, filter.getID());
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/RangeFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/RangeFilterTest.java
index 69b81505d7..e6f72adb59 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/RangeFilterTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/RangeFilterTest.java
@@ -14,7 +14,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.filters;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
@@ -198,7 +197,7 @@ public class RangeFilterTest {
}
@Test
public void testGetID() {
- assertTrue(RangeFilter.ID.equals(filter.getID()));
+ assertEquals(RangeFilter.ID, filter.getID());
}
private RangeFilter filter;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/SortFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/SortFilterTest.java
index a40c6574f5..88e05d5c4e 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/SortFilterTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/SortFilterTest.java
@@ -14,7 +14,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.filters;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
@@ -91,7 +90,7 @@ public class SortFilterTest {
}
@Test
public void testGetID() {
- assertTrue(SortFilter.ID.equals(filter.getID()));
+ assertEquals(SortFilter.ID, filter.getID());
}
private SortFilter filter;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/UniqueFilterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/UniqueFilterTest.java
index d767042108..7d32fd6e3f 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/UniqueFilterTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.graphing.core.tests/src/org/eclipse/linuxtools/systemtap/graphing/core/tests/filters/UniqueFilterTest.java
@@ -14,7 +14,6 @@ package org.eclipse.linuxtools.systemtap.graphing.core.tests.filters;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import java.util.ArrayList;
@@ -75,7 +74,7 @@ public class UniqueFilterTest {
}
@Test
public void testGetID() {
- assertTrue(UniqueFilter.ID.equals(filter.getID()));
+ assertEquals(UniqueFilter.ID, filter.getID());
}
private UniqueFilter filter;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/.settings/org.eclipse.jdt.ui.prefs b/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..91b392e9a9
--- /dev/null
+++ b/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,57 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/LoggingStreamDaemonTest.java b/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/LoggingStreamDaemonTest.java
index 2ced11d12a..095526fef3 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/LoggingStreamDaemonTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/LoggingStreamDaemonTest.java
@@ -11,6 +11,7 @@
package org.eclipse.linuxtools.systemtap.structures.tests;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
@@ -39,10 +40,10 @@ public class LoggingStreamDaemonTest {
@Test
public void testGetOutput() {
- assertTrue("".equals(daemon.getOutput()));
+ assertTrue(daemon.getOutput().isEmpty());
daemon.handleDataEvent("test");
- assertTrue("test".equals(daemon.getOutput()));
+ assertEquals("test", daemon.getOutput());
}
@Test
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/SortTest.java b/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/SortTest.java
index 7f88d03333..6c0f8835bf 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/SortTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/SortTest.java
@@ -13,7 +13,6 @@ package org.eclipse.linuxtools.systemtap.structures.tests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import org.eclipse.linuxtools.systemtap.structures.Sort;
import org.junit.Test;
@@ -32,47 +31,47 @@ public class SortTest {
String[] s5 = new String[] {"d", "c", "b", "a"};
String[] s6 = new String[] {"c", "d", "a", "b"};
String[] s7 = new String[] {"a", "d", "a", "b"};
-
+
Sort.quicksort(s0, 0, 0);
assertNull("Sort null list", s0);
Sort.quicksort(s1, 0, 0);
assertEquals("Sort empty list", 0, s1.length);
-
+
Sort.quicksort(s2, 0, s2.length-1);
assertEquals("Sort blank list", 1, s2.length);
assertEquals("Blank item same", blank, s2[0]);
Sort.quicksort(s3, 0, s3.length-1);
assertEquals("Sort single item list", 1, s3.length);
- assertTrue("Single item same", "a".equals(s3[0]));
+ assertEquals("Single item same", "a", s3[0]);
Sort.quicksort(s4, 0, s4.length-1);
assertEquals("Sort ordered list", 4, s4.length);
- assertTrue("Single item same", "a".equals(s4[0]));
- assertTrue("Single item same", "b".equals(s4[1]));
- assertTrue("Single item same", "c".equals(s4[2]));
- assertTrue("Single item same", "d".equals(s4[3]));
+ assertEquals("Single item same", "a", s4[0]);
+ assertEquals("Single item same", "b", s4[1]);
+ assertEquals("Single item same", "c", s4[2]);
+ assertEquals("Single item same", "d", s4[3]);
Sort.quicksort(s5, 0, s5.length-1);
assertEquals("Sort reversed list", 4, s5.length);
- assertTrue("Single item same", "a".equals(s5[0]));
- assertTrue("Single item same", "b".equals(s5[1]));
- assertTrue("Single item same", "c".equals(s5[2]));
- assertTrue("Single item same", "d".equals(s5[3]));
+ assertEquals("Single item same", "a", s5[0]);
+ assertEquals("Single item same", "b", s5[1]);
+ assertEquals("Single item same", "c", s5[2]);
+ assertEquals("Single item same", "d", s5[3]);
Sort.quicksort(s6, 0, s6.length-1);
assertEquals("Sort random list", 4, s6.length);
- assertTrue("Single item same", "a".equals(s6[0]));
- assertTrue("Single item same", "b".equals(s6[1]));
- assertTrue("Single item same", "c".equals(s6[2]));
- assertTrue("Single item same", "d".equals(s6[3]));
+ assertEquals("Single item same", "a", s6[0]);
+ assertEquals("Single item same", "b", s6[1]);
+ assertEquals("Single item same", "c", s6[2]);
+ assertEquals("Single item same", "d", s6[3]);
Sort.quicksort(s7, 0, s7.length-1);
assertEquals("Sort duplicate item list", 4, s7.length);
- assertTrue("Single item same", "a".equals(s7[0]));
- assertTrue("Single item same", "a".equals(s7[1]));
- assertTrue("Single item same", "b".equals(s7[2]));
- assertTrue("Single item same", "d".equals(s7[3]));
+ assertEquals("Single item same", "a", s7[0]);
+ assertEquals("Single item same", "a", s7[1]);
+ assertEquals("Single item same", "b", s7[2]);
+ assertEquals("Single item same", "d", s7[3]);
}
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/StringFormatterTest.java b/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/StringFormatterTest.java
index 52ec60fb1f..901c479fb5 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/StringFormatterTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.structures.tests/src/org/eclipse/linuxtools/systemtap/structures/tests/StringFormatterTest.java
@@ -13,7 +13,6 @@ package org.eclipse.linuxtools.systemtap.structures.tests;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
import org.eclipse.linuxtools.systemtap.structures.IFormattingStyles;
import org.eclipse.linuxtools.systemtap.structures.StringFormatter;
@@ -64,25 +63,25 @@ public class StringFormatterTest {
public void testFormat() {
formatter.setFormat(IFormattingStyles.BINARY);
- assertTrue("0x1000".equals(formatter.format("8")));
+ assertEquals("0x1000", formatter.format("8"));
formatter.setFormat(IFormattingStyles.HEX);
- assertTrue("0x8".equals(formatter.format("8")));
+ assertEquals("0x8", formatter.format("8"));
formatter.setFormat(IFormattingStyles.OCTAL);
- assertTrue("0x10".equals(formatter.format("8")));
+ assertEquals("0x10",formatter.format("8"));
formatter.setFormat(IFormattingStyles.STRING);
- assertTrue("8".equals(formatter.format("8")));
+ assertEquals("8", formatter.format("8"));
formatter.setFormat(IFormattingStyles.UNFORMATED);
- assertTrue("8".equals(formatter.format("8")));
+ assertEquals("8", formatter.format("8"));
formatter.setFormat(IFormattingStyles.DATE);
- assertTrue("Dec 31, 1969 4:00:00 PM".equals(formatter.format("8")));
+ assertEquals("Dec 31, 1969 4:00:00 PM", formatter.format("8"));
formatter.setFormat(IFormattingStyles.DOUBLE);
- assertTrue("8.0".equals(formatter.format("8")));
+ assertEquals("8.0", formatter.format("8"));
}
private StringFormatter formatter;
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java
index fbdcc8c304..baf2f3473c 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/editors/stp/STPCompletionProcessorTest.java
@@ -11,6 +11,7 @@
package org.eclipse.linuxtools.systemtap.ui.ide.test.editors.stp;
+import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
@@ -126,7 +127,7 @@ public class STPCompletionProcessorTest extends SystemtapTest{
@Test
public void testGlobalInvalidCompletion() throws BadLocationException {
ICompletionProposal[] proposals = getCompletionsForPrefix("probe fake.fake");
- assertTrue(proposals.length == 0);
+ assertEquals(proposals.length, 0);
}
@Test
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java
index bdc48634ce..d672f30420 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/structures/TreeSettingsTest.java
@@ -41,16 +41,16 @@ public class TreeSettingsTest {
assertFalse("Set func null", TreeSettings.setTrees(t3, t));
assertFalse("Set probe null", TreeSettings.setTrees(t, t3));
}
-
+
@Test
public void testGetTreeFileDate() {
long d1 = TreeSettings.getTreeFileDate();
long d2 = TreeSettings.getTreeFileDate();
assertEquals("TreeDate same", d1, d2);
-
+
TreeSettings.setTrees(new TreeNode("f", false), new TreeNode("p", false));
d2 = TreeSettings.getTreeFileDate();
-
+
assertTrue("TreeDate changed", d1 < d2);
}
@@ -60,12 +60,12 @@ public class TreeSettingsTest {
TreeNode t = new TreeNode("f", false);
TreeNode t1 = new TreeNode(null, false);
TreeNode t2 = new TreeNode(new StringBuilder("asfd"), true);
-
+
TreeSettings.setTrees(t, t);
temp = TreeSettings.getFunctionTree();
assertEquals("Funcs no children", 0, temp.getChildCount());
- assertTrue("Funcs object", t.getData().toString().equals(temp.getData().toString()));
- assertTrue("Funcs display", t.toString().equals(temp.toString()));
+ assertEquals("Funcs object", t.getData().toString(), temp.getData().toString());
+ assertEquals("Funcs display", t.toString(),temp.toString());
TreeSettings.setTrees(t1, t);
temp = TreeSettings.getFunctionTree();
@@ -76,30 +76,30 @@ public class TreeSettingsTest {
TreeSettings.setTrees(t2, t);
temp = TreeSettings.getFunctionTree();
assertEquals("Funcs no children", 0, temp.getChildCount());
- assertTrue("Funcs object", t2.getData().toString().equals(temp.getData()));
- assertTrue("Funcs display", t2.toString().equals(temp.toString()));
+ assertEquals("Funcs object", t2.getData().toString(),temp.getData());
+ assertEquals("Funcs display", t2.toString(), temp.toString());
t.add(t2);
t.add(t1);
TreeSettings.setTrees(t, t);
temp = TreeSettings.getFunctionTree();
assertEquals("Funcs has children", 2, temp.getChildCount());
- assertTrue("Funcs child object", t2.getData().toString().equals(temp.getChildAt(0).getData()));
- assertTrue("Funcs child display", t2.toString().equals(temp.getChildAt(0).toString()));
+ assertEquals("Funcs child object", t2.getData().toString(), temp.getChildAt(0).getData());
+ assertEquals("Funcs child display", t2.toString(), temp.getChildAt(0).toString());
}
-
+
@Test
public void testGetProbeTree() {
TreeNode temp;
TreeNode t = new TreeNode("f", false);
TreeNode t1 = new TreeNode(null, false);
TreeNode t2 = new TreeNode(new StringBuilder("asfd"), true);
-
+
TreeSettings.setTrees(t, t);
temp = TreeSettings.getProbeTree();
assertEquals("Probs no children", 0, temp.getChildCount());
- assertTrue("Probs object", t.getData().toString().equals(temp.getData().toString()));
- assertTrue("Probs display", t.toString().equals(temp.toString()));
+ assertEquals("Probs object", t.getData().toString(), temp.getData().toString());
+ assertEquals("Probs display", t.toString(), temp.toString());
TreeSettings.setTrees(t, t1);
temp = TreeSettings.getProbeTree();
@@ -110,16 +110,16 @@ public class TreeSettingsTest {
TreeSettings.setTrees(t, t2);
temp = TreeSettings.getProbeTree();
assertEquals("Probs no children", 0, temp.getChildCount());
- assertTrue("Probs object", t2.getData().toString().equals(temp.getData()));
- assertTrue("Probs display", t2.toString().equals(temp.toString()));
+ assertEquals("Probs object", t2.getData().toString(), temp.getData());
+ assertEquals("Probs display", t2.toString(), temp.toString());
t.add(t2);
t.add(t1);
TreeSettings.setTrees(t, t);
temp = TreeSettings.getProbeTree();
assertEquals("Probs has children", 2, temp.getChildCount());
- assertTrue("Probs child object", t2.getData().toString().equals(temp.getChildAt(0).getData()));
- assertTrue("Probs child display", t2.toString().equals(temp.getChildAt(0).toString()));
+ assertEquals("Probs child object", t2.getData().toString(), temp.getChildAt(0).getData());
+ assertEquals("Probs child display", t2.toString(), temp.getChildAt(0).toString());
- }
+ }
}
diff --git a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java
index 62bb1b91be..400261c6b8 100644
--- a/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java
+++ b/systemtap/org.eclipse.linuxtools.systemtap.ui.ide.tests/src/org/eclipse/linuxtools/systemtap/ui/ide/test/swtbot/TestCreateSystemtapScript.java
@@ -16,6 +16,7 @@ import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.allOf;
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.widgetOfType;
import static org.eclipse.swtbot.swt.finder.matchers.WidgetMatcherFactory.withStyle;
import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
@@ -395,8 +396,8 @@ public class TestCreateSystemtapScript {
SWTBotToolbarButton remButton = debugView.toolbarPushButton("Remove All Terminated Launches");
assertTrue(remButton.isEnabled());
remButton.click();
- assertTrue(debugTable.getAllItems().length == 0);
- assertTrue(!remButton.isEnabled());
+ assertEquals(debugTable.getAllItems().length, 0);
+ assertFalse(remButton.isEnabled());
}
@Test
@@ -472,7 +473,7 @@ public class TestCreateSystemtapScript {
items[2].doubleClick();
assertTrue(editor.getText().contains("probe " + items[2].getText() + "\n"));
editor = bot.editorByTitle(scriptName).toTextEditor();
- assertTrue(!editor.getText().contains("probe " + items[2].getText() + "\n"));
+ assertFalse(editor.getText().contains("probe " + items[2].getText() + "\n"));
// Switch to the non-stp editor, and add a probe. A dialog should appear
// to let the user choose which of the open files to add to.
@@ -488,7 +489,7 @@ public class TestCreateSystemtapScript {
bot.button("OK").click();
bot.waitUntil(Conditions.shellCloses(shell));
editor = bot.activeEditor().toTextEditor();
- assertTrue(!editor.getTitle().equals("Untitled 1"));
+ assertFalse(editor.getTitle().equals("Untitled 1"));
assertTrue(editor.getText().contains("probe " + items[3].getText() + "\n"));
}
@@ -506,8 +507,8 @@ public class TestCreateSystemtapScript {
// As soon as the Graphing tab is entered, no regular expression exists & nothing can be run.
SWTBotCombo combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
assertEquals("", combo.getText());
- assertTrue(!runButton.isEnabled());
- assertTrue(!addButton.isEnabled());
+ assertFalse(runButton.isEnabled());
+ assertFalse(addButton.isEnabled());
combo.setText("(1)(2)");
assertEquals("(1)(2)", combo.getText());
assertTrue(runButton.isEnabled());
@@ -519,7 +520,7 @@ public class TestCreateSystemtapScript {
// Removing groups from the regex disables graphs that rely on those groups.
combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
combo.setText("(1)");
- assertTrue(!runButton.isEnabled());
+ assertFalse(runButton.isEnabled());
combo.setText("(1)(2)(3)");
assertTrue(runButton.isEnabled());
@@ -530,7 +531,7 @@ public class TestCreateSystemtapScript {
assertTrue(runButton.isEnabled());
combo.setText("(1)");
- assertTrue(!runButton.isEnabled());
+ assertFalse(runButton.isEnabled());
for (int i = 0, n = table.rowCount(); i < n; i++) {
String itemTitle = table.getTableItem(i).getText();
assertTrue("Graph " + i + " should be invalid, but it's not: " + itemTitle,
@@ -538,14 +539,14 @@ public class TestCreateSystemtapScript {
}
setupGraphGeneral("Safe", 1, graphID, true);
- assertTrue(!table.getTableItem(2).getText().contains(Messages.SystemTapScriptGraphOptionsTab_invalidGraph));
+ assertFalse(table.getTableItem(2).getText().contains(Messages.SystemTapScriptGraphOptionsTab_invalidGraph));
combo.setText("(1)(2)(3)");
assertTrue(runButton.isEnabled());
setupGraphGeneral("Unsafe", 3, graphID, true);
assertTrue(runButton.isEnabled());
combo.setText("(1)(2)");
- assertTrue(!runButton.isEnabled());
+ assertFalse(runButton.isEnabled());
for (int i = 0, n = table.rowCount(); i < n; i++) {
String itemTitle = table.getTableItem(i).getText();
assertTrue("Graph " + i + " has incorrect validity: " + itemTitle,
@@ -582,13 +583,13 @@ public class TestCreateSystemtapScript {
});
combo.setText(combo.getText().concat(" ")); // Just to refresh the dialog
- assertTrue(!runButton.isEnabled());
+ assertFalse(runButton.isEnabled());
assertTrue(table.getTableItem(0).getText().contains(Messages.SystemTapScriptGraphOptionsTab_invalidGraphID));
table.select(0);
dupButton.click();
remButton.click();
- assertTrue(!runButton.isEnabled());
+ assertFalse(runButton.isEnabled());
assertTrue(table.getTableItem(table.rowCount() - 1).getText().contains(Messages.SystemTapScriptGraphOptionsTab_invalidGraphID));
table.select(table.rowCount() - 1);
@@ -596,7 +597,7 @@ public class TestCreateSystemtapScript {
bot.waitUntil(Conditions.shellIsActive("Edit Graph"));
graphShell = bot.activeShell();
finishButton = bot.button("Finish");
- assertTrue(!finishButton.isEnabled());
+ assertFalse(finishButton.isEnabled());
bot.radio(0).click();
finishButton.click();
bot.waitUntil(Conditions.shellCloses(graphShell));
@@ -605,7 +606,7 @@ public class TestCreateSystemtapScript {
// Removing all invalid graphs should restore validity.
combo.setText("(1)");
- assertTrue(!runButton.isEnabled());
+ assertFalse(runButton.isEnabled());
for (int i = table.rowCount() - 1; i >= 0; i--) {
if (table.getTableItem(i).getText().contains(Messages.SystemTapScriptGraphOptionsTab_invalidGraph)) {
table.select(i);
@@ -966,7 +967,7 @@ public class TestCreateSystemtapScript {
// Enter a regex.
SWTBotCombo combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
SWTBotButton button = bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton);
- assertTrue(!button.isEnabled());
+ assertFalse(button.isEnabled());
combo.setText("(.*): (\\d+) (\\d+) (\\d+)");
// Add bar, pie, and line graphs that use the same column data.
@@ -1030,18 +1031,18 @@ public class TestCreateSystemtapScript {
SWTBotButton leftButton = bot.button(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages.GraphDiscreteXControl_Left);
SWTBotButton rightButton = bot.button(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages.GraphDiscreteXControl_Right);
SWTBotButton lastButton = bot.button(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages.GraphDiscreteXControl_Last);
- assertTrue(!firstButton.isEnabled());
- assertTrue(!leftButton.isEnabled());
- assertTrue(!rightButton.isEnabled());
- assertTrue(!lastButton.isEnabled());
+ assertFalse(firstButton.isEnabled());
+ assertFalse(leftButton.isEnabled());
+ assertFalse(rightButton.isEnabled());
+ assertFalse(lastButton.isEnabled());
// Test zooming in. The amount of zoom is arbitrary for this test--just make sure zooming happened.
SWTBotButton zoomInButton = bot.button(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages.GraphDiscreteXControl_ZoomIn);
SWTBotButton zoomOutButton = bot.button(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages.GraphDiscreteXControl_ZoomOut);
SWTBotButton allButton = bot.button(org.eclipse.linuxtools.systemtap.graphing.ui.widgets.Messages.GraphDiscreteXControl_All);
assertTrue(zoomInButton.isEnabled());
- assertTrue(!zoomOutButton.isEnabled());
- assertTrue(!allButton.isEnabled());
+ assertFalse(zoomOutButton.isEnabled());
+ assertFalse(allButton.isEnabled());
zoomInButton.click();
assertTrue(zoomOutButton.isEnabled());
assertTrue(allButton.isEnabled());
@@ -1053,8 +1054,8 @@ public class TestCreateSystemtapScript {
// Left scrolling should now be enabled.
assertTrue(firstButton.isEnabled());
assertTrue(leftButton.isEnabled());
- assertTrue(!rightButton.isEnabled());
- assertTrue(!lastButton.isEnabled());
+ assertFalse(rightButton.isEnabled());
+ assertFalse(lastButton.isEnabled());
// Test scrolling left. Again, the specific amount is arbitrary, just make sure scrolling happened.
leftButton.click();
@@ -1069,12 +1070,12 @@ public class TestCreateSystemtapScript {
range = axis.getRange();
assertTrue(range.upper - range.lower == numAxisItems - 1 && cb.getScale() == 1.0 && cb.getScroll() < scroll);
assertTrue(zoomInButton.isEnabled());
- assertTrue(!zoomOutButton.isEnabled());
- assertTrue(!allButton.isEnabled());
- assertTrue(!firstButton.isEnabled());
- assertTrue(!leftButton.isEnabled());
- assertTrue(!rightButton.isEnabled());
- assertTrue(!lastButton.isEnabled());
+ assertFalse(zoomOutButton.isEnabled());
+ assertFalse(allButton.isEnabled());
+ assertFalse(firstButton.isEnabled());
+ assertFalse(leftButton.isEnabled());
+ assertFalse(rightButton.isEnabled());
+ assertFalse(lastButton.isEnabled());
// For convenience, zooming out after having scrolled somewhere should make zooming in
// zoom back to the area that was scrolled to.
@@ -1088,8 +1089,8 @@ public class TestCreateSystemtapScript {
assertTrue(range.upper == numAxisItems - 1 && range.lower > 0 && cb.getScroll() > scroll);
assertTrue(firstButton.isEnabled());
assertTrue(leftButton.isEnabled());
- assertTrue(!rightButton.isEnabled());
- assertTrue(!lastButton.isEnabled());
+ assertFalse(rightButton.isEnabled());
+ assertFalse(lastButton.isEnabled());
// Zoom in as much as possible (range should show only one item),
// and step right/left. Add a loop limit for safety.
@@ -1110,9 +1111,9 @@ public class TestCreateSystemtapScript {
leftButton.click();
assertTrue(axis.getRange().lower < range.lower);
range = axis.getRange();
- assertTrue(range.lower == range.upper);
+ assertEquals(range.lower, range.upper, 0.0);
}
- assertTrue(axis.getRange().lower == 0);
+ assertEquals(axis.getRange().lower, 0, 0.0);
for (int i = 0; i < numAxisItems; i++) {
if (axis.getRange().upper == numAxisItems - 1) {
break;
@@ -1120,23 +1121,23 @@ public class TestCreateSystemtapScript {
rightButton.click();
assertTrue(axis.getRange().upper > range.upper);
range = axis.getRange();
- assertTrue(range.lower == range.upper);
+ assertEquals(range.lower, range.upper, 0.0);
}
- assertTrue(axis.getRange().upper == numAxisItems - 1);
+ assertEquals(axis.getRange().upper, numAxisItems - 1, 0);
firstButton.click();
- assertTrue(axis.getRange().lower == 0);
- assertTrue(!firstButton.isEnabled());
- assertTrue(!leftButton.isEnabled());
+ assertEquals(axis.getRange().lower, 0, 0);
+ assertFalse(firstButton.isEnabled());
+ assertFalse(leftButton.isEnabled());
assertTrue(rightButton.isEnabled());
assertTrue(lastButton.isEnabled());
lastButton.click();
- assertTrue(axis.getRange().upper == numAxisItems - 1);
+ assertEquals(axis.getRange().upper, numAxisItems - 1, 0);
assertTrue(firstButton.isEnabled());
assertTrue(leftButton.isEnabled());
- assertTrue(!rightButton.isEnabled());
- assertTrue(!lastButton.isEnabled());
+ assertFalse(rightButton.isEnabled());
+ assertFalse(lastButton.isEnabled());
}
private double getAxisScale(AbstractChartBuilder cb, boolean isXAxis) {
@@ -1175,7 +1176,7 @@ public class TestCreateSystemtapScript {
int thumb = scrollBar.getThumb();
// Default range should be 100%, so zooming out shouldn't have an effect yet.
- assertTrue(scale == 1.0);
+ assertEquals(scale, 1.0, 0);
int zoomValue = zoomScale.getValue();
Range range = axis.getRange();
zoomOutButton.click();
@@ -1213,7 +1214,7 @@ public class TestCreateSystemtapScript {
controlRange = scrollBar.getMaximum() - scrollBar.getThumb() - scrollBar.getMinimum();
scrollBar.setSelection(controlRange / 2);
bot.sleep(100);
- assertTrue(scrollBar.getThumb() == thumb);
+ assertEquals(scrollBar.getThumb(), thumb);
// Scroll towards origin.
range = axis.getRange();
@@ -1246,7 +1247,7 @@ public class TestCreateSystemtapScript {
// Enter a regex.
SWTBotCombo combo = bot.comboBoxWithLabel(Messages.SystemTapScriptGraphOptionsTab_regexLabel);
- assertTrue(!bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton).isEnabled());
+ assertFalse(bot.button(Messages.SystemTapScriptGraphOptionsTab_AddGraphButton).isEnabled());
combo.setText("(\\d+)");
// Add bar, pie, and line graphs that use the same column data.
@@ -1363,7 +1364,7 @@ public class TestCreateSystemtapScript {
SWTBotCombo comboY1 = bot.comboBoxWithLabel("Y Series 1:");
assertEquals(3, comboY1.itemCount()); // Y Series (i>0) has extra "NA" option as first entry
comboY1.setSelection(1);
- assertTrue(!bot.button("Finish").isEnabled()); // Don't allow duplicate selections
+ assertFalse(bot.button("Finish").isEnabled()); // Don't allow duplicate selections
comboY1.setSelection(2);
bot.button("Finish").click();
diff --git a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/MultiProcessTest.java b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/MultiProcessTest.java
index 35209575e4..a6038399c7 100644
--- a/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/MultiProcessTest.java
+++ b/valgrind/org.eclipse.linuxtools.valgrind.massif.tests/src/org/eclipse/linuxtools/internal/valgrind/massif/tests/MultiProcessTest.java
@@ -13,6 +13,7 @@ package org.eclipse.linuxtools.internal.valgrind.massif.tests;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
@@ -95,7 +96,7 @@ public class MultiProcessTest extends AbstractMassifTest {
assertTrue(snapshots1.length == 8 || snapshots1.length == 14);
MassifSnapshot[] snapshots2 = output.getSnapshots(pids[1]);
assertTrue(snapshots2.length == 8 || snapshots2.length == 14);
- assertTrue(snapshots1.length != snapshots2.length);
+ assertNotEquals(snapshots1.length, snapshots2.length);
if (snapshots1.length == 8) {
checkSnapshots(snapshots1, 400, 8);

Back to the top