You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/03/06 18:35:06 UTC
[04/10] ISIS-695: deleting dir accidentally created ...
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java
deleted file mode 100644
index 14c5616..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java
+++ /dev/null
@@ -1,90 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration;
-
-import app.ToDoItemAnalysis;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
-import org.apache.isis.core.commons.config.IsisConfiguration;
-import org.apache.isis.core.commons.config.IsisConfigurationDefault;
-import org.apache.isis.core.integtestsupport.IsisSystemForTest;
-import org.apache.isis.core.wrapper.WrapperFactoryDefault;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusObjectStore;
-import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
-import org.apache.isis.objectstore.jdo.datanucleus.service.support.IsisJdoSupportImpl;
-
-/**
- * Holds an instance of an {@link IsisSystemForTest} as a {@link ThreadLocal} on the current thread,
- * initialized with ToDo app's domain services.
- */
-public class ToDoSystemInitializer {
-
- private ToDoSystemInitializer(){}
-
- public static IsisSystemForTest initIsft() {
- IsisSystemForTest isft = IsisSystemForTest.getElseNull();
- if(isft == null) {
- isft = new ToDoSystemBuilder().build().setUpSystem();
- IsisSystemForTest.set(isft);
- }
- return isft;
- }
-
- private static class ToDoSystemBuilder extends IsisSystemForTest.Builder {
-
- public ToDoSystemBuilder() {
- //withFixtures( ... reference data fixtures ...); // if we had any...
- withLoggingAt(org.apache.log4j.Level.INFO);
- with(testConfiguration());
- with(new DataNucleusPersistenceMechanismInstaller());
-
- withServices(
- new ToDoItems(),
- new ToDoItemAnalysis(),
- new ToDoItemContributions(),
- new WrapperFactoryDefault(),
- new IsisJdoSupportImpl(),
- new Bulk.InteractionContext(),
- new QueryResultsCache()
- );
- }
-
- private IsisConfiguration testConfiguration() {
- final IsisConfigurationDefault testConfiguration = new IsisConfigurationDefault();
-
- testConfiguration.add("isis.persistor.datanucleus.RegisterEntities.packagePrefix", "dom");
- testConfiguration.add("isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL", "jdbc:hsqldb:mem:test");
-
- testConfiguration.add("isis.persistor.datanucleus.impl.datanucleus.defaultInheritanceStrategy", "TABLE_PER_CLASS");
- testConfiguration.add(DataNucleusObjectStore.INSTALL_FIXTURES_KEY , "true");
-
- testConfiguration.add("isis.persistor.datanucleus.impl.datanucleus.cache.level2.type","none");
-
- testConfiguration.add("isis.persistor.datanucleus.impl.datanucleus.identifier.case", "PreserveCase");
-
- return testConfiguration;
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
deleted file mode 100644
index f800e25..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/BootstrappingGlue.java
+++ /dev/null
@@ -1,59 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.glue;
-
-import integration.ToDoSystemInitializer;
-import cucumber.api.java.After;
-import cucumber.api.java.Before;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.specsupport.scenarios.ScenarioExecutionScope;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-public class BootstrappingGlue extends CukeGlueAbstract {
-
- // //////////////////////////////////////
-
- @Before(value={"@unit"}, order=100)
- public void beforeScenarioUnitScope() {
- before(ScenarioExecutionScope.UNIT);
- }
-
- @Before(value={"@integration"}, order=100)
- public void beforeScenarioIntegrationScope() {
- org.apache.log4j.PropertyConfigurator.configure("logging.properties");
- ToDoSystemInitializer.initIsft();
-
- before(ScenarioExecutionScope.INTEGRATION);
- }
-
- @After
- public void afterScenario(cucumber.api.Scenario sc) {
- assertMocksSatisfied();
- after(sc);
- }
-
- // //////////////////////////////////////
-
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
deleted file mode 100644
index c826d30..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/CatalogOfFixturesGlue.java
+++ /dev/null
@@ -1,50 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.glue;
-
-import cucumber.api.java.Before;
-import dom.todo.ToDoItem;
-import fixture.todo.ToDoItemsFixture;
-
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-public class CatalogOfFixturesGlue extends CukeGlueAbstract {
-
-
- @Before(value={"@unit", "@ToDoItemsFixture"}, order=20000)
- public void unitFixtures() throws Throwable {
- final InMemoryDB inMemoryDB = new InMemoryDBForToDoApp(this.scenarioExecution());
- inMemoryDB.getElseCreate(ToDoItem.class, "Write blog post");
- inMemoryDB.getElseCreate(ToDoItem.class, "Pick up bread");
- final ToDoItem t3 = inMemoryDB.getElseCreate(ToDoItem.class, "Pick up butter");
- t3.setComplete(true);
- putVar("isis", "in-memory-db", inMemoryDB);
- }
-
- // //////////////////////////////////////
-
- @Before(value={"@integration", "@ToDoItemsFixture"}, order=20000)
- public void integrationFixtures() throws Throwable {
- scenarioExecution().install(new ToDoItemsFixture());
- }
-
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
deleted file mode 100644
index 4d8af87..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/InMemoryDBForToDoApp.java
+++ /dev/null
@@ -1,43 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.glue;
-
-import dom.todo.ToDoItem;
-
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.scenarios.ScenarioExecution;
-
-public class InMemoryDBForToDoApp extends InMemoryDB {
-
- public InMemoryDBForToDoApp(ScenarioExecution scenarioExecution) {
- super(scenarioExecution);
- }
-
- /**
- * Hook to initialize if possible.
- */
- @Override
- protected void init(Object obj, String str) {
- if(obj instanceof ToDoItem) {
- ToDoItem toDoItem = (ToDoItem) obj;
- toDoItem.setDescription(str);
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
deleted file mode 100644
index ccbb270..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/glue/todoitem/ToDoItemGlue.java
+++ /dev/null
@@ -1,169 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.glue.todoitem;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-import java.util.Collections;
-import java.util.List;
-
-import com.google.common.base.Predicate;
-import com.google.common.base.Predicates;
-import com.google.common.collect.Iterables;
-import com.google.common.collect.Lists;
-
-import cucumber.api.java.en.Given;
-import cucumber.api.java.en.Then;
-import cucumber.api.java.en.When;
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-
-import org.jmock.Expectations;
-import org.junit.Assert;
-
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.applib.annotation.Bulk.InteractionContext;
-import org.apache.isis.core.specsupport.scenarios.InMemoryDB;
-import org.apache.isis.core.specsupport.specs.CukeGlueAbstract;
-
-public class ToDoItemGlue extends CukeGlueAbstract {
-
- @Given("^there are a number of incomplete ToDo items${symbol_dollar}")
- public void there_are_a_number_of_incomplete_ToDo_items() throws Throwable {
- if(supportsMocks()) {
- checking(new Expectations() {
- {
- allowing(service(ToDoItems.class)).notYetComplete();
- will(returnValue(notYetCompleteItems()));
- }
- });
- }
- try {
- final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
- assertThat(notYetComplete.isEmpty(), is(false));
- putVar("list", "notYetCompleteItems", notYetComplete);
-
- } finally {
- assertMocksSatisfied();
- }
- }
-
- @When("^I choose the first of the incomplete items${symbol_dollar}")
- public void I_choose_the_first_one() throws Throwable {
- @SuppressWarnings("unchecked")
- List<ToDoItem> notYetComplete = getVar(null, "notYetCompleteItems", List.class);
- assertThat(notYetComplete.isEmpty(), is(false));
-
- putVar("todo", "toDoItem", notYetComplete.get(0));
- }
-
- @When("^mark the item as complete${symbol_dollar}")
- public void mark_it_as_complete() throws Throwable {
- final ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- if(supportsMocks()) {
- final Bulk.InteractionContext bulkInteractionContext = service(Bulk.InteractionContext.class);
- checking(new Expectations() {
- {
- allowing(bulkInteractionContext);
- }
- });
- toDoItem.injectBulkInteractionContext(bulkInteractionContext);
- }
- wrap(toDoItem).completed();
- }
-
- @Then("^the item is no longer listed as incomplete${symbol_dollar}")
- public void the_item_is_no_longer_listed_as_incomplete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- whetherNotYetCompletedContains(toDoItem, false);
- }
-
- @Given("^.*completed .*item${symbol_dollar}")
- public void a_completed_ToDo_item() throws Throwable {
- if(supportsMocks()) {
- checking(new Expectations(){{
- allowing(service(ToDoItems.class)).allToDos();
- will(returnValue(findItems(Predicates.<ToDoItem>alwaysTrue()) ));
- }});
- }
- try {
- final List<ToDoItem> allToDos = service(ToDoItems.class).allToDos();
- for (ToDoItem toDoItem : allToDos) {
- if(toDoItem.isComplete()) {
- putVar("todo", "toDoItem", toDoItem);
- return;
- }
- }
- Assert.fail("could not locate any completed ToDo items");
- } finally {
- assertMocksSatisfied();
- }
- }
-
- @When("^I mark the .*item as not yet complete${symbol_dollar}")
- public void I_mark_it_as_not_yet_complete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- assertThat(toDoItem.isComplete(), is(true));
-
- toDoItem.setComplete(false);
- }
-
- @Then("^the .*item is listed as incomplete${symbol_dollar}")
- public void the_item_is_listed_as_incomplete() throws Throwable {
- ToDoItem toDoItem = getVar(null, "toDoItem", ToDoItem.class);
- whetherNotYetCompletedContains(toDoItem, true);
- }
-
- private void whetherNotYetCompletedContains(ToDoItem toDoItem, final boolean whetherContained) {
- if(supportsMocks()) {
- final List<ToDoItem> notYetCompleteItems = notYetCompleteItems();
- checking(new Expectations() {
- {
- oneOf(service(ToDoItems.class)).notYetComplete();
- will(returnValue(notYetCompleteItems));
- }
- });
- }
- try {
- final List<ToDoItem> notYetComplete = service(ToDoItems.class).notYetComplete();
- assertThat(notYetComplete.contains(toDoItem), is(whetherContained));
- } finally {
- assertMocksSatisfied();
- }
- }
-
-
- // helper
- private List<ToDoItem> notYetCompleteItems() {
- return findItems(new Predicate<ToDoItem>(){
- @Override
- public boolean apply(ToDoItem input) {
- return !input.isComplete();
- }
- });
- }
-
- private List<ToDoItem> findItems(final Predicate<ToDoItem> predicate) {
- final InMemoryDB inMemoryDB = getVar("isis", "in-memory-db", InMemoryDB.class);
- final List<ToDoItem> items = inMemoryDB.findAll(ToDoItem.class);
- return Lists.newArrayList(Iterables.filter(items, predicate));
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
deleted file mode 100644
index a0d30e2..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/RunSpecs.java
+++ /dev/null
@@ -1,41 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package integration.specs.todoitem;
-
-import cucumber.api.junit.Cucumber;
-
-import org.junit.runner.RunWith;
-
-
-/**
- * Runs scenarios in all <tt>.feature</tt> files (this package and any subpackages).
- */
-@RunWith(Cucumber.class)
-@Cucumber.Options(
- format = {
- "html:target/cucumber-html-report"
- ,"json:target/cucumber.json"
- },
- glue={"classpath:integration.glue"},
- strict = true,
- tags = { "~@backlog", "~@ignore" })
-public class RunSpecs {
- // intentionally empty
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
deleted file mode 100644
index 9fc1596..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findAndComplete.feature
+++ /dev/null
@@ -1,39 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-@ToDoItemsFixture
-Feature: Find And Complete ToDo Items
-
- # the scenario is listed twice here just to demonstrate that it
- # can be run either at @unit-level scope (using mocks) or
- # at @integration-level scope (against the running system).
-
- @unit
- Scenario: Todo items once completed are no longer listed
- Given there are a number of incomplete ToDo items
- When I choose the first of the incomplete items
- And mark the item as complete
- Then the item is no longer listed as incomplete
-
-
- @integration
- Scenario: Todo items once completed are no longer listed
- Given there are a number of incomplete ToDo items
- When I choose the first of the incomplete items
- And mark the item as complete
- Then the item is no longer listed as incomplete
-
-
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
deleted file mode 100644
index 1f5f73e..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/specs/todoitem/ToDoItemSpec_findCompletedAndMarkAsNotYetComplete.feature
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-@ToDoItemsFixture
-Feature: Find completed ToDoItem and mark as not yet complete
-
- # the scenario is listed twice here just to demonstrate that it
- # can be run either at @unit-level scope (using mocks) or
- # at @integration-level scope (against the running system).
-
- @integration
- Scenario: Todo items can be uncompleted
- Given a completed item
- When I mark the item as not yet complete
- Then the item is listed as incomplete
-
-
- @unit
- Scenario: Todo items can be uncompleted
- Given a completed ToDo item
- When I mark the item as not yet complete
- Then the item is listed as incomplete
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoIntegTest.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoIntegTest.java
deleted file mode 100644
index 4e60a9b..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoIntegTest.java
+++ /dev/null
@@ -1,43 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests;
-
-import integration.ToDoSystemInitializer;
-
-import org.junit.BeforeClass;
-
-import org.apache.isis.core.integtestsupport.IntegrationTestAbstract;
-import org.apache.isis.core.integtestsupport.scenarios.ScenarioExecutionForIntegration;
-
-public abstract class ToDoIntegTest extends IntegrationTestAbstract {
-
-
- @BeforeClass
- public static void initClass() {
- org.apache.log4j.PropertyConfigurator.configure("logging.properties");
- ToDoSystemInitializer.initIsft();
-
- // instantiating will install onto ThreadLocal
- new ScenarioExecutionForIntegration();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemContributionsTest_updateCategory.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemContributionsTest_updateCategory.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemContributionsTest_updateCategory.java
deleted file mode 100644
index ec23d72..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemContributionsTest_updateCategory.java
+++ /dev/null
@@ -1,101 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.actions;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-import fixture.todo.ToDoItemsFixture;
-
-import org.joda.time.LocalDate;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.clock.Clock;
-
-public class ToDoItemContributionsTest_updateCategory extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private ToDoItemContributions toDoItemContributions;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final ToDoItems toDoItems = wrap(service(ToDoItems.class));
- toDoItemContributions = wrap(service(ToDoItemContributions.class));
- final List<ToDoItem> all = toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- toDoItemContributions.updateCategory(toDoItem, Category.Professional, Subcategory.Consulting);
-
- // then
- assertThat(toDoItem.getCategory(), is(Category.Professional));
- assertThat(toDoItem.getSubcategory(), is(Subcategory.Consulting));
-
- // when
- toDoItemContributions.updateCategory(toDoItem, Category.Domestic, Subcategory.Chores);
-
- // then
- assertThat(toDoItem.getCategory(), is(Category.Domestic));
- assertThat(toDoItem.getSubcategory(), is(Subcategory.Chores));
- }
-
-
- @Test
- public void categoryCannotBeNull() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Category is mandatory");
- toDoItemContributions.updateCategory(toDoItem, null, Subcategory.Chores);
- }
-
- @Test
- public void subcategoryCanBeNull() throws Exception {
-
- // when, then
- toDoItemContributions.updateCategory(toDoItem, Category.Professional, null);
- }
-
- @Test
- public void subcategoryMustBelongToCategory() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Invalid subcategory"));
- toDoItemContributions.updateCategory(toDoItem, Category.Professional, Subcategory.Chores);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
deleted file mode 100644
index 7f31f74..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
+++ /dev/null
@@ -1,86 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.actions;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_completed extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.isComplete(), is(false));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(toDoItem.isComplete(), is(true));
- }
-
-
- @Test
- public void cannotCompleteIfAlreadyCompleted() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when, then should fail
- expectedExceptions.expectMessage("Already completed");
- toDoItem.completed();
- }
-
-
- @Test
- public void cannotSetPropertyDirectly() throws Exception {
-
- // given
-
- // when, then should fail
- expectedExceptions.expectMessage("Always disabled");
- toDoItem.setComplete(true);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
deleted file mode 100644
index 20366aa..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
+++ /dev/null
@@ -1,76 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.actions;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.math.BigDecimal;
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.joda.time.LocalDate;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.clock.Clock;
-
-public class ToDoItemTest_duplicate extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private ToDoItem duplicateToDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- final LocalDate todaysDate = Clock.getTimeAsLocalDate();
- toDoItem.setDueBy(todaysDate);
- toDoItem.updateCost(new BigDecimal("123.45"));
-
- duplicateToDoItem = toDoItem.duplicate(
- unwrap(toDoItem).default0Duplicate(),
- unwrap(toDoItem).default1Duplicate(),
- unwrap(toDoItem).default2Duplicate(),
- unwrap(toDoItem).default3Duplicate(),
- new BigDecimal("987.65"));
-
- // then
- assertThat(duplicateToDoItem.getDescription(), is(toDoItem.getDescription() + " - Copy"));
- assertThat(duplicateToDoItem.getCategory(), is(toDoItem.getCategory()));
- assertThat(duplicateToDoItem.getDueBy(), is(todaysDate));
- assertThat(duplicateToDoItem.getCost(), is(new BigDecimal("987.65")));
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
deleted file mode 100644
index f6f33cf..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
+++ /dev/null
@@ -1,76 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.actions;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_notYetCompleted extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(toDoItem.isComplete(), is(false));
- }
-
-
- @Test
- public void cannotUndoIfNotYetCompleted() throws Exception {
-
- // given
- assertThat(toDoItem.isComplete(), is(false));
-
- // when, then should fail
- expectedExceptions.expectMessage("Not yet completed");
- toDoItem.notYetCompleted();
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java
deleted file mode 100644
index 48a11a3..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java
+++ /dev/null
@@ -1,69 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.colls;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-import fixture.todo.ToDoItemsFixture;
-
-import org.joda.time.LocalDate;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.clock.Clock;
-
-public class ToDoItemContributionsTest_similarTo extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private ToDoItemContributions toDoItemContributions;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final ToDoItems toDoItems = wrap(service(ToDoItems.class));
- toDoItemContributions = wrap(service(ToDoItemContributions.class));
- final List<ToDoItem> all = toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- List<ToDoItem> similarItems = toDoItemContributions.similarTo(toDoItem);
-
- // then
- assertThat(similarItems.size(), is(6));
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
deleted file mode 100644
index e6bc674..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
+++ /dev/null
@@ -1,92 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.colls;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_dependencies_add extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private ToDoItem otherToDoItem;
-
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> items = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(items.get(0));
- otherToDoItem = items.get(1); // wrapping this seems to trip up cglib :-(
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDependencies().size(), is(0));
-
- // when
- toDoItem.add(otherToDoItem);
-
- // then
- assertThat(toDoItem.getDependencies().size(), is(1));
- assertThat(toDoItem.getDependencies().first(), is(unwrap(otherToDoItem)));
- }
-
-
- @Test
- public void cannotDependOnSelf() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Can't set up a dependency to self");
- toDoItem.add(toDoItem);
- }
-
- @Test
- public void cannotAddDependencyIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when, then
- expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
- toDoItem.add(otherToDoItem);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
deleted file mode 100644
index c417d12..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
+++ /dev/null
@@ -1,96 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.colls;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_dependencies_remove extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private ToDoItem otherToDoItem;
- private ToDoItem yetAnotherToDoItem;
-
-
- @Before
- public void setUp() throws Exception {
- // given
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> items = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(items.get(0));
- otherToDoItem = items.get(1); // wrapping this seems to trip up cglib :-(
- yetAnotherToDoItem = items.get(2); // wrapping this seems to trip up cglib :-(
-
- toDoItem.add(otherToDoItem);
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDependencies().size(), is(1));
-
- // when
- toDoItem.remove(otherToDoItem);
-
- // then
- assertThat(toDoItem.getDependencies().size(), is(0));
- }
-
-
- @Test
- public void cannotRemoveItemIfNotADepedndency() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Not a dependency");
- toDoItem.remove(yetAnotherToDoItem);
- }
-
- @Test
- public void cannotRemoveDependencyIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // when, then
- expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
- toDoItem.remove(otherToDoItem);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
deleted file mode 100644
index ffa6a11..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
+++ /dev/null
@@ -1,71 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemContributionsTest_priority extends ToDoIntegTest {
-
- private ToDoItemContributions toDoItemContributions;
-
- private List<ToDoItem> notYetComplete;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final ToDoItems toDoItems = wrap(service(ToDoItems.class));
- toDoItemContributions = service(ToDoItemContributions.class);
- notYetComplete = toDoItems.notYetComplete();
- }
-
- @Test
- public void happyCase() throws Exception {
- assertPriority(0, 1);
- assertPriority(1, 2);
- assertPriority(2, 4);
- assertPriority(3, 6);
- assertPriority(4, 5);
- assertPriority(5, 7);
- assertPriority(6, 9);
- assertPriority(7, 8);
- assertPriority(8, 3);
- assertPriority(9, 10);
- }
-
- private void assertPriority(final int n, final int priority) {
- assertThat(toDoItemContributions.relativePriority(notYetComplete.get(n)), is(Integer.valueOf(priority)));
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
deleted file mode 100644
index 9f9060e..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
+++ /dev/null
@@ -1,81 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.nio.charset.Charset;
-import java.util.List;
-
-import javax.activation.MimeType;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.value.Blob;
-
-public class ToDoItemTest_attachment extends ToDoIntegTest {
-
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
-
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- byte[] bytes = "{${symbol_escape}"foo${symbol_escape}": ${symbol_escape}"bar${symbol_escape}"}".getBytes(Charset.forName("UTF-8"));
- final Blob newAttachment = new Blob("myfile.json", new MimeType("application/json"), bytes);
-
- // when
- toDoItem.setAttachment(newAttachment);
-
- // then
- assertThat(toDoItem.getAttachment(), is(newAttachment));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setAttachment((Blob)null);
-
- // then
- assertThat(toDoItem.getAttachment(), is((Blob)null));
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
deleted file mode 100644
index 6d3726b..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
+++ /dev/null
@@ -1,56 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import dom.todo.ToDoItem.Category;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_category extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
- toDoItem.setCategory(Category.Professional);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
deleted file mode 100644
index 10816e3..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
+++ /dev/null
@@ -1,95 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.math.BigDecimal;
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_cost extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
- private BigDecimal cost;
-
- @Before
- public void setUp() throws Exception {
- // given
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- cost = toDoItem.getCost();
- }
-
- @Test
- public void happyCaseUsingProperty() throws Exception {
-
- final BigDecimal newCost = new BigDecimal("123.45");
-
- // when
- toDoItem.updateCost(newCost);
-
- // then
- assertThat(toDoItem.getCost(), is(newCost));
- }
-
- @Test
- public void happyCaseUsingAction() throws Exception {
-
- final BigDecimal newCost = new BigDecimal("123.45");
-
- // when
- toDoItem.updateCost(newCost);
-
- // then
- assertThat(toDoItem.getCost(), is(newCost));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.updateCost((BigDecimal)null);
-
- // then
- assertThat(toDoItem.getCost(), is((BigDecimal)null));
- }
-
- @Test
- public void defaultForAction() throws Exception {
-
- // then
- assertThat(unwrap(toDoItem).default0UpdateCost(), is(cost));
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
deleted file mode 100644
index 7c2aaa1..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
+++ /dev/null
@@ -1,102 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_description extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.setDescription("Buy bread and butter");
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread and butter"));
- }
-
-
- @Test
- public void failsRegex() throws Exception {
-
- // when
- expectedExceptions.expectMessage("Doesn't match pattern");
- toDoItem.setDescription("exclamation marks are not allowed!!!");
- }
-
- @Test
- public void cannotBeNull() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Mandatory");
- toDoItem.setDescription(null);
- }
-
- @Test
- public void onlyJustShortEnough() throws Exception {
-
- // when, then
- toDoItem.setDescription(characters(100));
- }
-
- @Test
- public void tooLong() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("The value proposed exceeds the maximum length of 100");
- toDoItem.setDescription(characters(101));
- }
-
- private static String characters(final int n) {
- StringBuffer buf = new StringBuffer();
- for(int i=0; i<n; i++) {
- buf.append("a");
- }
- return buf.toString();
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
deleted file mode 100644
index 6f6f2eb..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
+++ /dev/null
@@ -1,99 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.joda.time.LocalDate;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import org.apache.isis.applib.clock.Clock;
-
-public class ToDoItemTest_dueBy extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().plusDays(5);
- toDoItem.setDueBy(fiveDaysFromNow);
-
- // then
- assertThat(toDoItem.getDueBy(), is(fiveDaysFromNow));
- }
-
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setDueBy((LocalDate)null);
-
- // then
- assertThat(toDoItem.getDueBy(), is((LocalDate)null));
- }
-
- @Test
- public void canBeUpToSixDaysInPast() throws Exception {
-
- final LocalDate nowAsLocalDate = Clock.getTimeAsLocalDate();
- final LocalDate sixDaysAgo = nowAsLocalDate.plusDays(-5);
-
- // when
- toDoItem.setDueBy(sixDaysAgo);
-
- // then
- assertThat(toDoItem.getDueBy(), is(sixDaysAgo));
- }
-
-
- @Test
- public void cannotBeMoreThanSixDaysInPast() throws Exception {
-
- final LocalDate sevenDaysAgo = Clock.getTimeAsLocalDate().plusDays(-7);
-
- // when, then
- expectedExceptions.expectMessage("Due by date cannot be more than one week old");
- toDoItem.setDueBy(sevenDaysAgo);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
deleted file mode 100644
index bce40e6..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
+++ /dev/null
@@ -1,73 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_notes extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- // given
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- final String newNotes = "Lorem ipsum yada yada";
-
- // when
- toDoItem.setNotes(newNotes);
-
- // then
- assertThat(toDoItem.getNotes(), is(newNotes));
- }
-
- @Test
- public void canBeNull() throws Exception {
-
- // when
- toDoItem.setNotes((String)null);
-
- // then
- assertThat(toDoItem.getNotes(), is((String)null));
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
deleted file mode 100644
index fa5af04..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
+++ /dev/null
@@ -1,59 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import dom.todo.ToDoItem.Category;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_ownedBy extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage("Always hidden");
- toDoItem.setOwnedBy("other");
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/c4752a8c/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
----------------------------------------------------------------------
diff --git a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java b/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
deleted file mode 100644
index 48fac31..0000000
--- a/example/archetype/quickstart_wicket_restful_jdo/archetype/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
+++ /dev/null
@@ -1,56 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package integration.tests.props;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Subcategory;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixture;
-
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_subcategory extends ToDoIntegTest {
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- scenarioExecution().install(new ToDoItemsFixture());
-
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void cannotModify() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
- toDoItem.setSubcategory(Subcategory.Chores);
- }
-}