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


Java Description.isSuite方法代码示例

本文整理汇总了Java中org.junit.runner.Description.isSuite方法的典型用法代码示例。如果您正苦于以下问题:Java Description.isSuite方法的具体用法?Java Description.isSuite怎么用?Java Description.isSuite使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.junit.runner.Description的用法示例。


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

示例1: test

import org.junit.runner.Description; //导入方法依赖的package包/类
@Override
public boolean test(Object receiver, String property, Object[] args,
		Object expectedValue) {

	if (receiver instanceof IStructuredSelection == false) {
		return false;
	}

	Object element = ((IStructuredSelection) receiver).getFirstElement();

	if (element == null || element instanceof Description == false) {
		return false;
	}

	Description description = (Description) element;

	if (property.equals("isTest")) {
		return description.isTest();
	}

	if (property.equals("isSuite")) {
		return description.isSuite();
	}

	return false;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:27,代码来源:DescriptionTester.java

示例2: getText

import org.junit.runner.Description; //导入方法依赖的package包/类
@Override
public String getText(Object element) {

	if (element instanceof Description == false) {
		return "";
	}

	Description desc = ((Description) element);

	if (desc.isSuite()) {
		return N4IDEXpectFileNameUtil.getSuiteName(desc);
	}

	if (desc.isTest()) {
		return N4IDEXpectFileNameUtil.getTestName(desc);
	}

	return "";
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:XpectLabelProvider.java

示例3: getImageDescriptor

import org.junit.runner.Description; //导入方法依赖的package包/类
/**
 * get icon based on item type (test/suite) and its status (pass/failed/exception/skip/in progress...)
 */
private ImageDescriptor getImageDescriptor(Object element) throws RuntimeException {
	ImageDescriptor descriptor = null;
	if (element instanceof Description == false) {
		String msg = "Unknown type of element in tree of type " + element.getClass().getName();
		Exception e = new RuntimeException(msg);
		N4IDEXpectUIPlugin.logError("cannot obtain image descriptor, fallback to default", e);
		return getImageDescriptor("n4_logo.png");
	}

	Description desc = (Description) element;

	if (desc.isTest()) {
		descriptor = getTestImageDescriptor(executionStatus.getStatus(desc));
	} else if (desc.isSuite()) {
		descriptor = getSuiteImageDescriptor(desc, executionStatus.getStatus(desc));
	} else {
		descriptor = getImageDescriptor("n4_logo.png");
	}
	return descriptor;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:24,代码来源:XpectLabelProvider.java

示例4: getSuiteName

import org.junit.runner.Description; //导入方法依赖的package包/类
/***/
public static String getSuiteName(Description description) {
	String text = null;
	if (description.isSuite()) {
		String s = description.getDisplayName();
		int posSemi = s.indexOf(":");
		text = s.substring(0, posSemi);
	}
	return text;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:11,代码来源:N4IDEXpectFileNameUtil.java

示例5: apply

import org.junit.runner.Description; //导入方法依赖的package包/类
@Override
public Statement apply(final Statement base, final Description description) {
  if (description.isTest()) {
    return statement(base);
  } else if (description.isSuite()) {
    return statementClass(base);
  }
  return base;
}
 
开发者ID:ampool,项目名称:monarch,代码行数:10,代码来源:RuleAndClassRuleTest.java

示例6: execute

import org.junit.runner.Description; //导入方法依赖的package包/类
/**
 * When called will check if provided data contains {@link Description test description} with failed status stored
 * in {@link N4IDEXpectView test view}. If that holds, will generate data for bug report in a console view,
 * otherwise will show message to reconfigure and rerun Xpect tests.
 */
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {

	IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);

	IWorkbenchWindow[] windows = N4IDEXpectUIPlugin.getDefault().getWorkbench().getWorkbenchWindows();
	try {
		view = (N4IDEXpectView) windows[0].getActivePage().showView(
				N4IDEXpectView.ID);
	} catch (PartInitException e) {
		N4IDEXpectUIPlugin.logError("cannot refresh test view window", e);
	}

	Description desc = (Description) selection.getFirstElement();

	// handle failed suite
	if (desc.isSuite()) {
		final N4IDEXpectView finalview = view;

		boolean suitePassed = desc.getChildren().stream()
				.noneMatch(childDescription -> finalview.testsExecutionStatus.hasFailed(childDescription));

		if (suitePassed) {
			XpectFileContentsUtil.getXpectFileContentAccess(desc).ifPresent(
					xpectFielContentAccess -> {
						if (xpectFielContentAccess.containsFixme()) {
							generateAndDisplayReport(
									N4IDEXpectFileNameUtil.getSuiteName(desc),
									xpectFielContentAccess.getContetns());
						}
					});

		} else {
			XpectConsole console = ConsoleDisplayMgr.getOrCreate("generated bug for "
					+ N4IDEXpectFileNameUtil.getSuiteName(desc));
			console.clear();
			String ls = System.lineSeparator();
			console.log("Suite must be passing and contain XPECT FIXME marker to be submited bug report. Please :"
					+ ls + " - fix failing tests" + ls + " - mark test in question with XPECT FIXME");
		}
	}

	return null;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:50,代码来源:GenerateXpectReportCommandHandler.java

示例7: isTest

import org.junit.runner.Description; //导入方法依赖的package包/类
protected boolean isTest(final Description description) {
  return (description.isSuite() || description.isTest());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:4,代码来源:IgnoreUntilRule.java

示例8: isTest

import org.junit.runner.Description; //导入方法依赖的package包/类
private boolean isTest(final Description description) {
  return (description.isSuite() || description.isTest());
}
 
开发者ID:ampool,项目名称:monarch,代码行数:4,代码来源:RetryRule.java


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