⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 versiongrabberinterceptortest.java

📁 sourcode about java basic
💻 JAVA
字号:
package jsunit.java.tests_server.net.jsunit.interceptor;

import junit.framework.TestCase;
import com.opensymphony.xwork.Action;
import net.jsunit.action.VersionGrabberAware;
import net.jsunit.version.VersionGrabber;
import net.jsunit.version.JsUnitWebsiteVersionGrabber;

public class VersionGrabberInterceptorTest extends TestCase {

    public void testSimple() throws Exception {
        VersionGrabberInterceptor interceptor = new VersionGrabberInterceptor();
        VersionGrabberAction action = new VersionGrabberAction();
        MockActionInvocation invocation = new MockActionInvocation(action);
        interceptor.intercept(invocation);
        assertNotNull(action.versionGrabber);
        assertTrue(action.versionGrabber instanceof JsUnitWebsiteVersionGrabber);
        assertTrue(invocation.wasInvokeCalled);
    }

    static class VersionGrabberAction implements Action, VersionGrabberAware {
        private VersionGrabber versionGrabber;

        public String execute() throws Exception {
            return null;
        }

        public void setVersionGrabber(VersionGrabber versionGrabber) {
            this.versionGrabber = versionGrabber;
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -