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/07/21 09:01:15 UTC
[01/14] git commit: ISIS-839: updating pom.xml for Wicket viewer to
reference non-SNAPSHOT parents.
Repository: isis
Updated Branches:
refs/heads/prepare/isis-1.6.0 d34fdddad -> 5831e9807
ISIS-839: updating pom.xml for Wicket viewer to reference non-SNAPSHOT parents.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/8014f5e4
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/8014f5e4
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/8014f5e4
Branch: refs/heads/prepare/isis-1.6.0
Commit: 8014f5e4b64d60aadf3a8ae3eaf07c71f507ba98
Parents: d34fddd
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 11:10:33 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 11:10:33 2014 +0100
----------------------------------------------------------------------
component/viewer/wicket/pom.xml | 2 +-
component/viewer/wicket/tck/pom.xml | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/8014f5e4/component/viewer/wicket/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/pom.xml b/component/viewer/wicket/pom.xml
index e8fbe9d..318aeb6 100644
--- a/component/viewer/wicket/pom.xml
+++ b/component/viewer/wicket/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.core</groupId>
<artifactId>isis</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<relativePath>../../../core/pom.xml</relativePath>
</parent>
http://git-wip-us.apache.org/repos/asf/isis/blob/8014f5e4/component/viewer/wicket/tck/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/tck/pom.xml b/component/viewer/wicket/tck/pom.xml
index 6614337..bf4b3f2 100644
--- a/component/viewer/wicket/tck/pom.xml
+++ b/component/viewer/wicket/tck/pom.xml
@@ -23,7 +23,7 @@
<parent>
<groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-tck</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<relativePath>../../../../core/tck/pom.xml</relativePath>
</parent>
[06/14] ISIS-839: updating todoapp archetype
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
index 49f9ff2..80eb250 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -140,7 +140,7 @@ ${symbol_pound}
${symbol_pound} Providing such capabilities as i18n
${symbol_pound}
-isis.reflector.facet-decorators=org.apache.isis.core.progmodel.facetdecorators.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
+isis.reflector.facet-decorators=org.apache.isis.core.metamodel.facetdecorator.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
@@ -157,78 +157,44 @@ ${symbol_pound} the set of the classes for Isis to instantiate as domain service
${symbol_pound} From these domain service instances the rest of the metamodel is discovered, while the
${symbol_pound} end-user gains access to other domain objects by invoking the actions of the domain services.
${symbol_pound}
-
+isis.services-installer=configuration-and-annotation
+isis.services.ServicesInstallerFromAnnotation.packagePrefix=app,${symbol_escape}
+ dom.todo,${symbol_escape}
+ fixture.todo,${symbol_escape}
+ webapp.admin,${symbol_escape}
+ webapp.prototyping
${symbol_pound}isis.services.prefix =
isis.services = ${symbol_escape}
- 10:dom.todo.ToDoItems,${symbol_escape}
- 20:app.ToDoItemAnalysis,${symbol_escape}
- 30:webapp.admin.Admin,${symbol_escape}
- 30:webapp.admin.AdminContributions,${symbol_escape}
- ${symbol_escape}
- 40:fixture.todo.ToDoItemsFixturesService,${symbol_escape}
- 40:webapp.prototyping.DeveloperUtilities,${symbol_escape}
- 40:webapp.prototyping.ExternalLinksService,${symbol_escape}
- ${symbol_escape}
- app.ToDoAppDashboardService,${symbol_escape}
- app.ToDoItemAnalysisContributions,${symbol_escape}
- dom.todo.ToDoItemContributions,${symbol_escape}
- dom.todo.ToDoItemSubscriptions,${symbol_escape}
+ org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions,${symbol_escape}
${symbol_escape}
- ${symbol_pound} supporting services if using JDO objectstore, ${symbol_escape}
+ ${symbol_pound} customizable exception handling for JDO objectstore, ${symbol_escape}
org.apache.isis.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore,${symbol_escape}
- org.apache.isis.objectstore.jdo.datanucleus.service.support.IsisJdoSupportImpl,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} Core implementation of the various bookmark/memento services, ${symbol_escape}
- org.apache.isis.core.metamodel.services.bookmarks.BookmarkServiceDefault,${symbol_escape}
- org.apache.isis.core.runtime.services.memento.MementoServiceDefault,${symbol_escape}
- org.apache.isis.core.runtime.services.xmlsnapshot.XmlSnapshotServiceDefault,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} Core implementation of a clock service, ${symbol_escape}
- org.apache.isis.applib.services.clock.ClockService,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} Core implementation of the various (inter)action services, ${symbol_escape}
- org.apache.isis.applib.services.command.CommandContext,${symbol_escape}
- org.apache.isis.applib.annotation.Bulk${symbol_dollar}InteractionContext,${symbol_escape}
- org.apache.isis.applib.services.scratchpad.Scratchpad,${symbol_escape}
- org.apache.isis.applib.services.queryresultscache.QueryResultsCache,${symbol_escape}
- org.apache.isis.core.wrapper.WrapperFactoryDefault,${symbol_escape}
- org.apache.isis.applib.services.classdiscovery.ClassDiscoveryServiceUsingReflections,${symbol_escape}
${symbol_escape}
- ${symbol_pound} JDO implementation of the EventBusService, ${symbol_escape}
- org.apache.isis.objectstore.jdo.datanucleus.service.eventbus.EventBusServiceJdo,${symbol_escape}
+ ${symbol_pound} isis-module-background services (depends on: isis-module-command-jdo), ${symbol_escape}
+ org.apache.isis.core.runtime.services.background.BackgroundServiceDefault,${symbol_escape}
${symbol_escape}
- ${symbol_pound} JDO implementation of the CommandService, ${symbol_escape}
+ ${symbol_pound} isis-module-command-jdo services, ${symbol_escape}
org.apache.isis.objectstore.jdo.applib.service.command.CommandServiceJdo,${symbol_escape}
org.apache.isis.objectstore.jdo.applib.service.command.CommandServiceJdoContributions,${symbol_escape}
- org.apache.isis.objectstore.jdo.applib.service.command.CommandServiceJdoRepository,${symbol_escape}
+ org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdoContributions,${symbol_escape}
${symbol_escape}
- ${symbol_pound} JDO implementation of the AuditingService, ${symbol_escape}
+ ${symbol_pound} isis-module-audit-jdo services, ${symbol_escape}
org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdo,${symbol_escape}
org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdoContributions,${symbol_escape}
- org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdoRepository,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} Core implementation of BackgroundService (depends on: MementoService & BackgroundCommandService & CommandContext service), ${symbol_escape}
- org.apache.isis.core.runtime.services.background.BackgroundServiceDefault,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} JDO implementation of the BackgroundCommandService (depends on: CommandContext service), ${symbol_escape}
- org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdo,${symbol_escape}
- org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdoContributions,${symbol_escape}
- org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdoRepository,${symbol_escape}
${symbol_escape}
- ${symbol_pound} JDO implementation of the PublishingService (depends on: CommandContext service), ${symbol_escape}
+ ${symbol_pound} isis-module-publishing-jdo services, ${symbol_escape}
org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdo,${symbol_escape}
org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdoContributions,${symbol_escape}
- org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdoRepository,${symbol_escape}
- org.apache.isis.viewer.restfulobjects.rendering.eventserializer.RestfulObjectsSpecEventSerializer,${symbol_escape}
${symbol_escape}
${symbol_pound} JDO implementation of the two SettingsServices, ${symbol_escape}
- ${symbol_pound}org.apache.isis.objectstore.jdo.applib.service.settings.ApplicationSettingsServiceJdo,${symbol_escape}
- ${symbol_pound}org.apache.isis.objectstore.jdo.applib.service.settings.UserSettingsServiceJdo,${symbol_escape}
+ ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.settings.ApplicationSettingsServiceJdo,${symbol_escape}
+ ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.settings.UserSettingsServiceJdo,${symbol_escape}
${symbol_escape}
${symbol_pound} Core (example) implementations of auditing and publishing services, ${symbol_escape}
- ${symbol_pound}org.apache.isis.applib.services.audit.AuditingService3${symbol_dollar}Stderr,${symbol_escape}
- ${symbol_pound}org.apache.isis.applib.services.publish.PublishingService${symbol_dollar}Stderr,${symbol_escape}
+ ${symbol_pound} org.apache.isis.applib.services.audit.AuditingService3${symbol_dollar}Stderr,${symbol_escape}
+ ${symbol_pound} org.apache.isis.applib.services.publish.PublishingService${symbol_dollar}Stderr,${symbol_escape}
+ ${symbol_pound}
${symbol_pound} Specify the (optional) test fixtures
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
index 0b6d023..9720880 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/logging.properties
@@ -71,6 +71,12 @@ log4j.appender.connection.Append=false
log4j.appender.connection.layout=org.apache.log4j.PatternLayout
log4j.appender.connection.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %m%n
+log4j.appender.wicket.i18n=org.apache.log4j.RollingFileAppender
+log4j.appender.wicket.i18n.file=./logs/wicket-i18n.log
+log4j.appender.wicket.i18n.append=false
+log4j.appender.wicket.i18n.layout=org.apache.log4j.PatternLayout
+log4j.appender.wicket.i18n.layout.ConversionPattern=%d [%-20c{1} %-10t %-5p] %m%n
+
@@ -163,6 +169,32 @@ ${symbol_pound}log4j.additivity.org.apache.isis.viewer.wicket.viewer.integration
+${symbol_pound} to track Wicket i18n
+log4j.logger.org.apache.wicket.Localizer=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.Localizer=false
+
+log4j.logger.org.apache.wicket.resource.loader.ClassStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ClassStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.ComponentStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ComponentStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.PackageStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.PackageStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.BundleStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.BundleStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.InitializerStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.InitializerStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.resource.loader.ValidatorStringResourceLoader=false
+
+log4j.logger.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=WARN,Console,wicket.i18n
+log4j.additivity.org.apache.wicket.core.util.resource.locator.ExtensionResourceNameIterator=false
+
+
${symbol_pound} quieten some of the noisier classes in Isis' bootstrapping
log4j.logger.org.apache.isis.core.metamodel.specloader.specimpl.FacetedMethodsBuilder=WARN,Console
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
index 6c96534..fe47df4 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/persistor.properties
@@ -94,14 +94,14 @@ ${symbol_pound}
${symbol_pound} MS SQL Server
${symbol_pound}
${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=com.microsoft.sqlserver.jdbc.SQLServerDriver
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=quickstart
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=sa
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=p4ssword
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
${symbol_pound}
${symbol_pound} MS SQL Server (using log4jdbc-remix)
${symbol_pound}
${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionDriverName=net.sf.log4jdbc.DriverSpy
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:sqlserver://127.0.0.1:1433;instance=SQLEXPRESS;databaseName=jdo
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=jdo
-${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=jdopass
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionURL=jdbc:log4jdbc:sqlserver://127.0.0.1:1433;instance=.;databaseName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionUserName=isis
+${symbol_pound}isis.persistor.datanucleus.impl.javax.jdo.option.ConnectionPassword=isis
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
index 2263069..8c5f7d3 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/shiro.ini
@@ -84,6 +84,16 @@ securityManager.realms = $realm1,$realm2
+#######
+# optional, configure realm(s) to use Isis' extended permission syntax
+# (see webapp/realm1.ini for usage)
+#######
+
+# permissionResolver = org.apache.isis.security.shiro.authorization.IsisPermissionResolver
+# realm1.permissionResolver = $permissionResolver
+# realm2.permissionResolver = $permissionResolver
+
+
# -----------------------------------------------------------------------------
# Users and their assigned roles
# -----------------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
index e461216..e5255f3 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
@@ -63,18 +63,17 @@ ${symbol_pound}wrapper {
<a href="http://isis.apache.org">Apache Isis</a>™ is a framework to let you rapidly develop
domain-driven apps in Java. This app has been generated using Isis'
<a href="http://isis.apache.org/getting-started/quickstart-archetype.html">quickstart</a> archetype,
- which configures Isis' most commonly used components as part of a straightforward
- "todo" app.
+ which configures Isis' most commonly used components as part of a (quite feature rich) "todo" app.
<p>
The app itself consists of a single domain class, <tt>ToDoItem</tt>, along with a number of supporting
- services. You are free to strip it back and reuse for your own purposes.
+ services.
</p>
<p>
- Alternatively, if stripping back this app is too much work, you might want to start with the even simpler
- <a href="http://isis.apache.org/getting-started/simple-archetype.html">simple</a> archetype, and use this
- app by way of reference.
+ To build your own app, while you could start with this todo app and remove/rename as required, you are
+ probably better off using the extremely minimal
+ <a href="http://isis.apache.org/getting-started/simple-archetype.html">simple</a> archetype.
</p>
<p>
@@ -115,7 +114,7 @@ ${symbol_pound}wrapper {
</table>
<p>
- The default user/password is <i>sven/pass</i> (as configured in the
+ The default user/password is <b><i>sven/pass</i></b> (as configured in the
<a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/webapp/src/main/webapp/WEB-INF/shiro.ini">shiro.ini</a> file).
</p>
@@ -135,25 +134,23 @@ ${symbol_pound}wrapper {
</li>
</ul>
</li>
- <li>Fixture classes (in <tt>fixture</tt> module and <tt>webapp</tt> module)
+ <li>Fixture scripts (in <tt>fixture</tt> module)
<ul>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixture.java"><tt>ToDoItemsFixture</tt></a> example fixture data (since configured for in-memory HSQLDB)
- </li>
- <li><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/webapp/src/main/java/webapp/prototyping/ToDoItemsFixturesService.java"><tt>ToDoItemsFixtureService</tt></a> domain service to install fixtures at run-time
+ <li><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java"><tt>ToDoItemsFixtureService</tt></a> domain service to install fixtures at run-time
</li>
</ul>
</li>
<li><tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart%5Fwicket_restful_jdo/webapp/src/main/webapp/WEB-INF/web.xml">WEB-INF/web.xml</a></tt> (in <tt>webapp</tt> module)
<ul>
- <li><tt>AboutPageFilter</tt> - filter that redirects to this page
- </li>
- <li><tt>ResourceCachingFilter</tt> and <tt>ResourceServlet</tt> - filter and servlet for serving up static resources.
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L98">ResourceCachingFilter</a></tt> and <tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L134">ResourceServlet</a></tt> - filter and servlet for serving up static resources.
</li>
- <li><tt>WicketFilter</tt> - filter for the wicket application, mapped to <tt>/wicket/*</tt>
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L174">WicketFilter</a></tt> - filter for the wicket application, mapped to <tt>/wicket/*</tt>
</li>
- <li><tt>ResteasyBootstrap</tt>, <tt>IsisSessionFilterForRestfulObjects</tt>, <tt>RestfulObjectsRestEasyDispatcher</tt> - listeners, filters and servlets to bootstrap and map restful objects viewer to <tt>/restful/*</tt>.
+ <li><tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L223">ResteasyBootstrap</a></tt>,
+ <tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L240">IsisSessionFilterForRestfulObjects</a></tt>,
+ <tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L271">RestfulObjectsRestEasyDispatcher</a></tt> - listeners, filters and servlets to bootstrap and map restful objects viewer to <tt>/restful/*</tt>.
</li>
- <li>commented out <tt>IsisWebAppBootstrapper</tt> listener; this is NOT required unless wicket viewer config is removed
+ <li>commented out <tt><a href="https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/webapp/src/main/webapp/WEB-INF/web.xml${symbol_pound}L208">IsisWebAppBootstrapper</a></tt> listener; this is NOT required unless wicket viewer config is removed
</li>
</ul>
</li>
@@ -187,29 +184,6 @@ ${symbol_pound}wrapper {
</ul>
</li>
</ul>
-
- <h2>Next steps</h2>
- <p>Use the following as a check-list for refactoring towards your own application:
- <ul>
- <li>Experiment with users, roles and permissions (in <tt>shiro.ini</tt>)
- </li>
- <li>Refactor the <tt>ToDoItem</tt>, <tt>ToDoItems</tt> and <tt>ToDoItemsJdo</tt> towards your own application's functionality; obviously you are likely to introduce many more classes and services
- </li>
- <li>Reconfigure <tt>persistor.properties</tt> to specify the JDBC URL to the database you wish to work with; if necessary also update the <tt>pom.xml</tt> in the <tt>webapp</tt> module to add the JDBC driver to the classpath
- </li>
- <li>Fine-tune other RDBMS settings in <tt>persistor_datanucleus.properties</tt>
- </li>
- <li>Assuming you are using a persistent data store, then remove the <tt>ToDoItemsFixtureService</tt> from the <tt>isis.properties</tt> file (<tt>isis.services</tt> key). Alternatively you could keep but refactor to provide a similar service for your own application's domain.
- </li>
- <li>Replace (or remove) the publishing and auditing service implementations.
- </li>
- <li>If you want the wicket viewer but NOT the restful objects viewer, then remove/comment out the <tt>ResteasyBootstrap</tt>, <tt>IsisSessionFilterForRestfulObjects</tt>, <tt>RestfulObjectsRestEasyDispatcher</tt> from <tt>web.xml</tt>
- </li>
- <li>If you want the restful objects viewer but NOT the wicket viewer, then remove/comment out the <tt>WicketFilter</tt> filter and uncomment the <tt>IsisWebAppBootstrapper</tt> listener in <tt>web.xml</tt>
- </li>
- <li>Update this page (<tt>about/index.html</tt>) as required for your application, and/or remove the <tt>welcome-file-list</tt> from <tt>web.xml</tt>
- </li>
- </ul>
</div>
</body>
</html>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
index 639d1c3..ac67314 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/webapp/css/application.css
@@ -77,4 +77,4 @@ li.x-highlight a {
div.x-key span.scalarName {
color: red;
}
-}
\ No newline at end of file
+
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
index 89bcac7..fd1bb2d 100644
--- a/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/todoapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Mon Jun 02 13:50:06 BST 2014
+#Sat Jul 19 12:20:35 BST 2014
package=it.pkg
version=0.1-SNAPSHOT
groupId=archetype.it
[04/14] git commit: [maven-release-plugin] prepare for next
development iteration
Posted by da...@apache.org.
[maven-release-plugin] prepare for next development iteration
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/c26bc604
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/c26bc604
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/c26bc604
Branch: refs/heads/prepare/isis-1.6.0
Commit: c26bc604aba2f53b6d8303e7f3346fd04eb33fc1
Parents: 11e3c88
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 11:17:24 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 11:17:24 2014 +0100
----------------------------------------------------------------------
component/viewer/wicket/applib/pom.xml | 2 +-
component/viewer/wicket/impl/pom.xml | 2 +-
component/viewer/wicket/model/pom.xml | 2 +-
component/viewer/wicket/pom.xml | 20 ++++++++------------
component/viewer/wicket/tck/pom.xml | 8 ++------
component/viewer/wicket/ui/pom.xml | 2 +-
6 files changed, 14 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/c26bc604/component/viewer/wicket/applib/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/applib/pom.xml b/component/viewer/wicket/applib/pom.xml
index abbaa67..6c079f6 100644
--- a/component/viewer/wicket/applib/pom.xml
+++ b/component/viewer/wicket/applib/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>isis-viewer-wicket-applib</artifactId>
http://git-wip-us.apache.org/repos/asf/isis/blob/c26bc604/component/viewer/wicket/impl/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/pom.xml b/component/viewer/wicket/impl/pom.xml
index 1f4917f..7e98dff 100644
--- a/component/viewer/wicket/impl/pom.xml
+++ b/component/viewer/wicket/impl/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
</parent>
<name>Isis Wicket Viewer Implementation</name>
http://git-wip-us.apache.org/repos/asf/isis/blob/c26bc604/component/viewer/wicket/model/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/pom.xml b/component/viewer/wicket/model/pom.xml
index 0f896e3..9093154 100644
--- a/component/viewer/wicket/model/pom.xml
+++ b/component/viewer/wicket/model/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>isis-viewer-wicket-model</artifactId>
http://git-wip-us.apache.org/repos/asf/isis/blob/c26bc604/component/viewer/wicket/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/pom.xml b/component/viewer/wicket/pom.xml
index 7b23370..b3d60d0 100644
--- a/component/viewer/wicket/pom.xml
+++ b/component/viewer/wicket/pom.xml
@@ -30,7 +30,7 @@
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
<name>Isis Wicket Viewer</name>
@@ -101,41 +101,41 @@
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-applib</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-model</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-model</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-ui</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-ui</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-impl</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-impl</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
@@ -321,8 +321,4 @@
</dependencies>
</dependencyManagement>
-
- <scm>
- <tag>isis-viewer-wicket-1.6.0-RC1</tag>
- </scm>
</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/c26bc604/component/viewer/wicket/tck/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/tck/pom.xml b/component/viewer/wicket/tck/pom.xml
index d32ec0f..6d9eb7a 100644
--- a/component/viewer/wicket/tck/pom.xml
+++ b/component/viewer/wicket/tck/pom.xml
@@ -29,13 +29,13 @@
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-tck</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
<name>Isis Wicket Viewer TCK tests</name>
<properties>
- <isis-viewer-wicket.version>1.6.0</isis-viewer-wicket.version>
+ <isis-viewer-wicket.version>1.7.0-SNAPSHOT</isis-viewer-wicket.version>
<siteBaseDir>..</siteBaseDir>
<relativeUrl>wicket-tck/</relativeUrl>
<!-- until someone comes up with a better solution -->
@@ -114,8 +114,4 @@
</dependency>
</dependencies>
-
- <scm>
- <tag>isis-viewer-wicket-1.6.0-RC1</tag>
- </scm>
</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/c26bc604/component/viewer/wicket/ui/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/pom.xml b/component/viewer/wicket/ui/pom.xml
index 2e96c9c..f783d98 100644
--- a/component/viewer/wicket/ui/pom.xml
+++ b/component/viewer/wicket/ui/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
</parent>
<artifactId>isis-viewer-wicket-ui</artifactId>
[05/14] git commit: ISIS-839: updating simpleapp archetype for 1.6.0
Posted by da...@apache.org.
ISIS-839: updating simpleapp archetype for 1.6.0
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/20a89ba1
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/20a89ba1
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/20a89ba1
Branch: refs/heads/prepare/isis-1.6.0
Commit: 20a89ba1d69883500cc55fc8b52cca8f05124ddf
Parents: c26bc60
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 12:18:29 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 12:18:29 2014 +0100
----------------------------------------------------------------------
.../src/main/java/dom/simple/SimpleObjects.java | 2 +-
.../simple/SimpleObjectsFixturesService.java | 2 +-
example/application/simpleapp/pom.xml | 4 +-
example/application/todoapp/pom.xml | 4 +-
example/archetype/simpleapp/pom.xml | 8 +--
.../META-INF/maven/archetype-metadata.xml | 2 +-
.../resources/archetype-resources/dom/pom.xml | 23 ++++--
.../src/main/java/dom/simple/SimpleObjects.java | 6 +-
.../archetype-resources/fixture/pom.xml | 2 +-
.../fixture/simple/SimpleObjectsFixture.java | 14 ++--
.../simple/SimpleObjectsFixturesService.java | 70 ++++++++++++++++++
.../archetype-resources/integtests/pom.xml | 10 +--
.../integration/SimpleAppSystemInitializer.java | 22 +++---
.../main/resources/archetype-resources/pom.xml | 33 +--------
.../launch/SimpleApp-PROTOTYPE-jrebel.launch | 2 +-
.../SimpleApp-PROTOTYPE-no-fixtures.launch | 2 +-
.../SimpleApp-PROTOTYPE-with-fixtures.launch | 2 +-
.../launch/SimpleApp-SERVER-no-fixtures.launch | 2 +-
.../archetype-resources/webapp/pom.xml | 76 +++++++++++++++++---
.../webapp/prototyping/DeveloperUtilities.java | 4 +-
.../SimpleObjectsFixturesService.java | 71 ------------------
.../src/main/webapp/WEB-INF/isis.properties | 63 +++++-----------
.../webapp/src/main/webapp/about/index.html | 2 +-
.../projects/basic/archetype.properties | 2 +-
24 files changed, 222 insertions(+), 206 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/application/simpleapp/dom/src/main/java/dom/simple/SimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/dom/src/main/java/dom/simple/SimpleObjects.java b/example/application/simpleapp/dom/src/main/java/dom/simple/SimpleObjects.java
index 0df6bd2..f7e9038 100644
--- a/example/application/simpleapp/dom/src/main/java/dom/simple/SimpleObjects.java
+++ b/example/application/simpleapp/dom/src/main/java/dom/simple/SimpleObjects.java
@@ -23,7 +23,7 @@ import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.annotation.*;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
-@DomainService(menuOrder = "2", repositoryFor = SimpleObject.class)
+@DomainService(menuOrder = "10", repositoryFor = SimpleObject.class)
public class SimpleObjects {
//region > identification in the UI
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/application/simpleapp/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java b/example/application/simpleapp/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java
index 12a9e2b..fcb6c49 100644
--- a/example/application/simpleapp/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java
+++ b/example/application/simpleapp/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java
@@ -32,7 +32,7 @@ import org.apache.isis.applib.fixturescripts.SimpleFixtureScript;
* Enables fixtures to be installed from the application.
*/
@Named("Prototyping")
-@DomainService(menuOrder = "1")
+@DomainService(menuOrder = "20")
public class SimpleObjectsFixturesService extends FixtureScripts {
public SimpleObjectsFixturesService() {
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/application/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/simpleapp/pom.xml b/example/application/simpleapp/pom.xml
index de6115e..91f5399 100644
--- a/example/application/simpleapp/pom.xml
+++ b/example/application/simpleapp/pom.xml
@@ -34,8 +34,8 @@
</prerequisites>
<properties>
- <isis.version>1.6.0-SNAPSHOT</isis.version>
- <isis-viewer-wicket.version>1.6.0-SNAPSHOT</isis-viewer-wicket.version>
+ <isis.version>1.6.0</isis.version>
+ <isis-viewer-wicket.version>1.6.0</isis-viewer-wicket.version>
<!-- must be consistent with the versions defined by the JDO Objectstore -->
<datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/application/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/application/todoapp/pom.xml b/example/application/todoapp/pom.xml
index 158a31d..1d40e99 100644
--- a/example/application/todoapp/pom.xml
+++ b/example/application/todoapp/pom.xml
@@ -34,8 +34,8 @@
</prerequisites>
<properties>
- <isis.version>1.6.0-SNAPSHOT</isis.version>
- <isis-viewer-wicket.version>1.6.0-SNAPSHOT</isis-viewer-wicket.version>
+ <isis.version>1.6.0</isis.version>
+ <isis-viewer-wicket.version>1.6.0</isis-viewer-wicket.version>
<!-- must be consistent with the versions defined by the JDO Objectstore -->
<datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/pom.xml b/example/archetype/simpleapp/pom.xml
index 47267fa..cd61e80 100644
--- a/example/archetype/simpleapp/pom.xml
+++ b/example/archetype/simpleapp/pom.xml
@@ -17,13 +17,13 @@
specific language governing permissions and limitations
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.isis.archetype</groupId>
- <artifactId>simple_wicket_restful_jdo-archetype</artifactId>
+ <artifactId>simpleapp-archetype</artifactId>
<version>1.6.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
- <name>simple_wicket_restful_jdo-archetype</name>
+ <name>simpleapp-archetype</name>
<build>
<extensions>
<extension>
@@ -44,7 +44,7 @@
<parent>
<groupId>org.apache.isis.core</groupId>
<artifactId>isis</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<relativePath>../../../core/pom.xml</relativePath>
</parent>
</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
index 59a6ecc..a5cd621 100644
--- a/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/example/archetype/simpleapp/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -17,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
-<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="simple_wicket_restful_jdo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="simpleapp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modules>
<module id="${rootArtifactId}-dom" dir="dom" name="${rootArtifactId}-dom">
<fileSets>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
index ecbd6a7..87f8214 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>${artifactId}</artifactId>
- <name>Simple Wicket/Restful/JDO DOM</name>
+ <name>Simple App DOM</name>
<build>
<resources>
@@ -101,11 +101,22 @@
<artifactId>isis-core-applib</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.isis.objectstore</groupId>
- <artifactId>isis-objectstore-jdo-applib</artifactId>
- </dependency>
-
+ <!--
+ uncomment to use the AppSettings or UserSettings services
+ (also uncomment corresponding dependency in webapp module)
+ -->
+ <!--
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-applib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-applib</artifactId>
+ </dependency>
+ -->
+
+
<dependency>
<groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-unittestsupport</artifactId>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/dom/simple/SimpleObjects.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/dom/simple/SimpleObjects.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/dom/simple/SimpleObjects.java
index 40bdc5a..c5ec526 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/dom/simple/SimpleObjects.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/dom/src/main/java/dom/simple/SimpleObjects.java
@@ -23,12 +23,10 @@ package dom.simple;
import java.util.List;
import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.ActionSemantics;
+import org.apache.isis.applib.annotation.*;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.Bookmarkable;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
+@DomainService(menuOrder = "10", repositoryFor = SimpleObject.class)
public class SimpleObjects {
//region > identification in the UI
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml
index 204bc79..eae6a5f 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>${artifactId}</artifactId>
- <name>Simple Wicket/Restful/JDO Fixtures</name>
+ <name>Simple App Fixtures</name>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixture.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixture.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixture.java
index 4b03a11..139ad01 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixture.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixture.java
@@ -29,6 +29,10 @@ import org.apache.isis.applib.fixturescripts.FixtureScript;
public class SimpleObjectsFixture extends FixtureScript {
+ public SimpleObjectsFixture() {
+ withDiscoverability(Discoverability.DISCOVERABLE);
+ }
+
@Override
protected void execute(ExecutionContext executionContext) {
@@ -36,15 +40,15 @@ public class SimpleObjectsFixture extends FixtureScript {
execute(new SimpleObjectsTearDownFixture(), executionContext);
// create
- create("Foo");
- create("Bar");
- create("Baz");
+ create("Foo", executionContext);
+ create("Bar", executionContext);
+ create("Baz", executionContext);
}
// //////////////////////////////////////
- private SimpleObject create(final String name) {
- return simpleObjects.create(name);
+ private SimpleObject create(final String name, ExecutionContext executionContext) {
+ return executionContext.add(this, simpleObjects.create(name));
}
// //////////////////////////////////////
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java
new file mode 100644
index 0000000..fb69258
--- /dev/null
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/simple/SimpleObjectsFixturesService.java
@@ -0,0 +1,70 @@
+#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 fixture.simple;
+
+import java.util.List;
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Named;
+import org.apache.isis.applib.annotation.Prototype;
+import org.apache.isis.applib.fixturescripts.FixtureResult;
+import org.apache.isis.applib.fixturescripts.FixtureScript;
+import org.apache.isis.applib.fixturescripts.FixtureScripts;
+import org.apache.isis.applib.fixturescripts.SimpleFixtureScript;
+
+/**
+ * Enables fixtures to be installed from the application.
+ */
+@Named("Prototyping")
+@DomainService(menuOrder = "20")
+public class SimpleObjectsFixturesService extends FixtureScripts {
+
+ public SimpleObjectsFixturesService() {
+ super("fixture.simple");
+ }
+
+ //@Override // compatibility with core 1.5.0
+ public FixtureScript default0RunFixtureScript() {
+ return findFixtureScriptFor(SimpleFixtureScript.class);
+ }
+
+ /**
+ * Raising visibility to <tt>public</tt> so that choices are available for first param
+ * of {@link ${symbol_pound}runFixtureScript(FixtureScript, String)}.
+ */
+ @Override
+ public List<FixtureScript> choices0RunFixtureScript() {
+ return super.choices0RunFixtureScript();
+ }
+
+
+ // //////////////////////////////////////
+
+ @Prototype
+ @MemberOrder(sequence="20")
+ public Object installFixturesAndReturnFirst() {
+ final List<FixtureResult> run = findFixtureScriptFor(SimpleObjectsFixture.class).run(null);
+ return run.get(0).getObject();
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml
index 4b47301..4c9015c 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>${artifactId}</artifactId>
- <name>Simple Wicket/Restful/JDO Integration Tests</name>
+ <name>Simple App Integration Tests</name>
<build>
<testResources>
@@ -72,12 +72,12 @@
</dependency>
<dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-wrapper</artifactId>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-wrapper</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.isis.objectstore</groupId>
- <artifactId>isis-objectstore-jdo-datanucleus</artifactId>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-objectstore-jdo-datanucleus</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/SimpleAppSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/SimpleAppSystemInitializer.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/SimpleAppSystemInitializer.java
index 5bfef2b..7e5384e 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/SimpleAppSystemInitializer.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/SimpleAppSystemInitializer.java
@@ -19,14 +19,10 @@
*/
package integration;
-import dom.simple.SimpleObjects;
-
import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.integtestsupport.IsisSystemForTest;
-import org.apache.isis.core.wrapper.WrapperFactoryDefault;
import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
-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,
@@ -48,16 +44,20 @@ public class SimpleAppSystemInitializer {
private static class SimpleAppSystemBuilder extends IsisSystemForTest.Builder {
public SimpleAppSystemBuilder() {
- //withFixtures( ... reference data fixtures ...); // if we had any...
withLoggingAt(org.apache.log4j.Level.INFO);
with(testConfiguration());
with(new DataNucleusPersistenceMechanismInstaller());
-
- withServices(
- new SimpleObjects(),
- new WrapperFactoryDefault(),
- new IsisJdoSupportImpl()
- );
+
+ // services annotated with @DomainService
+ withServicesIn( "dom.simple"
+ ,"fixture.simple"
+ ,"org.apache.isis.core.wrapper"
+ ,"org.apache.isis.applib"
+ ,"org.apache.isis.core.metamodel.services"
+ ,"org.apache.isis.core.runtime.services"
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.support" // IsisJdoSupportImpl
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.eventbus" // EventBusServiceJdo
+ );
}
private static IsisConfiguration testConfiguration() {
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
index a19912a..97d3406 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/pom.xml
@@ -23,7 +23,7 @@
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
- <name>Simple Wicket/Restful/JDO App</name>
+ <name>Simple App</name>
<packaging>pom</packaging>
@@ -32,11 +32,8 @@
</prerequisites>
<properties>
- <isis.version>1.5.0</isis.version>
- <isis-objectstore-jdo.version>1.5.0</isis-objectstore-jdo.version>
- <isis-viewer-wicket.version>1.5.0</isis-viewer-wicket.version>
- <isis-viewer-restfulobjects.version>2.3.0</isis-viewer-restfulobjects.version>
- <isis-security-shiro.version>1.5.0</isis-security-shiro.version>
+ <isis.version>1.6.0</isis.version>
+ <isis-viewer-wicket.version>1.6.0</isis-viewer-wicket.version>
<!-- must be consistent with the versions defined by the JDO Objectstore -->
<datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
@@ -308,14 +305,6 @@
</dependency>
<dependency>
- <groupId>org.apache.isis.objectstore</groupId>
- <artifactId>isis-objectstore-jdo</artifactId>
- <version>${isis-objectstore-jdo.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
<version>${isis-viewer-wicket.version}</version>
@@ -323,22 +312,6 @@
<scope>import</scope>
</dependency>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-restfulobjects</artifactId>
- <version>${isis-viewer-restfulobjects.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.security</groupId>
- <artifactId>isis-security-shiro</artifactId>
- <version>${isis-security-shiro.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
<!-- this project's own modules -->
<dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-jrebel.launch
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-jrebel.launch b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-jrebel.launch
index 3b1d393..467f9ec 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-jrebel.launch
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-jrebel.launch
@@ -27,7 +27,7 @@
<booleanAttribute value="true" key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH"/>
<stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
<stringAttribute value="--port 8080 --type PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="simple_wicket_restful_jdo-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
<stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
<stringAttribute value="${jrebel_args} -Drebel.log=false -Drebel.check_class_hash=true -Drebel.packages_exclude=org.apache.isis -Dproject.root=${project_loc}/.. -Dtarget.dir=target-ide -Drebel.plugins=C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar -Disis-jrebel-plugin.packagePrefix=dom.simple,org.apache.isis.objectstore.jdo.applib -Disis-jrebel-plugin.loggingLevel=warn -XX:MaxPermSize=128m" key="org.eclipse.jdt.launching.VM_ARGUMENTS"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-no-fixtures.launch
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-no-fixtures.launch b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-no-fixtures.launch
index 4fd7be2..25b0671 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-no-fixtures.launch
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-no-fixtures.launch
@@ -20,6 +20,6 @@
<stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
<stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
<stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="simple_wicket_restful_jdo-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
<stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-with-fixtures.launch
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-with-fixtures.launch b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-with-fixtures.launch
index 3376620..c4a828b 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-with-fixtures.launch
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-PROTOTYPE-with-fixtures.launch
@@ -17,6 +17,6 @@
<stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
<stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
<stringAttribute value="--port 8080 -D isis.persistor.datanucleus.install-fixtures=true --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="simple_wicket_restful_jdo-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
<stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-SERVER-no-fixtures.launch
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-SERVER-no-fixtures.launch b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-SERVER-no-fixtures.launch
index 2e2e0ea..22e983b 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-SERVER-no-fixtures.launch
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/SimpleApp-SERVER-no-fixtures.launch
@@ -20,6 +20,6 @@
<stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
<stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
<stringAttribute value="--port 8080 --type SERVER" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="simple_wicket_restful_jdo-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
<stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
index ee58552..7a2087a 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>${artifactId}</artifactId>
- <name>Simple Wicket/Restful/JDO Webapp</name>
+ <name>Simple App Webapp</name>
<description>This module runs both the Wicket viewer and the Restfulobjects viewer in a single webapp configured to run using the datanucleus object store.</description>
@@ -156,20 +156,20 @@
<!-- other isis components -->
<dependency>
- <groupId>org.apache.isis.objectstore</groupId>
- <artifactId>isis-objectstore-jdo-datanucleus</artifactId>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-objectstore-jdo-datanucleus</artifactId>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-impl</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-restfulobjects-server</artifactId>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-viewer-restfulobjects-server</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.isis.security</groupId>
- <artifactId>isis-security-shiro</artifactId>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-security-shiro</artifactId>
</dependency>
@@ -179,8 +179,8 @@
<artifactId>isis-core-runtime</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-wrapper</artifactId>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-wrapper</artifactId>
</dependency>
<dependency>
<groupId>org.apache.isis.core</groupId>
@@ -190,7 +190,63 @@
<groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-security</artifactId>
</dependency>
-
+
+
+ <!-- isis modules -->
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-impl</artifactId>
+ </dependency>
+ <!--
+ uncomment to enable auditing (@Audited),
+ persisted to database
+ -->
+ <!--
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-audit-jdo</artifactId>
+ </dependency>
+ -->
+
+ <!--
+ uncomment to enable commands (@Command annotation)
+ persisted to database, also enabling the ability to run commands in the background
+ (eg using the Quartz scheduler)
+ -->
+ <!--
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-command-jdo</artifactId>
+ </dependency>
+ -->
+
+ <!--
+ uncomment to enable publishing (@PublishedObject, @PublishedAction annotations)
+ persisted to database, and using the Restful Objects (JSON) serialization of the event.
+ -->
+ <!--
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-publishing-jdo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-publishingeventserializer-ro</artifactId>
+ </dependency>
+ -->
+
+ <!--
+ uncomment to use the AppSettings or UserSettings services
+ (see also declaration of its applib in dom module)
+ -->
+ <!--
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-impl-jdo</artifactId>
+ </dependency>
+ -->
+
+
<!-- to run using WebServer (optional) -->
<dependency>
<groupId>org.apache.isis.core</groupId>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java
index 21bdcdb..39d2485 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java
@@ -19,6 +19,7 @@
*/
package webapp.prototyping;
+import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;
@@ -26,8 +27,9 @@ import org.apache.isis.core.metamodel.services.devutils.DeveloperUtilitiesServic
/**
* These overrides are simply to 'move' the action underneath the
- * {@link SimpleObjectsFixturesService prototyping} menu.
+ * {@link fixture.simple.SimpleObjectsFixturesService prototyping} menu.
*/
+@DomainService(menuOrder = "20")
public class DeveloperUtilities extends DeveloperUtilitiesServiceDefault {
@MemberOrder(name="Prototyping", sequence="90")
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/SimpleObjectsFixturesService.java
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/SimpleObjectsFixturesService.java b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/SimpleObjectsFixturesService.java
deleted file mode 100644
index e58a077..0000000
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/SimpleObjectsFixturesService.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 webapp.prototyping;
-
-import dom.simple.SimpleObject;
-import dom.simple.SimpleObjects;
-import fixture.simple.SimpleObjectsFixture;
-
-import java.util.List;
-import org.apache.isis.applib.annotation.DomainService;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Prototype;
-import org.apache.isis.applib.fixturescripts.FixtureScripts;
-import org.apache.isis.core.runtime.fixtures.FixturesInstallerDelegate;
-
-/**
- * Enables fixtures to be installed from the application.
- */
-@DomainService(20)
-@Named("Prototyping")
-public class SimpleObjectsFixturesService extends FixtureScripts {
-
- public SimpleObjectsFixturesService() {
- super("fixture.simple");
- }
-
- @Prototype
- public String installFixtures() {
- final FixturesInstallerDelegate installer = new FixturesInstallerDelegate().withOverride();
- installer.addFixture(new SimpleObjectsFixture());
- installer.installFixtures();
- return "Example fixtures installed";
- }
-
- // //////////////////////////////////////
-
- @Prototype
- public SimpleObject installFixturesAndReturnFirst() {
- installFixtures();
- List<SimpleObject> all = simpleObjects.listAll();
- return !all.isEmpty() ? all.get(0) : null;
- }
-
-
- // //////////////////////////////////////
-
- private SimpleObjects simpleObjects;
- public void injectSimpleObjects(SimpleObjects simpleObjects) {
- this.simpleObjects = simpleObjects;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
index 5e0186c..be6d98a 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/WEB-INF/isis.properties
@@ -140,7 +140,7 @@ ${symbol_pound}
${symbol_pound} Providing such capabilities as i18n
${symbol_pound}
-isis.reflector.facet-decorators=org.apache.isis.core.progmodel.facetdecorators.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
+isis.reflector.facet-decorators=org.apache.isis.core.metamodel.facetdecorator.i18n.resourcebundle.I18nDecoratorUsingResourceBundleInstaller
${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbo
l_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}${symbol_pound}
@@ -157,69 +157,42 @@ ${symbol_pound} the set of the classes for Isis to instantiate as domain service
${symbol_pound} From these domain service instances the rest of the metamodel is discovered, while the
${symbol_pound} end-user gains access to other domain objects by invoking the actions of the domain services.
${symbol_pound}
-
+isis.services-installer=configuration-and-annotation
+isis.services.ServicesInstallerFromAnnotation.packagePrefix=dom.simple,${symbol_escape}
+ fixture.simple,${symbol_escape}
+ webapp.prototyping
${symbol_pound}isis.services.prefix =
isis.services = ${symbol_escape}
- 10:dom.simple.SimpleObjects,${symbol_escape}
- ${symbol_escape}
- 20:webapp.prototyping.SimpleObjectsFixturesService,${symbol_escape}
- 20:webapp.prototyping.DeveloperUtilities,${symbol_escape}
+ org.apache.isis.applib.services.bookmark.BookmarkHolderActionContributions,${symbol_escape}
${symbol_escape}
- ${symbol_pound} supporting services if using JDO objectstore, ${symbol_escape}
+ ${symbol_pound} customizable exception handling for JDO objectstore, ${symbol_escape}
org.apache.isis.objectstore.jdo.applib.service.exceprecog.ExceptionRecognizerCompositeForJdoObjectStore,${symbol_escape}
- org.apache.isis.objectstore.jdo.datanucleus.service.support.IsisJdoSupportImpl,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} Core implementation of the various bookmark/memento services, ${symbol_escape}
- org.apache.isis.core.metamodel.services.bookmarks.BookmarkServiceDefault,${symbol_escape}
- org.apache.isis.core.runtime.services.memento.MementoServiceDefault,${symbol_escape}
- org.apache.isis.core.runtime.services.xmlsnapshot.XmlSnapshotServiceDefault,${symbol_escape}
${symbol_escape}
- ${symbol_pound} Core implementation of a clock service, ${symbol_escape}
- org.apache.isis.applib.services.clock.ClockService,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} Core implementation of the various (inter)action services, ${symbol_escape}
- org.apache.isis.applib.services.command.CommandContext,${symbol_escape}
- org.apache.isis.applib.annotation.Bulk${symbol_dollar}InteractionContext,${symbol_escape}
- org.apache.isis.applib.services.scratchpad.Scratchpad,${symbol_escape}
- org.apache.isis.applib.services.queryresultscache.QueryResultsCache,${symbol_escape}
- org.apache.isis.core.wrapper.WrapperFactoryDefault,${symbol_escape}
- org.apache.isis.applib.services.classdiscovery.ClassDiscoveryServiceUsingReflections,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} JDO implementation of the EventBusService, ${symbol_escape}
- org.apache.isis.objectstore.jdo.datanucleus.service.eventbus.EventBusServiceJdo,${symbol_escape}
+ ${symbol_pound} isis-module-background services (depends on: isis-module-command-jdo), ${symbol_escape}
+ ${symbol_pound} org.apache.isis.core.runtime.services.background.BackgroundServiceDefault,${symbol_escape}
${symbol_escape}
- ${symbol_pound} JDO implementation of the CommandService, ${symbol_escape}
+ ${symbol_pound} isis-module-command-jdo services, ${symbol_escape}
${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.command.CommandServiceJdo,${symbol_escape}
${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.command.CommandServiceJdoContributions,${symbol_escape}
- ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.command.CommandServiceJdoRepository,${symbol_escape}
+ ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdoContributions,${symbol_escape}
${symbol_escape}
- ${symbol_pound} JDO implementation of the AuditingService, ${symbol_escape}
+ ${symbol_pound} isis-module-audit-jdo services, ${symbol_escape}
${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdo,${symbol_escape}
${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdoContributions,${symbol_escape}
- ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.audit.AuditingServiceJdoRepository,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} Core implementation of BackgroundService (depends on: MementoService & BackgroundCommandService & CommandContext service), ${symbol_escape}
- ${symbol_pound} org.apache.isis.core.runtime.services.background.BackgroundServiceDefault,${symbol_escape}
- ${symbol_escape}
- ${symbol_pound} JDO implementation of the BackgroundCommandService (depends on: CommandContext service), ${symbol_escape}
- ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdo,${symbol_escape}
- ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdoContributions,${symbol_escape}
- ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.background.BackgroundCommandServiceJdoRepository,${symbol_escape}
${symbol_escape}
- ${symbol_pound} JDO implementation of the PublishingService (depends on: CommandContext service), ${symbol_escape}
+ ${symbol_pound} isis-module-publishing-jdo services, ${symbol_escape}
${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdo,${symbol_escape}
${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdoContributions,${symbol_escape}
- ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdoRepository,${symbol_escape}
- ${symbol_pound} org.apache.isis.viewer.restfulobjects.rendering.eventserializer.RestfulObjectsSpecEventSerializer,${symbol_escape}
${symbol_escape}
${symbol_pound} JDO implementation of the two SettingsServices, ${symbol_escape}
- ${symbol_pound}org.apache.isis.objectstore.jdo.applib.service.settings.ApplicationSettingsServiceJdo,${symbol_escape}
- ${symbol_pound}org.apache.isis.objectstore.jdo.applib.service.settings.UserSettingsServiceJdo,${symbol_escape}
+ ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.settings.ApplicationSettingsServiceJdo,${symbol_escape}
+ ${symbol_pound} org.apache.isis.objectstore.jdo.applib.service.settings.UserSettingsServiceJdo,${symbol_escape}
${symbol_escape}
${symbol_pound} Core (example) implementations of auditing and publishing services, ${symbol_escape}
- ${symbol_pound}org.apache.isis.applib.services.audit.AuditingService3${symbol_dollar}Stderr,${symbol_escape}
- ${symbol_pound}org.apache.isis.applib.services.publish.PublishingService${symbol_dollar}Stderr,${symbol_escape}
+ ${symbol_pound} org.apache.isis.applib.services.audit.AuditingService3${symbol_dollar}Stderr,${symbol_escape}
+ ${symbol_pound} org.apache.isis.applib.services.publish.PublishingService${symbol_dollar}Stderr,${symbol_escape}
+ ${symbol_pound}
${symbol_pound} Specify the (optional) test fixtures
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
index a14497c..fb67f71 100644
--- a/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
+++ b/example/archetype/simpleapp/src/main/resources/archetype-resources/webapp/src/main/webapp/about/index.html
@@ -116,7 +116,7 @@ ${symbol_pound}wrapper {
</table>
<p>
- The default user/password is <i>sven/pass</i> (as configured in the
+ The default user/password is <b><i>sven/pass</i></b> (as configured in the
<a href="https://github.com/apache/isis/blob/master/example/application/simple%5Fwicket_restful_jdo/webapp/src/main/webapp/WEB-INF/shiro.ini">shiro.ini</a> file).
</p>
http://git-wip-us.apache.org/repos/asf/isis/blob/20a89ba1/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
index 4a7b33c..aeed3e5 100644
--- a/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
+++ b/example/archetype/simpleapp/src/test/resources/projects/basic/archetype.properties
@@ -1,4 +1,4 @@
-#Mon Jun 02 14:06:09 BST 2014
+#Sat Jul 19 12:13:28 BST 2014
package=it.pkg
version=0.1-SNAPSHOT
groupId=archetype.it
[03/14] git commit: [maven-release-plugin] prepare release
isis-viewer-wicket-1.6.0-RC1
Posted by da...@apache.org.
[maven-release-plugin] prepare release isis-viewer-wicket-1.6.0-RC1
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/11e3c883
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/11e3c883
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/11e3c883
Branch: refs/heads/prepare/isis-1.6.0
Commit: 11e3c883537cebb43905111d36d03ebb6f4889e2
Parents: 4b54fc5
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 11:17:20 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 11:17:20 2014 +0100
----------------------------------------------------------------------
component/viewer/wicket/applib/pom.xml | 2 +-
component/viewer/wicket/impl/pom.xml | 2 +-
component/viewer/wicket/model/pom.xml | 2 +-
component/viewer/wicket/pom.xml | 20 ++++++++++++--------
component/viewer/wicket/tck/pom.xml | 8 ++++++--
component/viewer/wicket/ui/pom.xml | 2 +-
6 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/11e3c883/component/viewer/wicket/applib/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/applib/pom.xml b/component/viewer/wicket/applib/pom.xml
index 3377218..abbaa67 100644
--- a/component/viewer/wicket/applib/pom.xml
+++ b/component/viewer/wicket/applib/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
</parent>
<artifactId>isis-viewer-wicket-applib</artifactId>
http://git-wip-us.apache.org/repos/asf/isis/blob/11e3c883/component/viewer/wicket/impl/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/impl/pom.xml b/component/viewer/wicket/impl/pom.xml
index 1d4c073..1f4917f 100644
--- a/component/viewer/wicket/impl/pom.xml
+++ b/component/viewer/wicket/impl/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
</parent>
<name>Isis Wicket Viewer Implementation</name>
http://git-wip-us.apache.org/repos/asf/isis/blob/11e3c883/component/viewer/wicket/model/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/model/pom.xml b/component/viewer/wicket/model/pom.xml
index 5203c95..0f896e3 100644
--- a/component/viewer/wicket/model/pom.xml
+++ b/component/viewer/wicket/model/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
</parent>
<artifactId>isis-viewer-wicket-model</artifactId>
http://git-wip-us.apache.org/repos/asf/isis/blob/11e3c883/component/viewer/wicket/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/pom.xml b/component/viewer/wicket/pom.xml
index 318aeb6..7b23370 100644
--- a/component/viewer/wicket/pom.xml
+++ b/component/viewer/wicket/pom.xml
@@ -30,7 +30,7 @@
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<name>Isis Wicket Viewer</name>
@@ -101,41 +101,41 @@
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-applib</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-model</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-model</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-ui</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-ui</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-impl</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-impl</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<scope>test</scope>
<type>test-jar</type>
</dependency>
@@ -321,4 +321,8 @@
</dependencies>
</dependencyManagement>
+
+ <scm>
+ <tag>isis-viewer-wicket-1.6.0-RC1</tag>
+ </scm>
</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/11e3c883/component/viewer/wicket/tck/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/tck/pom.xml b/component/viewer/wicket/tck/pom.xml
index bf4b3f2..d32ec0f 100644
--- a/component/viewer/wicket/tck/pom.xml
+++ b/component/viewer/wicket/tck/pom.xml
@@ -29,13 +29,13 @@
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-tck</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<name>Isis Wicket Viewer TCK tests</name>
<properties>
- <isis-viewer-wicket.version>1.6.0-SNAPSHOT</isis-viewer-wicket.version>
+ <isis-viewer-wicket.version>1.6.0</isis-viewer-wicket.version>
<siteBaseDir>..</siteBaseDir>
<relativeUrl>wicket-tck/</relativeUrl>
<!-- until someone comes up with a better solution -->
@@ -114,4 +114,8 @@
</dependency>
</dependencies>
+
+ <scm>
+ <tag>isis-viewer-wicket-1.6.0-RC1</tag>
+ </scm>
</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/11e3c883/component/viewer/wicket/ui/pom.xml
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/pom.xml b/component/viewer/wicket/ui/pom.xml
index b0d5c01..2e96c9c 100644
--- a/component/viewer/wicket/ui/pom.xml
+++ b/component/viewer/wicket/ui/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
</parent>
<artifactId>isis-viewer-wicket-ui</artifactId>
[08/14] ISIS-839: updating todoapp archetype
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
index 1872775..d75a856 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>${artifactId}</artifactId>
- <name>Quickstart Wicket/Restful/JDO Fixtures</name>
+ <name>ToDo App Fixtures</name>
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
index 38676d4..da1c7c3 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/fixture/src/main/java/fixture/todo/ToDoItemsFixturesService.java
@@ -24,6 +24,7 @@ package fixture.todo;
import fixture.todo.scenarios.RecreateToDoItemsAndCompleteSeveralForCurrent;
import java.util.List;
+import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.annotation.Named;
import org.apache.isis.applib.annotation.Prototype;
@@ -35,12 +36,18 @@ import org.apache.isis.applib.fixturescripts.FixtureScripts;
* Enables fixtures to be installed from the application.
*/
@Named("Prototyping") // has the effect of defining a "Prototyping" menu item
+@DomainService(menuOrder = "40.1")
public class ToDoItemsFixturesService extends FixtureScripts {
public ToDoItemsFixturesService() {
super("fixture.todo");
}
+ //@Override // compatibility with core 1.5.0
+ public FixtureScript default0RunFixtureScript() {
+ return findFixtureScriptFor(RecreateToDoItemsAndCompleteSeveralForCurrent.class);
+ }
+
/**
* Raising visibility to <tt>public</tt> so that choices are available for first param
* of {@link ${symbol_pound}runFixtureScript(FixtureScript, String)}.
@@ -50,6 +57,9 @@ public class ToDoItemsFixturesService extends FixtureScripts {
return super.choices0RunFixtureScript();
}
+ // //////////////////////////////////////
+
+
@Prototype
@MemberOrder(sequence="20")
public Object recreateToDoItemsForCurrentAndReturnFirst() {
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
index 93dbfee..ddd276f 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>${artifactId}</artifactId>
- <name>Quickstart Wicket/Restful/JDO Integration Tests</name>
+ <name>ToDo App Integration Tests</name>
<build>
<testResources>
@@ -72,12 +72,12 @@
</dependency>
<dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-wrapper</artifactId>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-wrapper</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.isis.objectstore</groupId>
- <artifactId>isis-objectstore-jdo-datanucleus</artifactId>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-objectstore-jdo-datanucleus</artifactId>
</dependency>
<dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java
index f0f0cdf..70adfb8 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/ToDoSystemInitializer.java
@@ -19,25 +19,10 @@
*/
package integration;
-import app.ToDoItemAnalysis;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItemSubscriptions;
-import dom.todo.ToDoItems;
-import fixture.todo.ToDoItemsFixturesService;
-
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.applib.services.classdiscovery.ClassDiscoveryServiceUsingReflections;
-import org.apache.isis.applib.services.clock.ClockService;
-import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
import org.apache.isis.core.commons.config.IsisConfiguration;
import org.apache.isis.core.integtestsupport.IsisSystemForTest;
-import org.apache.isis.core.metamodel.services.bookmarks.BookmarkServiceDefault;
-import org.apache.isis.core.runtime.services.memento.MementoServiceDefault;
-import org.apache.isis.core.wrapper.WrapperFactoryDefault;
import org.apache.isis.objectstore.jdo.datanucleus.DataNucleusPersistenceMechanismInstaller;
import org.apache.isis.objectstore.jdo.datanucleus.IsisConfigurationForJdoIntegTests;
-import org.apache.isis.objectstore.jdo.datanucleus.service.eventbus.EventBusServiceJdo;
-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,
@@ -59,27 +44,23 @@ public class ToDoSystemInitializer {
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 ToDoItemsFixturesService(),
- new ClassDiscoveryServiceUsingReflections(),
- new ToDoItemSubscriptions(),
- new WrapperFactoryDefault(),
- new IsisJdoSupportImpl(),
- new Bulk.InteractionContext(),
- new EventBusServiceJdo(),
- new QueryResultsCache(),
- new MementoServiceDefault(),
- new BookmarkServiceDefault(),
- new ClockService()
- );
+
+ // services annotated with @DomainService
+ withServicesIn("app"
+ ,"dom.todo"
+ ,"fixture.todo"
+ ,"webapp.admin"
+ ,"webapp.prototyping"
+ ,"org.apache.isis.core.wrapper"
+ ,"org.apache.isis.applib"
+ ,"org.apache.isis.core.metamodel.services"
+ ,"org.apache.isis.core.runtime.services"
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.support" // IsisJdoSupportImpl
+ ,"org.apache.isis.objectstore.jdo.datanucleus.service.eventbus" // EventBusServiceJdo
+ );
}
private static IsisConfiguration testConfiguration() {
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
new file mode 100644
index 0000000..f6625d1
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/AbstractToDoIntegTest.java
@@ -0,0 +1,41 @@
+#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 AbstractToDoIntegTest 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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoIntegTest.java
deleted file mode 100644
index ce12615..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoIntegTest.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.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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
new file mode 100644
index 0000000..c1b59ed
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemContributionsIntegTest.java
@@ -0,0 +1,152 @@
+#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 dom.todo.ToDoItem;
+import dom.todo.ToDoItemContributions;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public abstract class ToDoItemContributionsIntegTest extends AbstractToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture().withTracing());
+ }
+
+ @Inject
+ ToDoItems toDoItems;
+ @Inject
+ ToDoItemContributions toDoItemContributions;
+
+ ToDoItemContributions toDoItemContributionsWrapped;
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = toDoItems.notYetComplete();
+ toDoItem = wrap(all.get(0));
+
+ toDoItemContributionsWrapped = wrap(toDoItemContributions);
+ }
+
+ public static class Actions {
+ public static class UpdateCategory extends ToDoItemContributionsIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Consulting);
+
+ // then
+ assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Professional));
+ assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Consulting));
+
+ // when
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Domestic, ToDoItem.Subcategory.Chores);
+
+ // then
+ assertThat(toDoItem.getCategory(), is(ToDoItem.Category.Domestic));
+ assertThat(toDoItem.getSubcategory(), is(ToDoItem.Subcategory.Chores));
+ }
+
+
+ @Test
+ public void categoryCannotBeNull() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("'Category' is mandatory");
+ toDoItemContributionsWrapped.updateCategory(toDoItem, null, ToDoItem.Subcategory.Chores);
+ }
+
+ @Test
+ public void subcategoryCanBeNull() throws Exception {
+
+ // when, then
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, null);
+ }
+
+ @Test
+ public void subcategoryMustBelongToCategory() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Invalid subcategory"));
+ toDoItemContributionsWrapped.updateCategory(toDoItem, ToDoItem.Category.Professional, ToDoItem.Subcategory.Chores);
+ }
+ }
+
+ public static class SimilarTo extends ToDoItemContributionsIntegTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ List<ToDoItem> similarItems = toDoItemContributionsWrapped.similarTo(toDoItem);
+
+ // then
+ assertThat(similarItems.size(), is(6));
+ }
+
+ }
+ }
+
+ public static class Properties {
+ public static class Priority extends ToDoItemContributionsIntegTest {
+
+ private List<ToDoItem> notYetComplete;
+
+ @Before
+ public void setUp() throws Exception {
+ notYetComplete = wrap(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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
new file mode 100644
index 0000000..447070e
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemIntegTest.java
@@ -0,0 +1,1040 @@
+#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 dom.todo.ToDoItem;
+import dom.todo.ToDoItemSubscriptions;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+
+import java.math.BigDecimal;
+import java.nio.charset.Charset;
+import java.util.EventObject;
+import java.util.List;
+import javax.activation.MimeType;
+import javax.inject.Inject;
+import org.hamcrest.Description;
+import org.hamcrest.Matcher;
+import org.hamcrest.TypeSafeMatcher;
+import org.jmock.Expectations;
+import org.jmock.Sequence;
+import org.jmock.auto.Mock;
+import org.joda.time.LocalDate;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.apache.isis.applib.NonRecoverableException;
+import org.apache.isis.applib.RecoverableException;
+import org.apache.isis.applib.clock.Clock;
+import org.apache.isis.applib.services.clock.ClockService;
+import org.apache.isis.applib.services.eventbus.*;
+import org.apache.isis.applib.value.Blob;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+
+public class ToDoItemIntegTest extends AbstractToDoIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ @Inject
+ ToDoItems toDoItems;
+ @Inject
+ ToDoItemSubscriptions toDoItemSubscriptions;
+
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = toDoItems.notYetComplete();
+ toDoItem = wrap(all.get(0));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ toDoItemSubscriptions.reset();
+ }
+
+
+ public static class Title extends ToDoItemIntegTest {
+
+ private LocalDate dueBy;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
+ toDoItem = wrap(all.get(0));
+
+ dueBy = toDoItem.getDueBy();
+ }
+
+
+ @Test
+ public void includesDescription() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread due by"));
+
+ // when
+ unwrap(toDoItem).setDescription("Buy bread and butter");
+
+ // then
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread and butter due by"));
+ }
+
+ @Test
+ public void includesDueDateIfAny() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), containsString("due by " + dueBy.toString("yyyy-MM-dd")));
+
+ // when
+ final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().plusDays(5);
+ unwrap(toDoItem).setDueBy(fiveDaysFromNow);
+
+ // then
+ assertThat(container().titleOf(toDoItem), containsString("due by " + fiveDaysFromNow.toString("yyyy-MM-dd")));
+ }
+
+
+ @Test
+ public void ignoresDueDateIfNone() throws Exception {
+
+ // when
+ // (since wrapped, will call clearDueBy)
+ toDoItem.setDueBy(null);
+
+ // then
+ assertThat(container().titleOf(toDoItem), not(containsString("due by")));
+ }
+
+ @Test
+ public void usesWhetherCompleted() throws Exception {
+
+ // given
+ assertThat(container().titleOf(toDoItem), not(containsString("Completed!")));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(container().titleOf(toDoItem), not(containsString("due by")));
+ assertThat(container().titleOf(toDoItem), containsString("Buy bread - Completed!"));
+ }
+ }
+
+ public static class Actions {
+
+ public static class Completed extends ToDoItemIntegTest {
+
+ @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();
+
+ // and then
+ final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
+ assertThat(ev, is(nullValue()));
+ }
+
+
+ @Test
+ public void cannotSetPropertyDirectly() throws Exception {
+
+ // given
+
+ // when, then should fail
+ expectedExceptions.expectMessage("Always disabled");
+ toDoItem.setComplete(true);
+
+ // and then
+ final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
+ assertThat(ev, is(nullValue()));
+ }
+
+ @Test
+ public void subscriberReceivesEvents() throws Exception {
+
+ // given
+ toDoItemSubscriptions.reset();
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ assertThat(unwrap(toDoItem).isComplete(), is(false));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(unwrap(toDoItem).isComplete(), is(true));
+
+ // and then
+ final List<ToDoItem.CompletedEvent> receivedEvents = toDoItemSubscriptions.receivedEvents(ToDoItem.CompletedEvent.class);
+
+ // hide, disable, validate, executing, executed
+ // sent to both the general on(ActionInteractionEvent ev)
+ // and also the specific on(final ToDoItem.CompletedEvent ev)
+ assertThat(receivedEvents.size(), is(5*2));
+ final ToDoItem.CompletedEvent ev = receivedEvents.get(0);
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("completed"));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.completed();
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.completed();
+ }
+
+ @Test
+ public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // when
+ toDoItem.completed();
+
+ // then
+ // (no expectedExceptions setup, expect to continue)
+ assertTrue(true);
+ }
+
+ }
+
+ /**
+ * This test demonstrates how a single service can be replaced, eg to use a mock.
+ */
+ public static class Completed_withMockService extends ToDoItemIntegTest {
+
+ private EventBusService originalEventBusService;
+ @Mock
+ private EventBusService mockEventBusService;
+
+ @Before
+ public void setUpMockEventBusService() throws Exception {
+ originalEventBusService = scenarioExecution().service(EventBusService.class);
+
+ context.checking(new Expectations() {{
+ ignoring(mockEventBusService).register(with(any(Object.class)));
+ ignoring(mockEventBusService).unregister(with(any(Object.class)));
+ }});
+
+ scenarioExecution().replaceService(originalEventBusService, mockEventBusService);
+ scenarioExecution().closeSession();
+ scenarioExecution().openSession();
+ }
+
+ @After
+ public void reinstateOriginalEventBusService() throws Exception {
+ scenarioExecution().replaceService(mockEventBusService, originalEventBusService);
+ }
+
+ @Test
+ public void raisesEvent() throws Exception {
+
+ final Sequence busRulesThenExec = context.sequence("busRulesThenExec");
+ // then
+ context.checking(new Expectations() {{
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.HIDE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.DISABLE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.VALIDATE)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTING)));
+ inSequence(busRulesThenExec);
+ oneOf(mockEventBusService).post(with(completedEvent(AbstractInteractionEvent.Phase.EXECUTED)));
+ inSequence(busRulesThenExec);
+ }});
+
+ // when
+ toDoItem.completed();
+ }
+
+ private Matcher<Object> completedEvent(final AbstractInteractionEvent.Phase phase) {
+ return new TypeSafeMatcher<Object>() {
+ @Override
+ protected boolean matchesSafely(Object item) {
+ if (!(item instanceof ToDoItem.CompletedEvent)) {
+ return false;
+ }
+
+ final ToDoItem.CompletedEvent completedEvent = (ToDoItem.CompletedEvent) item;
+ return completedEvent.getPhase() == phase;
+
+ }
+
+ @Override
+ public void describeTo(Description description) {
+ description.appendText(" instance of a ToDoItem.CompletedEvent, " + phase);
+ }
+ };
+ }
+ }
+
+
+ public static class Duplicate extends ToDoItemIntegTest {
+
+ ToDoItem duplicateToDoItem;
+
+ @Inject
+ private ClockService clockService;
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ final LocalDate todaysDate = clockService.now();
+ 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")));
+ }
+ }
+
+ public static class NotYetCompleted extends ToDoItemIntegTest {
+
+ @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();
+ }
+
+ /**
+ * Even though {@link dom.todo.ToDoItem${symbol_pound}notYetCompleted()} is not annotated with
+ * {@link org.apache.isis.applib.annotation.ActionInteraction}, an event is still raised.
+ */
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ unwrap(toDoItem).setComplete(true);
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(unwrap(toDoItem).isComplete(), is(false));
+
+ // and then
+ final ActionInteractionEvent<ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionInteractionEvent.class);
+ assertThat(ev, is(not(nullValue())));
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("notYetCompleted"));
+ }
+ }
+ }
+
+ public static class Collections {
+
+ public static class Dependencies {
+ public static class Add extends ToDoItemIntegTest {
+
+ private ToDoItem otherToDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+ otherToDoItem = wrap(items.get(1));
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ super.tearDown();
+ }
+
+ @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 {
+
+ // then
+ expectedExceptions.expectMessage("Can't set up a dependency to self");
+
+ // when
+ toDoItem.add(toDoItem);
+ }
+
+ @Test
+ public void cannotAddIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // then
+ expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ toDoItemSubscriptions.reset();
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // then received events
+ @SuppressWarnings("unchecked")
+ final List<EventObject> receivedEvents = toDoItemSubscriptions.receivedEvents();
+
+ assertThat(receivedEvents.size(), is(7));
+ assertThat(receivedEvents.get(0) instanceof ActionInteractionEvent, is(true)); // ToDoItem${symbol_pound}add() executed
+ assertThat(receivedEvents.get(1) instanceof CollectionInteractionEvent, is(true)); // ToDoItem${symbol_pound}dependencies add, executed
+ assertThat(receivedEvents.get(2) instanceof CollectionInteractionEvent, is(true)); // ToDoItem${symbol_pound}dependencies add, executing
+ assertThat(receivedEvents.get(3) instanceof ActionInteractionEvent, is(true)); // ToDoItem${symbol_pound}add executing
+ assertThat(receivedEvents.get(4) instanceof ActionInteractionEvent, is(true)); // ToDoItem${symbol_pound}add validate
+ assertThat(receivedEvents.get(5) instanceof ActionInteractionEvent, is(true)); // ToDoItem${symbol_pound}add disable
+ assertThat(receivedEvents.get(6) instanceof ActionInteractionEvent, is(true)); // ToDoItem${symbol_pound}add hide
+
+ // inspect the collection interaction (posted programmatically in ToDoItem${symbol_pound}add)
+ final CollectionInteractionEvent<ToDoItem,ToDoItem> ciEv = (CollectionInteractionEvent<ToDoItem, ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionInteractionEvent.class);
+ assertThat(ciEv, is(notNullValue()));
+
+ assertThat(ciEv.getSource(), is(equalTo(unwrap(toDoItem))));
+ assertThat(ciEv.getIdentifier().getMemberName(), is("dependencies"));
+ assertThat(ciEv.getOf(), is(CollectionInteractionEvent.Of.ADD_TO));
+ assertThat(ciEv.getValue(), is(unwrap(otherToDoItem)));
+
+ // inspect the action interaction (posted declaratively by framework)
+ final ActionInteractionEvent<ToDoItem> aiEv = (ActionInteractionEvent<ToDoItem>) toDoItemSubscriptions.mostRecentlyReceivedEvent(ActionInteractionEvent.class);
+ assertThat(aiEv, is(notNullValue()));
+
+ assertThat(aiEv.getSource(), is(equalTo(unwrap(toDoItem))));
+ assertThat(aiEv.getIdentifier().getMemberName(), is("add"));
+ assertThat(aiEv.getArguments().size(), is(1));
+ assertThat(aiEv.getArguments().get(0), is(unwrap((Object)otherToDoItem)));
+ assertThat(aiEv.getCommand(), is(notNullValue()));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.add(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // when
+ toDoItem.add(otherToDoItem);
+
+ // then
+ // (no expectedExceptions setup, expect to continue)
+ assertTrue(true);
+ }
+ }
+ public static class Remove extends ToDoItemIntegTest {
+
+ private ToDoItem otherToDoItem;
+ private ToDoItem yetAnotherToDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
+ otherToDoItem = wrap(items.get(1));
+ yetAnotherToDoItem = wrap(items.get(2));
+
+ toDoItem.add(otherToDoItem);
+ }
+
+ @After
+ public void tearDown() throws Exception {
+ unwrap(toDoItem).getDependencies().clear();
+ super.tearDown();
+ }
+
+ @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 cannotRemoveItemIfNotADependency() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("Not a dependency");
+
+ // when
+ toDoItem.remove(yetAnotherToDoItem);
+ }
+
+ @Test
+ public void cannotRemoveDependencyIfComplete() throws Exception {
+
+ // given
+ unwrap(toDoItem).setComplete(true);
+
+ // then
+ expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+ }
+
+ @Test
+ public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // when
+ toDoItem.remove(otherToDoItem);
+
+ // then
+ // (no expectedExceptions setup, expect to continue)
+ assertTrue(true);
+ }
+ }
+ }
+
+ }
+
+ public static class Properties {
+
+ public static class Attachment extends ToDoItemIntegTest {
+
+ @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));
+ }
+ }
+
+ public static class Category extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
+ toDoItem.setCategory(ToDoItem.Category.Professional);
+ }
+ }
+
+ public static class Cost extends ToDoItemIntegTest {
+
+ private BigDecimal cost;
+
+ @Before
+ public void setUp() throws Exception {
+ super.setUp();
+ 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));
+ }
+
+ }
+
+ public static class Description extends ToDoItemIntegTest {
+
+ @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 cannotUseModify() throws Exception {
+
+ expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.modifyDescription("Buy bread and butter");
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+ }
+
+ @Test
+ public void cannotUseClear() throws Exception {
+
+ expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
+
+ // given
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.clearDescription();
+
+ // then
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+ }
+
+
+ @Test
+ public void onlyJustShortEnough() throws Exception {
+
+ // when, then
+ toDoItem.setDescription(characters(100));
+ }
+
+ @Test
+ public void tooLong() throws Exception {
+
+ // then
+ expectedExceptions.expectMessage("The value proposed exceeds the maximum length of 100");
+
+ // when
+ toDoItem.setDescription(characters(101));
+ }
+
+
+ @Test
+ public void subscriberReceivesEvent() throws Exception {
+
+ // given
+ assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AnyExecuteAccept));
+ assertThat(toDoItem.getDescription(), is("Buy bread"));
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // then published and received
+ @SuppressWarnings("unchecked")
+ final PropertyInteractionEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyInteractionEvent.class);
+ assertThat(ev, is(not(nullValue())));
+
+ ToDoItem source = ev.getSource();
+ assertThat(source, is(equalTo(unwrap(toDoItem))));
+ assertThat(ev.getIdentifier().getMemberName(), is("description"));
+ assertThat(ev.getOldValue(), is("Buy bread"));
+ assertThat(ev.getNewValue(), is("Buy bread and butter"));
+ }
+
+ @Test
+ public void subscriberVetoesEventWithRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithRecoverableException);
+
+ // then
+ expectedExceptions.expect(RecoverableException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ @Test
+ public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithNonRecoverableException);
+
+ // then
+ expectedExceptions.expect(NonRecoverableException.class);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+ }
+
+
+ @Test
+ public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
+
+ // given
+ toDoItemSubscriptions.subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteVetoWithOtherException);
+
+ // when
+ toDoItem.setDescription("Buy bread and butter");
+
+ // then
+ // (no expectedExceptions setup, expect to continue)
+ assertTrue(true);
+ }
+
+
+ private static String characters(final int n) {
+ StringBuffer buf = new StringBuffer();
+ for(int i=0; i<n; i++) {
+ buf.append("a");
+ }
+ return buf.toString();
+ }
+ }
+
+ public static class DueBy extends ToDoItemIntegTest {
+
+ @Inject
+ private ClockService clockService;
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // when
+ final LocalDate fiveDaysFromNow = clockService.now().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 = clockService.now();
+ 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);
+ }
+ }
+
+ public static class Notes extends ToDoItemIntegTest {
+
+ @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));
+ }
+
+ @Test
+ public void suscriberReceivedDefaultEvent() throws Exception {
+
+ final String newNotes = "Lorem ipsum yada yada";
+
+ // when
+ toDoItem.setNotes(newNotes);
+
+ // then
+ assertThat(unwrap(toDoItem).getNotes(), is(newNotes));
+
+ // and then receive the default event.
+ @SuppressWarnings("unchecked")
+ final PropertyInteractionEvent.Default ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyInteractionEvent.Default.class);
+ assertThat(ev, is(notNullValue()));
+
+ assertThat(ev.getSource(), is((Object)unwrap(toDoItem)));
+ assertThat(ev.getNewValue(), is((Object)newNotes));
+ }
+
+
+ }
+
+ public static class OwnedBy extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage("Always hidden");
+ toDoItem.setOwnedBy("other");
+ }
+
+
+ }
+
+ public static class Subcategory extends ToDoItemIntegTest {
+
+ @Test
+ public void cannotModify() throws Exception {
+
+ // when, then
+ expectedExceptions.expectMessage(containsString("Reason: Use action to update both category and subcategory."));
+ toDoItem.setSubcategory(ToDoItem.Subcategory.Chores);
+ }
+ }
+
+ }
+
+
+
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
new file mode 100644
index 0000000..c95e9c0
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/ToDoItemsIntegTest.java
@@ -0,0 +1,116 @@
+#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 dom.todo.ToDoItem;
+import dom.todo.ToDoItems;
+import fixture.todo.integtests.ToDoItemsIntegTestFixture;
+
+import java.util.List;
+import javax.inject.Inject;
+import org.hamcrest.Matchers;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+public class ToDoItemsIntegTest extends AbstractToDoIntegTest {
+
+ @Inject
+ ToDoItems toDoItems;
+
+ public static class Finders extends ToDoItemsIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ scenarioExecution().install(new ToDoItemsIntegTestFixture());
+ }
+
+ private int notYetCompletedSize;
+ private int completedSize;
+
+ @Before
+ public void setUp() throws Exception {
+ final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
+ final List<ToDoItem> completedItems = wrap(toDoItems).complete();
+
+ notYetCompletedSize = notYetCompleteItems.size();
+ completedSize = completedItems.size();
+
+ assertThat(notYetCompletedSize, is(Matchers.greaterThan(5)));
+ }
+
+ @Test
+ public void complete_and_notYetComplete() throws Exception {
+
+ // given
+ List<ToDoItem> notYetCompleteItems = wrap(service(ToDoItems.class)).notYetComplete();
+ final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize-1));
+ assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize+1));
+
+ // and when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize));
+ assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize));
+ }
+ }
+
+ public static class NewToDo_and_Delete extends ToDoItemsIntegTest {
+
+ @Before
+ public void setUpData() throws Exception {
+ // none
+ }
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ int size = wrap(toDoItems).notYetComplete().size();
+
+ // when
+ final ToDoItem newToDo = toDoItems.newToDo("new todo", ToDoItem.Category.Professional, ToDoItem.Subcategory.OpenSource, null, null);
+
+ // then
+ assertThat(newToDo.getDescription(), is("new todo"));
+ assertThat(newToDo.getCategory(), is(ToDoItem.Category.Professional));
+ assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size+1));
+
+ // when
+ newToDo.delete();
+
+ // then
+ assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size));
+ }
+
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemContributionsTest_updateCategory.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemContributionsTest_updateCategory.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemContributionsTest_updateCategory.java
deleted file mode 100644
index 9fd3683..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemContributionsTest_updateCategory.java
+++ /dev/null
@@ -1,106 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemContributionsTest_updateCategory extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture().withTracing());
- }
-
- @Inject
- private ToDoItems toDoItems;
- @Inject
- private ToDoItemContributions toDoItemContributions;
-
- private ToDoItemContributions toDoItemContributionsWrapper;
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
-
- toDoItemContributionsWrapper = wrap(toDoItemContributions);
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- toDoItemContributionsWrapper.updateCategory(toDoItem, Category.Professional, Subcategory.Consulting);
-
- // then
- assertThat(toDoItem.getCategory(), is(Category.Professional));
- assertThat(toDoItem.getSubcategory(), is(Subcategory.Consulting));
-
- // when
- toDoItemContributionsWrapper.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");
- toDoItemContributionsWrapper.updateCategory(toDoItem, null, Subcategory.Chores);
- }
-
- @Test
- public void subcategoryCanBeNull() throws Exception {
-
- // when, then
- toDoItemContributionsWrapper.updateCategory(toDoItem, Category.Professional, null);
- }
-
- @Test
- public void subcategoryMustBelongToCategory() throws Exception {
-
- // when, then
- expectedExceptions.expectMessage(containsString("Invalid subcategory"));
- toDoItemContributionsWrapper.updateCategory(toDoItem, Category.Professional, Subcategory.Chores);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
deleted file mode 100644
index 98e5ee8..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_completed.java
+++ /dev/null
@@ -1,174 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItemSubscriptions;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.EventObject;
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public class ToDoItemTest_completed extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
- @Inject
- private ToDoItemSubscriptions toDoItemSubscriptions;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @After
- public void tearDown() throws Exception {
- toDoItemSubscriptions.reset();
- }
-
- @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();
-
- // and then
- final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
- assertThat(ev, is(nullValue()));
- }
-
-
- @Test
- public void cannotSetPropertyDirectly() throws Exception {
-
- // given
-
- // when, then should fail
- expectedExceptions.expectMessage("Always disabled");
- toDoItem.setComplete(true);
-
- // and then
- final EventObject ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(EventObject.class);
- assertThat(ev, is(nullValue()));
- }
-
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AcceptEvents));
- assertThat(toDoItem.isComplete(), is(false));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(toDoItem.isComplete(), is(true));
-
- // and then
- final ToDoItem.CompletedEvent ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(ToDoItem.CompletedEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("completed"));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.completed();
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.completed();
- }
-
- @Test
- public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.ThrowOtherException);
-
- // when
- toDoItem.completed();
-
- // then
- // (no expectedExceptions setup, expect to continue)
- assertTrue(true);
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
deleted file mode 100644
index e959918..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_duplicate.java
+++ /dev/null
@@ -1,83 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.math.BigDecimal;
-import java.util.List;
-import javax.inject.Inject;
-import org.joda.time.LocalDate;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.services.clock.ClockService;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemTest_duplicate extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
- @Inject
- private ClockService clockService;
-
- private ToDoItem toDoItem;
- private ToDoItem duplicateToDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- final LocalDate todaysDate = clockService.now();
- 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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
deleted file mode 100644
index 47ff7d8..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/actions/ToDoItemTest_notYetCompleted.java
+++ /dev/null
@@ -1,79 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemTest_notYetCompleted extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.java
deleted file mode 100644
index 451904a..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemContributionsTest_similarTo.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.colls;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemContributionsTest_similarTo extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
- @Inject
- private ToDoItemContributions toDoItemContributions;
-
- private ToDoItemContributions toDoItemContributionsWrapped;
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = this.toDoItems.notYetComplete();
- toDoItem = wrap(all.get(0));
-
- toDoItemContributionsWrapped = wrap(toDoItemContributions);
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- List<ToDoItem> similarItems = toDoItemContributionsWrapped.similarTo(toDoItem);
-
- // then
- assertThat(similarItems.size(), is(6));
- }
-
-}
\ No newline at end of file
[10/14] git commit: [maven-release-plugin] prepare release
simpleapp-archetype-1.6.0-RC1
Posted by da...@apache.org.
[maven-release-plugin] prepare release simpleapp-archetype-1.6.0-RC1
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/90017a46
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/90017a46
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/90017a46
Branch: refs/heads/prepare/isis-1.6.0
Commit: 90017a46e18159da88f12a46781959f2bdbd7c29
Parents: 308aadc
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 12:43:03 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 12:43:03 2014 +0100
----------------------------------------------------------------------
example/archetype/simpleapp/pom.xml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/90017a46/example/archetype/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/pom.xml b/example/archetype/simpleapp/pom.xml
index cd61e80..77a7c9f 100644
--- a/example/archetype/simpleapp/pom.xml
+++ b/example/archetype/simpleapp/pom.xml
@@ -17,11 +17,11 @@
specific language governing permissions and limitations
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.isis.archetype</groupId>
<artifactId>simpleapp-archetype</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<packaging>maven-archetype</packaging>
<name>simpleapp-archetype</name>
<build>
@@ -47,4 +47,8 @@
<version>1.6.0</version>
<relativePath>../../../core/pom.xml</relativePath>
</parent>
+
+ <scm>
+ <tag>simpleapp-archetype-1.6.0-RC1</tag>
+ </scm>
</project>
[14/14] git commit: ISIS-839: updating STATUS for 1.6.0 release
Posted by da...@apache.org.
ISIS-839: updating STATUS for 1.6.0 release
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/5831e980
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/5831e980
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/5831e980
Branch: refs/heads/prepare/isis-1.6.0
Commit: 5831e9807de5927932042e7346813f206d977990
Parents: 9d3fb8a
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sun Jul 20 15:35:24 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sun Jul 20 15:35:24 2014 +0100
----------------------------------------------------------------------
STATUS | 5 +++++
1 file changed, 5 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/5831e980/STATUS
----------------------------------------------------------------------
diff --git a/STATUS b/STATUS
index 37b135e..aa4eea7 100644
--- a/STATUS
+++ b/STATUS
@@ -21,6 +21,11 @@ Description
TLP releases:
+ * isis-1.6.0 : 25 Jul 2014
+ * isis-viewer-wicket-1.6.0 : 25 Jul 2014
+ * todoapp-archetype-1.6.0 : 25 Jul 2014
+ * simpleapp-archetype-1.6.0 : 25 Jul 2014
+
* isis-1.5.0 : 08 Jun 2014
* isis-objectstore-jdo-1.5.0 : 08 Jun 2014
* isis-security-shiro-1.5.0 : 08 Jun 2014
[13/14] git commit: [maven-release-plugin] prepare for next
development iteration
Posted by da...@apache.org.
[maven-release-plugin] prepare for next development iteration
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/9d3fb8a8
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/9d3fb8a8
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/9d3fb8a8
Branch: refs/heads/prepare/isis-1.6.0
Commit: 9d3fb8a84cafd51da5f09753b961b1699d58c05d
Parents: abac9a4
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 12:45:58 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 12:45:58 2014 +0100
----------------------------------------------------------------------
example/archetype/todoapp/pom.xml | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/9d3fb8a8/example/archetype/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/pom.xml b/example/archetype/todoapp/pom.xml
index 4944b9d..dd73d4a 100644
--- a/example/archetype/todoapp/pom.xml
+++ b/example/archetype/todoapp/pom.xml
@@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.isis.archetype</groupId>
<artifactId>todoapp-archetype</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>todoapp-archetype</name>
<build>
@@ -47,8 +47,4 @@
<version>1.6.0</version>
<relativePath>../../../core/pom.xml</relativePath>
</parent>
-
- <scm>
- <tag>todoapp-archetype-1.6.0-RC1</tag>
- </scm>
</project>
[02/14] git commit: ISIS-839: fixing RAT errors for Wicket viewer.
Posted by da...@apache.org.
ISIS-839: fixing RAT errors for Wicket viewer.
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/4b54fc58
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/4b54fc58
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/4b54fc58
Branch: refs/heads/prepare/isis-1.6.0
Commit: 4b54fc584feb8cae47514e7ae080f01fee3f0a8c
Parents: 8014f5e
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 11:10:49 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 11:10:49 2014 +0100
----------------------------------------------------------------------
.../FixedObjectAdapterMementoProviderTest.java | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/4b54fc58/component/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/FixedObjectAdapterMementoProviderTest.java
----------------------------------------------------------------------
diff --git a/component/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/FixedObjectAdapterMementoProviderTest.java b/component/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/FixedObjectAdapterMementoProviderTest.java
index 93f662e..7f508d3 100644
--- a/component/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/FixedObjectAdapterMementoProviderTest.java
+++ b/component/viewer/wicket/ui/src/test/java/org/apache/isis/viewer/wicket/ui/components/widgets/valuechoices/FixedObjectAdapterMementoProviderTest.java
@@ -1,3 +1,21 @@
+/*
+ * 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 org.apache.isis.viewer.wicket.ui.components.widgets.valuechoices;
import java.util.Collection;
[11/14] git commit: [maven-release-plugin] prepare for next
development iteration
Posted by da...@apache.org.
[maven-release-plugin] prepare for next development iteration
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/8c67a767
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/8c67a767
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/8c67a767
Branch: refs/heads/prepare/isis-1.6.0
Commit: 8c67a7673fd280771a12cece6c2c2d746922fe9b
Parents: 90017a4
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 12:43:07 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 12:43:07 2014 +0100
----------------------------------------------------------------------
example/archetype/simpleapp/pom.xml | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/8c67a767/example/archetype/simpleapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/simpleapp/pom.xml b/example/archetype/simpleapp/pom.xml
index 77a7c9f..4eeade6 100644
--- a/example/archetype/simpleapp/pom.xml
+++ b/example/archetype/simpleapp/pom.xml
@@ -21,7 +21,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.isis.archetype</groupId>
<artifactId>simpleapp-archetype</artifactId>
- <version>1.6.0</version>
+ <version>1.7.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
<name>simpleapp-archetype</name>
<build>
@@ -47,8 +47,4 @@
<version>1.6.0</version>
<relativePath>../../../core/pom.xml</relativePath>
</parent>
-
- <scm>
- <tag>simpleapp-archetype-1.6.0-RC1</tag>
- </scm>
</project>
[12/14] git commit: [maven-release-plugin] prepare release
todoapp-archetype-1.6.0-RC1
Posted by da...@apache.org.
[maven-release-plugin] prepare release todoapp-archetype-1.6.0-RC1
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/abac9a42
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/abac9a42
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/abac9a42
Branch: refs/heads/prepare/isis-1.6.0
Commit: abac9a42a1de887eacf7c5570222df8e5c9bffaa
Parents: 8c67a76
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 12:45:55 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 12:45:55 2014 +0100
----------------------------------------------------------------------
example/archetype/todoapp/pom.xml | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/abac9a42/example/archetype/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/pom.xml b/example/archetype/todoapp/pom.xml
index 19c35fe..4944b9d 100644
--- a/example/archetype/todoapp/pom.xml
+++ b/example/archetype/todoapp/pom.xml
@@ -17,11 +17,11 @@
specific language governing permissions and limitations
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.isis.archetype</groupId>
<artifactId>todoapp-archetype</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<packaging>maven-archetype</packaging>
<name>todoapp-archetype</name>
<build>
@@ -47,4 +47,8 @@
<version>1.6.0</version>
<relativePath>../../../core/pom.xml</relativePath>
</parent>
+
+ <scm>
+ <tag>todoapp-archetype-1.6.0-RC1</tag>
+ </scm>
</project>
[09/14] git commit: ISIS-839: updating todoapp archetype
Posted by da...@apache.org.
ISIS-839: updating todoapp archetype
Project: http://git-wip-us.apache.org/repos/asf/isis/repo
Commit: http://git-wip-us.apache.org/repos/asf/isis/commit/308aadc4
Tree: http://git-wip-us.apache.org/repos/asf/isis/tree/308aadc4
Diff: http://git-wip-us.apache.org/repos/asf/isis/diff/308aadc4
Branch: refs/heads/prepare/isis-1.6.0
Commit: 308aadc484027880fea7703b5b559508bcd2be20
Parents: 20a89ba
Author: Dan Haywood <da...@haywood-associates.co.uk>
Authored: Sat Jul 19 12:37:06 2014 +0100
Committer: Dan Haywood <da...@haywood-associates.co.uk>
Committed: Sat Jul 19 12:37:06 2014 +0100
----------------------------------------------------------------------
example/archetype/todoapp/pom.xml | 8 +-
.../META-INF/maven/archetype-metadata.xml | 2 +-
.../resources/archetype-resources/dom/pom.xml | 16 +-
.../dom/src/main/java/app/ToDoAppDashboard.java | 9 -
.../main/java/app/ToDoAppDashboardService.java | 41 +-
.../dom/src/main/java/app/ToDoItemAnalysis.java | 13 +-
.../java/app/ToDoItemAnalysisContributions.java | 10 +-
.../java/app/ToDoItemsByCategoryViewModel.java | 15 -
.../java/app/ToDoItemsByDateRangeViewModel.java | 16 -
.../dom/src/main/java/dom/todo/Categorized.java | 35 +
.../dom/src/main/java/dom/todo/ToDoItem.java | 126 ++-
.../src/main/java/dom/todo/ToDoItem.layout.json | 192 ++--
.../dom/todo/ToDoItemChangedPayloadFactory.java | 1 +
.../java/dom/todo/ToDoItemContributions.java | 27 +-
.../java/dom/todo/ToDoItemSubscriptions.java | 248 ++++-
.../dom/src/main/java/dom/todo/ToDoItems.java | 41 +-
.../src/test/java/dom/todo/ToDoItemTest.java | 94 ++
.../test/java/dom/todo/ToDoTest_completed.java | 71 --
.../java/dom/todo/ToDoTest_notYetCompleted.java | 71 --
.../archetype-resources/fixture/pom.xml | 2 +-
.../fixture/todo/ToDoItemsFixturesService.java | 10 +
.../archetype-resources/integtests/pom.xml | 10 +-
.../java/integration/ToDoSystemInitializer.java | 47 +-
.../tests/AbstractToDoIntegTest.java | 41 +
.../java/integration/tests/ToDoIntegTest.java | 41 -
.../tests/ToDoItemContributionsIntegTest.java | 152 +++
.../integration/tests/ToDoItemIntegTest.java | 1040 ++++++++++++++++++
.../integration/tests/ToDoItemsIntegTest.java | 116 ++
...oDoItemContributionsTest_updateCategory.java | 106 --
.../tests/actions/ToDoItemTest_completed.java | 174 ---
.../tests/actions/ToDoItemTest_duplicate.java | 83 --
.../actions/ToDoItemTest_notYetCompleted.java | 79 --
.../ToDoItemContributionsTest_similarTo.java | 71 --
.../colls/ToDoItemTest_dependencies_add.java | 181 ---
.../colls/ToDoItemTest_dependencies_remove.java | 176 ---
.../ToDoItemContributionsTest_priority.java | 75 --
.../tests/props/ToDoItemTest_attachment.java | 82 --
.../tests/props/ToDoItemTest_category.java | 62 --
.../tests/props/ToDoItemTest_cost.java | 100 --
.../tests/props/ToDoItemTest_description.java | 220 ----
.../tests/props/ToDoItemTest_dueBy.java | 106 --
.../tests/props/ToDoItemTest_notes.java | 90 --
.../tests/props/ToDoItemTest_ownedBy.java | 61 -
.../tests/props/ToDoItemTest_subcategory.java | 62 --
.../tests/repo/ToDoItemsTest_finders.java | 84 --
.../repo/ToDoItemsTest_newToDo_and_delete.java | 68 --
.../tests/smoke/ToDoItemTest_title.java | 116 --
.../main/resources/archetype-resources/pom.xml | 40 +-
.../launch/ToDoApp-PROTOTYPE-jrebel.launch | 2 +-
.../ToDoApp-PROTOTYPE-with-fixtures.launch | 2 +-
.../ide/eclipse/launch/ToDoApp-PROTOTYPE.launch | 2 +-
.../ide/eclipse/launch/ToDoApp-SERVER.launch | 2 +-
.../archetype-resources/webapp/pom.xml | 48 +-
.../src/main/java/webapp/admin/Admin.java | 1 +
.../java/webapp/admin/AdminContributions.java | 7 +-
.../webapp/prototyping/DeveloperUtilities.java | 6 +-
.../prototyping/ExternalLinksService.java | 8 +-
.../prototyping/WicketDeveloperUtilities.java | 42 +
.../webapp/ToDoApplication_en.properties | 54 +
.../webapp/src/main/resources/webapp/realm1.ini | 26 +
.../src/main/resources/webapp/welcome.html | 2 +-
.../src/main/webapp/WEB-INF/isis.properties | 74 +-
.../src/main/webapp/WEB-INF/logging.properties | 32 +
.../main/webapp/WEB-INF/persistor.properties | 12 +-
.../webapp/src/main/webapp/WEB-INF/shiro.ini | 10 +
.../webapp/src/main/webapp/about/index.html | 54 +-
.../webapp/src/main/webapp/css/application.css | 2 +-
.../projects/basic/archetype.properties | 2 +-
68 files changed, 2175 insertions(+), 2744 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/pom.xml b/example/archetype/todoapp/pom.xml
index 90d7b9c..19c35fe 100644
--- a/example/archetype/todoapp/pom.xml
+++ b/example/archetype/todoapp/pom.xml
@@ -17,13 +17,13 @@
specific language governing permissions and limitations
under the License.
-->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>org.apache.isis.archetype</groupId>
- <artifactId>quickstart_wicket_restful_jdo-archetype</artifactId>
+ <artifactId>todoapp-archetype</artifactId>
<version>1.6.0-SNAPSHOT</version>
<packaging>maven-archetype</packaging>
- <name>quickstart_wicket_restful_jdo-archetype</name>
+ <name>todoapp-archetype</name>
<build>
<extensions>
<extension>
@@ -44,7 +44,7 @@
<parent>
<groupId>org.apache.isis.core</groupId>
<artifactId>isis</artifactId>
- <version>1.6.0-SNAPSHOT</version>
+ <version>1.6.0</version>
<relativePath>../../../core/pom.xml</relativePath>
</parent>
</project>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml b/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
index 6e02d99..4addf7b 100644
--- a/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/example/archetype/todoapp/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -17,7 +17,7 @@
specific language governing permissions and limitations
under the License.
-->
-<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="quickstart_wicket_restful_jdo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+<archetype-descriptor xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0" xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd" name="todoapp" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modules>
<module id="${rootArtifactId}-dom" dir="dom" name="${rootArtifactId}-dom">
<fileSets>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
index d8ad66c..4b60832 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>${artifactId}</artifactId>
- <name>Quickstart Wicket/Restful/JDO DOM</name>
+ <name>ToDo App DOM</name>
<build>
<resources>
@@ -101,11 +101,15 @@
<artifactId>isis-core-applib</artifactId>
</dependency>
- <dependency>
- <groupId>org.apache.isis.objectstore</groupId>
- <artifactId>isis-objectstore-jdo-applib</artifactId>
- </dependency>
-
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-applib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-applib</artifactId>
+ </dependency>
+
<dependency>
<groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-unittestsupport</artifactId>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
index bf007d5..c63b566 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboard.java
@@ -32,7 +32,6 @@ import org.apache.isis.applib.annotation.Render.Type;
public class ToDoAppDashboard extends AbstractViewModel {
//region > identification in the UI
- // //////////////////////////////////////
public String title() {
return "Dashboard";
}
@@ -43,8 +42,6 @@ public class ToDoAppDashboard extends AbstractViewModel {
//endregion
//region > ViewModel contract
- // //////////////////////////////////////
-
private String memento;
@Override
@@ -60,8 +57,6 @@ public class ToDoAppDashboard extends AbstractViewModel {
//endregion
//region > getAnalysisByCategory (collection)
- // //////////////////////////////////////
-
@Named("By Category")
@Render(Type.EAGERLY)
@Disabled
@@ -71,8 +66,6 @@ public class ToDoAppDashboard extends AbstractViewModel {
//endregion
//region > getAnalysisByDateRange (collection)
- // //////////////////////////////////////
-
@Named("By Date Range")
@Render(Type.EAGERLY)
@Disabled
@@ -82,8 +75,6 @@ public class ToDoAppDashboard extends AbstractViewModel {
//endregion
//region > injected services
- // //////////////////////////////////////
-
@javax.inject.Inject
private ToDoItemAnalysis toDoItemAnalysis;
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
index abd6268..0062a3e 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoAppDashboardService.java
@@ -21,45 +21,16 @@
*/
package app;
-import org.apache.isis.applib.DomainObjectContainer;
-import org.apache.isis.applib.annotation.ActionSemantics;
-import org.apache.isis.applib.annotation.ActionSemantics.Of;
+import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.HomePage;
+import org.apache.isis.applib.services.homepage.AbstractHomePageDashboardService;
+@DomainService
@Hidden
-public class ToDoAppDashboardService {
+public class ToDoAppDashboardService extends AbstractHomePageDashboardService<ToDoAppDashboard> {
- //region > identification in the UI
- // //////////////////////////////////////
-
- private static final String ID = "dashboard";
-
- public String getId() {
- return ID;
- }
-
- public String iconName() {
- return ID;
- }
- //endregion
-
- //region > lookup (action)
- // //////////////////////////////////////
- @ActionSemantics(Of.SAFE)
- @HomePage
- public ToDoAppDashboard lookup() {
- return container.newViewModelInstance(ToDoAppDashboard.class, ID);
+ public ToDoAppDashboardService() {
+ super(ToDoAppDashboard.class);
}
- //endregion
-
- //region > injected services
- // //////////////////////////////////////
-
- @javax.inject.Inject
- private DomainObjectContainer container;
-
- //endregion
-
}
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
index 1d4c73b..9609164 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysis.java
@@ -33,12 +33,11 @@ import org.apache.isis.applib.annotation.*;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
@Named("Analysis")
+@DomainService(menuOrder = "20")
public class ToDoItemAnalysis {
//region > identification in the UI
- // //////////////////////////////////////
-
public String getId() {
return "analysis";
}
@@ -49,8 +48,6 @@ public class ToDoItemAnalysis {
//endregion
//region > byCategory (action)
- // //////////////////////////////////////
-
@Named("By Category")
@Bookmarkable
@ActionSemantics(Of.SAFE)
@@ -71,12 +68,10 @@ public class ToDoItemAnalysis {
}
};
}
-
//endregion
//region > byDateRange (action)
- // //////////////////////////////////////
-
+
public enum DateRange {
OverDue,
Today,
@@ -109,8 +104,6 @@ public class ToDoItemAnalysis {
//endregion
//region > forCategory (programmatic)
- // //////////////////////////////////////
-
@Programmatic
public ToDoItemsByCategoryViewModel toDoItemsForCategory(Category category) {
return byCategory().apply(category);
@@ -119,8 +112,6 @@ public class ToDoItemAnalysis {
//endregion
//region > injected services
- // //////////////////////////////////////
-
@javax.inject.Inject
private DomainObjectContainer container;
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
index ead5e79..21ed821 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemAnalysisContributions.java
@@ -23,20 +23,16 @@ package app;
import dom.todo.ToDoItem;
-import org.apache.isis.applib.annotation.ActionSemantics;
+import org.apache.isis.applib.annotation.*;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.Hidden;
-import org.apache.isis.applib.annotation.NotContributed;
import org.apache.isis.applib.annotation.NotContributed.As;
-import org.apache.isis.applib.annotation.NotInServiceMenu;
+@DomainService
@Hidden
public class ToDoItemAnalysisContributions {
//region > analyseCategory (action)
- // //////////////////////////////////////
-
@NotInServiceMenu
@NotContributed(As.ASSOCIATION)
@ActionSemantics(Of.SAFE)
@@ -46,8 +42,6 @@ public class ToDoItemAnalysisContributions {
//endregion
//region > injected services
- // //////////////////////////////////////
-
@javax.inject.Inject
private ToDoItemAnalysis toDoAppAnalysis;
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
index 68f23b0..f92cbac 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByCategoryViewModel.java
@@ -44,8 +44,6 @@ public class ToDoItemsByCategoryViewModel
implements Comparable<ToDoItemsByCategoryViewModel> {
//region > viewModel implementation
- // //////////////////////////////////////
-
@Override
public String viewModelMemento() {
return getCategory().name();
@@ -55,12 +53,9 @@ public class ToDoItemsByCategoryViewModel
public void viewModelInit(String memento) {
setCategory(Category.valueOf(memento));
}
-
//endregion
//region > category (property)
- // //////////////////////////////////////
-
private Category category;
/**
@@ -77,8 +72,6 @@ public class ToDoItemsByCategoryViewModel
//endregion
//region > notYetComplete (property), complete (property)
- // //////////////////////////////////////
-
@MultiLine(numberOfLines=5)
public String getNotYetComplete() {
final List<ToDoItem> notYetComplete = getItemsNotYetComplete();
@@ -115,8 +108,6 @@ public class ToDoItemsByCategoryViewModel
//endregion
//region > getItemsNotYetComplete (collection), getItemsComplete (collection)
- // //////////////////////////////////////
-
/**
* All those items {@link ToDoItems${symbol_pound}notYetComplete() not yet complete}, for this {@link ${symbol_pound}getCategory() category}.
*/
@@ -138,8 +129,6 @@ public class ToDoItemsByCategoryViewModel
//endregion
//region > deleteCompleted (action)
- // //////////////////////////////////////
-
@Named("Delete")
public ToDoItemsByCategoryViewModel deleteCompleted() {
for (ToDoItem item : getItemsComplete()) {
@@ -152,8 +141,6 @@ public class ToDoItemsByCategoryViewModel
//endregion
//region > compareTo
- // //////////////////////////////////////
-
@Override
public int compareTo(ToDoItemsByCategoryViewModel other) {
return ObjectContracts.compare(this, other, "category");
@@ -161,8 +148,6 @@ public class ToDoItemsByCategoryViewModel
//endregion
//region > injected services
- // //////////////////////////////////////
-
@javax.inject.Inject
private ToDoItems toDoItems;
//endregion
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
index ecd2f45..5d2b118 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/app/ToDoItemsByDateRangeViewModel.java
@@ -51,8 +51,6 @@ public class ToDoItemsByDateRangeViewModel
implements Comparable<ToDoItemsByDateRangeViewModel> {
//region > viewModel implementation
- // //////////////////////////////////////
-
@Override
public String viewModelMemento() {
return getDateRange().name();
@@ -66,10 +64,6 @@ public class ToDoItemsByDateRangeViewModel
//endregion
//region > dateRange (property)
- // //////////////////////////////////////
- //
- // //////////////////////////////////////
-
private DateRange dateRange;
/**
@@ -86,17 +80,12 @@ public class ToDoItemsByDateRangeViewModel
//endregion
//region > count (derived property)
- // //////////////////////////////////////
-
public int getCount() {
return getItemsNotYetComplete().size();
}
-
//endregion
//region > getItemsNotYetComplete (collection)
- // //////////////////////////////////////
-
/**
* All those items {@link ToDoItems${symbol_pound}notYetComplete() not yet complete}, for this {@link ${symbol_pound}getCategory() category}.
*/
@@ -139,8 +128,6 @@ public class ToDoItemsByDateRangeViewModel
//endregion
//region > compareTo
- // //////////////////////////////////////
-
@Override
public int compareTo(ToDoItemsByDateRangeViewModel other) {
return ObjectContracts.compare(this, other, "dateRange");
@@ -148,14 +135,11 @@ public class ToDoItemsByDateRangeViewModel
//endregion
//region > injected services
- // //////////////////////////////////////
-
@javax.inject.Inject
private ToDoItems toDoItems;
@javax.inject.Inject
private ClockService clockService;
-
//endregion
}
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
new file mode 100644
index 0000000..9bb6bad
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/Categorized.java
@@ -0,0 +1,35 @@
+#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 dom.todo;
+
+/**
+ * Enables {@link dom.todo.ToDoItemContributions${symbol_pound}updateCategory(dom.todo.Categorized, dom.todo.ToDoItem.Category, dom.todo.ToDoItem.Subcategory)} to be contributed to
+ * both the {@link dom.todo.ToDoItem} (entity) and also the {@link app.ToDoItemWizard} (wizard).
+ */
+public interface Categorized {
+
+ ToDoItem.Category getCategory();
+ void setCategory(ToDoItem.Category category);
+
+ ToDoItem.Subcategory getSubcategory();
+ void setSubcategory(ToDoItem.Subcategory subcategory);
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
index 13672f8..4ddc10d 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.java
@@ -42,11 +42,10 @@ import org.apache.isis.applib.annotation.Bulk.AppliesTo;
import org.apache.isis.applib.annotation.Bulk.InteractionContext.InvokedAs;
import org.apache.isis.applib.annotation.Command.ExecuteIn;
import org.apache.isis.applib.annotation.Optional;
-import org.apache.isis.applib.clock.Clock;
import org.apache.isis.applib.services.background.BackgroundService;
import org.apache.isis.applib.services.clock.ClockService;
import org.apache.isis.applib.services.command.CommandContext;
-import org.apache.isis.applib.services.eventbus.ActionInvokedEvent;
+import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
import org.apache.isis.applib.services.eventbus.EventBusService;
import org.apache.isis.applib.services.scratchpad.Scratchpad;
import org.apache.isis.applib.services.wrapper.WrapperFactory;
@@ -104,7 +103,7 @@ import org.apache.isis.applib.value.Clob;
@AutoComplete(repository=ToDoItems.class, action="autoComplete") // default unless overridden by autoCompleteNXxx() method
//@Bounded - if there were a small number of instances only (overrides autoComplete functionality)
@Bookmarkable
-public class ToDoItem implements Comparable<ToDoItem> {
+public class ToDoItem implements Categorized, Comparable<ToDoItem> {
//region > LOG
/**
@@ -115,7 +114,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
// region > title, icon
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public String title() {
final TitleBuffer buf = new TitleBuffer();
buf.append(getDescription());
@@ -135,13 +133,11 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > description (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private String description;
@javax.jdo.annotations.Column(allowsNull="false", length=100)
- @PostsPropertyChangedEvent()
+ @PropertyInteraction()
@RegEx(validation = "${symbol_escape}${symbol_escape}w[@&:${symbol_escape}${symbol_escape}-${symbol_escape}${symbol_escape},${symbol_escape}${symbol_escape}.${symbol_escape}${symbol_escape}+ ${symbol_escape}${symbol_escape}w]*")
- @TypicalLength(50)
public String getDescription() {
return description;
}
@@ -158,7 +154,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > dueBy (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@javax.jdo.annotations.Persistent(defaultFetchGroup="true")
private LocalDate dueBy;
@@ -178,13 +173,12 @@ public class ToDoItem implements Comparable<ToDoItem> {
if (dueBy == null) {
return null;
}
- return isMoreThanOneWeekInPast(dueBy) ? "Due by date cannot be more than one week old" : null;
+ return toDoItems.validateDueBy(dueBy);
}
//endregion
//region > category and subcategory (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static enum Category {
Professional {
@Override
@@ -243,6 +237,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
private Category category;
@javax.jdo.annotations.Column(allowsNull="false")
+ @Disabled(reason="Use action to update both category and subcategory")
public Category getCategory() {
return category;
}
@@ -256,6 +251,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
private Subcategory subcategory;
@javax.jdo.annotations.Column(allowsNull="true")
+ @Disabled(reason="Use action to update both category and subcategory")
public Subcategory getSubcategory() {
return subcategory;
}
@@ -265,7 +261,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > ownedBy (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
private String ownedBy;
@javax.jdo.annotations.Column(allowsNull="false")
@@ -279,7 +275,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > complete (property), completed (action), notYetCompleted (action)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
private boolean complete;
@Disabled
@@ -291,7 +287,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
this.complete = complete;
}
- @PostsActionInvokedEvent(CompletedEvent.class)
+ @ActionInteraction(CompletedEvent.class)
@Command
@PublishedAction
@Bulk
@@ -319,7 +315,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
return isComplete() ? "Already completed" : null;
}
- @PostsActionInvokedEvent(NoLongerCompletedEvent.class)
+ @ActionInteraction(NoLongerCompletedEvent.class)
@Command
@PublishedAction
@Bulk
@@ -349,7 +345,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > cost (property), updateCost (action)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private BigDecimal cost;
@javax.jdo.annotations.Column(allowsNull="true", scale=2)
@@ -362,7 +357,8 @@ public class ToDoItem implements Comparable<ToDoItem> {
public void setCost(final BigDecimal cost) {
this.cost = cost!=null?cost.setScale(2):null;
}
-
+
+ @ActionSemantics(Of.IDEMPOTENT)
public ToDoItem updateCost(
@Named("New cost")
@javax.validation.constraints.Digits(integer=10, fraction=2)
@@ -393,7 +389,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > notes (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private String notes;
@javax.jdo.annotations.Column(allowsNull="true", length=400)
@@ -407,7 +402,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > attachment (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private Blob attachment;
@javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
@javax.jdo.annotations.Column(name = "attachment_name"),
@@ -425,7 +419,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > doc (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
private Clob doc;
@javax.jdo.annotations.Persistent(defaultFetchGroup="false", columns = {
@javax.jdo.annotations.Column(name = "doc_name"),
@@ -443,7 +436,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > version (derived property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public Long getVersionSequence() {
if(!(this instanceof javax.jdo.spi.PersistenceCapable)) {
return null;
@@ -459,7 +451,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > dependencies (property), add (action), remove (action)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// overrides the natural ordering
public static class DependenciesComparator implements Comparator<ToDoItem> {
@@ -481,8 +472,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
@javax.jdo.annotations.Element(column="dependentId")
private SortedSet<ToDoItem> dependencies = new TreeSet<ToDoItem>();
- @PostsCollectionAddedToEvent
- @PostsCollectionRemovedFromEvent
+ @CollectionInteraction
@SortedBy(DependenciesComparator.class)
public SortedSet<ToDoItem> getDependencies() {
return dependencies;
@@ -491,7 +481,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
public void setDependencies(final SortedSet<ToDoItem> dependencies) {
this.dependencies = dependencies;
}
-
+
public void addToDependencies(final ToDoItem toDoItem) {
getDependencies().add(toDoItem);
}
@@ -504,7 +494,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
@TypicalLength(20)
final ToDoItem toDoItem) {
// By wrapping the call, Isis will detect that the collection is modified
- // and it will automatically send a CollectionAddedToEvent to the Event Bus.
+ // and it will automatically send CollectionInteractionEvents to the Event Bus.
// ToDoItemSubscriptions is a demo subscriber to this event
wrapperFactory.wrapSkipRules(this).addToDependencies(toDoItem);
return this;
@@ -537,7 +527,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
@TypicalLength(20)
final ToDoItem toDoItem) {
// By wrapping the call, Isis will detect that the collection is modified
- // and it will automatically send a CollectionRemovedFromEvent to the Event Bus.
+ // and it will automatically send a CollectionInteractionEvent to the Event Bus.
// ToDoItemSubscriptions is a demo subscriber to this event
wrapperFactory.wrapSkipRules(this).removeFromDependencies(toDoItem);
return this;
@@ -563,7 +553,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > clone (action)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// the name of the action in the UI
// nb: method is not called "clone()" is inherited by java.lang.Object and
@@ -602,8 +591,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > delete (action)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- @PostsActionInvokedEvent(DeletedEvent.class)
+ @ActionInteraction(DeletedEvent.class)
@Bulk
public List<ToDoItem> delete() {
@@ -617,7 +605,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > totalCost (property)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ActionSemantics(Of.SAFE)
@Bulk(AppliesTo.BULK_ONLY)
public BigDecimal totalCost() {
@@ -631,7 +618,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > scheduleExplicitly (action), scheduleImplicitly (background action)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ActionSemantics(Of.IDEMPOTENT)
@Prototype
public ToDoItem scheduleExplicitly() {
@@ -640,8 +626,6 @@ public class ToDoItem implements Comparable<ToDoItem> {
return this;
}
- // //////////////////////////////////////
-
@ActionSemantics(Of.IDEMPOTENT)
@Command(executeIn=ExecuteIn.BACKGROUND)
@Prototype
@@ -652,17 +636,15 @@ public class ToDoItem implements Comparable<ToDoItem> {
//endregion
//region > openSourceCodeOnGithub (action)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@Prototype
@ActionSemantics(Of.SAFE)
public URL openSourceCodeOnGithub() throws MalformedURLException {
- return new URL("https://github.com/apache/isis/tree/master/example/application/${parentArtifactId}/dom/src/main/java/dom/todo/ToDoItem.java");
+ return new URL("https://github.com/apache/isis/tree/master/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java");
}
//endregion
//region > demoException (action)
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static enum DemoExceptionType {
RecoverableException,
RecoverableExceptionAutoEscalated,
@@ -691,8 +673,41 @@ public class ToDoItem implements Comparable<ToDoItem> {
}
//endregion
+ //region > lifecycle callbacks
+
+ public void created() {
+ LOG.debug("lifecycle callback: created: " + container.titleOf(this));
+ }
+
+ public void loaded() {
+ LOG.debug("lifecycle callback: loaded: " + container.titleOf(this));
+ }
+
+ public void persisting() {
+ LOG.debug("lifecycle callback: persisting: " + container.titleOf(this));
+ }
+
+ public void persisted() {
+ LOG.debug("lifecycle callback: persisted: " + container.titleOf(this));
+ }
+
+ public void updating() {
+ LOG.debug("lifecycle callback: updating: " + container.titleOf(this));
+ }
+ public void updated() {
+ LOG.debug("lifecycle callback: updated: " + container.titleOf(this));
+ }
+
+ public void removing() {
+ LOG.debug("lifecycle callback: removing: " + container.titleOf(this));
+ }
+
+ public void removed() {
+ LOG.debug("lifecycle callback: removed: " + container.titleOf(this));
+ }
+ //endregion
+
//region > object-level validation
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* In a real app, if this were actually a rule, then we'd expect that
@@ -705,36 +720,27 @@ public class ToDoItem implements Comparable<ToDoItem> {
}
return null;
}
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//endregion
//region > programmatic helpers
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- private static final long ONE_WEEK_IN_MILLIS = 7 * 24 * 60 * 60 * 1000L;
-
@Programmatic // excluded from the framework's metamodel
public boolean isDue() {
if (getDueBy() == null) {
return false;
}
- return !isMoreThanOneWeekInPast(getDueBy());
- }
-
- private static boolean isMoreThanOneWeekInPast(final LocalDate dueBy) {
- return dueBy.toDateTimeAtStartOfDay().getMillis() < Clock.getTime() - ONE_WEEK_IN_MILLIS;
+ return !toDoItems.isMoreThanOneWeekInPast(getDueBy());
}
//endregion
//region > events
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- public static abstract class AbstractActionInvokedEvent extends ActionInvokedEvent<ToDoItem> {
+ public static abstract class AbstractActionInteractionEvent extends ActionInteractionEvent<ToDoItem> {
private static final long serialVersionUID = 1L;
private final String description;
- public AbstractActionInvokedEvent(
- final String description,
- final ToDoItem source,
- final Identifier identifier,
+ public AbstractActionInteractionEvent(
+ final String description,
+ final ToDoItem source,
+ final Identifier identifier,
final Object... arguments) {
super(source, identifier, arguments);
this.description = description;
@@ -744,7 +750,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
}
}
- public static class CompletedEvent extends AbstractActionInvokedEvent {
+ public static class CompletedEvent extends AbstractActionInteractionEvent {
private static final long serialVersionUID = 1L;
public CompletedEvent(
final ToDoItem source,
@@ -754,7 +760,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
}
}
- public static class NoLongerCompletedEvent extends AbstractActionInvokedEvent {
+ public static class NoLongerCompletedEvent extends AbstractActionInteractionEvent {
private static final long serialVersionUID = 1L;
public NoLongerCompletedEvent(
final ToDoItem source,
@@ -764,7 +770,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
}
}
- public static class DeletedEvent extends AbstractActionInvokedEvent {
+ public static class DeletedEvent extends AbstractActionInteractionEvent {
private static final long serialVersionUID = 1L;
public DeletedEvent(
final ToDoItem source,
@@ -773,12 +779,11 @@ public class ToDoItem implements Comparable<ToDoItem> {
super("deleted", source, identifier, arguments);
}
}
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
//endregion
//region > predicates
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
public static class Predicates {
public static Predicate<ToDoItem> thoseOwnedBy(final String currentUser) {
@@ -853,7 +858,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
}
}
- // ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+
//endregion
//region > toString, compareTo
@@ -884,12 +889,12 @@ public class ToDoItem implements Comparable<ToDoItem> {
@javax.inject.Inject
@SuppressWarnings("unused")
private ClockService clockService;
-
+
Bulk.InteractionContext bulkInteractionContext;
public void injectBulkInteractionContext(Bulk.InteractionContext bulkInteractionContext) {
this.bulkInteractionContext = bulkInteractionContext;
}
-
+
@SuppressWarnings("unused")
@javax.inject.Inject
private CommandContext commandContext;
@@ -907,6 +912,7 @@ public class ToDoItem implements Comparable<ToDoItem> {
@javax.inject.Inject
private WrapperFactory wrapperFactory;
+
// ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//endregion
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
index db9e7d2..f15424d 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItem.layout.json
@@ -15,68 +15,62 @@
* limitations under the License.
*/
{
- columns: [
+ "columns": [
{
- span: 6,
- memberGroups: {
- General: {
- members: {
- description: {
- typicalLength: { value: 50 }
+ "span": 6,
+ "memberGroups": {
+ "General": {
+ "members": {
+ "description": {
+ "typicalLength": { "value": 50 }
},
- category: {
- disabled: {
- reason: "Use action to update both category and subcategory"
- }
+ "category": {
},
- subcategory: {
- disabled: {
- reason: "Use action to update both category and subcategory"
- },
- actions: {
- updateCategory: {
- named: {
- value: "Update"
+ "subcategory": {
+ "actions": {
+ "updateCategory": {
+ "named": {
+ "value": "Update"
}
},
- analyseCategory: {}
+ "analyseCategory": {}
}
},
- ownedBy: {
- hidden: {}
+ "ownedBy": {
+ "hidden": {}
},
- complete: {
- actions: {
- completed: {
- named: { value: "Done" },
- describedAs: {
- value: "Mark this todo item as having been completed"
+ "complete": {
+ "actions": {
+ "completed": {
+ "named": { "value": "Done" },
+ "describedAs": {
+ "value": "Mark this todo item as having been completed"
},
- cssClass: { value: "x-highlight" }
+ "cssClass": { "value": "x-highlight" }
},
- notYetCompleted: {
- named: { value: "Not done" }
+ "notYetCompleted": {
+ "named": { "value": "Not done" }
},
- scheduleExplicitly: {
+ "scheduleExplicitly": {
},
- scheduleImplicitly: {
+ "scheduleImplicitly": {
}
},
- describedAs: {
- value: "Whether this todo item has been completed"
+ "describedAs": {
+ "value": "Whether this todo item has been completed"
}
}
}
},
- Misc: {
- members: {
- versionSequence: {
- named: {
- value: "Version"
+ "Misc": {
+ "members": {
+ "versionSequence": {
+ "named": {
+ "value": "Version"
},
- disabled: {},
- hidden: {
- where: ALL_TABLES
+ "disabled": {},
+ "hidden": {
+ "where": "ALL_TABLES"
}
}
}
@@ -84,48 +78,48 @@
}
},
{
- span: 6,
- memberGroups: {
- Priority: {
- members: {
- relativePriority: {
- actions: {
- previous: {},
- next: {}
+ "span": 6,
+ "memberGroups": {
+ "Priority": {
+ "members": {
+ "relativePriority": {
+ "actions": {
+ "previous": {},
+ "next": {}
}
},
- dueBy: {
- cssClass: { value: "x-key" }
+ "dueBy": {
+ "cssClass": { "value": "x-key" }
}
}
},
- Other: {
- members: {
- cost: {
- actions: {
- updateCost:{
- named: {
- value: "Update"
+ "Other": {
+ "members": {
+ "cost": {
+ "actions": {
+ "updateCost":{
+ "named": {
+ "value": "Update"
}
}
}
},
- notes: {
- multiLine: {
- numberOfLines: 5
+ "notes": {
+ "multiLine": {
+ "numberOfLines": 5
},
- hidden: {
- where: ALL_TABLES
+ "hidden": {
+ "where": "ALL_TABLES"
}
},
- attachment: {
- hidden: {
- where: STANDALONE_TABLES
+ "attachment": {
+ "hidden": {
+ "where": "STANDALONE_TABLES"
}
},
- doc: {
- hidden: {
- where: STANDALONE_TABLES
+ "doc": {
+ "hidden": {
+ "where": "STANDALONE_TABLES"
}
}
}
@@ -133,49 +127,49 @@
}
},
{
- span: 0
+ "span": 0
},
{
- span: 6,
- collections: {
- dependencies: {
- disabled: {},
- actions: {
- add:{},
- remove: {
- cssClass: { value: "x-caution" }
+ "span": 6,
+ "collections": {
+ "dependencies": {
+ "disabled": {},
+ "actions": {
+ "add":{},
+ "remove": {
+ "cssClass": { "value": "x-caution" }
}
},
- paged: {
- value: 5
+ "paged": {
+ "value": 5
},
- render: {
- value: EAGERLY
+ "render": {
+ "value": "EAGERLY"
}
},
- similarTo: {
- disabled: {},
- paged: {
- value: 3
+ "similarTo": {
+ "disabled": {},
+ "paged": {
+ "value": 3
},
- render: {
- value: LAZILY
+ "render": {
+ "value": "LAZILY"
}
}
}
}
],
- actions: {
- totalCost: {},
- delete: {
- cssClass: { value: "x-caution" }
+ "actions": {
+ "totalCost": {},
+ "delete": {
+ "cssClass": { "value": "x-caution" }
},
- duplicate: {
- named: {
- value: "Clone"
+ "duplicate": {
+ "named": {
+ "value": "Clone"
},
- describedAs: {
- value: "Create a new todo item from this one"
+ "describedAs": {
+ "value": "Create a new todo item from this one"
}
}
}
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
index 7c03f19..f88ec1c 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemChangedPayloadFactory.java
@@ -42,6 +42,7 @@ public class ToDoItemChangedPayloadFactory implements PayloadFactory{
return getChanged().getDescription();
}
}
+
@Override
public EventPayload payloadFor(Object changedObject, ChangeKind changeKind) {
return new ToDoItemPayload((ToDoItem) changedObject);
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
index eb7c606..789796d 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemContributions.java
@@ -39,11 +39,10 @@ import org.apache.isis.applib.annotation.NotContributed.As;
import org.apache.isis.applib.query.QueryDefault;
import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
+@DomainService
public class ToDoItemContributions extends AbstractFactoryAndRepository {
//region > priority (contributed property)
- // //////////////////////////////////////
-
@DescribedAs("The relative priority of this item compared to others not yet complete (using 'due by' date)")
@NotInServiceMenu
@ActionSemantics(Of.SAFE)
@@ -70,7 +69,6 @@ public class ToDoItemContributions extends AbstractFactoryAndRepository {
}}, ToDoItemContributions.class, "relativePriority", toDoItem);
}
-
private List<ToDoItem> sortedNotYetComplete() {
return ORDERING_DUE_BY
.compound(ORDERING_DESCRIPTION)
@@ -97,8 +95,6 @@ public class ToDoItemContributions extends AbstractFactoryAndRepository {
//endregion
//region > next, previous (contributed actions)
- // //////////////////////////////////////
-
@DescribedAs("The next item not yet completed")
@NotInServiceMenu
@ActionSemantics(Of.SAFE)
@@ -163,8 +159,6 @@ public class ToDoItemContributions extends AbstractFactoryAndRepository {
//endregion
//region > similarTo (contributed collection)
- // //////////////////////////////////////
-
@NotInServiceMenu
@ActionSemantics(Of.SAFE)
@NotContributed(As.ACTION)
@@ -189,52 +183,45 @@ public class ToDoItemContributions extends AbstractFactoryAndRepository {
//endregion
//region > updateCategory (contributed action)
- // //////////////////////////////////////
@DescribedAs("Update category and subcategory")
@NotInServiceMenu
@ActionSemantics(Of.IDEMPOTENT)
- public ToDoItem updateCategory(
- final ToDoItem item,
+ public Categorized updateCategory(
+ final Categorized item,
final @Named("Category") Category category,
final @Optional @Named("Subcategory") Subcategory subcategory) {
item.setCategory(category);
item.setSubcategory(subcategory);
return item;
}
-
public Category default1UpdateCategory(
- final ToDoItem item) {
+ final Categorized item) {
return item != null? item.getCategory(): null;
}
public Subcategory default2UpdateCategory(
- final ToDoItem item) {
+ final Categorized item) {
return item != null? item.getSubcategory(): null;
}
public List<Subcategory> choices2UpdateCategory(
- final ToDoItem item, final Category category) {
+ final Categorized item, final Category category) {
return Subcategory.listFor(category);
}
public String validateUpdateCategory(
- final ToDoItem item, final Category category, final Subcategory subcategory) {
+ final Categorized item, final Category category, final Subcategory subcategory) {
return Subcategory.validate(category, subcategory);
}
//endregion
//region > helpers
- // //////////////////////////////////////
-
protected String currentUserName() {
return getContainer().getUser().getName();
}
-
//endregion
//region > injected services
- // //////////////////////////////////////
-
@javax.inject.Inject
private ToDoItems toDoItems;
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
index 1ee6d98..dab085e 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItemSubscriptions.java
@@ -23,33 +23,52 @@ package dom.todo;
import java.util.EventObject;
import java.util.List;
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
import com.google.common.collect.Lists;
import com.google.common.eventbus.Subscribe;
import org.apache.isis.applib.DomainObjectContainer;
import org.apache.isis.applib.NonRecoverableException;
import org.apache.isis.applib.RecoverableException;
import org.apache.isis.applib.annotation.*;
-import org.apache.isis.applib.services.eventbus.CollectionAddedToEvent;
-import org.apache.isis.applib.services.eventbus.CollectionRemovedFromEvent;
+import org.apache.isis.applib.services.eventbus.ActionInteractionEvent;
+import org.apache.isis.applib.services.eventbus.CollectionInteractionEvent;
import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.applib.services.eventbus.PropertyChangedEvent;
+import org.apache.isis.applib.services.eventbus.PropertyInteractionEvent;
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.transform;
+import static com.google.common.collect.Lists.newArrayList;
+
+@DomainService
public class ToDoItemSubscriptions {
//region > LOG
private final static org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(ToDoItemSubscriptions.class);
//endregion
-
//region > on(Event)...
- // //////////////////////////////////////
+
public static enum Behaviour {
- AcceptEvents,
- RejectEventsWithRecoverableException,
- RejectEventsWithNonRecoverableException,
- ThrowOtherException
+ AnyExecuteAccept,
+ AnyExecuteVetoWithRecoverableException,
+ AnyExecuteVetoWithNonRecoverableException,
+ AnyExecuteVetoWithOtherException,
+ UpdateCostActionHide,
+ UpdateCostActionDisable,
+ UpdateCostActionInvalidate,
+ DescriptionPropertyHide,
+ DescriptionPropertyDisable,
+ DescriptionPropertyInvalidate,
+ DependenciesCollectionHide,
+ // not implemented in Wicket viewer, but supported in wrapped objects
+ DependenciesCollectionDisable,
+ // not implemented in Wicket viewer, but supported in wrapped objects
+ DependenciesCollectionInvalidateAdd,
+ DependenciesCollectionInvalidateRemove,
+ SimilarToCollectionHide
}
- private Behaviour behaviour = Behaviour.AcceptEvents;
+ private Behaviour behaviour = Behaviour.AnyExecuteAccept;
/**
* To demo/test what occurs if a subscriber that might veto an event.
@@ -58,77 +77,177 @@ public class ToDoItemSubscriptions {
@MemberOrder(name = "Prototyping", sequence = "80")
@Named("Set subscriber behaviour")
@ActionSemantics(ActionSemantics.Of.IDEMPOTENT)
- public String subscriberBehaviour(@Named("Behaviour") Behaviour behaviour) {
+ public ToDoItem subscriberBehaviour(ToDoItem toDoItem, @Named("Behaviour") Behaviour behaviour) {
this.behaviour = behaviour;
- return "Subscriber behaviour set to: " + behaviour;
+ container.informUser("Subscriber behaviour set to: " + behaviour);
+ return toDoItem;
}
- public Behaviour default0SubscriberBehaviour() {
+ public Behaviour default1SubscriberBehaviour() {
return this.behaviour;
}
+
@Programmatic
public Behaviour getSubscriberBehaviour() {
return behaviour;
}
- private void rejectIfRequired() {
- if(behaviour == Behaviour.RejectEventsWithRecoverableException) {
+ private void onExecutedVetoIfRequired() {
+ if(behaviour == Behaviour.AnyExecuteVetoWithRecoverableException) {
throw new RecoverableException("Rejecting event (recoverable exception thrown)");
}
- if(behaviour == Behaviour.RejectEventsWithNonRecoverableException) {
+ if(behaviour == Behaviour.AnyExecuteVetoWithNonRecoverableException) {
throw new NonRecoverableException("Rejecting event (recoverable exception thrown)");
}
- if(behaviour == Behaviour.ThrowOtherException) {
+ if(behaviour == Behaviour.AnyExecuteVetoWithOtherException) {
throw new RuntimeException("Throwing some other exception");
}
}
//endregion
- //region > on(Event)...
- // //////////////////////////////////////
-
+ //region > on(Event) for ToDoItem-specific events
@Programmatic
@Subscribe
- public void on(ToDoItem.AbstractActionInvokedEvent ev) {
- rejectIfRequired();
+ public void on(final ToDoItem.CompletedEvent ev) {
recordEvent(ev);
- LOG.info(ev.getEventDescription() + ": " + container.titleOf(ev.getSource()));
+ switch(ev.getPhase()) {
+ case HIDE:
+ break;
+ case DISABLE:
+ break;
+ case VALIDATE:
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received ToDoItem.CompletedEvent for : " + container.titleOf(ev.getSource()));
+ break;
+ }
}
+ //endregion
+ //region > on(Event) ... general purpose
@Programmatic
@Subscribe
- public void on(PropertyChangedEvent<?,?> ev) {
- rejectIfRequired();
+ public void on(final ActionInteractionEvent<?> ev) {
recordEvent(ev);
- if(ev.getIdentifier().getMemberName().contains("description")) {
- String newValue = (String) ev.getNewValue();
- if(newValue.matches(".*demo veto.*")) {
- throw new RecoverableException("oh no you don't! " + ev.getNewValue());
- }
+ switch(ev.getPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionHide) {
+ if(ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.hide();
+ }
+ }
+ break;
+ case DISABLE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionDisable) {
+ if(ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.disable("ToDoItemSubscriptions says: updateCost action disabled!");
+ }
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.UpdateCostActionInvalidate &&
+ ev.getIdentifier().getMemberName().equals("updateCost")) {
+ ev.disable("ToDoItemSubscriptions says: can't invoke updateCostaction with these args!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received ActionInteractionEvent, " + container.titleOf(ev.getSource()) + ", invoked " + ev.getIdentifier().getMemberName());
+ onExecutedVetoIfRequired();
+ break;
}
- LOG.info(container.titleOf(ev.getSource()) + ", changed " + ev.getIdentifier().getMemberName() + " : " + ev.getOldValue() + " -> " + ev.getNewValue());
}
-
+
@Programmatic
@Subscribe
- public void on(CollectionAddedToEvent<?,?> ev) {
- rejectIfRequired();
+ public void on(PropertyInteractionEvent<?,?> ev) {
recordEvent(ev);
- LOG.info(container.titleOf(ev.getSource()) + ", added to " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
+ switch(ev.getPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyHide &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.hide();
+ }
+ break;
+ case DISABLE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyDisable &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.disable("ToDoItemSubscriptions says: description property disabled!");
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.DescriptionPropertyInvalidate &&
+ ev.getIdentifier().getMemberName().equals("description")) {
+ ev.disable("ToDoItemSubscriptions says: can't change description property to this value!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ LOG.info("Received PropertyInteractionEvent, " + container.titleOf(ev.getSource()) + ", changed " + ev.getIdentifier().getMemberName() + " : " + ev.getOldValue() + " -> " + ev.getNewValue());
+ onExecutedVetoIfRequired();
+
+ if(ev.getIdentifier().getMemberName().contains("description")) {
+ String newValue = (String) ev.getNewValue();
+ if(newValue.matches(".*demo veto.*")) {
+ throw new RecoverableException("oh no you don't! " + ev.getNewValue());
+ }
+ }
+ break;
+ }
}
@Programmatic
@Subscribe
- public void on(CollectionRemovedFromEvent<?,?> ev) {
- rejectIfRequired();
+ public void on(CollectionInteractionEvent<?,?> ev) {
recordEvent(ev);
- LOG.info(container.titleOf(ev.getSource()) + ", removed from " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
- }
+ switch (ev.getPhase()) {
+ case HIDE:
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionHide &&
+ ev.getIdentifier().getMemberName().equals("dependencies")) {
+ ev.hide();
+ }
+ if (getSubscriberBehaviour() == Behaviour.SimilarToCollectionHide &&
+ ev.getIdentifier().getMemberName().equals("similarTo")) {
+ ev.hide();
+ }
+ break;
+ case DISABLE:
+ if (getSubscriberBehaviour() == Behaviour.DependenciesCollectionDisable &&
+ ev.getIdentifier().getMemberName().equals("dependencies")) {
+ ev.disable("ToDoItemSubscriptions says: dependencies collection disabled!");
+ }
+ break;
+ case VALIDATE:
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateAdd &&
+ ev.getIdentifier().getMemberName().equals("dependencies") &&
+ ev.getOf() == CollectionInteractionEvent.Of.ADD_TO ) {
+ ev.invalidate("ToDoItemSubscriptions says: can't add this object to dependencies collection!");
+ }
+ if(getSubscriberBehaviour() == Behaviour.DependenciesCollectionInvalidateRemove &&
+ ev.getIdentifier().getMemberName().equals("dependencies") &&
+ ev.getOf() == CollectionInteractionEvent.Of.REMOVE_FROM ) {
+ ev.invalidate("ToDoItemSubscriptions says: can't remove this object from dependencies collection!");
+ }
+ break;
+ case EXECUTING:
+ break;
+ case EXECUTED:
+ if(ev.getOf() == CollectionInteractionEvent.Of.ADD_TO) {
+ LOG.info("Received CollectionInteractionEvent, " + container.titleOf(ev.getSource()) + ", added to " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
+ } else {
+ LOG.info("Received CollectionInteractionEvent, " + container.titleOf(ev.getSource()) + ", removed from " + ev.getIdentifier().getMemberName() + " : " + ev.getValue());
+ }
+ onExecutedVetoIfRequired();
+ break;
+ }
+ }
//endregion
//region > receivedEvents
- // //////////////////////////////////////
-
private final List<java.util.EventObject> receivedEvents = Lists.newLinkedList();
/**
@@ -138,19 +257,43 @@ public class ToDoItemSubscriptions {
public List<java.util.EventObject> receivedEvents() {
return receivedEvents;
}
+
+ /**
+ * Used in integration tests.
+ */
+ @Programmatic
+ public <T extends java.util.EventObject> List<T> receivedEvents(final Class<T> expectedType) {
+ return newArrayList(
+ transform(
+ filter(receivedEvents, instanceOf(expectedType)),
+ castTo(expectedType)));
+ }
+
+ private static <T extends EventObject> Function<EventObject, T> castTo(Class<T> expectedType) {
+ return new Function<EventObject, T>() {
+ @Override
+ public T apply(EventObject input) {
+ return (T) input;
+ }
+ };
+ }
+
+ private static <T extends EventObject> Predicate<EventObject> instanceOf(final Class<T> expectedType) {
+ return new Predicate<EventObject>() {
+ @Override
+ public boolean apply(EventObject input) {
+ return expectedType.isInstance(input);
+ }
+ };
+ }
+
/**
* Used in integration tests.
*/
@Programmatic
public <T extends java.util.EventObject> T mostRecentlyReceivedEvent(Class<T> expectedType) {
- if (receivedEvents.isEmpty()) {
- return null;
- }
- final EventObject ev = receivedEvents.get(0);
- if(!expectedType.isAssignableFrom(ev.getClass())) {
- return null;
- }
- return expectedType.cast(ev);
+ final List<T> receivedEvents = receivedEvents(expectedType);
+ return !receivedEvents.isEmpty() ? receivedEvents.get(0) : null;
}
private void recordEvent(final java.util.EventObject ev) {
receivedEvents.add(0, ev);
@@ -161,20 +304,17 @@ public class ToDoItemSubscriptions {
@Programmatic
public void reset() {
receivedEvents.clear();
- subscriberBehaviour(ToDoItemSubscriptions.Behaviour.AcceptEvents);
+ subscriberBehaviour(null, ToDoItemSubscriptions.Behaviour.AnyExecuteAccept);
}
-
//endregion
-
//region > injected services
- // //////////////////////////////////////
-
@javax.inject.Inject
private DomainObjectContainer container;
@SuppressWarnings("unused")
private EventBusService eventBusService;
+ @Programmatic
public final void injectEventBusService(EventBusService eventBusService) {
eventBusService.register(this);
}
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
index 7c58d7c..bee7631 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/main/java/dom/todo/ToDoItems.java
@@ -35,11 +35,10 @@ import org.apache.isis.applib.query.QueryDefault;
import org.apache.isis.applib.services.clock.ClockService;
@Named("ToDos")
+@DomainService(menuOrder = "10", repositoryFor = ToDoItem.class)
public class ToDoItems {
//region > identification in the UI
- // //////////////////////////////////////
-
public String getId() {
return "toDoItems";
}
@@ -50,11 +49,9 @@ public class ToDoItems {
//endregion
//region > notYetComplete (action)
- // //////////////////////////////////////
-
@Bookmarkable
@ActionSemantics(Of.SAFE)
- @MemberOrder(sequence = "1")
+ @MemberOrder(sequence = "10")
public List<ToDoItem> notYetComplete() {
final List<ToDoItem> items = notYetCompleteNoUi();
if(items.isEmpty()) {
@@ -73,10 +70,8 @@ public class ToDoItems {
//endregion
//region > complete (action)
- // //////////////////////////////////////
-
@ActionSemantics(Of.SAFE)
- @MemberOrder(sequence = "3")
+ @MemberOrder(sequence = "20")
public List<ToDoItem> complete() {
final List<ToDoItem> items = completeNoUi();
if(items.isEmpty()) {
@@ -95,12 +90,10 @@ public class ToDoItems {
//endregion
//region > categorized (action)
- // //////////////////////////////////////
-
@SuppressWarnings("unchecked")
@Bookmarkable
@ActionSemantics(Of.SAFE)
- @MemberOrder(sequence = "30")
+ @MemberOrder(sequence = "40")
public List<ToDoItem> categorized(
@Named("Category") final Category category,
@Named("Subcategory") final Subcategory subcategory,
@@ -134,9 +127,7 @@ public class ToDoItems {
//endregion
//region > newToDo (action)
- // //////////////////////////////////////
-
- @MemberOrder(sequence = "40")
+ @MemberOrder(sequence = "5")
public ToDoItem newToDo(
final @RegEx(validation = "${symbol_escape}${symbol_escape}w[@&:${symbol_escape}${symbol_escape}-${symbol_escape}${symbol_escape},${symbol_escape}${symbol_escape}.${symbol_escape}${symbol_escape}+ ${symbol_escape}${symbol_escape}w]*") @Named("Description") String description,
final @Named("Category") Category category,
@@ -167,8 +158,7 @@ public class ToDoItems {
//endregion
//region > allToDos (action)
- // //////////////////////////////////////
-
+ @Prototype
@ActionSemantics(Of.SAFE)
@MemberOrder(sequence = "50")
public List<ToDoItem> allToDos() {
@@ -184,8 +174,6 @@ public class ToDoItems {
//endregion
//region > autoComplete (programmatic)
- // //////////////////////////////////////
-
@Programmatic // not part of metamodel
public List<ToDoItem> autoComplete(final String description) {
return container.allMatches(
@@ -197,8 +185,6 @@ public class ToDoItems {
//endregion
//region > helpers
- // //////////////////////////////////////
-
@Programmatic // for use by fixtures
public ToDoItem newToDo(
final String description,
@@ -226,9 +212,20 @@ public class ToDoItems {
//endregion
+ //region > common validation
+ private static final long ONE_WEEK_IN_MILLIS = 7 * 24 * 60 * 60 * 1000L;
+
+ @Programmatic
+ public String validateDueBy(LocalDate dueBy) {
+ return isMoreThanOneWeekInPast(dueBy) ? "Due by date cannot be more than one week old" : null;
+ }
+ @Programmatic
+ boolean isMoreThanOneWeekInPast(final LocalDate dueBy) {
+ return dueBy.toDateTimeAtStartOfDay().getMillis() < clockService.nowAsMillis() - ONE_WEEK_IN_MILLIS;
+ }
+ //endregion
+
//region > injected services
- // //////////////////////////////////////
-
@javax.inject.Inject
private DomainObjectContainer container;
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
new file mode 100644
index 0000000..5020190
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoItemTest.java
@@ -0,0 +1,94 @@
+#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 dom.todo;
+
+import org.jmock.auto.Mock;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.apache.isis.applib.annotation.Bulk;
+import org.apache.isis.applib.services.eventbus.EventBusService;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
+import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
+
+import static org.hamcrest.CoreMatchers.*;
+import static org.junit.Assert.assertThat;
+
+public abstract class ToDoItemTest {
+
+ @Rule
+ public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
+
+ @Mock
+ EventBusService eventBusService;
+
+ ToDoItem toDoItem;
+
+ @Before
+ public void setUp() throws Exception {
+ toDoItem = new ToDoItem();
+
+ toDoItem.bulkInteractionContext = Bulk.InteractionContext.regularAction(toDoItem);
+ toDoItem.eventBusService = eventBusService;
+
+ context.ignoring(eventBusService);
+ }
+
+ public static class Actions {
+
+ public static class Completed extends ToDoItemTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ toDoItem.setComplete(false);
+ assertThat(toDoItem.disableCompleted(), is(nullValue()));
+
+ // when
+ toDoItem.completed();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(true));
+ assertThat(toDoItem.disableCompleted(), is(not(nullValue())));
+ }
+ }
+
+ public static class NotYetCompleted extends ToDoItemTest {
+
+ @Test
+ public void happyCase() throws Exception {
+
+ // given
+ toDoItem.setComplete(true);
+ assertThat(toDoItem.disableNotYetCompleted(), is(nullValue()));
+
+ // when
+ toDoItem.notYetCompleted();
+
+ // then
+ assertThat(toDoItem.isComplete(), is(false));
+ assertThat(toDoItem.disableNotYetCompleted(), is(not(nullValue())));
+ }
+ }
+ }
+
+
+}
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoTest_completed.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoTest_completed.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoTest_completed.java
deleted file mode 100644
index 718460f..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoTest_completed.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 dom.todo;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-
-public class ToDoTest_completed {
-
- @Rule
- public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
- @Mock
- private EventBusService eventBusService;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- toDoItem = new ToDoItem();
- toDoItem.bulkInteractionContext = Bulk.InteractionContext.regularAction(toDoItem);
- toDoItem.eventBusService = eventBusService;
-
- context.ignoring(eventBusService);
-
- toDoItem.setComplete(false);
- }
-
- @Test
- public void happyCase() throws Exception {
- // given
- assertThat(toDoItem.disableCompleted(), is(nullValue()));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(toDoItem.isComplete(), is(true));
- assertThat(toDoItem.disableCompleted(), is(not(nullValue())));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoTest_notYetCompleted.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoTest_notYetCompleted.java b/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoTest_notYetCompleted.java
deleted file mode 100644
index bc02446..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/dom/src/test/java/dom/todo/ToDoTest_notYetCompleted.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 dom.todo;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-import org.jmock.auto.Mock;
-import org.junit.Before;
-import org.junit.Rule;
-import org.junit.Test;
-
-import org.apache.isis.applib.annotation.Bulk;
-import org.apache.isis.applib.services.eventbus.EventBusService;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2;
-import org.apache.isis.core.unittestsupport.jmocking.JUnitRuleMockery2.Mode;
-
-public class ToDoTest_notYetCompleted {
-
- @Rule
- public JUnitRuleMockery2 context = JUnitRuleMockery2.createFor(Mode.INTERFACES_AND_CLASSES);
-
- @Mock
- private EventBusService eventBusService;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- toDoItem = new ToDoItem();
-
- toDoItem.bulkInteractionContext = Bulk.InteractionContext.regularAction(toDoItem);
- toDoItem.eventBusService = eventBusService;
-
- context.ignoring(eventBusService);
- toDoItem.setComplete(true);
- }
-
- @Test
- public void happyCase() throws Exception {
- // given
- assertThat(toDoItem.disableNotYetCompleted(), is(nullValue()));
-
- // when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(toDoItem.isComplete(), is(false));
- assertThat(toDoItem.disableNotYetCompleted(), is(not(nullValue())));
- }
-
-}
[07/14] ISIS-839: updating todoapp archetype
Posted by da...@apache.org.
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
deleted file mode 100644
index 3423a34..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_add.java
+++ /dev/null
@@ -1,181 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItemSubscriptions;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.services.eventbus.CollectionAddedToEvent;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public class ToDoItemTest_dependencies_add extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
-
- @Inject
- private ToDoItems toDoItems;
- @Inject
- private ToDoItemSubscriptions toDoItemSubscriptions;
-
- private ToDoItem toDoItem;
- private ToDoItem otherToDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
- toDoItem = wrap(items.get(0));
- otherToDoItem = wrap(items.get(1));
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- toDoItemSubscriptions.reset();
- }
-
- @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)));
-
- // and then
- @SuppressWarnings("unchecked")
- final CollectionAddedToEvent<ToDoItem,ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionAddedToEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("dependencies"));
- assertThat(ev.getValue(), is(unwrap(otherToDoItem)));
- }
-
-
- @Test
- public void cannotDependOnSelf() throws Exception {
-
- // then
- expectedExceptions.expectMessage("Can't set up a dependency to self");
-
- // when
- toDoItem.add(toDoItem);
- }
-
- @Test
- public void cannotAddDependencyIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // then
- expectedExceptions.expectMessage("Cannot add dependencies for items that are complete");
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
-
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AcceptEvents));
-
- // when
- toDoItem.add(otherToDoItem);
-
- // then
- @SuppressWarnings("unchecked")
- final CollectionAddedToEvent<ToDoItem,ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionAddedToEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("dependencies"));
- assertThat(ev.getValue(), is(unwrap(otherToDoItem)));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.add(otherToDoItem);
- }
-
- @Test
- public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.ThrowOtherException);
-
- // when
- toDoItem.add(otherToDoItem);
-
- // then
- // (no expectedExceptions setup, expect to continue)
- assertTrue(true);
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
deleted file mode 100644
index de8fb37..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/colls/ToDoItemTest_dependencies_remove.java
+++ /dev/null
@@ -1,176 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItemSubscriptions;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.services.eventbus.CollectionRemovedFromEvent;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public class ToDoItemTest_dependencies_remove extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
- @Inject
- private ToDoItemSubscriptions toDoItemSubscriptions;
-
- private ToDoItem toDoItem;
- private ToDoItem otherToDoItem;
- private ToDoItem yetAnotherToDoItem;
-
-
- @Before
- public void setUp() throws Exception {
-
- final List<ToDoItem> items = wrap(toDoItems).notYetComplete();
- toDoItem = wrap(items.get(0));
- otherToDoItem = wrap(items.get(1));
- yetAnotherToDoItem = wrap(items.get(2));
-
- toDoItem.add(otherToDoItem);
- }
-
- @After
- public void tearDown() throws Exception {
- unwrap(toDoItem).getDependencies().clear();
- toDoItemSubscriptions.reset();
- }
-
- @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 cannotRemoveItemIfNotADependency() throws Exception {
-
- // then
- expectedExceptions.expectMessage("Not a dependency");
-
- // when
- toDoItem.remove(yetAnotherToDoItem);
- }
-
- @Test
- public void cannotRemoveDependencyIfComplete() throws Exception {
-
- // given
- unwrap(toDoItem).setComplete(true);
-
- // then
- expectedExceptions.expectMessage("Cannot remove dependencies for items that are complete");
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AcceptEvents));
- assertThat(toDoItem.getDependencies().size(), is(1));
-
- // when
- toDoItem.remove(otherToDoItem);
-
- // then
- @SuppressWarnings("unchecked")
- final CollectionRemovedFromEvent<ToDoItem,ToDoItem> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(CollectionRemovedFromEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("dependencies"));
- assertThat(ev.getValue(), is(unwrap(otherToDoItem)));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.remove(otherToDoItem);
- }
-
- @Test
- public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.ThrowOtherException);
-
- // when
- toDoItem.remove(otherToDoItem);
-
- // then
- // (no expectedExceptions setup, expect to continue)
- assertTrue(true);
- }
-
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
deleted file mode 100644
index 6f358c7..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemContributionsTest_priority.java
+++ /dev/null
@@ -1,75 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItemContributions;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemContributionsTest_priority extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
- @Inject
- private ToDoItemContributions toDoItemContributions;
-
- private List<ToDoItem> notYetComplete;
-
- @Before
- public void setUp() throws Exception {
- notYetComplete = wrap(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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
deleted file mode 100644
index 0e08405..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_attachment.java
+++ /dev/null
@@ -1,82 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.nio.charset.Charset;
-import java.util.List;
-import javax.activation.MimeType;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.value.Blob;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemTest_attachment extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
deleted file mode 100644
index 75b907b..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_category.java
+++ /dev/null
@@ -1,62 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.containsString;
-
-public class ToDoItemTest_category extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
deleted file mode 100644
index f9f2278..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_cost.java
+++ /dev/null
@@ -1,100 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.math.BigDecimal;
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemTest_cost extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- private ToDoItem toDoItem;
- private BigDecimal cost;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
deleted file mode 100644
index 619520a..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_description.java
+++ /dev/null
@@ -1,220 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItemSubscriptions;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.NonRecoverableException;
-import org.apache.isis.applib.RecoverableException;
-import org.apache.isis.applib.services.eventbus.PropertyChangedEvent;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-import static org.junit.Assert.assertTrue;
-
-public class ToDoItemTest_description extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
- @Inject
- private ToDoItemSubscriptions toDoItemSubscriptions;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @After
- public void tearDown() throws Exception {
- toDoItemSubscriptions.reset();
- }
-
- @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 cannotUseModify() throws Exception {
-
- expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.modifyDescription("Buy bread and butter");
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread"));
- }
-
- @Test
- public void cannotUseClear() throws Exception {
-
- expectedExceptions.expectMessage("Cannot invoke supporting method for 'Description'; use only property accessor/mutator");
-
- // given
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.clearDescription();
-
- // then
- assertThat(toDoItem.getDescription(), is("Buy bread"));
- }
-
-
- @Test
- public void onlyJustShortEnough() throws Exception {
-
- // when, then
- toDoItem.setDescription(characters(100));
- }
-
- @Test
- public void tooLong() throws Exception {
-
- // then
- expectedExceptions.expectMessage("The value proposed exceeds the maximum length of 100");
-
- // when
- toDoItem.setDescription(characters(101));
- }
-
-
- @Test
- public void subscriberReceivesEvent() throws Exception {
-
- // given
- assertThat(toDoItemSubscriptions.getSubscriberBehaviour(), is(ToDoItemSubscriptions.Behaviour.AcceptEvents));
- assertThat(toDoItem.getDescription(), is("Buy bread"));
-
- // when
- toDoItem.setDescription("Buy bread and butter");
-
- // then published and received
- @SuppressWarnings("unchecked")
- final PropertyChangedEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyChangedEvent.class);
- assertThat(ev, is(not(nullValue())));
-
- ToDoItem source = ev.getSource();
- assertThat(source, is(equalTo(unwrap(toDoItem))));
- assertThat(ev.getIdentifier().getMemberName(), is("description"));
- assertThat(ev.getOldValue(), is("Buy bread"));
- assertThat(ev.getNewValue(), is("Buy bread and butter"));
- }
-
- @Test
- public void subscriberVetoesEventWithRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithRecoverableException);
-
- // then
- expectedExceptions.expect(RecoverableException.class);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
- }
-
-
- @Test
- public void subscriberVetoesEventWithNonRecoverableException() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.RejectEventsWithNonRecoverableException);
-
- // then
- expectedExceptions.expect(NonRecoverableException.class);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
- }
-
-
- @Test
- public void subscriberThrowingOtherExceptionIsIgnored() throws Exception {
-
- // given
- toDoItemSubscriptions.subscriberBehaviour(ToDoItemSubscriptions.Behaviour.ThrowOtherException);
-
- // when
- toDoItem.setDescription("Buy bread and butter");
-
- // then
- // (no expectedExceptions setup, expect to continue)
- assertTrue(true);
- }
-
-
- 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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
deleted file mode 100644
index f9b043f..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_dueBy.java
+++ /dev/null
@@ -1,106 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.joda.time.LocalDate;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.clock.Clock;
-import org.apache.isis.applib.services.clock.ClockService;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemTest_dueBy extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ClockService clockService;
- @Inject
- private ToDoItems toDoItems;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
- toDoItem = wrap(all.get(0));
- }
-
- @Test
- public void happyCase() throws Exception {
-
- // when
- final LocalDate fiveDaysFromNow = clockService.now().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 = clockService.now();
- 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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.java
deleted file mode 100644
index e8b9a00..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_notes.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.tests.props;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItemSubscriptions;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.services.eventbus.PropertyChangedEvent;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.nullValue;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemTest_notes extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- private ToDoItem toDoItem;
- private ToDoItemSubscriptions toDoItemSubscriptions;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(service(ToDoItems.class)).notYetComplete();
- toDoItem = wrap(all.get(0));
- toDoItemSubscriptions = service(ToDoItemSubscriptions.class);
- }
-
- @After
- public void tearDown() throws Exception {
- toDoItemSubscriptions.reset();
- }
-
- @Test
- public void happyCase() throws Exception {
-
- final String newNotes = "Lorem ipsum yada yada";
-
- // when
- toDoItem.setNotes(newNotes);
-
- // then
- assertThat(toDoItem.getNotes(), is(newNotes));
-
- // and then not published so not received
- @SuppressWarnings("unchecked")
- final PropertyChangedEvent<ToDoItem,String> ev = toDoItemSubscriptions.mostRecentlyReceivedEvent(PropertyChangedEvent.class);
- assertThat(ev, is(nullValue()));
- }
-
- @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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
deleted file mode 100644
index caeb116..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_ownedBy.java
+++ /dev/null
@@ -1,61 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ToDoItemTest_ownedBy extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).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/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
deleted file mode 100644
index 20579b2..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/props/ToDoItemTest_subcategory.java
+++ /dev/null
@@ -1,62 +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 dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Subcategory;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.containsString;
-
-public class ToDoItemTest_subcategory extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- private ToDoItem toDoItem;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> all = wrap(toDoItems).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);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
deleted file mode 100644
index 03681ff..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_finders.java
+++ /dev/null
@@ -1,84 +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.repo;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.hamcrest.Matchers;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemsTest_finders extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- private int notYetCompletedSize;
- private int completedSize;
-
- @Before
- public void setUp() throws Exception {
- final List<ToDoItem> notYetCompleteItems = wrap(toDoItems).notYetComplete();
- final List<ToDoItem> completedItems = wrap(toDoItems).complete();
-
- notYetCompletedSize = notYetCompleteItems.size();
- completedSize = completedItems.size();
-
- assertThat(notYetCompletedSize, is(Matchers.greaterThan(5)));
- }
-
- @Test
- public void complete_and_notYetComplete() throws Exception {
-
- // given
- List<ToDoItem> notYetCompleteItems = wrap(service(ToDoItems.class)).notYetComplete();
- final ToDoItem toDoItem = wrap(notYetCompleteItems.get(0));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize-1));
- assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize+1));
-
- // and when
- toDoItem.notYetCompleted();
-
- // then
- assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(notYetCompletedSize));
- assertThat(wrap(service(ToDoItems.class)).complete().size(), is(completedSize));
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
deleted file mode 100644
index 6b8e94d..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/repo/ToDoItemsTest_newToDo_and_delete.java
+++ /dev/null
@@ -1,68 +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.repo;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItem.Category;
-import dom.todo.ToDoItem.Subcategory;
-import dom.todo.ToDoItems;
-import integration.tests.ToDoIntegTest;
-
-import javax.inject.Inject;
-import org.junit.Before;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemsTest_newToDo_and_delete extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- // none
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- @Test
- public void happyCase() throws Exception {
-
- // given
- int size = wrap(toDoItems).notYetComplete().size();
-
- // when
- final ToDoItem newToDo = wrap(service(ToDoItems.class)).newToDo("new todo", Category.Professional, Subcategory.OpenSource, null, null);
-
- // then
- assertThat(newToDo.getDescription(), is("new todo"));
- assertThat(newToDo.getCategory(), is(Category.Professional));
- assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size+1));
-
- // when
- newToDo.delete();
-
- // then
- assertThat(wrap(service(ToDoItems.class)).notYetComplete().size(), is(size));
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java b/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
deleted file mode 100644
index afbc6b7..0000000
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/integtests/src/test/java/integration/tests/smoke/ToDoItemTest_title.java
+++ /dev/null
@@ -1,116 +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.smoke;
-
-import dom.todo.ToDoItem;
-import dom.todo.ToDoItems;
-import fixture.todo.integtests.ToDoItemsIntegTestFixture;
-import integration.tests.ToDoIntegTest;
-
-import java.util.List;
-import javax.inject.Inject;
-import org.joda.time.LocalDate;
-import org.junit.Before;
-import org.junit.Test;
-import org.apache.isis.applib.clock.Clock;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertThat;
-
-public class ToDoItemTest_title extends ToDoIntegTest {
-
- @Before
- public void setUpData() throws Exception {
- scenarioExecution().install(new ToDoItemsIntegTestFixture());
- }
-
- @Inject
- private ToDoItems toDoItems;
-
- private ToDoItem toDoItem;
- private LocalDate dueBy;
-
- @Before
- public void setUp() throws Exception {
-
- final List<ToDoItem> all = wrap(toDoItems).notYetComplete();
- toDoItem = wrap(all.get(0));
-
- dueBy = toDoItem.getDueBy();
- }
-
-
- @Test
- public void includesDescription() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), containsString("Buy bread due by"));
-
- // when
- unwrap(toDoItem).setDescription("Buy bread and butter");
-
- // then
- assertThat(container().titleOf(toDoItem), containsString("Buy bread and butter due by"));
- }
-
- @Test
- public void includesDueDateIfAny() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), containsString("due by " + dueBy.toString("yyyy-MM-dd")));
-
- // when
- final LocalDate fiveDaysFromNow = Clock.getTimeAsLocalDate().plusDays(5);
- unwrap(toDoItem).setDueBy(fiveDaysFromNow);
-
- // then
- assertThat(container().titleOf(toDoItem), containsString("due by " + fiveDaysFromNow.toString("yyyy-MM-dd")));
- }
-
-
- @Test
- public void ignoresDueDateIfNone() throws Exception {
-
- // when
- // (since wrapped, will call clearDueBy)
- toDoItem.setDueBy(null);
-
- // then
- assertThat(container().titleOf(toDoItem), not(containsString("due by")));
- }
-
- @Test
- public void usesWhetherCompleted() throws Exception {
-
- // given
- assertThat(container().titleOf(toDoItem), not(containsString("Completed!")));
-
- // when
- toDoItem.completed();
-
- // then
- assertThat(container().titleOf(toDoItem), not(containsString("due by")));
- assertThat(container().titleOf(toDoItem), containsString("Buy bread - Completed!"));
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
index 1ba2a5a..8b6ee60 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/pom.xml
@@ -23,7 +23,7 @@
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
- <name>Quickstart Wicket/Restful/JDO App</name>
+ <name>ToDo App</name>
<packaging>pom</packaging>
@@ -32,11 +32,8 @@
</prerequisites>
<properties>
- <isis.version>1.5.0</isis.version>
- <isis-objectstore-jdo.version>1.5.0</isis-objectstore-jdo.version>
- <isis-viewer-wicket.version>1.5.0</isis-viewer-wicket.version>
- <isis-viewer-restfulobjects.version>2.3.0</isis-viewer-restfulobjects.version>
- <isis-security-shiro.version>1.5.0</isis-security-shiro.version>
+ <isis.version>1.6.0</isis.version>
+ <isis-viewer-wicket.version>1.6.0</isis-viewer-wicket.version>
<!-- must be consistent with the versions defined by the JDO Objectstore -->
<datanucleus-accessplatform-jdo-rdbms.version>3.3.6</datanucleus-accessplatform-jdo-rdbms.version>
@@ -90,13 +87,9 @@
<version>2.16</version>
<configuration>
<includes>
- <include>**/*Test.java</include>
- <include>**/*Test_*.java</include>
- <include>**/*Spec*.java</include>
+ <include>**/*.java</include>
</includes>
<excludes>
- <exclude>**/Test*.java</exclude>
- <exclude>**/*ForTesting.java</exclude>
<exclude>**/*Abstract*.java</exclude>
</excludes>
<useFile>true</useFile>
@@ -310,14 +303,6 @@
</dependency>
<dependency>
- <groupId>org.apache.isis.objectstore</groupId>
- <artifactId>isis-objectstore-jdo</artifactId>
- <version>${isis-objectstore-jdo.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket</artifactId>
<version>${isis-viewer-wicket.version}</version>
@@ -325,22 +310,6 @@
<scope>import</scope>
</dependency>
- <dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-restfulobjects</artifactId>
- <version>${isis-viewer-restfulobjects.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.isis.security</groupId>
- <artifactId>isis-security-shiro</artifactId>
- <version>${isis-security-shiro.version}</version>
- <type>pom</type>
- <scope>import</scope>
- </dependency>
-
<!-- this project's own modules -->
<dependency>
@@ -360,7 +329,6 @@
</dependency>
-
<!-- quartz scheduler integration -->
<dependency>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
index 358e3d9..87bfd3b 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-jrebel.launch
@@ -20,7 +20,7 @@
<stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
<stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
<stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="quickstart_wicket_restful_jdo-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
<stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
<stringAttribute value="${jrebel_args} -Drebel.log=false -Drebel.check_class_hash=true -Drebel.packages_exclude=org.apache.isis -Dproject.root=${project_loc}/.. -Dtarget.dir=target-ide -Drebel.plugins=C:/github/danhaywood/isis-jrebel-plugin/target/danhaywood-isis-jrebel-plugin-1.0.0-SNAPSHOT.jar -Disis-jrebel-plugin.packagePrefix=dom.todo,org.apache.isis.objectstore.jdo.applib -Disis-jrebel-plugin.loggingLevel=warn -XX:MaxPermSize=128m" key="org.eclipse.jdt.launching.VM_ARGUMENTS"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
index 3376620..456dc66 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE-with-fixtures.launch
@@ -17,6 +17,6 @@
<stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
<stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
<stringAttribute value="--port 8080 -D isis.persistor.datanucleus.install-fixtures=true --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="quickstart_wicket_restful_jdo-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
<stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
index 4fd7be2..cd6c8a8 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-PROTOTYPE.launch
@@ -20,6 +20,6 @@
<stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
<stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
<stringAttribute value="--port 8080 --type SERVER_PROTOTYPE" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="quickstart_wicket_restful_jdo-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
<stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
index 2e2e0ea..3577cbc 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/ide/eclipse/launch/ToDoApp-SERVER.launch
@@ -20,6 +20,6 @@
<stringAttribute value="org.eclipse.m2e.launchconfig.classpathProvider" key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER"/>
<stringAttribute value="org.apache.isis.WebServer" key="org.eclipse.jdt.launching.MAIN_TYPE"/>
<stringAttribute value="--port 8080 --type SERVER" key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS"/>
- <stringAttribute value="${rootArtifactId}-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
+ <stringAttribute value="quickstart_wicket_restful_jdo-webapp" key="org.eclipse.jdt.launching.PROJECT_ATTR"/>
<stringAttribute value="org.eclipse.m2e.launchconfig.sourcepathProvider" key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER"/>
</launchConfiguration>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
index fd82d02..2b28acc 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/pom.xml
@@ -26,7 +26,7 @@
</parent>
<artifactId>${artifactId}</artifactId>
- <name>Quickstart Wicket/Restful/JDO Webapp</name>
+ <name>ToDo App Webapp</name>
<description>This module runs both the Wicket viewer and the Restfulobjects viewer in a single webapp configured to run using the datanucleus object store.</description>
@@ -156,20 +156,20 @@
<!-- other isis components -->
<dependency>
- <groupId>org.apache.isis.objectstore</groupId>
- <artifactId>isis-objectstore-jdo-datanucleus</artifactId>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-objectstore-jdo-datanucleus</artifactId>
</dependency>
<dependency>
<groupId>org.apache.isis.viewer</groupId>
<artifactId>isis-viewer-wicket-impl</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.isis.viewer</groupId>
- <artifactId>isis-viewer-restfulobjects-server</artifactId>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-viewer-restfulobjects-server</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.isis.security</groupId>
- <artifactId>isis-security-shiro</artifactId>
+ <groupId>org.apache.isis.core</groupId>
+ <artifactId>isis-core-security-shiro</artifactId>
</dependency>
@@ -179,8 +179,8 @@
<artifactId>isis-core-runtime</artifactId>
</dependency>
<dependency>
- <groupId>org.apache.isis.core</groupId>
- <artifactId>isis-core-wrapper</artifactId>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-wrapper</artifactId>
</dependency>
<dependency>
<groupId>org.apache.isis.core</groupId>
@@ -190,7 +190,35 @@
<groupId>org.apache.isis.core</groupId>
<artifactId>isis-core-security</artifactId>
</dependency>
-
+
+
+ <!-- isis modules -->
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-devutils-impl</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-audit-jdo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-command-jdo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-publishing-jdo</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-publishingeventserializer-ro</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.isis.module</groupId>
+ <artifactId>isis-module-settings-impl-jdo</artifactId>
+ </dependency>
+
+
<!-- to run using WebServer (optional) -->
<dependency>
<groupId>org.apache.isis.core</groupId>
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/Admin.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/Admin.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/Admin.java
index 748b29e..9130c31 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/Admin.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/Admin.java
@@ -33,6 +33,7 @@ import org.apache.isis.objectstore.jdo.applib.service.command.CommandServiceJdoR
import org.apache.isis.objectstore.jdo.applib.service.publish.PublishedEventJdo;
import org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdoRepository;
+@DomainService(menuOrder = "35")
public class Admin extends AbstractService {
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/AdminContributions.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/AdminContributions.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/AdminContributions.java
index a4b6707..1267098 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/AdminContributions.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/admin/AdminContributions.java
@@ -28,12 +28,8 @@ import org.joda.time.LocalDate;
import org.apache.isis.applib.AbstractService;
import org.apache.isis.applib.ViewModel;
-import org.apache.isis.applib.annotation.ActionSemantics;
+import org.apache.isis.applib.annotation.*;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.MemberOrder;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.NotInServiceMenu;
-import org.apache.isis.applib.annotation.Optional;
import org.apache.isis.applib.services.HasTransactionId;
import org.apache.isis.applib.services.bookmark.Bookmark;
import org.apache.isis.applib.services.bookmark.BookmarkService;
@@ -46,6 +42,7 @@ import org.apache.isis.objectstore.jdo.applib.service.command.CommandServiceJdoR
import org.apache.isis.objectstore.jdo.applib.service.publish.PublishedEventJdo;
import org.apache.isis.objectstore.jdo.applib.service.publish.PublishingServiceJdoRepository;
+@DomainService
public class AdminContributions extends AbstractService {
/**
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java
index f9bf99e..a75ecdb 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/DeveloperUtilities.java
@@ -19,8 +19,7 @@
*/
package webapp.prototyping;
-import fixture.todo.ToDoItemsFixturesService;
-
+import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.MemberOrder;
import org.apache.isis.applib.value.Blob;
import org.apache.isis.applib.value.Clob;
@@ -28,8 +27,9 @@ import org.apache.isis.core.metamodel.services.devutils.DeveloperUtilitiesServic
/**
* These overrides are simply to 'move' the action underneath the
- * {@link ToDoItemsFixturesService fixtures} menu.
+ * 'Prototyping' menu.
*/
+@DomainService(menuOrder = "40.2")
public class DeveloperUtilities extends DeveloperUtilitiesServiceDefault {
@MemberOrder(name="Prototyping", sequence="90.1")
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
index a7326a8..b947ec1 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/ExternalLinksService.java
@@ -22,17 +22,15 @@ package webapp.prototyping;
import java.net.MalformedURLException;
import java.net.URL;
-import org.apache.isis.applib.annotation.ActionSemantics;
-import org.apache.isis.applib.annotation.Named;
-import org.apache.isis.applib.annotation.Prototype;
+import org.apache.isis.applib.annotation.*;
import org.apache.isis.applib.annotation.ActionSemantics.Of;
-import org.apache.isis.applib.annotation.MemberOrder;
+@DomainService(menuOrder = "40.3")
public class ExternalLinksService {
public static enum ExternalLink {
ISIS_DOCUMENTATION("Apache Isis docs", "http://isis.apache.org/documentation.html"),
- PROJECT_ON_GITHUB("Project source code on Github", "https://github.com/apache/isis/tree/master/example/application/${parentArtifactId}/");
+ PROJECT_ON_GITHUB("Project source code on Github", "https://github.com/apache/isis/tree/master/example/application/quickstart_wicket_restful_jdo/");
private final String title;
private final String url;
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
new file mode 100644
index 0000000..5c7678f
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/java/webapp/prototyping/WicketDeveloperUtilities.java
@@ -0,0 +1,42 @@
+#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 webapp.prototyping;
+
+import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.MemberOrder;
+import org.apache.isis.applib.annotation.Named;
+import org.apache.isis.viewer.wicket.viewer.applib.WicketDeveloperUtilitiesService;
+
+/**
+ * These overrides are simply to 'move' the action underneath the
+ * 'Prototyping' menu.
+ */
+@DomainService(menuOrder = "40.3")
+public class WicketDeveloperUtilities extends WicketDeveloperUtilitiesService {
+
+ @Named("Clear i18n Cache")
+ @MemberOrder(name="Prototyping", sequence="90.3")
+ @Override
+ public void resetI18nCache() {
+ super.resetI18nCache();
+ }
+
+}
+
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
new file mode 100644
index 0000000..65dc6ea
--- /dev/null
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/ToDoApplication_en.properties
@@ -0,0 +1,54 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+${symbol_pound}
+${symbol_pound} Licensed to the Apache Software Foundation (ASF) under one
+${symbol_pound} or more contributor license agreements. See the NOTICE file
+${symbol_pound} distributed with this work for additional information
+${symbol_pound} regarding copyright ownership. The ASF licenses this file
+${symbol_pound} to you under the Apache License, Version 2.0 (the
+${symbol_pound} "License"); you may not use this file except in compliance
+${symbol_pound} with the License. You may obtain a copy of the License at
+${symbol_pound}
+${symbol_pound} http://www.apache.org/licenses/LICENSE-2.0
+${symbol_pound}
+${symbol_pound} Unless required by applicable law or agreed to in writing,
+${symbol_pound} software distributed under the License is distributed on an
+${symbol_pound} "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+${symbol_pound} KIND, either express or implied. See the License for the
+${symbol_pound} specific language governing permissions and limitations
+${symbol_pound} under the License.
+${symbol_pound}
+
+
+${symbol_pound} override WicketSignInPage.properties
+loginHeader=Login
+
+${symbol_pound} override PageAbstract.properties
+aboutLabel=About
+logoutLabel=Logout
+
+${symbol_pound} override EntityPropertiesForm.properties and also
+${symbol_pound} override ActionParametersFormPanel.properties
+okLabel=OK
+cancelLabel=Cancel
+editLabel=Edit
+
+
+
+
+${symbol_pound}
+${symbol_pound} 3rd-party components
+${symbol_pound}
+
+${symbol_pound} Select2Choice
+
+${symbol_pound}noMatches=...
+${symbol_pound}inputTooShortSingular=...
+${symbol_pound}inputTooShortPlural=...
+${symbol_pound}loadMore=...
+${symbol_pound}searching=...
+
+${symbol_pound} datatables
+${symbol_pound}no-records-found=...
+
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
index 13246ad..311694b 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/realm1.ini
@@ -38,6 +38,18 @@ bob = pass, user_role, self-install_role
+#
+# some additional users/roles
+# require IsisPermissionResolver to be configured in shiro.ini, and
+# require additional role/perms to be configured below in [roles]
+#
+
+# # fred should have access to everything except the analysis features
+# fred = pass,isisperms_all_but_analysis_role
+# # bill should have access to everything (the admin role 'trumps' the vetos)
+# bill = pass,isisperms_all_but_analysis_role,isisperms_admin_role
+
+
# -----------------------------------------------------------------------------
# Roles with assigned permissions
#
@@ -66,3 +78,17 @@ analysis_role = *:ToDoItemAnalysis:*:*,\
self-install_role = *:ToDoItemsFixturesService:installFixtures:*
admin_role = *
+
+
+
+#
+# some additional role/perms
+# require IsisPermissionResolver to be configured in shiro.ini
+#
+
+# isisperms_all_but_analysis_role = aba/*,\
+# !aba/*:ToDoItemAnalysis:*,\
+# !aba/*:ToDoItemsByCategoryViewModel:*:*,\
+# !aba/*:ToDoItemsByDateRangeViewModel:*:*
+# isisperms_admin_role = adm/*
+
http://git-wip-us.apache.org/repos/asf/isis/blob/308aadc4/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
----------------------------------------------------------------------
diff --git a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
index a71ec99..e9155b0 100644
--- a/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
+++ b/example/archetype/todoapp/src/main/resources/archetype-resources/webapp/src/main/resources/webapp/welcome.html
@@ -30,7 +30,7 @@
which configures Isis' most commonly used components in a straightforward "todo" app.
<br/>
<br/>
- The core domain functionality class is provided by the <a href="https://github.com/apache/isis/blob/master/example/application/${parentArtifactId}/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank">ToDoItem</a> domain class.
+ The core domain functionality class is provided by the <a href="https://github.com/apache/isis/blob/master/example/application/quickstart_wicket_restful_jdo/dom/src/main/java/dom/todo/ToDoItem.java" target="_blank">ToDoItem</a> domain class.
Supporting services provide additional capabilities.
<br/>
<br/>