Search in sources :

Example 1 with ProviderLaunchShortcut

use of org.eclipse.linuxtools.internal.profiling.launch.provider.launch.ProviderLaunchShortcut in project linuxtools by eclipse.

the class LaunchTest method testIExecutableExtension.

@Test
public void testIExecutableExtension() {
    IExtensionPoint extPoint = Platform.getExtensionRegistry().getExtensionPoint(LAUNCH_SHORT_EXTPT);
    assertNotNull(extPoint);
    IConfigurationElement[] configs = extPoint.getConfigurationElements();
    assertTrue(configs.length > 0);
    for (IConfigurationElement cfg : configs) {
        if (cfg.getAttribute("id").equals(STUB_ID)) {
            // $NON-NLS-1$
            try {
                // $NON-NLS-1$
                assertTrue(cfg.createExecutableExtension("class") instanceof ProviderLaunchShortcut);
            } catch (CoreException e) {
                fail(e.getMessage());
            }
            // $NON-NLS-1$
            assertEquals(cfg.getChildren("class").length, 1);
            // $NON-NLS-1$
            IConfigurationElement elem = cfg.getChildren("class")[0];
            for (int i = 0; i < 2; i++) {
                // $NON-NLS-1$ //$NON-NLS-2$
                assertNotNull(elem.getChildren("parameter")[i].getAttribute("name"));
                // $NON-NLS-1$ //$NON-NLS-2$
                assertNotNull(elem.getChildren("parameter")[i].getAttribute("value"));
            }
        }
    }
}
Also used : IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) CoreException(org.eclipse.core.runtime.CoreException) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) IExtensionPoint(org.eclipse.core.runtime.IExtensionPoint) ProviderLaunchShortcut(org.eclipse.linuxtools.internal.profiling.launch.provider.launch.ProviderLaunchShortcut) Test(org.junit.Test) AbstractTest(org.eclipse.linuxtools.profiling.tests.AbstractTest)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IExtensionPoint (org.eclipse.core.runtime.IExtensionPoint)1 ProviderLaunchShortcut (org.eclipse.linuxtools.internal.profiling.launch.provider.launch.ProviderLaunchShortcut)1 AbstractTest (org.eclipse.linuxtools.profiling.tests.AbstractTest)1 Test (org.junit.Test)1