theoriesperformancetest.java
来自「junit」· Java 代码 · 共 38 行
JAVA
38 行
package org.junit.tests.experimental.theories.runner;import static org.junit.Assert.assertThat;import static org.junit.Assume.assumeTrue;import static org.junit.experimental.results.PrintableResult.testResult;import static org.junit.experimental.results.ResultMatchers.isSuccessful;import org.junit.Test;import org.junit.experimental.theories.DataPoints;import org.junit.experimental.theories.Theories;import org.junit.experimental.theories.Theory;import org.junit.runner.RunWith;public class TheoriesPerformanceTest { @RunWith(Theories.class) public static class UpToTen { @DataPoints public static int[] ints= { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }; @Theory public void threeInts(int x, int y, int z) { // pass always } } private static final boolean TESTING_PERFORMANCE= false; // If we do not share the same instance of TestClass, repeatedly parsing the // class's annotations looking for @Befores and @Afters gets really costly. // // Likewise, the TestClass must be passed into AllMembersSupplier, or the // annotation parsing is again costly. @Test public void tryCombinationsQuickly() { assumeTrue(TESTING_PERFORMANCE); assertThat(testResult(UpToTen.class), isSuccessful()); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?