Return-Path: X-Original-To: apmail-struts-dev-archive@www.apache.org Delivered-To: apmail-struts-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 743C7D2BE for ; Wed, 5 Sep 2012 10:53:04 +0000 (UTC) Received: (qmail 72742 invoked by uid 500); 5 Sep 2012 10:53:04 -0000 Delivered-To: apmail-struts-dev-archive@struts.apache.org Received: (qmail 72575 invoked by uid 500); 5 Sep 2012 10:53:02 -0000 Mailing-List: contact dev-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Developers List" Reply-To: "Struts Developers List" Delivered-To: mailing list dev@struts.apache.org Received: (qmail 72538 invoked by uid 99); 5 Sep 2012 10:53:01 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 10:53:01 +0000 Received: from localhost (HELO mail-qa0-f48.google.com) (127.0.0.1) (smtp-auth username lukaszlenart, mechanism plain) by minotaur.apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Sep 2012 10:53:01 +0000 Received: by qady1 with SMTP id y1so673091qad.14 for ; Wed, 05 Sep 2012 03:53:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.202.10 with SMTP id fc10mr16732203qab.42.1346842380366; Wed, 05 Sep 2012 03:53:00 -0700 (PDT) Received: by 10.229.31.5 with HTTP; Wed, 5 Sep 2012 03:53:00 -0700 (PDT) In-Reply-To: References: <500E39E7.1000703@apache.org> Date: Wed, 5 Sep 2012 12:53:00 +0200 Message-ID: Subject: Re: Examples app From: Lukasz Lenart To: Struts Developers List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2012/9/4 Dave Newton : > I think the coolest would be to have some BDD in there, like with easyb/e= tc. I have no experiences with BDD/easyb, some example ? > It can drive JWebUnit (IIRC, or HtmlUnit), can be run from Maven, and is > easy to write. Yeah, no needs to run a web browser and so on, but that's wrong :/ Anyway, I was able to add a simple integration test to Blank Webapp, it looks like below, WDYT? Is it the right direction ? public class HelloWorldIntegrationTest { public static final int PORT =3D 8090; @Before public void setUp() throws Exception { Server server =3D new Server(PORT); WebAppContext handler =3D new WebAppContext("src/main/webapp", "/struts2-blank"); server.setHandler(handler); server.start(); JWebUnit.setBaseUrl("http://localhost:" + PORT + "/struts2-blank/")= ; } @Test public void testIndex() throws Exception { // when JWebUnit.beginAt("index.action"); // then JWebUnit.assertResponseCode(200); JWebUnit.assertTitleEquals("Struts is up and running ..."); JWebUnit.assertLinkPresentWithExactText("English"); JWebUnit.assertLinkPresentWithExactText("Espanol"); } } Regards --=20 =C5=81ukasz + 48 606 323 122 http://www.lenart.org.pl/ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org For additional commands, e-mail: dev-help@struts.apache.org