本文整理汇总了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());
}
示例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());
}
示例3: getRunTestsResult
import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
@Override
public RunTestsResult getRunTestsResult() {
if (deployResult != null) {
return deployResult.getDetails().getRunTestResult();
}
return null;
}
示例4: getRunTestsResult
import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
@Override
public RunTestsResult getRunTestsResult() {
return null;
}
示例5: RunTestsResultExt
import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
public RunTestsResultExt(RunTestsResult metadataRunTestsResult) {
this.metadataRunTestsResult = metadataRunTestsResult;
}
示例6: getTestResult
import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
@Override
public RunTestsResult getTestResult() {
return metadataRunTestsResult;
}
示例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());
}
示例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);
}
}
示例9: getRunTestsResult
import com.sforce.soap.metadata.RunTestsResult; //导入依赖的package包/类
public abstract RunTestsResult getRunTestsResult();