📄 testeventlistener.java
字号:
package org.momeunit.ant.event;/** * Abstract base class that all test event listeners must extend. Developers * should implement callback methods for processing test events * {@link #startTest(TestEvent)}, {@link #addError(TestEvent)}, * {@link #addFailure(TestEvent)}, {@link #endTest(TestEvent)}. Actually * method called on every test event is {@link #onEvevnt(TestEvent)}. To * simplify development of test listeners the implementation of this method * redirects test events to respective callback methods based on type of test * events. * * @author Sergio Morozov * @version 1.1.2 */public abstract class TestEventListener{ /** * Processes TestEvents. Redirects them to respective callback method. * * @param event * test event to process. * @since 1.1 */ public void onEvevnt(TestEvent event) { switch (event.getType()) { case TestEvent.START_TEST: this.startTest(event); break; case TestEvent.ERROR_TEST: this.addError(event); break; case TestEvent.FAIL_TEST: this.addFailure(event); break; case TestEvent.END_TEST: this.endTest(event); break; } } /** * Callback method that indicates an error while executing test. * * @param event * test event of error while executing test. * @since 1.1 */ public abstract void addError(TestEvent event); /** * Callback method that indicates test failure. * * @param event * test event of test failure. * @since 1.1 */ public abstract void addFailure(TestEvent event); /** * Callback method that indicates the end of test run. * * @param event * test event of end of test run. * @since 1.1 */ public abstract void endTest(TestEvent event); /** * Callback method that indicates the start of test run. * * @param event * test event of start of test run. * @since 1.1 */ public abstract void startTest(TestEvent event);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -