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


Java RunTestsResult类代码示例

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


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

示例1: testTestFailures

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
public void testTestFailures() {
    DeployResultExt resultHandler = mock(DeployResultExt.class);
    RunTestsResult testResult = mock(RunTestsResult.class);
    RunTestFailure testFailure = mock(RunTestFailure.class);

    DeployMessage message = new DeployMessage();
    message.setSuccess(true);

    DeployMessageExtractor extractor = new DeployMessageExtractor(resultHandler);
    assertEquals(0, extractor.getTestFailures().size());

    when(resultHandler.getRunTestsResult()).thenReturn(testResult);
    when(testResult.getFailures()).thenReturn(new RunTestFailure[] { testFailure });

    assertEquals(1, extractor.getTestFailures().size());
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:17,代码来源:DeployMessageExtractorTest_unit.java

示例2: testTestWarnings

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
public void testTestWarnings() {
    DeployResultExt resultHandler = mock(DeployResultExt.class);
    RunTestsResult testResult = mock(RunTestsResult.class);
    CodeCoverageWarning testWarning = mock(CodeCoverageWarning.class);

    DeployMessage message = new DeployMessage();
    message.setSuccess(true);

    DeployMessageExtractor extractor = new DeployMessageExtractor(resultHandler);
    assertEquals(0, extractor.getTestWarnings().size());

    when(resultHandler.getRunTestsResult()).thenReturn(testResult);
    when(testResult.getCodeCoverageWarnings()).thenReturn(new CodeCoverageWarning[] { testWarning });

    assertEquals(1, extractor.getTestWarnings().size());
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:17,代码来源:DeployMessageExtractorTest_unit.java

示例3: getRunTestsResult

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
@Override
   public RunTestsResult getRunTestsResult() {
   	if (deployResult != null) {
   		return deployResult.getDetails().getRunTestResult();
   	}
	return null;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:8,代码来源:DeployResultExt.java

示例4: getRunTestsResult

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
@Override
   public RunTestsResult getRunTestsResult() {
	return null;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:5,代码来源:EmptyDeployResultExt.java

示例5: RunTestsResultExt

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
public RunTestsResultExt(RunTestsResult metadataRunTestsResult) {
    this.metadataRunTestsResult = metadataRunTestsResult;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:4,代码来源:RunTestsResultExt.java

示例6: getTestResult

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
@Override
public RunTestsResult getTestResult() {
    return metadataRunTestsResult;
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:5,代码来源:RunTestsResultExt.java

示例7: testMetadataApiModelExt_validateRunTestsResultExt

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
public void testMetadataApiModelExt_validateRunTestsResultExt() {
	RunTestsResult runTestsResult = new RunTestsResult();

	CodeCoverageResult codeCoverageResult = new CodeCoverageResult();
	codeCoverageResult.setName("name");
	codeCoverageResult.setNamespace("namespace");
	codeCoverageResult
			.setLocationsNotCovered(new CodeLocation[] { new CodeLocation() });
	codeCoverageResult
			.setSoqlInfo(new CodeLocation[] { new CodeLocation() });
	runTestsResult
			.setCodeCoverage(new CodeCoverageResult[] { codeCoverageResult });

	CodeCoverageWarning codeCoverageWarning = new CodeCoverageWarning();
	codeCoverageWarning.setMessage("message");
	codeCoverageWarning.setName("name");
	runTestsResult
			.setCodeCoverageWarnings(new CodeCoverageWarning[] { codeCoverageWarning });

	RunTestSuccess runTestSuccess = new RunTestSuccess();
	runTestSuccess.setMethodName("method");
	runTestSuccess.setName("name");
	runTestsResult.setSuccesses(new RunTestSuccess[] { runTestSuccess });

	RunTestFailure runTestFailure = new RunTestFailure();
	runTestFailure.setMessage("message");
	runTestFailure.setMethodName("method");
	runTestsResult.setFailures(new RunTestFailure[] { runTestFailure });
	runTestsResult.setNumFailures(1);

	RunTestsResultExt runTestsResultExt = new RunTestsResultExt(
			runTestsResult);
	assertTrue("Number of run test failures should be 1", runTestsResultExt
			.getFailures().length == 1);
	assertTrue("Validate expected failure message failed",
			runTestsResultExt.getFailureMessages().get(0).contains(
					"message"));
	assertTrue("Number of run test successes should be 1",
			runTestsResultExt.getSuccesses().length == 1);
	assertTrue("Validate expected success method name failed",
			runTestsResultExt.getSuccesses()[0].getMethodName().equals(
					"method"));
	assertTrue("Number of code coverage results should be 1",
			runTestsResultExt.getCodeCoverages().length == 1);
	assertTrue("Number of code warnings should be 1", runTestsResultExt
			.getCodeCoverageWarnings().length == 1);
	assertNotNull("RunTestsResultExt toLog should not be null",
			runTestsResultExt.toLog());
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:50,代码来源:MetadataApiModelExtTest_unit.java

示例8: testGetCodeCoverageResults

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
@Test
public void testGetCodeCoverageResults() throws Exception
{
    if (username.isEmpty() || password.isEmpty() || securityToken.isEmpty())
    {
        Assert.assertTrue(true);
    }
    else
    {
        sfConnection = new SMAConnection(
                username,
                password,
                securityToken,
                server,
                "30000",
                "200",
                proxyServer,
                proxyUser,
                proxyPass,
                proxyPort
        );

        StringBuilder sb = new StringBuilder();
        sb.append(
                "[SMA] Code Coverage Results\n" +
                        "1st Test.cls -- 80%\n" +
                        "2nd Test.cls -- 80%\n" +
                        "\n" +
                        "Total code coverage for this deployment -- 80%" +
                        "\n"
        );
        String expectedCoverage = sb.toString();
        DeployDetails details = new DeployDetails();
        RunTestsResult testsResult = new RunTestsResult();

        CodeCoverageResult testCCR1 = new CodeCoverageResult();
        testCCR1.setName("1st Test");
        testCCR1.setNumLocations(10);
        testCCR1.setNumLocationsNotCovered(2);
        CodeCoverageResult testCCR2 = new CodeCoverageResult();
        testCCR2.setName("2nd Test");
        testCCR2.setNumLocations(20);
        testCCR2.setNumLocationsNotCovered(4);

        CodeCoverageResult[] expectedCCR = new CodeCoverageResult[]{testCCR1, testCCR2};

        testsResult.setCodeCoverage(expectedCCR);
        details.setRunTestResult(testsResult);

        sfConnection.setDeployDetails(details);

        String actualCoverage = sfConnection.getCodeCoverage();
        Assert.assertEquals(expectedCoverage, actualCoverage);
    }
}
 
开发者ID:aesanch2,项目名称:salesforce-migration-assistant,代码行数:56,代码来源:SMAConnectionTest.java

示例9: getRunTestsResult

import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
public abstract RunTestsResult getRunTestsResult(); 
开发者ID:forcedotcom,项目名称:idecore,代码行数:2,代码来源:IDeployResultExt.java


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