Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/385.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用Arquillian更新GWT服务测试中的HTTP会话_Java_Unit Testing_Junit_Gwt Rpc_Jboss Arquillian - Fatal编程技术网

Java 使用Arquillian更新GWT服务测试中的HTTP会话

Java 使用Arquillian更新GWT服务测试中的HTTP会话,java,unit-testing,junit,gwt-rpc,jboss-arquillian,Java,Unit Testing,Junit,Gwt Rpc,Jboss Arquillian,我试图测试一个受证书保护的应用程序,因此我有一个过滤器将证书放在servlet前面的HTTP会话中 这是一个GWT应用程序,所以我使用和Arquillian @RunWith(Arquillian.class) public class TestLiveLoginService { @Deployment public static WebArchive createDeployment() { return ShrinkWrap

我试图测试一个受证书保护的应用程序,因此我有一个过滤器将证书放在servlet前面的HTTP会话中

这是一个GWT应用程序,所以我使用和Arquillian

@RunWith(Arquillian.class)
public class TestLiveLoginService {

    @Deployment
    public static WebArchive createDeployment() {
        return ShrinkWrap
                .create(WebArchive.class, "launcher.war")
                .addPackages(true, "com.mycompany.launcher")
                .addAsResource("resources/logback.xml")
                .addAsWebInfResource("resources/web.xml")
                .merge(ShrinkWrap
                        .create(ExplodedImporter.class, "resources.war")
                        .importDirectory("war/launcher")
                        .as(WebArchive.class));
    }

    private static LoginService rpcService;

    @Before
    @RunAsClient
    public void initClient() {
        rpcService = (LoginService) SyncProxy.newProxyInstance(
                LoginService.class, "http://localhost/launcher/", "login");
    }

    @Test
    @RunAsClient
    public void testLogin1() throws ServerException {
        User result = rpcService.login(new User.Builder(
                "user", "password").build());
        assertTrue((result != null));
    }

}
我的测试
testLogin1()
失败,因为服务器代码正在查找正常登录流中会话中的证书

可以在Arquillian测试中更新HTTP会话吗? 在这种情况下,我可以在
initClient()
方法中轻松地在会话中添加模拟证书