本文整理汇总了Java中org.eclipse.jdt.junit.model.ITestRunSession类的典型用法代码示例。如果您正苦于以下问题:Java ITestRunSession类的具体用法?Java ITestRunSession怎么用?Java ITestRunSession使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ITestRunSession类属于org.eclipse.jdt.junit.model包,在下文中一共展示了ITestRunSession类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testStoppedSessionFinishedWithFailingTest
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testStoppedSessionFinishedWithFailingTest() {
ITestCaseElement testCaseElement = mockTestCaseElement();
ITestRunSession testRunSession = mockTestRunSession( OK, testCaseElement );
testRunListener.sessionLaunched( testRunSession );
testRunListener.sessionStarted( testRunSession );
setTestCaseResult( testCaseElement, ERROR );
testRunListener.testCaseFinished( testCaseElement );
when( testCaseElement.getTestRunSession().getProgressState() ).thenReturn( STOPPED );
testRunListener.sessionFinished( testCaseElement.getTestRunSession() );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).update( "0 / 1", SWT.CENTER, successColor(), 0, 1 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "1 / 1", SWT.CENTER, errorColor(), 1, 1 );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:19,代码来源:JUnitTestRunListenerTest.java
示例2: testLaunchTerminatedAfterSessionStarted
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testLaunchTerminatedAfterSessionStarted() {
ITestRunSession testRunSession = mockTestRunSession( OK, mockTestCaseElement() );
testRunListener.sessionLaunched( testRunSession );
testRunListener.sessionStarted( testRunSession );
ILaunch launch = mockLaunch( testRunSession.getTestRunName() );
fireLaunchTerminated( launch );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "0 / 1", SWT.CENTER, successColor(), 0, 1 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verifyNoMoreInteractions();
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:17,代码来源:JUnitTestRunListenerTest.java
示例3: testTestCaseFinished
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testTestCaseFinished() {
ITestCaseElement testCaseElement = mockTestCaseElement();
ITestRunSession testRunSession = mockTestRunSession( OK, testCaseElement );
testRunListener.sessionLaunched( testRunSession );
testRunListener.sessionStarted( testRunSession );
setTestCaseResult( testCaseElement, OK );
testRunListener.testCaseFinished( testCaseElement );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "0 / 1", SWT.CENTER, successColor(), 0, 1 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "1 / 1", SWT.CENTER, successColor(), 1, 1 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:19,代码来源:JUnitTestRunListenerTest.java
示例4: testOutOfOrderEvents
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testOutOfOrderEvents() {
ITestCaseElement testCaseElement1 = mockTestCaseElement();
ITestCaseElement testCaseElement2 = mockTestCaseElement();
ITestRunSession testRunSession
= mockTestRunSession( OK, testCaseElement1, testCaseElement2 );
testRunListener.sessionLaunched( testRunSession );
testRunListener.sessionStarted( testRunSession );
testRunListener.sessionFinished( testRunSession );
setTestCaseResult( testCaseElement1, OK );
testRunListener.testCaseFinished( testCaseElement1 );
setTestCaseResult( testCaseElement2, OK );
testRunListener.testCaseFinished( testCaseElement2 );
testRunListener.sessionFinished( testRunSession );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "0 / 2", SWT.CENTER, successColor(), 0, 2 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "1 / 2", SWT.CENTER, successColor(), 1, 2 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "2 / 2", SWT.CENTER, successColor(), 2, 2 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verifyNoMoreInteractions();
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:27,代码来源:JUnitTestRunListenerTest.java
示例5: sessionFinished
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
/***
* When JUnit finishes all unit tests TestED Plugin is run.
* First, all previous problem markers are deleted and
* then if all test have passed Tested Plugin is run by
* instantiating TestedMain.
*
* See Github issue number 4.
* https://github.com/christofferholmstedt/eclipse-plugin-tested/issues/4
*/
@Override
public void sessionFinished(ITestRunSession session)
{
try {
IResource resource = session.getLaunchedProject().getCorrespondingResource();
resource.deleteMarkers(MarkerHelper.PASSED_TEST_MARKER_ID, true, IResource.DEPTH_INFINITE);
} catch (CoreException e) {
// something went wrong
}
if (this.allTestPassed)
{
// By instantiating TestedMain the analyser is set up and all "analysers" are invoked.
new TestedMain(session.getLaunchedProject());
}
}
开发者ID:christofferholmstedt,项目名称:eclipse-plugin-tested,代码行数:27,代码来源:TestedTestRunListener.java
示例6: testSessionLaunched
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testSessionLaunched() {
ITestRunSession testRunSession = mockTestRunSession( OK );
testRunListener.sessionLaunched( testRunSession );
verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:10,代码来源:JUnitTestRunListenerTest.java
示例7: testSessionStarted
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testSessionStarted() {
ITestRunSession testRunSession = mockTestRunSession( OK, mockTestCaseElement() );
testRunListener.sessionLaunched( testRunSession );
testRunListener.sessionStarted( testRunSession );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).update( "0 / 1", SWT.CENTER, successColor(), 0, 1 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:13,代码来源:JUnitTestRunListenerTest.java
示例8: testStoppedSessionFinished
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testStoppedSessionFinished() {
ITestCaseElement testCaseElement = mockTestCaseElement();
ITestRunSession testRunSession = mockTestRunSession( OK, testCaseElement );
testRunListener.sessionLaunched( testRunSession );
testRunListener.sessionStarted( testRunSession );
when( testRunSession.getProgressState() ).thenReturn( STOPPED );
testRunListener.sessionFinished( testCaseElement.getTestRunSession() );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "0 / 1", SWT.CENTER, successColor(), 0, 1 );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:16,代码来源:JUnitTestRunListenerTest.java
示例9: testObsoleteSessionFinished
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testObsoleteSessionFinished() {
ITestRunSession testRunSession1 = mockTestRunSession( OK, mockTestCaseElement() );
testRunListener.sessionLaunched( testRunSession1 );
testRunListener.sessionStarted( testRunSession1 );
ITestRunSession testRunSession2
= mockTestRunSession( OK, mockTestCaseElement(), mockTestCaseElement() );
testRunListener.sessionLaunched( testRunSession2 );
testRunListener.sessionStarted( testRunSession2 );
setTestCaseResult( ( ITestCaseElement )testRunSession1.getChildren()[ 0 ], OK );
testRunListener.testCaseFinished( ( ITestCaseElement )testRunSession1.getChildren()[ 0 ] );
testRunListener.sessionFinished( testRunSession1 );
setTestCaseResult( ( ITestCaseElement )testRunSession2.getChildren()[ 0 ], OK );
testRunListener.testCaseFinished( ( ITestCaseElement )testRunSession2.getChildren()[ 0 ] );
setTestCaseResult( ( ITestCaseElement )testRunSession2.getChildren()[ 1 ], OK );
testRunListener.testCaseFinished( ( ITestCaseElement )testRunSession2.getChildren()[ 1 ] );
testRunListener.sessionFinished( testRunSession2 );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession1.getTestRunName() );
order.verify( progressUI ).update( "0 / 1", SWT.CENTER, successColor(), 0, 1 );
order.verify( progressUI ).setToolTipText( testRunSession1.getTestRunName() );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verify( progressUI).update( "0 / 2", SWT.CENTER, successColor(), 0, 2 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verify( progressUI).update( "1 / 2", SWT.CENTER, successColor(), 1, 2 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verify( progressUI ).update( "2 / 2", SWT.CENTER, successColor(), 2, 2 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verifyNoMoreInteractions();
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:35,代码来源:JUnitTestRunListenerTest.java
示例10: testLaunchTerminatedBeforeSessionStarted
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testLaunchTerminatedBeforeSessionStarted() {
ITestRunSession testRunSession = mockTestRunSession( OK );
testRunListener.sessionLaunched( testRunSession );
ILaunch launch = mockLaunch( testRunSession.getTestRunName() );
fireLaunchTerminated( launch );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession.getTestRunName() );
order.verify( progressUI ).update( "", SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( "" );
order.verifyNoMoreInteractions();
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:16,代码来源:JUnitTestRunListenerTest.java
示例11: testTestCaseFinishedWithFailure
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testTestCaseFinishedWithFailure() {
ITestCaseElement testCaseElement = mockTestCaseElement();
ITestRunSession testRunSession = mockTestRunSession( FAILURE, testCaseElement );
testRunListener.sessionLaunched( testRunSession );
testRunListener.sessionStarted( testRunSession );
setTestCaseResult( testCaseElement, FAILURE );
testRunListener.testCaseFinished( testCaseElement );
verify( progressUI ).update( "1 / 1", SWT.CENTER, errorColor(), 1, 1 );
verify( progressUI ).setToolTipText( getToolTipText( testRunSession, 1 ) );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:14,代码来源:JUnitTestRunListenerTest.java
示例12: testTestCaseFinishedWithError
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testTestCaseFinishedWithError() {
ITestCaseElement testCaseElement = mockTestCaseElement();
ITestRunSession testRunSession = mockTestRunSession( FAILURE, testCaseElement );
testRunListener.sessionLaunched( testRunSession );
testRunListener.sessionStarted( testRunSession );
setTestCaseResult( testCaseElement, ERROR );
testRunListener.testCaseFinished( testCaseElement );
verify( progressUI ).update( "1 / 1", SWT.CENTER, errorColor(), 1, 1 );
verify( progressUI ).setToolTipText( getToolTipText( testRunSession, 1 ) );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:14,代码来源:JUnitTestRunListenerTest.java
示例13: testSecondSessionLaunched
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testSecondSessionLaunched() {
ITestRunSession testRunSession1 = mockTestRunSession( OK, mockTestCaseElement() );
testRunListener.sessionLaunched( testRunSession1 );
testRunListener.sessionStarted( testRunSession1 );
ITestRunSession testRunSession2
= mockTestRunSession( OK, mockTestCaseElement(), mockTestCaseElement() );
testRunListener.sessionLaunched( testRunSession2 );
testRunListener.sessionStarted( testRunSession2 );
setTestCaseResult( ( ITestCaseElement )testRunSession1.getChildren()[ 0 ], OK );
testRunListener.testCaseFinished( ( ITestCaseElement )testRunSession1.getChildren()[ 0 ] );
setTestCaseResult( ( ITestCaseElement )testRunSession2.getChildren()[ 0 ], OK );
testRunListener.testCaseFinished( ( ITestCaseElement )testRunSession2.getChildren()[ 0 ] );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession1.getTestRunName() );
order.verify( progressUI ).update( "0 / 1", SWT.CENTER, successColor(), 0, 1 );
order.verify( progressUI ).setToolTipText( testRunSession1.getTestRunName() );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verify( progressUI ).update( "0 / 2", SWT.CENTER, successColor(), 0, 2 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verify( progressUI ).update( "1 / 2", SWT.CENTER, successColor(), 1, 2 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verifyNoMoreInteractions();
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:28,代码来源:JUnitTestRunListenerTest.java
示例14: testRunTwoSessionsFromStartToEnd
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Test
public void testRunTwoSessionsFromStartToEnd() {
ITestRunSession testRunSession1 = mockTestRunSession( OK, mockTestCaseElement() );
testRunListener.sessionLaunched( testRunSession1 );
testRunListener.sessionStarted( testRunSession1 );
setTestCaseResult( ( ITestCaseElement )testRunSession1.getChildren()[ 0 ], OK );
testRunListener.testCaseFinished( ( ITestCaseElement )testRunSession1.getChildren()[ 0 ] );
testRunListener.sessionFinished( testRunSession1 );
ITestRunSession testRunSession2
= mockTestRunSession( OK, mockTestCaseElement(), mockTestCaseElement() );
testRunListener.sessionLaunched( testRunSession2 );
testRunListener.sessionStarted( testRunSession2 );
setTestCaseResult( ( ITestCaseElement )testRunSession2.getChildren()[ 0 ], OK );
testRunListener.testCaseFinished( ( ITestCaseElement )testRunSession2.getChildren()[ 0 ] );
setTestCaseResult( ( ITestCaseElement )testRunSession2.getChildren()[ 1 ], OK );
testRunListener.testCaseFinished( ( ITestCaseElement )testRunSession2.getChildren()[ 1 ] );
testRunListener.sessionFinished( testRunSession2 );
InOrder order = inOrder( progressUI );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession1.getTestRunName() );
order.verify( progressUI ).update( "0 / 1", SWT.CENTER, successColor(), 0, 1 );
order.verify( progressUI ).setToolTipText( testRunSession1.getTestRunName() );
order.verify( progressUI ).update( "1 / 1", SWT.CENTER, successColor(), 1, 1 );
order.verify( progressUI ).setToolTipText( testRunSession1.getTestRunName() );
order.verify( progressUI ).update( STARTING, SWT.LEFT, null, 0, 0 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verify( progressUI ).update( "0 / 2", SWT.CENTER, successColor(), 0, 2 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verify( progressUI ).update( "1 / 2", SWT.CENTER, successColor(), 1, 2 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verify( progressUI ).update( "2 / 2", SWT.CENTER, successColor(), 2, 2 );
order.verify( progressUI ).setToolTipText( testRunSession2.getTestRunName() );
order.verifyNoMoreInteractions();
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:36,代码来源:JUnitTestRunListenerTest.java
示例15: mockTestRunSession
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
private static ITestRunSession mockTestRunSession( Result testResult, ITestElement... children )
{
ITestRunSession result = mock( ITestRunSession.class );
when( result.getTestRunSession() ).thenReturn( result );
when( result.getTestRunName() ).thenReturn( "test-run-" + new Object().hashCode() );
when( result.getTestResult( true ) ).thenReturn( testResult );
when( result.getChildren() ).thenReturn( children );
for( ITestElement child : children ) {
when( child.getTestRunSession() ).thenReturn( result );
}
return result;
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:13,代码来源:JUnitTestRunListenerTest.java
示例16: JUnitListener
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
/** Constructor. */
public JUnitListener() {
JUnitCore.addTestRunListener(new TestRunListener() {
@Override
public void sessionFinished(ITestRunSession session) {
super.sessionFinished(session);
WatchDogEventType.JUNIT.process(new JUnitInterval(session));
}
});
}
开发者ID:TestRoots,项目名称:watchdog,代码行数:12,代码来源:JUnitListener.java
示例17: JUnitExecution
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
/** Constructor. */
public JUnitExecution(ITestElement test, JUnitExecution parent) {
double elapsedTime = test.getElapsedTimeInSeconds();
if (parent == null) {
// Avoids potential NPE by making this JUnitExecution its own parent
// for the scope of the constructor.
parent = this;
}
if (elapsedTime > 0.0) {
duration = new JsonifiedDouble(elapsedTime);
}
setResult(test.getTestResult(true));
if (test instanceof ITestRunSession) {
ITestRunSession session = (ITestRunSession) test;
// FIXME (MMB) is test class name, but redundant! Can be replaced by
// project name
setProjectNameHash(session.getTestRunName());
}
if (test instanceof ITestCaseElement) {
ITestCaseElement testElement = (ITestCaseElement) test;
testMethodHash = WatchDogUtils
.createHash(testElement.getTestMethodName());
parent.setClassNameHash(testElement.getTestClassName());
} else if (test instanceof ITestElementContainer) {
ITestElementContainer testContainer = (ITestElementContainer) test;
childrenExecutions = createTree(testContainer);
}
}
开发者ID:TestRoots,项目名称:watchdog,代码行数:33,代码来源:JUnitExecution.java
示例18: sessionLaunched
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Override
public void sessionLaunched( ITestRunSession testRunSession ) {
currentSession = new TestRunSessionInfo( testRunSession );
updateProgressUI( STARTING );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:6,代码来源:JUnitTestRunListener.java
示例19: sessionStarted
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Override
public void sessionStarted( ITestRunSession testRunSession ) {
currentSession = new TestRunSessionInfo( testRunSession );
updateProgressUI( currentSession );
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:6,代码来源:JUnitTestRunListener.java
示例20: sessionFinished
import org.eclipse.jdt.junit.model.ITestRunSession; //导入依赖的package包/类
@Override
public void sessionFinished( ITestRunSession testRunSession ) {
if( belongsToCurrentSession( testRunSession ) ) {
finishSession();
}
}
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:7,代码来源:JUnitTestRunListener.java
注:本文中的org.eclipse.jdt.junit.model.ITestRunSession类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论