Return-Path: Delivered-To: apmail-ws-tuscany-commits-archive@locus.apache.org Received: (qmail 68946 invoked from network); 7 Feb 2008 00:02:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2008 00:02:18 -0000 Received: (qmail 82201 invoked by uid 500); 7 Feb 2008 00:02:10 -0000 Delivered-To: apmail-ws-tuscany-commits-archive@ws.apache.org Received: (qmail 82173 invoked by uid 500); 7 Feb 2008 00:02:10 -0000 Mailing-List: contact tuscany-commits-help@ws.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tuscany-dev@ws.apache.org Delivered-To: mailing list tuscany-commits@ws.apache.org Received: (qmail 82163 invoked by uid 99); 7 Feb 2008 00:02:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Feb 2008 16:02:10 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Feb 2008 00:01:41 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D3B921A9832; Wed, 6 Feb 2008 16:01:48 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r619226 - in /incubator/tuscany/java/sca: itest/ itest/component-type/ itest/services/ tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/ Date: Thu, 07 Feb 2008 00:01:47 -0000 To: tuscany-commits@ws.apache.org From: rfeng@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080207000148.D3B921A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rfeng Date: Wed Feb 6 16:01:45 2008 New Revision: 619226 URL: http://svn.apache.org/viewvc?rev=619226&view=rev Log: Bring up some of the itests to be runnable as a web app Modified: incubator/tuscany/java/sca/itest/component-type/pom.xml incubator/tuscany/java/sca/itest/pom.xml incubator/tuscany/java/sca/itest/services/pom.xml incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java Modified: incubator/tuscany/java/sca/itest/component-type/pom.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/component-type/pom.xml?rev=619226&r1=619225&r2=619226&view=diff ============================================================================== --- incubator/tuscany/java/sca/itest/component-type/pom.xml (original) +++ incubator/tuscany/java/sca/itest/component-type/pom.xml Wed Feb 6 16:01:45 2008 @@ -43,27 +43,5 @@ - - - - webapp - - - - org.apache.maven.plugins - maven-war-plugin - - - package - - war - - - - - - - - Modified: incubator/tuscany/java/sca/itest/pom.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/pom.xml?rev=619226&r1=619225&r2=619226&view=diff ============================================================================== --- incubator/tuscany/java/sca/itest/pom.xml (original) +++ incubator/tuscany/java/sca/itest/pom.xml Wed Feb 6 16:01:45 2008 @@ -34,7 +34,7 @@ junit junit 4.2 - runtime + compile @@ -114,38 +114,79 @@ webapp false + + org.apache.tuscany.sca tuscany-host-webapp 1.2-incubating-SNAPSHOT + runtime - - javax.servlet - servlet-api - 2.3 + javax.servlet + servlet-api + 2.3 provided - - - junit - junit - 4.2 - compile - + - component-type + callback-api + callback-basic + + callback-id + callback-multiple-wires + callback-set-callback + callback-set-conversation + + conversations + exceptions + exceptions-cross-binding + extended-api + oneway + operation-overloading + + references services + component-type + interfaces + wires + scopes + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.3.1 + + true + + + + + + org.apache.maven.plugins @@ -170,15 +211,27 @@ maven-war-plugin 2.0.2 + + WEB-INF/lib/tuscany-host-tomcat-*.jar,WEB-INF/lib/tuscany-host-jetty-*.jar,servlet-api-*.jar + - ${project.build.directory} *-tests.jar - WEB-INF/test-lib + WEB-INF/lib + + + + + ${settings.localRepository}/junit/junit/4.2 + + junit-4.2.jar + + WEB-INF/lib + Modified: incubator/tuscany/java/sca/itest/services/pom.xml URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/itest/services/pom.xml?rev=619226&r1=619225&r2=619226&view=diff ============================================================================== --- incubator/tuscany/java/sca/itest/services/pom.xml (original) +++ incubator/tuscany/java/sca/itest/services/pom.xml Wed Feb 6 16:01:45 2008 @@ -41,28 +41,6 @@ 1.2-incubating-SNAPSHOT runtime - - - - webapp - - - - org.apache.maven.plugins - maven-war-plugin - - - package - - war - - - - - - - - Modified: incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java?rev=619226&r1=619225&r2=619226&view=diff ============================================================================== --- incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java (original) +++ incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitGeneratorMojo.java Wed Feb 6 16:01:45 2008 @@ -76,6 +76,10 @@ + "\n " + "\n tuscany" + "\n org.apache.tuscany.sca.host.webapp.TuscanyServletFilter" + + "\n " + + "\n junit.tests.jar" + + "\n ${junit.tests.jar}" + + "\n " + "\n " + "\n " + "\n tuscany" @@ -86,6 +90,11 @@ /** * @parameter */ + private String testsJar; + + /** + * @parameter + */ private boolean geronimo; /** @@ -107,6 +116,12 @@ File webxml = new File(base, "web.xml"); getLog().info("Generating " + webxml.toString()); String content = setParameter(WEB_XML, "display.name", project.getName()); + + if (testsJar == null) { + testsJar = "/WEB-INF/lib/junit-tests.jar"; + } + content = setParameter(content, "junit.tests.jar", testsJar); + try { FileWriter writer = new FileWriter(webxml); writer.append(content); Modified: incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java?rev=619226&r1=619225&r2=619226&view=diff ============================================================================== --- incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java (original) +++ incubator/tuscany/java/sca/tools/maven/maven-web-junit/src/main/java/org/apache/tuscany/tools/sca/web/junit/plugin/WebJUnitMojo.java Wed Feb 6 16:01:45 2008 @@ -27,6 +27,7 @@ import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; +import org.apache.http.StatusLine; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.DefaultHttpClient; @@ -107,8 +108,11 @@ // Execute HTTP request HttpResponse response = client.execute(httpget); - if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) { - throw new MojoExecutionException(response.getStatusLine().getReasonPhrase()); + StatusLine status = response.getStatusLine(); + if (status.getStatusCode() != HttpStatus.SC_OK) { + // throw new MojoExecutionException(response.getStatusLine().getReasonPhrase()); + getLog().error(status.getStatusCode() + ": " + status.getReasonPhrase()); + return; } Header header = response.getFirstHeader("junit.errors"); errors = header == null ? 0 : Integer.parseInt(header.getValue()); @@ -135,7 +139,7 @@ sb.append(line); } xml = sb.toString(); - getLog().info(xml); + getLog().debug(xml); } catch (IOException ex) { @@ -160,10 +164,12 @@ } } catch (Exception e) { - throw new MojoExecutionException(e.getMessage(), e); + // throw new MojoExecutionException(e.getMessage(), e); + getLog().error(e); } if (errors != 0 || failures != 0) { - throw new MojoExecutionException(xml); + // throw new MojoExecutionException(xml); + getLog().error(xml); } } --------------------------------------------------------------------- To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org For additional commands, e-mail: tuscany-commits-help@ws.apache.org