analysis: Clean up critical path algorithm a bit
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.graph.core.tests / src / org / eclipse / tracecompass / analysis / graph / core / tests / analysis / criticalpath / TmfCriticalPathAlgoBoundedTest.java
CommitLineData
655d677d
FG
1/*******************************************************************************
2 * Copyright (c) 2015 École Polytechnique de Montréal
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9
10package org.eclipse.tracecompass.analysis.graph.core.tests.analysis.criticalpath;
11
12import static org.junit.Assert.assertNotNull;
da4232b4 13import static org.junit.Assert.fail;
655d677d
FG
14
15import org.eclipse.tracecompass.analysis.graph.core.base.TmfGraph;
16import org.eclipse.tracecompass.analysis.graph.core.base.TmfVertex;
da4232b4 17import org.eclipse.tracecompass.analysis.graph.core.criticalpath.CriticalPathAlgorithmException;
655d677d
FG
18import org.eclipse.tracecompass.analysis.graph.core.criticalpath.ICriticalPathAlgorithm;
19import org.eclipse.tracecompass.analysis.graph.core.tests.stubs.GraphBuilder;
20import org.eclipse.tracecompass.internal.analysis.graph.core.criticalpath.CriticalPathAlgorithmBounded;
21
22/**
23 * Test the {@link CriticalPathAlgorithmBounded} critical path algorithm
24 *
25 * @author Francis Giraldeau
26 * @author Geneviève Bastien
27 */
28public class TmfCriticalPathAlgoBoundedTest extends TmfCriticalPathAlgorithmTest {
29
30 @Override
31 protected TmfGraph computeCriticalPath(TmfGraph graph, TmfVertex start) {
32 assertNotNull(graph);
33 ICriticalPathAlgorithm cp = new CriticalPathAlgorithmBounded(graph);
da4232b4
MK
34 try {
35 return cp.compute(start, null);
36 } catch (CriticalPathAlgorithmException e) {
37 fail(e.getMessage());
38 }
39 return null;
655d677d
FG
40 }
41
42 @Override
43 protected TmfGraph getExpectedCriticalPath(GraphBuilder builder) {
44 return builder.criticalPathBounded();
45 }
46
47}
This page took 0.026157 seconds and 5 git commands to generate.