Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Montplaisir2012-04-27 15:45:16 +0000
committerAlexandre Montplaisir2012-04-27 15:45:16 +0000
commit73de153562a5a3af461dbb76494ec154bae6720e (patch)
tree77589770f97c91febf49c7fa8a5ad1d3a5189010 /lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src
parent9011899bdcc5df189e89b42a097f41209b7ef853 (diff)
downloadorg.eclipse.linuxtools-73de153562a5a3af461dbb76494ec154bae6720e.tar.gz
org.eclipse.linuxtools-73de153562a5a3af461dbb76494ec154bae6720e.tar.xz
org.eclipse.linuxtools-73de153562a5a3af461dbb76494ec154bae6720e.zip
lttng: Fix FindBugs warnings in lttng2.kernel.core.tests
Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
Diffstat (limited to 'lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src')
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFKernelStateInputTest.java2
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFTestFiles.java4
-rw-r--r--lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java21
3 files changed, 16 insertions, 11 deletions
diff --git a/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFKernelStateInputTest.java b/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFKernelStateInputTest.java
index 0c6038976e..c2b65926e1 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFKernelStateInputTest.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFKernelStateInputTest.java
@@ -30,7 +30,7 @@ import org.junit.Test;
*/
public class CTFKernelStateInputTest {
- protected static IStateChangeInput input;
+ static IStateChangeInput input;
@BeforeClass
public static void initialize() throws TmfTraceException {
diff --git a/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFTestFiles.java b/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFTestFiles.java
index 577c6b0440..e64c44ba26 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFTestFiles.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/CTFTestFiles.java
@@ -37,9 +37,9 @@ public abstract class CTFTestFiles {
public final static String traceFile = "traces/trace2"; //$NON-NLS-1$
public final static long startTime = 18669367225825L;
- public static CtfTmfTrace trace = null;
+ private static CtfTmfTrace trace = null;
- public static CtfTmfTrace getTestTrace() throws TmfTraceException {
+ public synchronized static CtfTmfTrace getTestTrace() throws TmfTraceException {
if (trace == null) {
trace = new CtfTmfTrace();
trace.initTrace(null, traceFile, CtfTmfEvent.class);
diff --git a/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java b/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java
index e6244d5cbf..c464a6634e 100644
--- a/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java
+++ b/lttng/org.eclipse.linuxtools.lttng2.kernel.core.tests/src/org/eclipse/linuxtools/lttng2/kernel/core/tests/stateprovider/StateSystemFullHistoryTest.java
@@ -42,13 +42,13 @@ import org.junit.*;
@SuppressWarnings("nls")
public class StateSystemFullHistoryTest {
- protected static File stateFile;
- protected static File stateFileBenchmark;
+ static File stateFile;
+ static File stateFileBenchmark;
- protected static HistoryBuilder builder;
- protected static IStateChangeInput input;
- protected static IStateHistoryBackend hp;
- protected static StateHistorySystem shs;
+ static HistoryBuilder builder;
+ static IStateChangeInput input;
+ static IStateHistoryBackend hp;
+ static StateHistorySystem shs;
private final static long interestingTimestamp1 = 18670067372290L;
@@ -73,8 +73,13 @@ public class StateSystemFullHistoryTest {
@AfterClass
public static void cleanup() {
- stateFile.delete();
- stateFileBenchmark.delete();
+ boolean ret1, ret2;
+ ret1 = stateFile.delete();
+ ret2 = stateFileBenchmark.delete();
+ if ( !(ret1 && ret2) ) {
+ System.err.println("Error cleaning up during unit testing, " +
+ "you might have leftovers state history files in /tmp");
+ }
}
/**

Back to the top