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


Java JUnitTest.getName方法代码示例

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


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

示例1: startTestSuite

import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; //导入方法依赖的package包/类
public void startTestSuite(JUnitTest suite)
{
    failures = 0;
    errors = 0;
    tests = 0;
    suiteName = suite.getName();
    if (suiteName.lastIndexOf('.') > 0)
    {
        suiteName = suiteName.substring(suiteName.lastIndexOf('.')+1);
    }
    suiteName += "/"+System.getProperty("mithra.xml.config");
    originalOut.println("Start Suite "+ suiteName);
    lastMessageTime = System.currentTimeMillis();
    originalOut.flush();
    flush();
}
 
开发者ID:goldmansachs,项目名称:reladomo,代码行数:17,代码来源:JunitFormatter.java

示例2: startTestSuite

import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; //导入方法依赖的package包/类
/**
 * The whole testsuite started.
 * @param suite the test suite
 */
public void startTestSuite(JUnitTest suite) {
    if (output == null) {
        return; // Quick return - no output do nothing.
    }
    StringBuffer sb = new StringBuffer("Testsuite: ");
    String n = suite.getName();
    if (n != null && !tag.isEmpty())
        n = n + "-" + tag;
    sb.append(n);
    sb.append(StringUtils.LINE_SEP);
    try {
        output.write(sb.toString());
        output.flush();
    } catch (IOException ex) {
        throw new BuildException(ex);
    }
}
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:22,代码来源:CassandraBriefJUnitResultFormatter.java

示例3: startTestSuite

import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; //导入方法依赖的package包/类
/**
 * called when a test suite starts to run
 * @param suite a <code>JUnitTest</code> value
 */
public void startTestSuite(JUnitTest suite) {
    StringBuffer sb = new StringBuffer();

    Object [] args = {
        "Running ",
        suite.getName()
    };

    MessageFormat form = new MessageFormat("{0} {1}\n");

    sb.append(form.format(args));

    if (out != null) {
        try {
            out.write(sb.toString().getBytes());
            out.flush();
        }
        catch (IOException ioex) {
            throw new BuildException("Unable to write output", ioex);
        }
        // DO NOT CLOSE the out stream!!!
    }
}
 
开发者ID:spacewalkproject,项目名称:spacewalk,代码行数:28,代码来源:RhnCustomFormatter.java

示例4: buildResultsMsg

import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; //导入方法依赖的package包/类
private void buildResultsMsg(JUnitTest suite, StringBuffer sb) {
    Object [] args = {
        suite.getName(),
        nf.format(suite.getRunTime() / RhnCustomFormatter.MS_PER_S),
        "ok"
    };

    MessageFormat form = new MessageFormat("{0}({1}s):  {2}\n\n");

    long problemCount = suite.failureCount() + suite.errorCount();
    if (problemCount > 0) {
        args[2] = problemCount + " NOT OK";
    }

    sb.append(form.format(args));
}
 
开发者ID:spacewalkproject,项目名称:spacewalk,代码行数:17,代码来源:RhnCustomFormatter.java

示例5: startTestSuite

import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; //导入方法依赖的package包/类
/**
     * The whole testsuite started.
     * @param suite the testsuite.
     */
    public void startTestSuite(final JUnitTest suite) {
        doc = getDocumentBuilder().newDocument();
        rootElement = doc.createElement(TESTSUITE);
        String n = suite.getName();
//        if (n != null && !tag.isEmpty())
//            n = n + "-" + tag;
        rootElement.setAttribute(ATTR_NAME, n == null ? UNKNOWN : n);

        //add the timestamp
        final String timestamp = DateUtils.format(new Date(),
                DateUtils.ISO8601_DATETIME_PATTERN);
        rootElement.setAttribute(TIMESTAMP, timestamp);
        //and the hostname.
        rootElement.setAttribute(HOSTNAME, getHostname());

        // Output properties
        final Element propsElement = doc.createElement(PROPERTIES);
        rootElement.appendChild(propsElement);
        final Properties props = suite.getProperties();
        if (props != null) {
            final Enumeration e = props.propertyNames();
            while (e.hasMoreElements()) {
                final String name = (String) e.nextElement();
                final Element propElement = doc.createElement(PROPERTY);
                propElement.setAttribute(ATTR_NAME, name);
                propElement.setAttribute(ATTR_VALUE, props.getProperty(name));
                propsElement.appendChild(propElement);
            }
        }
    }
 
开发者ID:scylladb,项目名称:scylla-tools-java,代码行数:35,代码来源:CassandraXMLJUnitResultFormatter.java

示例6: getSuiteName

import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; //导入方法依赖的package包/类
/**
 * Return the name of the test suite.  If the suite object does not
 * contain a value in the name field, the name will be derived from
 * the class name. 
 *
 * @param   suite    Test suite information
 * @return  Name of the test suite 
 */
public String getSuiteName(JUnitTest suite) {
    String suiteName = null;

    String suiteClass = suite.getName();
    String suitePackage = null;

    // If the suite name is not specified, use the class name instead
    if ((suite.getName() != null) && (suite.getName().length() > 0)) {
        int delimIdx = suite.getName().lastIndexOf('.');
        if ((delimIdx > 0) && (delimIdx < suite.getName().length())) {
            suiteClass = suite.getName().substring(delimIdx);
            suitePackage = suite.getName().substring(0, delimIdx);
        } else {
            suitePackage = "";
        }

        suiteName = suite.getName();
    } else {
        suiteClass = suite.getClass().getName();
        suitePackage = suite.getClass().getPackage().getName();

        // Trim off the fully qualified package name
        if ((suitePackage != null) && suiteClass.startsWith(suitePackage) && (suiteClass.length() > suitePackage.length())) {
            suiteName = suite.getName().substring(suitePackage.length() + 1);
        } else {
            suiteName = suite.getName();
        }
    }

    return suiteName;
}
 
开发者ID:ModelN,项目名称:build-management,代码行数:40,代码来源:DbJUnitFormatter.java

示例7: startTestSuite

import org.apache.tools.ant.taskdefs.optional.junit.JUnitTest; //导入方法依赖的package包/类
public void startTestSuite(JUnitTest suite) throws BuildException {
        currentSuit = suite.getName();
        failures.clear();
}
 
开发者ID:google-code-export,项目名称:windowlicker,代码行数:5,代码来源:RecordingFormatter.java


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