/*******************************************************************************
- * Copyright (c) 2012 Ericsson
+ * Copyright (c) 2012, 2013 Ericsson
*
* All rights reserved. This program and the accompanying materials are
* made available under the terms of the Eclipse Public License v1.0 which
import java.util.List;
import org.eclipse.linuxtools.internal.tmf.core.statesystem.HistoryBuilder;
-import org.eclipse.linuxtools.internal.tmf.core.statesystem.IStateHistoryBackend;
-import org.eclipse.linuxtools.internal.tmf.core.statesystem.historytree.HistoryTreeBackend;
+import org.eclipse.linuxtools.internal.tmf.core.statesystem.backends.IStateHistoryBackend;
+import org.eclipse.linuxtools.internal.tmf.core.statesystem.backends.historytree.HistoryTreeBackend;
import org.eclipse.linuxtools.tmf.core.exceptions.AttributeNotFoundException;
+import org.eclipse.linuxtools.tmf.core.exceptions.StateSystemDisposedException;
import org.eclipse.linuxtools.tmf.core.exceptions.TimeRangeException;
import org.eclipse.linuxtools.tmf.core.interval.ITmfStateInterval;
-import org.eclipse.linuxtools.tmf.core.statesystem.IStateSystemQuerier;
+import org.eclipse.linuxtools.tmf.core.statesystem.IStateChangeInput;
+import org.eclipse.linuxtools.tmf.core.statesystem.ITmfStateSystem;
/**
* Small program to ensure a history file does not contain any "holes".
* trigger NPE's elsewhere in the stack.
*
* @author alexmont
- *
*/
-@SuppressWarnings({"nls","javadoc"})
+@SuppressWarnings("javadoc")
public class VerifyHistoryFile {
// Enter the .ht file name to test here
- public final static String pathToHistoryFile = "";
+ public static final String pathToHistoryFile = "";
private static File htFile;
private static IStateHistoryBackend htBackend;
- private static IStateSystemQuerier ss;
+ private static ITmfStateSystem ss;
private static long startTime;
private static long endTime;
private static int nbErrors;
public static void main(String[] args) throws IOException,
- TimeRangeException, AttributeNotFoundException {
+ TimeRangeException, AttributeNotFoundException,
+ StateSystemDisposedException {
htFile = new File(pathToHistoryFile);
- htBackend = new HistoryTreeBackend(htFile);
+ htBackend = new HistoryTreeBackend(htFile, IStateChangeInput.IGNORE_PROVIDER_VERSION);
ss = HistoryBuilder.openExistingHistory(htBackend);
startTime = ss.getStartTime();
}
private static void verifyAttribute(int attribute)
- throws TimeRangeException, AttributeNotFoundException {
+ throws TimeRangeException, AttributeNotFoundException,
+ StateSystemDisposedException {
List<ITmfStateInterval> intervals;
System.out.print("Checking attribute " + attribute);