From 51004941ab54e6a586ef09020f2622951f56115d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Genevi=C3=A8ve=20Bastien?= Date: Mon, 7 Mar 2016 12:24:00 -0500 Subject: [PATCH 1/1] ss: Move the HistoryTreeTest class to a new package MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The o.e.t.s.c.t.backend package only contains classes for backend tests Change-Id: I838b242102a1d5fc2ea3ce5271499cba191fa455 Signed-off-by: Geneviève Bastien Reviewed-on: https://git.eclipse.org/r/68095 Reviewed-by: Alexandre Montplaisir Tested-by: Alexandre Montplaisir Reviewed-by: Hudson CI --- .../{ => historytree}/HistoryTreeTest.java | 18 ++++++++++-------- .../backend/historytree/package-info.java | 11 +++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) rename statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/{ => historytree}/HistoryTreeTest.java (95%) create mode 100644 statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/historytree/package-info.java diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/HistoryTreeTest.java b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/historytree/HistoryTreeTest.java similarity index 95% rename from statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/HistoryTreeTest.java rename to statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/historytree/HistoryTreeTest.java index 053a4e712c..701913be41 100644 --- a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/HistoryTreeTest.java +++ b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/historytree/HistoryTreeTest.java @@ -7,7 +7,7 @@ * http://www.eclipse.org/legal/epl-v10.html *******************************************************************************/ -package org.eclipse.tracecompass.statesystem.core.tests.backend; +package org.eclipse.tracecompass.statesystem.core.tests.backend.historytree; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @@ -18,7 +18,7 @@ import java.io.IOException; import java.nio.channels.ClosedChannelException; import java.util.List; -import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.HTConfig; import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.HTInterval; import org.eclipse.tracecompass.internal.statesystem.core.backend.historytree.HTNode; @@ -45,11 +45,11 @@ public class HistoryTreeTest { /* String with 23 characters, interval in file will be 25 bytes long */ private static final String TEST_STRING = "abcdefghifklmnopqrstuvw"; - private static final @NonNull TmfStateValue STRING_VALUE = TmfStateValue.newValueString(TEST_STRING); - private static final @NonNull TmfStateValue LONG_VALUE = TmfStateValue.newValueLong(10L); - private static final @NonNull TmfStateValue INT_VALUE = TmfStateValue.newValueInt(1); + private static final TmfStateValue STRING_VALUE = TmfStateValue.newValueString(TEST_STRING); + private static final TmfStateValue LONG_VALUE = TmfStateValue.newValueLong(10L); + private static final TmfStateValue INT_VALUE = TmfStateValue.newValueInt(1); - private File fTempFile; + private @Nullable File fTempFile; /** * Create the temporary file for this history tree @@ -68,7 +68,9 @@ public class HistoryTreeTest { */ @After public void cleanup() { - fTempFile.delete(); + if (fTempFile != null) { + fTempFile.delete(); + } } /** @@ -105,7 +107,7 @@ public class HistoryTreeTest { return setupSmallTree(3); } - private static long fillValues(HistoryTree ht, @NonNull TmfStateValue value, int nbValues, long start) { + private static long fillValues(HistoryTree ht, TmfStateValue value, int nbValues, long start) { for (int i = 0; i < nbValues; i++) { ht.insertInterval(new HTInterval(start + i, start + i + 1, 1, value)); } diff --git a/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/historytree/package-info.java b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/historytree/package-info.java new file mode 100644 index 0000000000..8a7668732e --- /dev/null +++ b/statesystem/org.eclipse.tracecompass.statesystem.core.tests/src/org/eclipse/tracecompass/statesystem/core/tests/backend/historytree/package-info.java @@ -0,0 +1,11 @@ +/******************************************************************************* + * Copyright (c) 2016 École Polytechnique de Montréal + * + * 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 + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ + +@org.eclipse.jdt.annotation.NonNullByDefault +package org.eclipse.tracecompass.statesystem.core.tests.backend.historytree; -- 2.34.1