1 /*******************************************************************************
2 * Copyright (c) 2014 École Polytechnique de Montréal
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
10 * Geneviève Bastien - Initial API and implementation
11 *******************************************************************************/
13 package org
.eclipse
.tracecompass
.lttng2
.kernel
.core
.tests
;
15 import java
.io
.IOException
;
18 import org
.eclipse
.core
.runtime
.FileLocator
;
19 import org
.eclipse
.core
.runtime
.IPath
;
20 import org
.eclipse
.core
.runtime
.Path
;
21 import org
.eclipse
.core
.runtime
.Plugin
;
22 import org
.osgi
.framework
.BundleContext
;
25 * Activator for the lttng2.kernel.core.tests plugin
27 * @author Geneviève Bastien
29 public class Activator
extends Plugin
{
30 // ------------------------------------------------------------------------
32 // ------------------------------------------------------------------------
37 public static final String PLUGIN_ID
= "org.eclipse.tracecompass.lttng2.kernel.core.tests"; //$NON-NLS-1$
42 private static Activator PLUGIN
;
44 // ------------------------------------------------------------------------
46 // ------------------------------------------------------------------------
54 // ------------------------------------------------------------------------
56 // ------------------------------------------------------------------------
59 * Returns the shared instance
61 * @return the shared instance
63 public static Activator
getDefault() {
67 // ------------------------------------------------------------------------
69 // ------------------------------------------------------------------------
72 public void start(BundleContext context
) throws Exception
{
78 public void stop(BundleContext context
) throws Exception
{
84 * Return a path to a file relative to this plugin's base directory
87 * The path relative to the plugin's root directory
88 * @return The path corresponding to the relative path in parameter
90 public static IPath
getAbsoluteFilePath(String relativePath
) {
91 Activator plugin
= Activator
.getDefault();
94 * Shouldn't happen but at least throw something to get the test to
97 throw new IllegalStateException();
99 URL location
= FileLocator
.find(plugin
.getBundle(), new Path(relativePath
), null);
101 return new Path(FileLocator
.toFileURL(location
).getPath());
102 } catch (IOException e
) {
103 throw new IllegalStateException();
This page took 0.033417 seconds and 5 git commands to generate.