本文整理汇总了Java中com.intellij.execution.testframework.sm.runner.SMTestProxy类的典型用法代码示例。如果您正苦于以下问题:Java SMTestProxy类的具体用法?Java SMTestProxy怎么用?Java SMTestProxy使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SMTestProxy类属于com.intellij.execution.testframework.sm.runner包,在下文中一共展示了SMTestProxy类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createFromClassResult
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public static SMTestProxy.SMRootTestProxy createFromClassResult(ClassResult classResult) {
SMTestProxy.SMRootTestProxy classNode = new SMTestProxy.SMRootTestProxy();
classNode.setPresentation(classResult.getName());
classNode.setFinished();
if (classResult.getState().equals(ClassResult.STATE_FAILED)) {
classNode.setTestFailed("", "", true);
}
for (MethodResult methodsResult: classResult.getMethods()) {
SMTestProxy methodNode = new SMTestProxy(methodsResult.getName(), false, "");
if (methodsResult.getState().equals(MethodResult.STATE_FAILED)) {
methodNode.setTestFailed(methodsResult.getName() + " Failed", methodsResult.getContent(), true);
} else if (methodsResult.getState().equals(MethodResult.STATE_PASSED)) {
methodNode.addSystemOutput(methodsResult.getContent());
}
methodNode.setFinished();
classNode.addChild(methodNode);
}
return classNode;
}
开发者ID:atoum,项目名称:phpstorm-plugin,代码行数:25,代码来源:SMTRootTestProxyFactory.java
示例2: isDefect
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
/**
* If any of child failed proxy also is defect
* @return
*/
@Override
public boolean isDefect() {
if (myDefectFound) {
return true;
}
//Test suit fails if any of its tests fails
final List<? extends SMTestProxy> children = new ArrayList<SMTestProxy>(mySuiteProxy.getChildren());
for (SMTestProxy child : children) {
if (child.isDefect()) {
myDefectFound = true;
return true;
}
}
//cannot cache because one of child tests may fail in future
return false;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:SuiteInProgressState.java
示例3: testOnSelected_Suite
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testOnSelected_Suite() {
final SMTestProxy suite1 = createSuiteProxy("suite1", myRootSuite);
final SMTestProxy test1 = createTestProxy("test1", suite1);
final SMTestProxy test2 = createTestProxy("test2", suite1);
final SMTestProxy suite2 = createSuiteProxy("suite2", myRootSuite);
myStatisticsTableModel.updateModelOnProxySelected(suite1);
assertSameElements(getItems(), test1, test2);
myStatisticsTableModel.updateModelOnProxySelected(suite2);
assertSameElements(getItems());
myStatisticsTableModel.updateModelOnProxySelected(myRootSuite);
assertSameElements(getItems(), suite1, suite2);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:SMTRunnerStatisticsTableModelTest.java
示例4: testIgnoreRenamedMethodInRerunFailed
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testIgnoreRenamedMethodInRerunFailed() throws Exception {
final PsiClass baseClass = myFixture.addClass("abstract class ATest extends junit.framework.TestCase {" +
" public void testMe() {}\n" +
"}");
myFixture.addClass("public class ChildTest extends ATest {}");
final SMTestProxy testProxy = new SMTestProxy("testMe", false, "java:test://ChildTest.testMe");
final Project project = getProject();
final GlobalSearchScope searchScope = GlobalSearchScope.projectScope(project);
testProxy.setLocator(JavaTestLocator.INSTANCE);
WriteCommandAction.runWriteCommandAction(project, new Runnable() {
public void run() {
baseClass.getMethods()[0].setName("testName2");
}
});
assertNull(TestMethods.getTestPresentation(testProxy, project, searchScope));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JUnitRerunFailedTestsTest.java
示例5: formatRootNodeWithChildren
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public static void formatRootNodeWithChildren(final SMTestProxy.SMRootTestProxy testProxy,
final TestTreeRenderer renderer) {
renderer.setIcon(getIcon(testProxy, renderer.getConsoleProperties()));
final TestStateInfo.Magnitude magnitude = testProxy.getMagnitudeInfo();
final String text;
final String presentableName = testProxy.getPresentation();
if (presentableName != null) {
text = presentableName;
} else if (magnitude == TestStateInfo.Magnitude.RUNNING_INDEX) {
text = SMTestsRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.labels.running.tests");
} else if (magnitude == TestStateInfo.Magnitude.TERMINATED_INDEX) {
text = SMTestsRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.labels.was.terminated");
} else {
text = SMTestsRunnerBundle.message("sm.test.runner.ui.tests.tree.presentation.labels.test.results");
}
renderer.append(text, SimpleTextAttributes.REGULAR_ATTRIBUTES);
final String comment = testProxy.getComment();
if (comment != null) {
renderer.append(" (" + comment + ")", SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:TestsPresentationUtil.java
示例6: testInnerClass
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testInnerClass() throws Exception {
myFixture.addClass("public class TestClass {\n" +
" public static class Tests extends junit.framework.TestCase {\n" +
" public void testFoo() throws Exception {}\n" +
" }\n" +
"}");
final SMTestProxy testProxy = new SMTestProxy("testFoo", false, "java:test://TestClass$Tests.testFoo");
final Project project = getProject();
final GlobalSearchScope searchScope = GlobalSearchScope.projectScope(project);
testProxy.setLocator(JavaTestLocator.INSTANCE);
Location location = testProxy.getLocation(project, searchScope);
assertNotNull(location);
PsiElement element = location.getPsiElement();
assertTrue(element instanceof PsiMethod);
String name = ((PsiMethod)element).getName();
assertEquals(name, "testFoo");
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JUnitRerunFailedTestsTest.java
示例7: testRerunFailedTestWithDependency
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testRerunFailedTestWithDependency() throws Exception {
final PsiClass aClass =
myFixture.addClass("package a; public class ATest {" +
" @org.testng.annotations.Test()\n" +
" public void testTwo(){}\n " +
" @org.testng.annotations.Test(dependsOnMethods = \"testTwo\")\n" +
" public void testOne(String s){}\n" + //parameterized
"}");
final LinkedHashMap<PsiClass, Map<PsiMethod, List<String>>> classes = new LinkedHashMap<PsiClass, Map<PsiMethod, List<String>>>();
classes.put(aClass, new HashMap<PsiMethod, List<String>>());
final GlobalSearchScope projectScope = GlobalSearchScope.projectScope(getProject());
final SMTestProxy testProxy = new SMTestProxy("testOne", false, "java:test://a.ATest.testOne[a]");
testProxy.setLocator(new JavaTestLocator());
RerunFailedTestsAction.includeFailedTestWithDependencies(classes, projectScope, getProject(), testProxy);
assertEquals(1, classes.size());
final Map<PsiMethod, List<String>> params = classes.get(aClass);
assertContainsElements(params.keySet(), aClass.getMethods());
final List<String> paramsToRerun = params.get(aClass.findMethodsByName("testOne", false)[0]);
assertEquals(1, paramsToRerun.size());
assertContainsElements(paramsToRerun, "a");
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:DetectClassesToRunTest.java
示例8: testValueOf_SuiteRunning
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testValueOf_SuiteRunning() {
final SMTestProxy suite = createSuiteProxy();
final SMTestProxy test = createTestProxy("test", suite);
suite.setStarted();
test.setStarted();
assertEquals("<RUNNING>", myColumn.valueOf(suite));
test.setDuration(10000);
assertEquals("RUNNING: 10s", myColumn.valueOf(suite));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ColumnDurationTest.java
示例9: testPresentation_SuiteTestFailed
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testPresentation_SuiteTestFailed() {
mySuite.setStarted();
final SMTestProxy test1 = createTestProxy(mySuite);
doRender(mySuite);
assertEmpty(myFragmentsContainer.getFragments());
test1.setStarted();
test1.setTestFailed("", "", false);
doRender(mySuite);
assertFragmentsSize(1);
assertEquals(TestsPresentationUtil.DEFFECT_ATTRIBUTES, myFragmentsContainer.getAttribsAt(0));
assertEquals("F:1 ", myFragmentsContainer.getTextAt(0));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ColumnResultsTest.java
示例10: toTestProxy
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
@Nullable
private static SMTestProxy toTestProxy(SMTRunnerTestTreeView treeView, TreePath path) {
if (treeView.isPathSelected(path.getParentPath())) {
return null;
}
return treeView.getSelectedTest(path);
}
开发者ID:bazelbuild,项目名称:intellij,代码行数:8,代码来源:SmRunnerUtils.java
示例11: testOnSelected_Test
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testOnSelected_Test() {
final SMTestProxy test1 = createTestProxy("test1", myRootSuite);
final SMTestProxy test2 = createTestProxy("test2", myRootSuite);
myStatisticsTableModel.updateModelOnProxySelected(test1);
assertSameElements(getItems(), test1, test2);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:SMTRunnerStatisticsTableModelTest.java
示例12: getSelectedSmRunnerTreeElements
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public static List<Location<?>> getSelectedSmRunnerTreeElements(ConfigurationContext context) {
Project project = context.getProject();
List<SMTestProxy> tests = getSelectedTestProxies(context);
return tests
.stream()
.map(test -> (Location<?>) test.getLocation(project, GlobalSearchScope.allScope(project)))
.filter(Objects::nonNull)
.collect(Collectors.toList());
}
开发者ID:bazelbuild,项目名称:intellij,代码行数:10,代码来源:SmRunnerUtils.java
示例13: onSelected
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void onSelected(@Nullable final SMTestProxy selectedTestProxy,
@NotNull final TestResultsViewer viewer,
@NotNull final TestFrameworkRunningModel model) {
//TODO: tests o "onSelected"
SMRunnerUtil.runInEventDispatchThread(new Runnable() {
public void run() {
if (ScrollToTestSourceAction.isScrollEnabled(model)) {
final Navigatable descriptor = TestsUIUtil.getOpenFileDescriptor(selectedTestProxy, model);
if (descriptor != null) {
OpenSourceUtil.navigate(false, descriptor);
}
}
}
}, ModalityState.NON_MODAL);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:SMTRunnerUIActionsHandler.java
示例14: testSelectionRestoring_ForSuite
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testSelectionRestoring_ForSuite() {
myStatisticsPanel.selectProxy(myRootSuite);
// another suite was added. Model should be updated
final SMTestProxy suite = createSuiteProxy("suite1", myRootSuite);
myTestEventsListener.onSuiteStarted(suite);
assertEquals(null, myStatisticsPanel.getSelectedItem());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SMTRunnerStatisticsPanelTest.java
示例15: compare
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public int compare(final SMTestProxy proxy1, final SMTestProxy proxy2) {
final Long duration1 = proxy1.getDuration();
final Long duration2 = proxy2.getDuration();
if (duration1 == null) {
return duration2 == null ? 0 : -1;
}
if (duration2 == null) {
return +1;
}
return duration1.compareTo(duration2);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:ColumnDuration.java
示例16: testTotal_TotalNotRootSuite
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testTotal_TotalNotRootSuite() {
// pre condition
assertEquals("suite", mySuite.getName());
final SMTestProxy newRootSuite = createSuiteProxy("root_suite");
mySuite.setParent(newRootSuite);
doRender(mySuite, 0);
assertFragmentsSize(1);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ColumnTestTest.java
示例17: testPresentation_SuiteTestPassed
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void testPresentation_SuiteTestPassed() {
mySuite.setStarted();
final SMTestProxy test1 = createTestProxy(mySuite);
doRender(mySuite);
assertEmpty(myFragmentsContainer.getFragments());
test1.setStarted();
test1.setFinished();
doRender(mySuite);
assertFragmentsSize(1);
assertEquals(TestsPresentationUtil.PASSED_ATTRIBUTES, myFragmentsContainer.getAttribsAt(0));
assertEquals("P:1", myFragmentsContainer.getTextAt(0));
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ColumnResultsTest.java
示例18: createSelectMeListener
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
/**
* On event - change selection and probably requests focus. Is used when we want
* navigate from other component to this
* @return Listener
*/
public PropagateSelectionHandler createSelectMeListener() {
return new PropagateSelectionHandler() {
public void handlePropagateSelectionRequest(@Nullable final SMTestProxy selectedTestProxy,
@NotNull final Object sender,
final boolean requestFocus) {
selectProxy(selectedTestProxy, sender, requestFocus);
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:StatisticsPanel.java
示例19: selectProxy
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
public void selectProxy(@Nullable final SMTestProxy selectedTestProxy,
@NotNull final Object sender,
final boolean requestFocus) {
SMRunnerUtil.addToInvokeLater(new Runnable() {
public void run() {
// Select tab if focus was requested
if (requestFocus) {
IdeFocusManager.getInstance(myProject).requestFocus(myStatisticsTableView, true);
}
// Select proxy in table
selectProxy(selectedTestProxy);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:StatisticsPanel.java
示例20: showSelectedProxyInTestsTree
import com.intellij.execution.testframework.sm.runner.SMTestProxy; //导入依赖的package包/类
protected void showSelectedProxyInTestsTree() {
final Collection<SMTestProxy> proxies = myStatisticsTableView.getSelection();
if (proxies.isEmpty()) {
return;
}
final SMTestProxy proxy = proxies.iterator().next();
myStatisticsTableView.clearSelection();
fireOnPropagateSelection(proxy);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:StatisticsPanel.java
注:本文中的com.intellij.execution.testframework.sm.runner.SMTestProxy类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论