incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danhayw...@apache.org
Subject svn commit: r1044420 [1/2] - in /incubator/isis/trunk: support/prototype/viewer-bdd/ support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/scenarios/ support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/sc...
Date Fri, 10 Dec 2010 16:25:53 GMT
Author: danhaywood
Date: Fri Dec 10 16:25:52 2010
New Revision: 1044420

URL: http://svn.apache.org/viewvc?rev=1044420&view=rev
Log:
more on BDD docs, minor related BDD viewer changes

Added:
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/AllStories.java
      - copied, changed from r1044273, incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/scenarios/ScenarioSuite.java
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/
      - copied from r1044273, incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/scenarios/newClaim/
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/stories/
      - copied from r1044273, incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/scenarios/
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/stories/AllStories.html
      - copied unchanged from r1044273, incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/scenarios/ScenarioSuite.html
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckCollectionContentsPeer.java
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/RunViewer.java
      - copied, changed from r1044273, incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/StartClient.java
    incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckCollectionContentsForConcordion.java
Removed:
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/scenarios/ScenarioSuite.java
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/scenarios/newClaim/
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/scenarios/
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/stories/ScenarioSuite.html
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckListContainsPeer.java
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckListDoesNotContainPeer.java
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckListIsEmptyPeer.java
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckListIsNotEmptyPeer.java
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckListSizePeer.java
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/StartClient.java
    incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckListContainsForConcordion.java
    incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckListDoesNotContainForConcordion.java
    incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckListIsEmptyForConcordion.java
    incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckListIsNotEmptyForConcordion.java
    incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckListSizeForConcordion.java
Modified:
    incubator/isis/trunk/support/prototype/viewer-bdd/pom.xml
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Fixture.java
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Index.java
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioDefaultsOk.java
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.java
    incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.html
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/Scenario.java
    incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/AliasItemsInListPeer.java
    incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/AbstractIsisConcordionScenario.java
    incubator/isis/trunk/viewer/bdd/src/docbkx/guide/isis-bdd-viewer.xml

Modified: incubator/isis/trunk/support/prototype/viewer-bdd/pom.xml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/support/prototype/viewer-bdd/pom.xml?rev=1044420&r1=1044419&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/support/prototype/viewer-bdd/pom.xml (original)
+++ incubator/isis/trunk/support/prototype/viewer-bdd/pom.xml Fri Dec 10 16:25:52 2010
@@ -21,7 +21,7 @@
                         <concordion.output.dir>${project.build.directory}/concordion</concordion.output.dir>
                     </systemPropertyVariables>
                     <includes>
-                         <include>**/ScenarioSuite.java</include>
+                         <include>**/AllStories.java</include>
                     </includes>
                 </configuration>
             </plugin>

Copied: incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/AllStories.java
(from r1044273, incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/scenarios/ScenarioSuite.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/AllStories.java?p2=incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/AllStories.java&p1=incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/scenarios/ScenarioSuite.java&r1=1044273&r2=1044420&rev=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/scenarios/ScenarioSuite.java
(original)
+++ incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/AllStories.java
Fri Dec 10 16:25:52 2010
@@ -1,9 +1,9 @@
-package org.apache.isis.support.prototype.scenarios;
+package org.apache.isis.support.prototype.stories;
 
 import org.apache.isis.support.prototype.AbstractApplicationStory;
 
 
-public class ScenarioSuite extends AbstractApplicationStory {
+public class AllStories extends AbstractApplicationStory {
 
 
 }

Modified: incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Fixture.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Fixture.java?rev=1044420&r1=1044273&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Fixture.java
(original)
+++ incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Fixture.java
Fri Dec 10 16:25:52 2010
@@ -1,4 +1,4 @@
-package org.apache.isis.support.prototype.scenarios.newClaim;
+package org.apache.isis.support.prototype.stories.newClaim;
 
 import org.apache.isis.support.prototype.AbstractApplicationStory;
 

Modified: incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Index.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Index.java?rev=1044420&r1=1044273&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Index.java
(original)
+++ incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/Index.java
Fri Dec 10 16:25:52 2010
@@ -1,4 +1,4 @@
-package org.apache.isis.support.prototype.scenarios.newClaim;
+package org.apache.isis.support.prototype.stories.newClaim;
 
 import org.apache.isis.support.prototype.AbstractApplicationStory;
 

Modified: incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioDefaultsOk.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioDefaultsOk.java?rev=1044420&r1=1044273&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioDefaultsOk.java
(original)
+++ incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioDefaultsOk.java
Fri Dec 10 16:25:52 2010
@@ -1,4 +1,4 @@
-package org.apache.isis.support.prototype.scenarios.newClaim;
+package org.apache.isis.support.prototype.stories.newClaim;
 
 import org.apache.isis.support.prototype.AbstractApplicationStory;
 

Modified: incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.java?rev=1044420&r1=1044273&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.java
(original)
+++ incubator/isis/trunk/support/prototype/viewer-bdd/src/test/java/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.java
Fri Dec 10 16:25:52 2010
@@ -1,4 +1,4 @@
-package org.apache.isis.support.prototype.scenarios.newClaim;
+package org.apache.isis.support.prototype.stories.newClaim;
 
 import org.apache.isis.support.prototype.AbstractApplicationStory;
 

Modified: incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.html
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.html?rev=1044420&r1=1044273&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.html
(original)
+++ incubator/isis/trunk/support/prototype/viewer-bdd/src/test/resources/org/apache/isis/support/prototype/stories/newClaim/ScenarioOnceCreatedShowsUpForClaimant.html
Fri Dec 10 16:25:52 2010
@@ -67,7 +67,7 @@
 
         <li>
           <p>Confirm that <span
-          concordion:execute="#result=checkListIsEmpty(#TEXT)"
+          concordion:execute="#result=checkCollectionIsEmpty(#TEXT)"
           xmlns:concordion="http://www.concordion.org/2007/concordion">tomsClaimsInitially</span>
           has no claims; <span concordion:assertEquals="#result"
           xmlns:concordion="http://www.concordion.org/2007/concordion">ok</span>.</p>
@@ -242,7 +242,7 @@
 
         <li>
           <p
-          concordion:execute="#result=checkListIsNotEmpty(#tomsClaimsAfterwards)"
+          concordion:execute="#result=checkCollectionIsNotEmpty(#tomsClaimsAfterwards)"
           xmlns:concordion="http://www.concordion.org/2007/concordion">Confirm
           that the tom's claims afterwards is not empty; <span
           concordion:assertEquals="#result">ok</span>.</p>
@@ -250,7 +250,7 @@
 
         <li>
           <p
-          concordion:execute="#result=checkListSize(#tomsClaimsAfterwards,#expectedSize)"
+          concordion:execute="#result=checkCollectionSize(#tomsClaimsAfterwards,#expectedSize)"
           xmlns:concordion="http://www.concordion.org/2007/concordion">Confirm
           that tom has <span concordion:set="#expectedSize">2</span> claims;
           <span concordion:assertEquals="#result">ok</span>.</p>
@@ -258,7 +258,7 @@
 
         <li>
           <p
-          concordion:execute="#result=checkListContains(#tomsClaimsAfterwards,#tomsClaim1)"
+          concordion:execute="#result=checkCollectionContains(#tomsClaimsAfterwards,#tomsClaim1)"
           xmlns:concordion="http://www.concordion.org/2007/concordion">Confirm
           that tom's set of claims contains <span
           concordion:set="#tomsClaim1">tomsClaim1</span>; <span
@@ -267,7 +267,7 @@
 
         <li>
           <p
-          concordion:execute="#result=checkListDoesNotContain(#tomsClaimsAfterwards,#tomEmployee)"
+          concordion:execute="#result=checkCollectionDoesNotContain(#tomsClaimsAfterwards,#tomEmployee)"
           xmlns:concordion="http://www.concordion.org/2007/concordion">Confirm
           that tom's set of claims does NOT contain <span
           concordion:set="#tomEmployee">tomEmployee</span>; himself (duh!);

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/Scenario.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/Scenario.java?rev=1044420&r1=1044419&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/Scenario.java
(original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/Scenario.java
Fri Dec 10 16:25:52 2010
@@ -34,7 +34,7 @@ import org.apache.isis.viewer.bdd.common
 import org.apache.isis.viewer.bdd.common.story.bootstrapping.OpenSession;
 import org.apache.isis.viewer.bdd.common.story.bootstrapping.SetClock;
 import org.apache.isis.viewer.bdd.common.story.bootstrapping.ShutdownIsis;
-import org.apache.isis.viewer.bdd.common.story.bootstrapping.StartClient;
+import org.apache.isis.viewer.bdd.common.story.bootstrapping.RunViewer;
 import org.apache.isis.viewer.bdd.common.story.registries.AliasRegistryDefault;
 import org.apache.isis.viewer.bdd.common.story.registries.AliasRegistryHolder;
 
@@ -246,7 +246,7 @@ public class Scenario implements AliasRe
     // /////////////////////////////////////////////////////////
 
     public void runViewer() {
-        new StartClient(this).run();
+        new RunViewer(this).run();
     }
 
     // //////////////////////////////////////////////////////////////////

Modified: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/AliasItemsInListPeer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/AliasItemsInListPeer.java?rev=1044420&r1=1044419&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/AliasItemsInListPeer.java
(original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/AliasItemsInListPeer.java
Fri Dec 10 16:25:52 2010
@@ -72,7 +72,7 @@ public class AliasItemsInListPeer extend
     }
 
     private boolean typeMatches(final ObjectAdapter adapter) {
-        if (!typeBinding.isFound()) {
+        if (typeBinding == null || !typeBinding.isFound()) {
             return true;
         }
 

Added: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckCollectionContentsPeer.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckCollectionContentsPeer.java?rev=1044420&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckCollectionContentsPeer.java
(added)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/fixtures/CheckCollectionContentsPeer.java
Fri Dec 10 16:25:52 2010
@@ -0,0 +1,105 @@
+package org.apache.isis.viewer.bdd.common.fixtures;
+
+import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
+import org.apache.isis.viewer.bdd.common.AliasRegistry;
+
+public class CheckCollectionContentsPeer  extends AbstractListFixturePeer {
+
+    public CheckCollectionContentsPeer(final AliasRegistry aliasesRegistry,
+            final String listAlias) {
+        super(aliasesRegistry, listAlias);
+    }
+
+
+    /**
+     * Returns <tt>true</tt> if collection contains specified alias.
+     * 
+     * <p>
+     * If either the list alias is invalid, or the provided alias is 
+     * {@link #isValidAlias(String) invalid}, will return <tt>false</tt>.
+     */
+    public boolean contains(String alias) {
+        if(!isValidListAlias()) {
+            return false;
+        }
+
+        ObjectAdapter adapter = getAliasRegistry().getAliased(alias);
+        if(adapter == null) {
+            return false;
+        }
+        return collectionAdapters().contains(adapter);
+    }
+    
+
+    /**
+     * Returns <tt>true</tt> if collection does not contain specified alias.
+     * 
+     * <p>
+     * If either the list alias is invalid, or the provided alias is 
+     * {@link #isValidAlias(String) invalid}, will return <tt>false</tt>.
+     */
+    public boolean doesNotContain(String alias) {
+        if(!isValidListAlias()) {
+            return false;
+        }
+        ObjectAdapter adapter = getAliasRegistry().getAliased(alias);
+        if(adapter == null) {
+            return false;
+        }
+        return !collectionAdapters().contains(adapter);
+    }
+
+    /**
+     * Returns <tt>true</tt> if is empty.
+     * 
+     * @return <tt>false</tt> if the alias is invalid or does not represent a
list
+     */
+    public boolean isEmpty() {
+        if(!isValidListAlias()) {
+            return false;
+        }
+        return collectionAdapters().size() == 0;
+    }
+
+    
+    /**
+     * Returns <tt>true</tt> if is not empty.
+     * 
+     * @return <tt>false</tt> if the alias is invalid or does not represent a
list
+     */
+    public boolean isNotEmpty() {
+        if(!isValidListAlias()) {
+            return false;
+        }
+
+        return collectionAdapters().size() != 0;
+    }
+
+
+    
+    /**
+     * Returns <tt>true</tt> if collection has specified size.
+     * 
+     * @return <tt>false</tt> if the alias is invalid or does not represent a
list
+     */
+    public boolean assertSize(int size) {
+        if(!isValidListAlias()) {
+            return false;
+        }
+        return getSize() == size;
+    }
+
+
+    /**
+     * Returns the size of the collection.
+     * 
+     * @return <tt>-1</tt> if the alias is invalid or does not represent a list.
+     */
+    public int getSize() {
+        if(!isValidListAlias()) {
+            return -1;
+        }
+        return collectionAdapters().size();
+    }
+
+}

Copied: incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/RunViewer.java
(from r1044273, incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/StartClient.java)
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/RunViewer.java?p2=incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/RunViewer.java&p1=incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/StartClient.java&r1=1044273&r2=1044420&rev=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/StartClient.java
(original)
+++ incubator/isis/trunk/viewer/bdd/common/src/main/java/org/apache/isis/viewer/bdd/common/story/bootstrapping/RunViewer.java
Fri Dec 10 16:25:52 2010
@@ -5,11 +5,11 @@ import org.apache.isis.core.runtime.view
 import org.apache.isis.core.runtime.viewer.IsisViewerInstaller;
 import org.apache.isis.viewer.bdd.common.Scenario;
 
-public class StartClient extends AbstractHelper {
+public class RunViewer extends AbstractHelper {
 
     private static final String DND_VIEWER_NAME = "dnd";
 
-    public StartClient(final Scenario story) {
+    public RunViewer(final Scenario story) {
         super(story);
     }
 

Modified: incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/AbstractIsisConcordionScenario.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/AbstractIsisConcordionScenario.java?rev=1044420&r1=1044419&r2=1044420&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/AbstractIsisConcordionScenario.java
(original)
+++ incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/AbstractIsisConcordionScenario.java
Fri Dec 10 16:25:52 2010
@@ -20,12 +20,8 @@ import org.apache.isis.viewer.bdd.common
 import org.apache.isis.viewer.bdd.common.fixtures.perform.Perform;
 import org.apache.isis.viewer.bdd.concordion.internal.concordion.IsisExecuteCommandWithHeader;
 import org.apache.isis.viewer.bdd.concordion.internal.fixtures.AliasItemsInListForConcordion;
-import org.apache.isis.viewer.bdd.concordion.internal.fixtures.CheckListContainsForConcordion;
-import org.apache.isis.viewer.bdd.concordion.internal.fixtures.CheckListDoesNotContainForConcordion;
+import org.apache.isis.viewer.bdd.concordion.internal.fixtures.CheckCollectionContentsForConcordion;
 import org.apache.isis.viewer.bdd.concordion.internal.fixtures.CheckListForConcordion;
-import org.apache.isis.viewer.bdd.concordion.internal.fixtures.CheckListIsEmptyForConcordion;
-import org.apache.isis.viewer.bdd.concordion.internal.fixtures.CheckListIsNotEmptyForConcordion;
-import org.apache.isis.viewer.bdd.concordion.internal.fixtures.CheckListSizeForConcordion;
 import org.apache.isis.viewer.bdd.concordion.internal.fixtures.SetUpObjectsForConcordion;
 import org.apache.isis.viewer.bdd.concordion.internal.fixtures.UsingIsisViewerForConcordion;
 import org.concordion.Concordion;
@@ -442,33 +438,36 @@ public abstract class AbstractIsisConcor
     }
 
     // ////////////////////////////////////////////////////////////////////////
-    // check list
+    // check collection
     // ////////////////////////////////////////////////////////////////////////
 
 
-    public String checkListIsEmpty(String listAlias) {
-        CheckListIsEmptyForConcordion checkListIsEmpty = new CheckListIsEmptyForConcordion(getScenario().getAliasRegistry(),
StringUtils.normalized(listAlias));
-        return checkListIsEmpty.execute();
+    public String checkCollectionIsEmpty(String listAlias) {
+        return new CheckCollectionContentsForConcordion(getScenario().getAliasRegistry(),
StringUtils.normalized(listAlias)).isEmpty();
     }
 
-    public String checkListIsNotEmpty(String listAlias) {
-        return new CheckListIsNotEmptyForConcordion(getScenario().getAliasRegistry(), StringUtils.normalized(listAlias)).execute();
+    public String checkCollectionIsNotEmpty(String listAlias) {
+        return new CheckCollectionContentsForConcordion(getScenario().getAliasRegistry(),
StringUtils.normalized(listAlias)).isNotEmpty();
     }
     
-    public String checkListSize(String listAlias, int size) {
-        return new CheckListSizeForConcordion(getScenario().getAliasRegistry(), StringUtils.normalized(listAlias)).execute(size);
+    public String checkCollectionContains(String listAlias, String alias) {
+        return new CheckCollectionContentsForConcordion(getScenario().getAliasRegistry(),
StringUtils.normalized(listAlias)).contains(StringUtils.normalized(alias));
     }
     
-    public String checkListContains(String listAlias, String alias) {
-        return new CheckListContainsForConcordion(getScenario().getAliasRegistry(), StringUtils.normalized(listAlias)).execute(StringUtils.normalized(alias));
+    public String checkCollectionDoesNotContain(String listAlias, String alias) {
+        return new CheckCollectionContentsForConcordion(getScenario().getAliasRegistry(),
StringUtils.normalized(listAlias)).doesNotContain(StringUtils.normalized(alias));
     }
     
-    public String checkListDoesNotContain(String listAlias, String alias) {
-        return new CheckListDoesNotContainForConcordion(getScenario().getAliasRegistry(),
StringUtils.normalized(listAlias)).execute(StringUtils.normalized(alias));
+    public String checkCollectionSize(String listAlias, int size) {
+        return new CheckCollectionContentsForConcordion(getScenario().getAliasRegistry(),
StringUtils.normalized(listAlias)).assertSize(size);
     }
     
     
 
+    // ////////////////////////////////////////////////////////////////////////
+    // check list
+    // ////////////////////////////////////////////////////////////////////////
+
     private CheckListForConcordion checkList;
     
     public String checkList(String listAlias, String title) {

Added: incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckCollectionContentsForConcordion.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckCollectionContentsForConcordion.java?rev=1044420&view=auto
==============================================================================
--- incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckCollectionContentsForConcordion.java
(added)
+++ incubator/isis/trunk/viewer/bdd/concordion/src/main/java/org/apache/isis/viewer/bdd/concordion/internal/fixtures/CheckCollectionContentsForConcordion.java
Fri Dec 10 16:25:52 2010
@@ -0,0 +1,48 @@
+package org.apache.isis.viewer.bdd.concordion.internal.fixtures;
+
+import org.apache.isis.viewer.bdd.common.AliasRegistry;
+import org.apache.isis.viewer.bdd.common.fixtures.CheckCollectionContentsPeer;
+
+public class CheckCollectionContentsForConcordion extends AbstractFixture<CheckCollectionContentsPeer>
{
+
+    public CheckCollectionContentsForConcordion(final AliasRegistry aliasRegistry,
+        final String listAlias) {
+        super(new CheckCollectionContentsPeer(aliasRegistry, listAlias));
+    }
+
+    public String contains(String alias) {
+        if (!getPeer().isValidAlias(alias)) {
+            return "unknown alias '" + alias + "'";
+        }
+        boolean contains = getPeer().contains(alias);
+        return contains?"ok":"does not contain '" + alias + "'";
+    }
+
+    public String doesNotContain(String alias) {
+        if (!getPeer().isValidAlias(alias)) {
+            return "unknown alias '" + alias + "'";
+        }
+        boolean doesNotContain = getPeer().doesNotContain(alias);
+        return doesNotContain?"ok":"does contain";
+    }
+
+
+    public String isEmpty() {
+        boolean isEmpty = getPeer().isEmpty();
+        return isEmpty?"ok":"not empty";
+    }
+
+    
+    public String isNotEmpty() {
+        boolean isNotEmpty = getPeer().isNotEmpty();
+        return isNotEmpty?"ok":"empty";
+    }
+
+
+    public String assertSize(int size) {
+        boolean hasSize = getPeer().assertSize(size);
+        return hasSize?"ok":"contains " + getPeer().getSize() + " objects";
+    }
+
+}
+



Mime
View raw message