How to warp Warp into Core?

discussion

#1

Me and Aslak have discussed an option that Warp-like API could be moved into Core itself.

Conceptually, Warp consists from several pieces:

  1. class transformer (allows to use client-side (anonymous and inner classes) inside the server-side tests)
  2. command bus (communicates Warp commands between client and server - sort of “remote Arquillian events”)
  3. request interception (HTTP proxy)
  4. framework specific extensions (such as JAX-RS or JSF)
  5. Warp API (Warp.initiate(…).observe(…).inspect(…);
  6. Warp SPI (lifecycle bindings - @BeforeServlet, @AfterServlet…)

As Aslak realized, HTTP proxy is not required in lot of scenarios. It is basically good fit for situations where multiple requests are potentially candidates to be Warp-ed.

In simple REST-client scenarios, it is a overkill though, since there is only one request in fly at the time.

Since command bus (2) in some form already exists in the Core itself, the only piece that we would have to migrate to Core in order to enable Warp-light (not in a sense like Bud-light) is (1) class transformer and API (5).

Then we could open rich Core SPI that would enable extensions like todays-Warp to come with new ways how to intercept and filter appropriate requests (Warp.observe(filter) part) the same as HTTP proxy (3) do and how anything like servlet-filter can perform as well.

The last final piece are framework specific extensions (4) which can be integrated into framework-specific extensions (TBD).

This would help Warp to find new home while opening space for innovation.

WDYT?


Multi deployment Warping
#2

In this scenario, Warp could be refactored to leverage new Warp-light Core SPI and add few pieces, such as HTTP proxy or Servlets interceptor, and JSF specific lifecycle extensions.

(note: while HTTP proxy could actually live as a standalone tiny extension, that would serve well to other extensions such as Graphene).

Benefit is having relatively simple and specific Warp-future code that would be simpler to maintain.