Return-Path: X-Original-To: apmail-creadur-commits-archive@www.apache.org Delivered-To: apmail-creadur-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BF284FEA for ; Mon, 20 Aug 2012 17:55:42 +0000 (UTC) Received: (qmail 43848 invoked by uid 500); 20 Aug 2012 17:55:42 -0000 Delivered-To: apmail-creadur-commits-archive@creadur.apache.org Received: (qmail 43824 invoked by uid 500); 20 Aug 2012 17:55:42 -0000 Mailing-List: contact commits-help@creadur.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@creadur.apache.org Delivered-To: mailing list commits@creadur.apache.org Received: (qmail 43816 invoked by uid 99); 20 Aug 2012 17:55:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2012 17:55:42 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 20 Aug 2012 17:55:40 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C91CF23888E4 for ; Mon, 20 Aug 2012 17:54:56 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1375144 - /creadur/whisker/trunk/apache-whisker-cli/src/test/java/org/apache/creadur/whisker/cli/TestCommandParsing.java Date: Mon, 20 Aug 2012 17:54:56 -0000 To: commits@creadur.apache.org From: rdonkin@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120820175456.C91CF23888E4@eris.apache.org> Author: rdonkin Date: Mon Aug 20 17:54:56 2012 New Revision: 1375144 URL: http://svn.apache.org/viewvc?rev=1375144&view=rev Log: Test exclusivity Modified: creadur/whisker/trunk/apache-whisker-cli/src/test/java/org/apache/creadur/whisker/cli/TestCommandParsing.java Modified: creadur/whisker/trunk/apache-whisker-cli/src/test/java/org/apache/creadur/whisker/cli/TestCommandParsing.java URL: http://svn.apache.org/viewvc/creadur/whisker/trunk/apache-whisker-cli/src/test/java/org/apache/creadur/whisker/cli/TestCommandParsing.java?rev=1375144&r1=1375143&r2=1375144&view=diff ============================================================================== --- creadur/whisker/trunk/apache-whisker-cli/src/test/java/org/apache/creadur/whisker/cli/TestCommandParsing.java (original) +++ creadur/whisker/trunk/apache-whisker-cli/src/test/java/org/apache/creadur/whisker/cli/TestCommandParsing.java Mon Aug 20 17:54:56 2012 @@ -59,6 +59,33 @@ public class TestCommandParsing extends } } + public void testGenerateAndSkeletonAreMutuallyExclusive() throws Exception { + try { + subject.configure( + args(longOpt(CommandLineOption.LICENSE_DESCRIPTION.getLongName()), "PATH", + longOpt(CommandLineOption.ACT_TO_SKELETON.getLongName()), + longOpt(CommandLineOption.ACT_TO_GENERATE.getLongName()))); + + fail("Expected audit and generate to together to throw exception"); + } catch (AlreadySelectedException e) { + // expected + } + } + + public void testSkeletonAndAuditAreMutuallyExclusive() throws Exception { + try { + subject.configure( + args(longOpt(CommandLineOption.LICENSE_DESCRIPTION.getLongName()), "PATH", + longOpt(CommandLineOption.ACT_TO_AUDIT.getLongName()), + longOpt(CommandLineOption.ACT_TO_SKELETON.getLongName()))); + + fail("Expected audit and generate to together to throw exception"); + } catch (AlreadySelectedException e) { + // expected + } + } + + public void testSetGenerateAct() throws Exception { checkSetActForOption(Act.GENERATE, CommandLineOption.ACT_TO_GENERATE); }