Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 20e16fd0d64b60a331beca0ef24e627ab8bcdcd9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*******************************************************************************
 * Copyright (c) 2009 Red Hat, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Red Hat - initial API and implementation
 *******************************************************************************/
package org.eclipse.linuxtools.callgraph.launch.tests;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.linuxtools.internal.callgraph.launch.LaunchStapGraph;
import org.eclipse.linuxtools.internal.callgraph.launch.SystemTapOptionsTab;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.junit.Test;
public class SystemTapTabTest {

    @Test
    public void testTabs() throws CoreException{
        Shell sh = new Shell();
        Composite cmp = new Composite(sh, SWT.NONE);

        LaunchStapGraph shortCut = new LaunchStapGraph();
        SystemTapOptionsTab stp = new SystemTapOptionsTab();
        stp.createControl(cmp);
        ILaunchConfiguration configuration;
        configuration = shortCut.outsideGetLaunchConfigType().newInstance(
                null,
                (DebugPlugin.getDefault().getLaunchManager())
                        .generateLaunchConfigurationName("invalid"));
        ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
        stp.setDefaults(wc);
        stp.performApply(wc);
        wc.doSave();
        stp.initializeFrom(configuration);
        sh.open();
    }
}

Back to the top