Commit | Line | Data |
---|---|---|
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 | ||
10 | package org.eclipse.tracecompass.analysis.graph.core.tests.analysis.criticalpath; | |
11 | ||
12 | import static org.junit.Assert.assertNotNull; | |
da4232b4 | 13 | import static org.junit.Assert.fail; |
655d677d FG |
14 | |
15 | import org.eclipse.tracecompass.analysis.graph.core.base.TmfGraph; | |
16 | import org.eclipse.tracecompass.analysis.graph.core.base.TmfVertex; | |
da4232b4 | 17 | import org.eclipse.tracecompass.analysis.graph.core.criticalpath.CriticalPathAlgorithmException; |
655d677d FG |
18 | import org.eclipse.tracecompass.analysis.graph.core.criticalpath.ICriticalPathAlgorithm; |
19 | import org.eclipse.tracecompass.analysis.graph.core.tests.stubs.GraphBuilder; | |
20 | import 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 | */ | |
28 | public 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 | } |