[JBoss JIRA] (ARQ-1952) Warp requests hit the application port instead of LittleProxy`s one
by Razvan Petre (JIRA)
[ https://issues.jboss.org/browse/ARQ-1952?page=com.atlassian.jira.plugin.s... ]
Razvan Petre commented on ARQ-1952:
-----------------------------------
hi [~mjobanek], Thank you for your reply. I am trying to migrate from glassfish 3, java 6 to glassfish 4, java 8 a quite large suite of arquillian /warp/ grapehene tests, I would say around 1200 tests in total. I am hitting this problem: https://developer.jboss.org/message/963976#963976
Warp helped me a lot in developing in a TDD style and I feel very confident that this is the way to go. (even though these tests are quite heavy sometimes, but you are sure it will work when deployed in the container).
If you could release a new version with the latest changes it would be of great help. I have added below and example of one of my tests.
{code:java}
@RunAsClient
@WarpTest
@RunWith(Arquillian.class)
public class ErrorInspectorPageManageErrorsTest extends SeleniumTestHelper {
private static final String TAG_ERROR_FOR_TESTING = "comment on error";
private static final String ERROR_CODE_100 = "100";
private static final String ERROR_CODE_200 = "200";
private static final String ERROR_CODE_300 = "300";
private static final String ERROR_CODE_100_200 = "100,200";
private static final String ERROR_CODE_100_DESCRIPTION = "Error code 100 description";
private static final String ERROR_CODE_200_DESCRIPTION = "Error code 200 description";
private static final String ERROR_CODE_300_DESCRIPTION = "Error code 300 description";
@Deployment
public static WebArchive createDeployment() {
return Deployments.createFdsiDeployment();
}
@Test
public void canCloseErrors() {
Warp.initiate(new Activity() {
public void perform() {
//@formatter:off
final ErrorInspectorPage page = new ErrorInspectorPage(selenium).withPath(ErrorInspectorPage.PATH);
page.loginAs(BusinessRoles.Role.INTERFACE_ADMIN, ADMIN_USERS).addTestDataFor(CAN_CLOSE_ERRORS);
page.open();
assertThat(page.table().count().is(THREE_ERRORS), is(true));
assertThat(page.table.checkBoxes().size(), is(FOURTH));
assertThat(page.table.row(FIRST).cell(STATUS).text(), is(IS_OPEN));
assertThat(page.table.row(SECOND).cell(STATUS).text(), is(IS_OPEN));
assertThat(page.table.row(THIRD).cell(STATUS).text(), is(IS_OPEN));
assertThat(page.button(BULK_ACTION_BUTTON).getText(), is("Bulk Action on 3 errors"));
assertThat(page.topActionButton().isDisabled(), is(true));
assertThat(page.topActionButton().getText(), is("Action on selected error(s)"));
page.table.row(FIRST).selectionColumnCheckbox().click();
waitForTwoSeconds();
assertThat(page.topActionButton().isEnabled(), is(true));
assertThat(page.topActionButton().getText(), is("Action on 1 error(s)"));
page.topActionButton().click();
page.waitUntilPresent(page.topCloseButton());
page.waitUntilVisible(page.topCloseButton());
waitFor(DEFAULT_TIMEOUT).until(new Predicate<WebDriver>() {
public boolean apply(WebDriver input) {
page.button(CLOSE_BUTTON).click();
waitForTwoSeconds();
return page.overlayTextArea(CLOSE_OVERLAY_TEXTAREA).isDisplayed();
}
});
assertThat(page.closeErrorscounter().getText(), is("255 characters remaining."));
page.overlayTextArea(CLOSE_OVERLAY_TEXTAREA).typeInto(CLOSING_THE_ERROR_FOR_TESTING);
assertThat(page.overlayButton(OK_CLOSE_BUTTON).isPrimary(), is(true));
page.overlayButton(OK_CLOSE_BUTTON).click();
waitForTwoSeconds();
assertThat(page.topActionButton().isDisabled(), is(true));
page.waitUntilPresent(page.table());
assertThat(page.infoMessage(), is("Error(s) closed:You closed 1 error(s). 0 error(s) were skipped."));
assertThat(page.table().count().is(TWO_ERRORS), is(true));
assertThat(page.table.row(FIRST).cell(STATUS).text(), is(IS_OPEN));
assertThat(page.table.row(SECOND).cell(STATUS).text(), is(IS_OPEN));
assertThat(page.button(BULK_ACTION_BUTTON).getText(), is("Bulk Action on 2 errors"));
OurPage userAuditPage = new OurPage(selenium).withPath(UserAuditPage.PATH);
userAuditPage.open();
assertThat(userAuditPage.table().count().is(2), is(true));
assertThat(userAuditPage.table.row(1).cell(1).text(), is(FixtureBuilder.PRICING_PATTERN));
assertThat(userAuditPage.table.row(1).cell(2).text(), is(UserAction.UPDATE_ERROR.toCamelCase()));
assertThat(userAuditPage.table.row(1).cell(3).text(), is(""));
assertThat(userAuditPage.table.row(1).cell(4).text(), is("[1] errors were updated to [CLOSED]"));
assertThat(userAuditPage.table.row(1).cell(5).text(), is(TEST_USER));
page.assertDatabaseState(AssertTestData.CAN_CLOSE_ERRORS);
//@formatter:on
}
}).inspect(new Inspection() {
private static final long serialVersionUID = 1L;
});
}
{code}
> Warp requests hit the application port instead of LittleProxy`s one
> -------------------------------------------------------------------
>
> Key: ARQ-1952
> URL: https://issues.jboss.org/browse/ARQ-1952
> Project: Arquillian
> Issue Type: Bug
> Components: Extension - Warp
> Affects Versions: warp_1.0.0.Alpha7, warp_1.0.0.Beta1
> Environment: Linux x64, ChromeDriver , PhantomJSDriver, Wildfly 8.0 & 8.2, Mojarra 2.8 & 2.11
> Reporter: Pëtr Andreev
> Fix For: warp_1.0.0.Beta1
>
> Attachments: ARQ-1952-failure.log, ARQ-1952-success.log
>
>
> Warp observer intermittently fails while inspecting the requests with:
> "There were no requests matched by observer \[containsParameter(XXXX)\] ".
> The technical reason for the failure is that the client request hits the original (application server) port and not the [LittleProxy`s|https://github.com/adamfisk/LittleProxy] one (HTTP successful and failed traffic is attached showing the HTTP requests going to the wrong port, i.e 8080). Since Warp hooks into the client/server conversation providing its own implementation of _HttpFiltersSourceAdapter_ in _DefaultHttpFiltersSource_, while expecting the payload request from client after setting up a WarpContext, the Warp runs into timeout because of the HTTP request never reaches the LittleProxy.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (ARQ-1952) Warp requests hit the application port instead of LittleProxy`s one
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQ-1952?page=com.atlassian.jira.plugin.s... ]
Matous Jobanek commented on ARQ-1952:
-------------------------------------
Hi, I don't want to say that it is a dead project, it just relies on a community effort. The problem is that we don't have enough time and resources as we would like to have to keep the development of the project alive and to fix all issues that has been raised. We would be delighted to have some more contributions there, so if you are interested feel free to send a PR or ask questions about implementation details. We would really appreciate any input from your or anyone else's side. If you just want to release a new version of Warp containing the latest fixes and improvements, then drop me an email or create an issue on github and I'll do it ASAP.
Thanks
> Warp requests hit the application port instead of LittleProxy`s one
> -------------------------------------------------------------------
>
> Key: ARQ-1952
> URL: https://issues.jboss.org/browse/ARQ-1952
> Project: Arquillian
> Issue Type: Bug
> Components: Extension - Warp
> Affects Versions: warp_1.0.0.Alpha7, warp_1.0.0.Beta1
> Environment: Linux x64, ChromeDriver , PhantomJSDriver, Wildfly 8.0 & 8.2, Mojarra 2.8 & 2.11
> Reporter: Pëtr Andreev
> Fix For: warp_1.0.0.Beta1
>
> Attachments: ARQ-1952-failure.log, ARQ-1952-success.log
>
>
> Warp observer intermittently fails while inspecting the requests with:
> "There were no requests matched by observer \[containsParameter(XXXX)\] ".
> The technical reason for the failure is that the client request hits the original (application server) port and not the [LittleProxy`s|https://github.com/adamfisk/LittleProxy] one (HTTP successful and failed traffic is attached showing the HTTP requests going to the wrong port, i.e 8080). Since Warp hooks into the client/server conversation providing its own implementation of _HttpFiltersSourceAdapter_ in _DefaultHttpFiltersSource_, while expecting the payload request from client after setting up a WarpContext, the Warp runs into timeout because of the HTTP request never reaches the LittleProxy.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (ARQ-2034) Test enrichment and JUnit @Rule do not harmonize
by Matous Jobanek (JIRA)
[ https://issues.jboss.org/browse/ARQ-2034?page=com.atlassian.jira.plugin.s... ]
Matous Jobanek commented on ARQ-2034:
-------------------------------------
The branch should solve both of them.
This commit: [5015698|https://github.com/MatousJobanek/arquillian-core/commit/5015698d1...] is completely same one as that one contained in the referenced [PR110|https://github.com/arquillian/arquillian-core/pull/110] - this solves the first point
This commit [f3fe5a5|https://github.com/MatousJobanek/arquillian-core/commit/f3fe5a565...] should solve the second point
> Test enrichment and JUnit @Rule do not harmonize
> ------------------------------------------------
>
> Key: ARQ-2034
> URL: https://issues.jboss.org/browse/ARQ-2034
> Project: Arquillian
> Issue Type: Bug
> Components: Base Implementation
> Affects Versions: 1.1.11.Final
> Environment: junit 4.11
> arquillian-junit-container 1.1.11.Final
> wildfly-arquillian-container-remote 8.1.0.Final
> Reporter: Björn Kautler
> Assignee: Matous Jobanek
>
> We are starting with Arquillian tests on a remote WildFly instance.
> I tried to write a JUnit {{@Rule}}, that can be used to make a login call for all test methods automatically, but I was not yet able to make it work, as I need an injected {{@Ejb}} instance for this.
> I tried to add {{@EJB private InterfaceLoginManagement interfaceLoginManagement;}} to the {{TestRule}} implementation, but it stays {{null}}. I've read at ARQ-1954 that this should probably work, but unfortunately it is not, at least not with the remote container runner. {{org.jboss.arquillian.junit.extension.JUnitCoreExtension}} that should register {{org.jboss.arquillian.junit.extension.UpdateTestResultBeforeAfter}} and {{org.jboss.arquillian.junit.RulesEnricher}} is not even loaded on the container side. Maybe the {{META-INF/services/}} file is missing?
> Then I tried to simply give the injected instance to the rule from the test class like
> {code}
> @EJB private InterfaceLoginManagement interfaceLoginManagement;
> @Rule private LoginRule loginRule = new LoginRule(interfaceLoginManagement);
> {code}
> or even
> {code}
> @EJB private InterfaceLoginManagement interfaceLoginManagement;
> @Rule public LoginRule getLoginRule() {
> return new LoginRule(() -> {
> return interfaceLoginManagement;
> });
> }
> {code}
> with the {{LoginRule}} receiving a {{Supplier<InterfaceLoginManagement>}} and call it as late as possible, i. e. in the rules {{apply()}} method. But even this is still too early as the EJB is still {{null}} and the test enrichers are only run between the {{@Rule}} applying and {{@Before}} methods.
> So I'd like to suggest two things:
> # Fix the implementation of ARQ-1954 if it should work on container side which I assume it should
> # Make the test enrichments earlier in the lifecycle, i. e. before the {{@Rule}} s are being applied, or rather even before the {{@Rule}} methods are called, so that you at least can use the injected instances in the {{@Rule}} annotated methods to forward them to a rule. This is necessary even if top 1 is taken care of, because you might want to use a 3rd Party rule the code of which you cannot change.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months
[JBoss JIRA] (ARQ-1952) Warp requests hit the application port instead of LittleProxy`s one
by Razvan Petre (JIRA)
[ https://issues.jboss.org/browse/ARQ-1952?page=com.atlassian.jira.plugin.s... ]
Razvan Petre commented on ARQ-1952:
-----------------------------------
hi all,
Is Warp a dead project? I noticed that there a lot of issues that were raised a long time ago... My project relies heavily on Arquillian/Warp, what are my options?
> Warp requests hit the application port instead of LittleProxy`s one
> -------------------------------------------------------------------
>
> Key: ARQ-1952
> URL: https://issues.jboss.org/browse/ARQ-1952
> Project: Arquillian
> Issue Type: Bug
> Components: Extension - Warp
> Affects Versions: warp_1.0.0.Alpha7, warp_1.0.0.Beta1
> Environment: Linux x64, ChromeDriver , PhantomJSDriver, Wildfly 8.0 & 8.2, Mojarra 2.8 & 2.11
> Reporter: Pëtr Andreev
> Fix For: warp_1.0.0.Beta1
>
> Attachments: ARQ-1952-failure.log, ARQ-1952-success.log
>
>
> Warp observer intermittently fails while inspecting the requests with:
> "There were no requests matched by observer \[containsParameter(XXXX)\] ".
> The technical reason for the failure is that the client request hits the original (application server) port and not the [LittleProxy`s|https://github.com/adamfisk/LittleProxy] one (HTTP successful and failed traffic is attached showing the HTTP requests going to the wrong port, i.e 8080). Since Warp hooks into the client/server conversation providing its own implementation of _HttpFiltersSourceAdapter_ in _DefaultHttpFiltersSource_, while expecting the payload request from client after setting up a WarpContext, the Warp runs into timeout because of the HTTP request never reaches the LittleProxy.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
8 years, 3 months