Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0A6F410FE7 for ; Thu, 14 Nov 2013 22:39:36 +0000 (UTC) Received: (qmail 11541 invoked by uid 500); 14 Nov 2013 22:39:34 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 11473 invoked by uid 500); 14 Nov 2013 22:39:34 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 11465 invoked by uid 99); 14 Nov 2013 22:39:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Nov 2013 22:39:34 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [74.125.82.48] (HELO mail-wg0-f48.google.com) (74.125.82.48) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Nov 2013 22:39:30 +0000 Received: by mail-wg0-f48.google.com with SMTP id n12so2733540wgh.3 for ; Thu, 14 Nov 2013 14:39:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=6w7D6XM7npsBle41/M9ZfmqADG0fd+1dvPhl1fZK3jQ=; b=coTXSzqZAi1ecIgmDvB2vPY5mKPTYuXofvaBP35U+Aw6jtY+RRHxDKfkWOu+NF0Crb aPD8ZGBO8ZIDFnOJp1hNDSET1ME4oPQ/RjoS3MpIORpyHAkQtnh7xmqgadl2XdjQIdKa UNqR6EMVDAdqi5VGfDaAUL3v+fbjOTyqEtNYZQI9HI0YJTja9SGZZsM38OTyPo/HeRTU uZHiuQK+HruVRVP8Ybmlh0XfAUWZC+dZeHNECQIYU1AINZjGPejXalAa3UFgpHk36C5p V9wxXAKMnEfml44BvZKwwYBT2Fte76zigeGhWqUyS0PRKXIjewqAYNZO0mvgUtVJFM/W XaHg== X-Gm-Message-State: ALoCoQm394scyQY4mfkmm8pffJnKDvIgBHH+ubF0PFkGZS0A6V0qjWhL+u9SFLWvf3w2bdlynJ23 X-Received: by 10.180.39.205 with SMTP id r13mr4915329wik.55.1384468749030; Thu, 14 Nov 2013 14:39:09 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.185.77 with HTTP; Thu, 14 Nov 2013 14:38:48 -0800 (PST) In-Reply-To: References: <5283AB53.5050602@artifact-software.com> From: Matthew Adams Date: Thu, 14 Nov 2013 16:38:48 -0600 Message-ID: Subject: Re: maven-failsafe-plugin: what is it actually intended for? To: Maven Users List Content-Type: multipart/alternative; boundary=001a11c2b998fd381b04eb2abf52 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2b998fd381b04eb2abf52 Content-Type: text/plain; charset=ISO-8859-1 Here's a bit less philosophical, more practical description of Surefire v. Failsafe. Remember that if you use the maven-surefire-plugin, it's going to execute during the Maven "test" phase by default, and fail the build on errors _during that phase_ if any tests fail. The maven-failsafe-plugin executes during Maven's "integration-test" and "validate" phases. *Remember to specify both goals!* See http://maven.apache.org/surefire/maven-failsafe-plugin/usage.html and notice that _both_ goals, integration-test & validate, need to be specified. This allows the integration tests to execute & possibly fail without _immediately_ failing the build. The failing of the build happens via maven-failsafe-plugin during the validate phase, so that other plugins can clean things up during Maven's "post-integration-test" phase, which precedes "validate". HTH, Matthew On Thu, Nov 14, 2013 at 4:30 PM, Matthew Adams wrote: > On Wed, Nov 13, 2013 at 10:39 AM, Ron Wheeler < > rwheeler@artifact-software.com> wrote: > >> On 13/11/2013 11:16 AM, Matthew Adams wrote: >> >>> I don't think timing should be the heuristic here. The fact that unit >>> tests take less is a result of the fact that what you're testing, aka the >>> "unit", tends to be small. After all, a unit test should test a "unit". >>> >> So what is your definition? >> > "A unit test is test code that tests a unit in isolation." It's > intentionally ambiguous, because a unit is relative and may differ. > > >> >>> An integration test, then, if I were defining it strictly, would be >>> anything that's not a unit test. In practice, this usually means >>> replacing >>> any mocks and/or stubs in your unit tests with the real implementations, >>> plus using any other supporting infrastructure, like databases, >>> dependency >>> injection contexts, etc. >>> >> Not sure that this is true for all integration tests. You may be able to >> test the integration of two projects (a web service and a database access >> layer) while still using mocks and stubs (mock of a database persistence >> layer). >> People frequently test with Jetty when the final project will run on >> Tomcat. >> It all depends on what part of the system integration is being tested. >> > > I didn't say it had to be what's used in production. The key difference > is that you're using _something_, in addition to the unit. > > -matthew > -- mailto:matthew@matthewadams.me skype:matthewadams12 googletalk:matthew@matthewadams.me http://matthewadams.me http://www.linkedin.com/in/matthewadams --001a11c2b998fd381b04eb2abf52--