Java Code Examples for com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView#initUI()

The following examples show how to use com.intellij.execution.testframework.sm.runner.ui.SMTRunnerConsoleView#initUI() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThriftTestExecutionUtil.java    From consulo with Apache License 2.0 6 votes vote down vote up
public static void initConsoleView(@Nonnull final SMTRunnerConsoleView consoleView,
                                   @Nonnull final String testFrameworkName,
                                   @javax.annotation.Nullable final TestLocationProvider locator,
                                   final ThriftTestHandlerFactory factory,
                                   @Nullable final TestProxyFilterProvider filterProvider) {
  consoleView.addAttachToProcessListener(new AttachToProcessListener() {
    @Override
    public void onAttachToProcess(@Nonnull ProcessHandler processHandler) {
      TestProxyPrinterProvider printerProvider = null;
      if (filterProvider != null) {
        printerProvider = new TestProxyPrinterProvider(consoleView, filterProvider);
      }
      SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();
      attachEventsProcessors(consoleView.getProperties(), resultsForm, resultsForm.getStatisticsPane(), processHandler, testFrameworkName, locator, factory,
                             printerProvider);
    }
  });
  consoleView.setHelpId("reference.runToolWindow.testResultsTab");
  consoleView.initUI();
}
 
Example 2
Source File: SMTestRunnerConnectionUtil.java    From consulo with Apache License 2.0 6 votes vote down vote up
/**
 * @deprecated use {@link #initConsoleView(SMTRunnerConsoleView, String)} (to be removed in IDEA 16)
 */
@SuppressWarnings({"unused", "deprecation"})
public static void initConsoleView(@Nonnull final SMTRunnerConsoleView consoleView,
                                   @Nonnull final String testFrameworkName,
                                   @javax.annotation.Nullable final TestLocationProvider locator,
                                   final boolean idBasedTreeConstruction,
                                   @Nullable final TestProxyFilterProvider filterProvider) {
  consoleView.addAttachToProcessListener(new AttachToProcessListener() {
    @Override
    public void onAttachToProcess(@Nonnull ProcessHandler processHandler) {
      TestConsoleProperties properties = consoleView.getProperties();

      SMTestLocator testLocator = new CompositeTestLocationProvider(locator);

      TestProxyPrinterProvider printerProvider = null;
      if (filterProvider != null) {
        printerProvider = new TestProxyPrinterProvider(consoleView, filterProvider);
      }

      SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();
      attachEventsProcessors(properties, resultsForm, resultsForm.getStatisticsPane(), processHandler, testFrameworkName, testLocator, idBasedTreeConstruction, printerProvider);
    }
  });
  consoleView.setHelpId("reference.runToolWindow.testResultsTab");
  consoleView.initUI();
}
 
Example 3
Source File: SMTestRunnerConnectionUtil.java    From consulo with Apache License 2.0 5 votes vote down vote up
public static void initConsoleView(@Nonnull final SMTRunnerConsoleView consoleView, @Nonnull final String testFrameworkName) {
  consoleView.addAttachToProcessListener(new AttachToProcessListener() {
    @Override
    public void onAttachToProcess(@Nonnull ProcessHandler processHandler) {
      TestConsoleProperties properties = consoleView.getProperties();

      TestProxyPrinterProvider printerProvider = null;
      if (properties instanceof SMTRunnerConsoleProperties) {
        TestProxyFilterProvider filterProvider = ((SMTRunnerConsoleProperties)properties).getFilterProvider();
        if (filterProvider != null) {
          printerProvider = new TestProxyPrinterProvider(consoleView, filterProvider);
        }
      }

      SMTestLocator testLocator = FileUrlProvider.INSTANCE;
      if (properties instanceof SMTRunnerConsoleProperties) {
        SMTestLocator customLocator = ((SMTRunnerConsoleProperties)properties).getTestLocator();
        if (customLocator != null) {
          testLocator = new CombinedTestLocator(customLocator);
        }
      }

      boolean idBasedTestTree = false;
      if (properties instanceof SMTRunnerConsoleProperties) {
        idBasedTestTree = ((SMTRunnerConsoleProperties)properties).isIdBasedTestTree();
      }

      SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();
      attachEventsProcessors(properties, resultsForm, resultsForm.getStatisticsPane(), processHandler, testFrameworkName, testLocator, idBasedTestTree, printerProvider);
    }
  });
  consoleView.setHelpId("reference.runToolWindow.testResultsTab");
  consoleView.initUI();
}
 
Example 4
Source File: Unity3dTestRunState.java    From consulo-unity3d with Apache License 2.0 4 votes vote down vote up
@Nullable
@Override
@RequiredUIAccess
public ExecutionResult execute(Executor executor, @Nonnull ProgramRunner runner) throws ExecutionException
{
	Unity3dTestConfiguration profile = (Unity3dTestConfiguration) myEnvironment.getRunProfile();

	TestConsoleProperties testConsoleProperties = new SMTRunnerConsoleProperties(profile, TEST_FRAMEWORK_NAME, executor);

	testConsoleProperties.setIfUndefined(TestConsoleProperties.HIDE_PASSED_TESTS, false);

	String splitterPropertyName = SMTestRunnerConnectionUtil.getSplitterPropertyName(TEST_FRAMEWORK_NAME);

	final SMTRunnerConsoleView consoleView = new SMTRunnerConsoleView(testConsoleProperties, splitterPropertyName);

	final SimpleReference<UUID> ref = SimpleReference.create();

	consoleView.addAttachToProcessListener(new AttachToProcessListener()
	{
		@Override
		public void onAttachToProcess(@Nonnull ProcessHandler processHandler)
		{
			SMTestRunnerResultsForm resultsForm = consoleView.getResultsViewer();

			ref.set(attachEventsProcessors(consoleView.getProperties(), resultsForm, resultsForm.getStatisticsPane(), processHandler, TEST_FRAMEWORK_NAME));
		}
	});
	consoleView.setHelpId("reference.runToolWindow.testResultsTab");
	consoleView.initUI();

	final ProcessHandler osProcessHandler = new DefaultDebugProcessHandler();

	consoleView.attachToProcess(osProcessHandler);

	UnityRunTest runTest = new UnityRunTest();
	runTest.uuid = ref.get().toString();
	runTest.type = "";

	if(!UnityEditorCommunication.request(profile.getProject(), runTest, true))
	{
		ApplicationManager.getApplication().executeOnPooledThread(new Runnable()
		{
			@Override
			public void run()
			{
				osProcessHandler.notifyTextAvailable("UnityEditor dont received request, maybe is not run", ProcessOutputTypes.STDERR);
				osProcessHandler.destroyProcess();
			}
		});
	}

	return new DefaultExecutionResult(consoleView, osProcessHandler);
}