Analysis: Add unit tests for the critical path module
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.graph.core.tests / src / org / eclipse / tracecompass / analysis / graph / core / tests / analysis / criticalpath / TmfCriticalPathAlgoBoundedTest.java
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
10 package org.eclipse.tracecompass.analysis.graph.core.tests.analysis.criticalpath;
11
12 import static org.junit.Assert.assertNotNull;
13
14 import org.eclipse.tracecompass.analysis.graph.core.base.TmfGraph;
15 import org.eclipse.tracecompass.analysis.graph.core.base.TmfVertex;
16 import org.eclipse.tracecompass.analysis.graph.core.criticalpath.ICriticalPathAlgorithm;
17 import org.eclipse.tracecompass.analysis.graph.core.tests.stubs.GraphBuilder;
18 import org.eclipse.tracecompass.internal.analysis.graph.core.criticalpath.CriticalPathAlgorithmBounded;
19
20 /**
21 * Test the {@link CriticalPathAlgorithmBounded} critical path algorithm
22 *
23 * @author Francis Giraldeau
24 * @author Geneviève Bastien
25 */
26 public class TmfCriticalPathAlgoBoundedTest extends TmfCriticalPathAlgorithmTest {
27
28 @Override
29 protected TmfGraph computeCriticalPath(TmfGraph graph, TmfVertex start) {
30 assertNotNull(graph);
31 ICriticalPathAlgorithm cp = new CriticalPathAlgorithmBounded(graph);
32 TmfGraph bounded = cp.compute(start, null);
33 return bounded;
34 }
35
36 @Override
37 protected TmfGraph getExpectedCriticalPath(GraphBuilder builder) {
38 return builder.criticalPathBounded();
39 }
40
41 }
This page took 0.030724 seconds and 5 git commands to generate.