当前位置: 首页>>代码示例>>Java>>正文


Java TestRunnerUtil类代码示例

本文整理汇总了Java中com.intellij.testFramework.TestRunnerUtil的典型用法代码示例。如果您正苦于以下问题:Java TestRunnerUtil类的具体用法?Java TestRunnerUtil怎么用?Java TestRunnerUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TestRunnerUtil类属于com.intellij.testFramework包,在下文中一共展示了TestRunnerUtil类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldAddTestCase

import com.intellij.testFramework.TestRunnerUtil; //导入依赖的package包/类
private boolean shouldAddTestCase(final Class<?> testCaseClass, String moduleName, boolean testForExcluded) {
  if ((testCaseClass.getModifiers() & Modifier.ABSTRACT) != 0) return false;
  if (testForExcluded && shouldExcludeTestClass(moduleName, testCaseClass)) return false;

  if (TestCase.class.isAssignableFrom(testCaseClass) || TestSuite.class.isAssignableFrom(testCaseClass)) {
    return true;
  }
  try {
    final Method suiteMethod = testCaseClass.getMethod("suite");
    if (Test.class.isAssignableFrom(suiteMethod.getReturnType()) && (suiteMethod.getModifiers() & Modifier.STATIC) != 0) {
      return true;
    }
  }
  catch (NoSuchMethodException ignored) { }

  return TestRunnerUtil.isJUnit4TestClass(testCaseClass);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:TestCaseLoader.java

示例2: shouldAddTestCase

import com.intellij.testFramework.TestRunnerUtil; //导入依赖的package包/类
/**
 * Determine if we should load this test case.
 */
private boolean shouldAddTestCase(final Class<?> testCaseClass, boolean testForExcluded) {
  if ((testCaseClass.getModifiers() & Modifier.ABSTRACT) != 0) return false;
  if (testForExcluded && shouldExcludeTestClass(testCaseClass)) return false;

  if (TestCase.class.isAssignableFrom(testCaseClass) || TestSuite.class.isAssignableFrom(testCaseClass)) {
    return true;
  }
  try {
    final Method suiteMethod = testCaseClass.getMethod("suite");
    if (Test.class.isAssignableFrom(suiteMethod.getReturnType()) && (suiteMethod.getModifiers() & Modifier.STATIC) != 0) {
      //System.out.println("testCaseClass = " + testCaseClass);
      return true;
    }
  }
  catch (NoSuchMethodException e) {
    // can't be
  }

  return TestRunnerUtil.isJUnit4TestClass(testCaseClass);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:TestCaseLoader.java

示例3: testNothing

import com.intellij.testFramework.TestRunnerUtil; //导入依赖的package包/类
@SuppressWarnings("AssignmentToStaticFieldFromInstanceMethod")
public void testNothing() throws Exception {
  if (nothingIsCalled) return;

  nothingIsCalled = true;
  suiteStarted = System.nanoTime();

  SwingUtilities.invokeAndWait(new Runnable() {
    @Override
    public void run() {
      System.out.println("EDT is " + Thread.currentThread());
    }
  });
  // in tests EDT inexplicably shuts down sometimes during the first access,
  // which leads to nasty problems in ApplicationImpl which assumes there is only one EDT.
  // so we try to forcibly terminate EDT here to urge JVM to re-spawn new shiny permanent EDT-1
  TestRunnerUtil.replaceIdeEventQueueSafely();
  SwingUtilities.invokeAndWait(new Runnable() {
    @Override
    public void run() {
      System.out.println("EDT is " + Thread.currentThread());
    }
  });

  // force platform JNA load
  Class.forName("com.sun.jna.Native");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:_FirstInSuiteTest.java

示例4: apply

import com.intellij.testFramework.TestRunnerUtil; //导入依赖的package包/类
@Override
public Statement apply(Statement base, Description description) {
  return new Statement() {
    @Override
    public void evaluate() throws Throwable {
      TestRunnerUtil.replaceIdeEventQueueSafely();
      EdtTestUtil.runInEdtAndWait((ThrowableRunnable<Throwable>) base::evaluate);
    }
  };
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:11,代码来源:EdtRule.java

示例5: setup

import com.intellij.testFramework.TestRunnerUtil; //导入依赖的package包/类
/** Sets up the container. */
@Before
public final void setup() {
  // prevent memory leak error
  TestRunnerUtil.replaceIdeEventQueueSafely();

  Disposable disposableParent = TestUtils.createMockApplication();
  applicationContainer =
      (MutablePicoContainer) ApplicationManager.getApplication().getPicoContainer();
  project = TestUtils.mockProject(applicationContainer);
  Extensions.cleanRootArea(disposableParent);
  extensionsArea = (ExtensionsAreaImpl) Extensions.getRootArea();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:14,代码来源:BasePluginTestCase.java

示例6: runSetup

import com.intellij.testFramework.TestRunnerUtil; //导入依赖的package包/类
private void runSetup(ExtensionContext context) throws Exception {
  if (runInDispatchThread()) {
    TestRunnerUtil.replaceIdeEventQueueSafely();
    EdtTestUtil.runInEdtAndWait(this::setUp);
  } else {
    setUp();
  }
  Store store = getStore(context);
  store.put(Project.class, getProject());
  store.put(Module.class, getModule());
}
 
开发者ID:zielu,项目名称:GitToolBox,代码行数:12,代码来源:PlatformTestCaseExtension.java

示例7: isJUnitClass

import com.intellij.testFramework.TestRunnerUtil; //导入依赖的package包/类
private static boolean isJUnitClass(Class<?> clazz) {
  return TestCase.class.isAssignableFrom(clazz) || TestRunnerUtil.isJUnit4TestClass(clazz) || com.intellij.testFramework.Parameterized.class.isAssignableFrom(clazz);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:PathManagerEx.java

示例8: isJUnitClass

import com.intellij.testFramework.TestRunnerUtil; //导入依赖的package包/类
private static boolean isJUnitClass(Class<?> clazz) {
  return TestCase.class.isAssignableFrom(clazz) || TestRunnerUtil.isJUnit4TestClass(clazz);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:4,代码来源:PathManagerEx.java


注:本文中的com.intellij.testFramework.TestRunnerUtil类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。