Search in sources :

Example 1 with LaunchElement

use of org.eclipse.titan.executor.views.executormonitor.LaunchElement in project titan.EclipsePlug-ins by eclipse.

the class JniExecutor method startSession.

/**
 * Initializes the Executor.
 *
 * @param launch the ILaunch instance to start the session with.
 */
@Override
public void startSession(final ILaunch launch) {
    super.startSession(launch);
    if (automaticExecuteSectionExecution) {
        if (!LaunchStorage.getLaunchElementMap().containsKey(launch)) {
            ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
            LaunchElement launchElement = new LaunchElement(launchConfiguration.getName(), launch);
            LaunchStorage.registerLaunchElement(launchElement);
            ExecutorStorage.registerExecutorStorage(launchElement);
        }
        simpleExecutionRunning = true;
        startTest(true);
    }
}
Also used : ILaunchConfiguration(org.eclipse.debug.core.ILaunchConfiguration) LaunchElement(org.eclipse.titan.executor.views.executormonitor.LaunchElement)

Example 2 with LaunchElement

use of org.eclipse.titan.executor.views.executormonitor.LaunchElement in project titan.EclipsePlug-ins by eclipse.

the class TestExecutionView method getInitialInput.

private ITreeLeaf getInitialInput() {
    final ISelection selection = getSite().getPage().getSelection(EXECUTORMONITOR_VIEW_ID);
    if (null == selection || selection.isEmpty()) {
        return null;
    }
    final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
    ITreeLeaf element = (ITreeLeaf) structuredSelection.getFirstElement();
    if (null != element) {
        while (!(element instanceof LaunchElement)) {
            element = element.parent();
        }
    }
    return element;
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ITreeLeaf(org.eclipse.titan.executor.executors.ITreeLeaf) LaunchElement(org.eclipse.titan.executor.views.executormonitor.LaunchElement)

Example 3 with LaunchElement

use of org.eclipse.titan.executor.views.executormonitor.LaunchElement in project titan.EclipsePlug-ins by eclipse.

the class TestExecutionView method createTooltip.

private void createTooltip(final ITreeLeaf element) {
    if (null == element) {
        setTitleToolTip(null);
        return;
    }
    final List<ExecutedTestcase> executedTestCases = new ArrayList<ExecutedTestcase>();
    final List<ITreeLeaf> children = ((LaunchElement) actualInput).children();
    ITreeLeaf executorElement;
    for (ITreeLeaf aChildren : children) {
        executorElement = aChildren;
        if (executorElement instanceof MainControllerElement) {
            BaseExecutor executor = ((MainControllerElement) executorElement).executor();
            if (null != executor) {
                executedTestCases.addAll(executor.executedTests());
            }
        }
    }
    if (executedTestCases.isEmpty()) {
        setTitleToolTip(element.name());
        return;
    }
    String statistics = createStatistics(element, executedTestCases);
    setTitleToolTip(statistics);
}
Also used : BaseExecutor(org.eclipse.titan.executor.executors.BaseExecutor) ArrayList(java.util.ArrayList) ITreeLeaf(org.eclipse.titan.executor.executors.ITreeLeaf) LaunchElement(org.eclipse.titan.executor.views.executormonitor.LaunchElement) MainControllerElement(org.eclipse.titan.executor.views.executormonitor.MainControllerElement)

Example 4 with LaunchElement

use of org.eclipse.titan.executor.views.executormonitor.LaunchElement in project titan.EclipsePlug-ins by eclipse.

the class NotificationView method createActions.

private void createActions() {
    clearAction = new Action("Clear") {

        @Override
        public void run() {
            if (null != actualInput && actualInput instanceof LaunchElement) {
                final List<ITreeLeaf> children = ((LaunchElement) actualInput).children();
                for (ITreeLeaf aChildren : children) {
                    final BaseExecutor executor = ((MainControllerElement) aChildren).executor();
                    if (null != executor) {
                        executor.notifications().clear();
                        viewer.refresh();
                    }
                }
            }
        }
    };
    clearAction.setToolTipText("Clear");
    clearAction.setImageDescriptor(ImageCache.getImageDescriptor("trash_enabled.gif"));
    clearAction.setDisabledImageDescriptor(ImageCache.getImageDescriptor("trash_disabled.gif"));
    clearAction.setEnabled(false);
    saveAsAction = new Action("Save As") {

        @Override
        public void run() {
            saveAs();
        }
    };
    saveAsAction.setToolTipText("Save As");
    saveAsAction.setImageDescriptor(ImageCache.getImageDescriptor("saveas_edit.gif"));
    saveAsAction.setEnabled(false);
    followLastRecord = new Action("Follow the last record") {

        @Override
        public void run() {
            isFollowing = followLastRecord.isChecked();
        }
    };
    followLastRecord.setToolTipText("Toggles the follow the last line behavior");
    followLastRecord.setEnabled(true);
    followLastRecord.setChecked(isFollowing);
}
Also used : Action(org.eclipse.jface.action.Action) BaseExecutor(org.eclipse.titan.executor.executors.BaseExecutor) List(java.util.List) ITreeLeaf(org.eclipse.titan.executor.executors.ITreeLeaf) LaunchElement(org.eclipse.titan.executor.views.executormonitor.LaunchElement)

Example 5 with LaunchElement

use of org.eclipse.titan.executor.views.executormonitor.LaunchElement in project titan.EclipsePlug-ins by eclipse.

the class NotificationView method getInitialInput.

private ITreeLeaf getInitialInput() {
    final ISelection selection = getSite().getPage().getSelection(EXECUTORMONITOR_VIEW_ID);
    if (null == selection || selection.isEmpty()) {
        return null;
    }
    final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
    ITreeLeaf element = (ITreeLeaf) structuredSelection.getFirstElement();
    if (null != element) {
        while (!(element instanceof LaunchElement)) {
            element = element.parent();
        }
    }
    return element;
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ITreeLeaf(org.eclipse.titan.executor.executors.ITreeLeaf) LaunchElement(org.eclipse.titan.executor.views.executormonitor.LaunchElement)

Aggregations

LaunchElement (org.eclipse.titan.executor.views.executormonitor.LaunchElement)12 BaseExecutor (org.eclipse.titan.executor.executors.BaseExecutor)7 ITreeLeaf (org.eclipse.titan.executor.executors.ITreeLeaf)7 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)4 MainControllerElement (org.eclipse.titan.executor.views.executormonitor.MainControllerElement)4 ILaunch (org.eclipse.debug.core.ILaunch)3 File (java.io.File)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 IFile (org.eclipse.core.resources.IFile)2 ILaunchConfiguration (org.eclipse.debug.core.ILaunchConfiguration)2 ISelection (org.eclipse.jface.viewers.ISelection)2 FileWriter (java.io.FileWriter)1 PrintWriter (java.io.PrintWriter)1 HashMap (java.util.HashMap)1 List (java.util.List)1 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)1 CoreException (org.eclipse.core.runtime.CoreException)1 DebugException (org.eclipse.debug.core.DebugException)1