【问题标题】:Arquillian with Windows and Glassfish 4.1 very slow带有 Windows 和 Glassfish 4.1 的 Arquillian 非常慢
【发布时间】:2016-11-26 10:45:16
【问题描述】:

我使用 JSF 2.2.12、Prime Faces 6 和 Omnifaces 创建了一个 Java Web 应用程序。在后端,我有 Spring、Hibernate 等标准层,我的应用服务器是 Glassfish 4.1.1 我正在用 Arquillian 进行一些测试。奇怪的是,在 Linux(Ubuntu 16)上可以工作,但在 Windows 上却不行。

这是我的 Arquillian.xml 文件

<?xml version="1.0"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xmlns="http://jboss.org/schema/arquillian"
            xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

    <container qualifier="glassfish" default="true">
        <configuration>
            <property name="remoteServerAddress">localhost</property>
            <property name="remoteServerHttpPort">8080</property>
            <property name="remoteServerAdminPort">4848</property>
        </configuration>
    </container>

    <extension qualifier="webdriver">
        <property name="browser">chrome</property>
        <property name="remoteReusable">true</property>
    </extension>
</arquillian>

这里是测试类的一个例子

public class IndexFrontendTest extends BaseArquillianTest {

    @Drone
    private WebDriver browser;

    @ArquillianResource
    private URL deploymentUrl;

    @Page
    private IndexPage indexPage;

    private FrontendTestComponent frontendTestComponent;

    @Before
    public void setUp() {
        browser.manage().window().setSize(new Dimension(1920, 1080));
        browser.get(deploymentUrl.toExternalForm());
        frontendTestComponent = new FrontendTestComponent();
    }

    @RunAsClient
    @Test
    public void testCarManufacturersAndModels() {
        indexPage.getCarManufacturersDropdown().selectByVisibleText("Ajax");
        frontendTestComponent.waitForJStoLoad(browser);
        frontendTestComponent.checkSelect(indexPage.getCarModelsDropdown(), 1, true);
    }

    @RunAsClient
    @Test
    public void testContinentsAndCountries() {
        indexPage.getContinentsDropdown().selectByValue("1");
        frontendTestComponent.waitForJStoLoad(browser);
        frontendTestComponent.checkSelect(indexPage.getCountriesDropdown(), 45, true);
    }
}

BaseArquillianTest 类只有部署的静态方法

@RunWith(Arquillian.class)
public abstract class BaseArquillianTest {

    @Deployment(testable = true)
    public static WebArchive createDeployment() throws IOException {
       ...
       ...
    }
}

我的开发机器有双启动。 在 Linux 上,我的测试需要 60 秒。 在 Windows 上需要 20 分钟,有时我会看到“错误请求”之类的错误。

我尝试了 2 种不同的浏览器(phantomjs 和 chrome),但情况是一样的

我试图在互联网上搜索,但似乎有人有这个错误。我想我在配置上犯了一些错误。

你能帮帮我吗?

【问题讨论】:

    标签: glassfish jboss-arquillian arquillian-drone


    【解决方案1】:

    问题是 Glassfish 内部的一个错误。

    我已切换到 Payara,现在一切正常,即使完成 4 次测试(和 2 次部署)需要 2 分钟。

    我不知道这是否可以接受?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-01-11
      • 2013-04-18
      • 1970-01-01
      • 1970-01-01
      • 2020-03-19
      • 2012-12-12
      相关资源
      最近更新 更多