You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by pa...@apache.org on 2016/12/06 17:30:08 UTC
[1/5] zest-java git commit: bootstrap: add some assembly facilities
to ApplicationBuilder
Repository: zest-java
Updated Branches:
refs/heads/develop 2d6e287bc -> 994d38913
bootstrap: add some assembly facilities to ApplicationBuilder
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/4618a2eb
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/4618a2eb
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/4618a2eb
Branch: refs/heads/develop
Commit: 4618a2eb3d439083e4292f31a43ae0481953cb52
Parents: 2d6e287
Author: Paul Merlin <pa...@apache.org>
Authored: Sat Dec 3 16:24:28 2016 +0100
Committer: Paul Merlin <pa...@apache.org>
Committed: Mon Dec 5 09:51:25 2016 +0100
----------------------------------------------------------------------
.../ApplicationPassivationThread.java | 2 -
.../bootstrap/builder/ApplicationBuilder.java | 58 +++++++++++++++++++-
2 files changed, 55 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/4618a2eb/core/api/src/main/java/org/apache/zest/api/activation/ApplicationPassivationThread.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/activation/ApplicationPassivationThread.java b/core/api/src/main/java/org/apache/zest/api/activation/ApplicationPassivationThread.java
index 78ef07c..0923e67 100644
--- a/core/api/src/main/java/org/apache/zest/api/activation/ApplicationPassivationThread.java
+++ b/core/api/src/main/java/org/apache/zest/api/activation/ApplicationPassivationThread.java
@@ -27,8 +27,6 @@ import org.apache.zest.api.structure.Application;
/**
* Application Passivation Thread to use as a Shutdown Hook.
* <pre>Runtime.getRuntime().addShutdownHook( new ApplicationPassivationThread( application ) );</pre>
- * <p>Constructors to control where errors are logged are provided. They support PrintStream (STDOUT/STDERR) and SLF4J
- * Loggers. Defaults to STDERR.</p>
*/
public final class ApplicationPassivationThread
extends Thread
http://git-wip-us.apache.org/repos/asf/zest-java/blob/4618a2eb/core/bootstrap/src/main/java/org/apache/zest/bootstrap/builder/ApplicationBuilder.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/zest/bootstrap/builder/ApplicationBuilder.java b/core/bootstrap/src/main/java/org/apache/zest/bootstrap/builder/ApplicationBuilder.java
index bd4d9d0..7c53bea 100644
--- a/core/bootstrap/src/main/java/org/apache/zest/bootstrap/builder/ApplicationBuilder.java
+++ b/core/bootstrap/src/main/java/org/apache/zest/bootstrap/builder/ApplicationBuilder.java
@@ -48,6 +48,10 @@ public class ApplicationBuilder
implements ActivationEventListenerRegistration
{
private final String applicationName;
+ private String applicationVersion;
+ private Application.Mode applicationMode;
+ private final List<Object> metaInfos = new ArrayList<>();
+ private boolean passivationShutdownHook;
private final Map<String, LayerDeclaration> layers = new HashMap<>();
private final List<ActivationEventListener> activationListeners = new ArrayList<>();
@@ -56,6 +60,40 @@ public class ApplicationBuilder
this.applicationName = applicationName;
}
+ public ApplicationBuilder version( String version )
+ {
+ applicationVersion = version;
+ return this;
+ }
+
+ public ApplicationBuilder mode( Application.Mode mode )
+ {
+ applicationMode = mode;
+ return this;
+ }
+
+ public ApplicationBuilder metaInfo( Object... metaInfos )
+ {
+ for( Object metaInfo : metaInfos )
+ {
+ this.metaInfos.add( metaInfo );
+ }
+ return this;
+ }
+
+ /**
+ * Register a JVM shutdown hook that passivate the Application.
+ *
+ * The hook is registered after activating the Application and before {@link #afterActivation()}.
+ *
+ * @return This builder
+ */
+ public ApplicationBuilder withPassivationShutdownHook()
+ {
+ this.passivationShutdownHook = true;
+ return this;
+ }
+
/**
* Create and activate a new Application.
* @return Activated Application
@@ -74,6 +112,18 @@ public class ApplicationBuilder
{
ApplicationAssembly assembly = factory.newApplicationAssembly();
assembly.setName( applicationName );
+ if( applicationVersion != null )
+ {
+ assembly.setVersion( applicationVersion );
+ }
+ if( applicationMode != null )
+ {
+ assembly.setMode( applicationMode );
+ }
+ for( Object metaInfo : metaInfos )
+ {
+ assembly.setMetaInfo( metaInfo );
+ }
HashMap<String, LayerAssembly> createdLayers = new HashMap<>();
for( Map.Entry<String, LayerDeclaration> entry : layers.entrySet() )
{
@@ -94,6 +144,10 @@ public class ApplicationBuilder
}
beforeActivation();
application.activate();
+ if( passivationShutdownHook )
+ {
+ Runtime.getRuntime().addShutdownHook( new ApplicationPassivationThread( application ) );
+ }
afterActivation();
return application;
}
@@ -244,8 +298,6 @@ public class ApplicationBuilder
public static void main( String[] args )
throws JSONException, ActivationException, AssemblyException
{
- ApplicationBuilder builder = fromJson( System.in );
- Application application = builder.newApplication();
- Runtime.getRuntime().addShutdownHook( new ApplicationPassivationThread( application, System.err ) );
+ fromJson( System.in ).withPassivationShutdownHook().newApplication();
}
}
[5/5] zest-java git commit: api: Lifecycle can throw Exception
Posted by pa...@apache.org.
api: Lifecycle can throw Exception
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/994d3891
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/994d3891
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/994d3891
Branch: refs/heads/develop
Commit: 994d38913cd99c1a691611c50580c58d9fdc2940
Parents: ccb54f3
Author: Paul Merlin <pa...@apache.org>
Authored: Tue Dec 6 09:41:51 2016 +0100
Committer: Paul Merlin <pa...@apache.org>
Committed: Tue Dec 6 09:41:51 2016 +0100
----------------------------------------------------------------------
.../org/apache/zest/api/entity/Lifecycle.java | 11 ++++------
.../zest/api/entity/LifecycleException.java | 14 +++++--------
.../zest/runtime/entity/EntityInstance.java | 2 --
.../zest/runtime/entity/EntityMixinsModel.java | 21 ++++++++++++++++++--
.../apache/zest/regression/qi382/Qi382Test.java | 11 ++++------
.../zest/runtime/entity/EntityCreationTest.java | 5 +----
.../zest/runtime/entity/LifecycleTest.java | 7 ++-----
.../uowfile/plural/HasUoWFilesLifecycle.java | 7 +++----
.../uowfile/singular/HasUoWFileLifecycle.java | 7 +++----
9 files changed, 41 insertions(+), 44 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/core/api/src/main/java/org/apache/zest/api/entity/Lifecycle.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/entity/Lifecycle.java b/core/api/src/main/java/org/apache/zest/api/entity/Lifecycle.java
index e7bde27..3eb933a 100644
--- a/core/api/src/main/java/org/apache/zest/api/entity/Lifecycle.java
+++ b/core/api/src/main/java/org/apache/zest/api/entity/Lifecycle.java
@@ -65,17 +65,15 @@ package org.apache.zest.api.entity;
*/
public interface Lifecycle
{
-
/**
* Creation callback method.
* <p>
* Called by the Zest runtime before the newInstance of the entity completes, before the constraints are checked,
* allowing for additional initialization.
* </p>
- * @throws LifecycleException if the entity could not be created
+ * @throws Exception if the entity could not be created
*/
- void create()
- throws LifecycleException;
+ void create() throws Exception;
/**
* Removal callback method.
@@ -83,8 +81,7 @@ public interface Lifecycle
* Called by the Zest runtime before the entity is removed from the system, allowing
* for clean-up operations.
* </p>
- * @throws LifecycleException if the entity could not be removed
+ * @throws Exception if the entity could not be removed
*/
- void remove()
- throws LifecycleException;
+ void remove() throws Exception;
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/core/api/src/main/java/org/apache/zest/api/entity/LifecycleException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/entity/LifecycleException.java b/core/api/src/main/java/org/apache/zest/api/entity/LifecycleException.java
index 4670cf8..c4b5957 100644
--- a/core/api/src/main/java/org/apache/zest/api/entity/LifecycleException.java
+++ b/core/api/src/main/java/org/apache/zest/api/entity/LifecycleException.java
@@ -21,23 +21,19 @@
package org.apache.zest.api.entity;
/**
- * Thrown by methods of Lifecycle if invocation fails
+ * Thrown if Lifecycle invocation fails
*/
public class LifecycleException
extends RuntimeException
{
- public LifecycleException( String s )
- {
- super( s );
- }
+ private static final long serialVersionUID = 1L;
- public LifecycleException( String s, Throwable throwable )
+ public LifecycleException()
{
- super( s, throwable );
}
- public LifecycleException( Throwable throwable )
+ public LifecycleException( String message, Throwable cause )
{
- super( throwable );
+ super( message, cause );
}
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityInstance.java b/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityInstance.java
index 86f00cc..09453f1 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityInstance.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityInstance.java
@@ -33,7 +33,6 @@ import org.apache.zest.api.constraint.ConstraintViolationException;
import org.apache.zest.api.entity.EntityComposite;
import org.apache.zest.api.entity.EntityReference;
import org.apache.zest.api.identity.HasIdentity;
-import org.apache.zest.api.entity.LifecycleException;
import org.apache.zest.api.structure.ModuleDescriptor;
import org.apache.zest.api.unitofwork.NoSuchEntityException;
import org.apache.zest.api.unitofwork.UnitOfWork;
@@ -242,7 +241,6 @@ public final class EntityInstance
}
public void remove( UnitOfWork unitOfWork )
- throws LifecycleException
{
invokeRemove();
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityMixinsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityMixinsModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityMixinsModel.java
index 52ad5a9..c0737ed 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityMixinsModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/entity/EntityMixinsModel.java
@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.List;
import org.apache.zest.api.composite.CompositeInstance;
import org.apache.zest.api.entity.Lifecycle;
+import org.apache.zest.api.entity.LifecycleException;
import org.apache.zest.api.property.StateHolder;
import org.apache.zest.bootstrap.BindingException;
import org.apache.zest.runtime.composite.MixinModel;
@@ -88,11 +89,27 @@ public final class EntityMixinsModel
if( create )
{
- lifecycle.create();
+ try
+ {
+ lifecycle.create();
+ }
+ catch( Exception ex )
+ {
+ String message = "Unable to invoke create lifecycle on " + lifecycle;
+ throw new LifecycleException( message, ex );
+ }
}
else
{
- lifecycle.remove();
+ try
+ {
+ lifecycle.remove();
+ }
+ catch( Exception ex )
+ {
+ String message = "Unable to invoke remove lifecycle on " + lifecycle;
+ throw new LifecycleException( message, ex );
+ }
}
}
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/core/runtime/src/test/java/org/apache/zest/regression/qi382/Qi382Test.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi382/Qi382Test.java b/core/runtime/src/test/java/org/apache/zest/regression/qi382/Qi382Test.java
index 800d241..f34b55a 100644
--- a/core/runtime/src/test/java/org/apache/zest/regression/qi382/Qi382Test.java
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi382/Qi382Test.java
@@ -19,26 +19,25 @@
*/
package org.apache.zest.regression.qi382;
-import org.apache.zest.api.identity.Identity;
-import org.apache.zest.api.identity.StringIdentity;
-import org.apache.zest.api.unitofwork.UnitOfWorkFactory;
-import org.junit.Test;
import org.apache.zest.api.association.Association;
import org.apache.zest.api.entity.EntityBuilder;
import org.apache.zest.api.entity.EntityComposite;
import org.apache.zest.api.entity.Lifecycle;
-import org.apache.zest.api.entity.LifecycleException;
+import org.apache.zest.api.identity.Identity;
+import org.apache.zest.api.identity.StringIdentity;
import org.apache.zest.api.injection.scope.Structure;
import org.apache.zest.api.injection.scope.This;
import org.apache.zest.api.mixin.Mixins;
import org.apache.zest.api.unitofwork.UnitOfWork;
import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException;
+import org.apache.zest.api.unitofwork.UnitOfWorkFactory;
import org.apache.zest.api.value.ValueSerialization;
import org.apache.zest.bootstrap.AssemblyException;
import org.apache.zest.bootstrap.ModuleAssembly;
import org.apache.zest.entitystore.memory.MemoryEntityStoreService;
import org.apache.zest.test.AbstractZestTest;
import org.apache.zest.valueserialization.orgjson.OrgJsonValueSerializationService;
+import org.junit.Test;
import static org.hamcrest.core.IsEqual.equalTo;
import static org.hamcrest.core.IsNull.notNullValue;
@@ -92,7 +91,6 @@ public class Qi382Test extends AbstractZestTest
@Override
public void create()
- throws LifecycleException
{
UnitOfWork unitOfWork = uowf.currentUnitOfWork();
EntityBuilder<Person> builder = unitOfWork.newEntityBuilder( Person.class, NICLAS);
@@ -102,7 +100,6 @@ public class Qi382Test extends AbstractZestTest
@Override
public void remove()
- throws LifecycleException
{
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityCreationTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityCreationTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityCreationTest.java
index f9865e6..77c92c8 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityCreationTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/entity/EntityCreationTest.java
@@ -19,11 +19,9 @@
*/
package org.apache.zest.runtime.entity;
-import org.junit.Test;
import org.apache.zest.api.entity.EntityBuilder;
import org.apache.zest.api.entity.EntityComposite;
import org.apache.zest.api.entity.Lifecycle;
-import org.apache.zest.api.entity.LifecycleException;
import org.apache.zest.api.injection.scope.This;
import org.apache.zest.api.mixin.Mixins;
import org.apache.zest.api.property.Immutable;
@@ -33,6 +31,7 @@ import org.apache.zest.bootstrap.AssemblyException;
import org.apache.zest.bootstrap.ModuleAssembly;
import org.apache.zest.test.AbstractZestTest;
import org.apache.zest.test.EntityTestAssembler;
+import org.junit.Test;
/**
* Test case for http://team.ops4j.org/browse/QI-274
@@ -60,14 +59,12 @@ public class EntityCreationTest
@Override
public void create()
- throws LifecycleException
{
this._me.someProperty().set( "SomeValue" );
}
@Override
public void remove()
- throws LifecycleException
{
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/core/runtime/src/test/java/org/apache/zest/runtime/entity/LifecycleTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/entity/LifecycleTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/entity/LifecycleTest.java
index b9f5c2d..183d3e9 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/entity/LifecycleTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/entity/LifecycleTest.java
@@ -20,12 +20,9 @@
package org.apache.zest.runtime.entity;
-import org.hamcrest.CoreMatchers;
-import org.junit.Test;
import org.apache.zest.api.entity.EntityBuilder;
import org.apache.zest.api.entity.EntityComposite;
import org.apache.zest.api.entity.Lifecycle;
-import org.apache.zest.api.entity.LifecycleException;
import org.apache.zest.api.mixin.Mixins;
import org.apache.zest.api.unitofwork.UnitOfWork;
import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException;
@@ -33,6 +30,8 @@ import org.apache.zest.bootstrap.AssemblyException;
import org.apache.zest.bootstrap.ModuleAssembly;
import org.apache.zest.test.AbstractZestTest;
import org.apache.zest.test.EntityTestAssembler;
+import org.hamcrest.CoreMatchers;
+import org.junit.Test;
import static org.junit.Assert.assertThat;
@@ -106,13 +105,11 @@ public class LifecycleTest
implements Lifecycle, Testing
{
public void create()
- throws LifecycleException
{
create = true;
}
public void remove()
- throws LifecycleException
{
remove = true;
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/plural/HasUoWFilesLifecycle.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/plural/HasUoWFilesLifecycle.java b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/plural/HasUoWFilesLifecycle.java
index 0891714..048372f 100644
--- a/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/plural/HasUoWFilesLifecycle.java
+++ b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/plural/HasUoWFilesLifecycle.java
@@ -20,10 +20,10 @@
package org.apache.zest.library.uowfile.plural;
import java.io.File;
+import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.apache.zest.api.entity.Lifecycle;
-import org.apache.zest.api.entity.LifecycleException;
import org.apache.zest.api.injection.scope.This;
import org.apache.zest.api.mixin.Mixins;
@@ -39,14 +39,13 @@ public interface HasUoWFilesLifecycle<T extends Enum<T>>
@Override
public void create()
- throws LifecycleException
{
// NOOP
}
@Override
public void remove()
- throws LifecycleException
+ throws IOException
{
// We use the managed files so that if the UoW gets discarded the files will be restored
List<File> errors = new ArrayList<>();
@@ -62,7 +61,7 @@ public interface HasUoWFilesLifecycle<T extends Enum<T>>
}
if( !errors.isEmpty() )
{
- throw new LifecycleException( "Unable to delete existing files: " + errors );
+ throw new IOException( "Unable to delete existing files: " + errors );
}
}
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/994d3891/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/singular/HasUoWFileLifecycle.java
----------------------------------------------------------------------
diff --git a/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/singular/HasUoWFileLifecycle.java b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/singular/HasUoWFileLifecycle.java
index 7e47525..553ab45 100644
--- a/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/singular/HasUoWFileLifecycle.java
+++ b/libraries/uowfile/src/main/java/org/apache/zest/library/uowfile/singular/HasUoWFileLifecycle.java
@@ -20,8 +20,8 @@
package org.apache.zest.library.uowfile.singular;
import java.io.File;
+import java.io.IOException;
import org.apache.zest.api.entity.Lifecycle;
-import org.apache.zest.api.entity.LifecycleException;
import org.apache.zest.api.injection.scope.This;
import org.apache.zest.api.mixin.Mixins;
@@ -37,20 +37,19 @@ public interface HasUoWFileLifecycle
@Override
public void create()
- throws LifecycleException
{
// NOOP
}
@Override
public void remove()
- throws LifecycleException
+ throws IOException
{
// We use the managed file so that if the UoW gets discarded the file will be restored
File file = hasUoWFile.managedFile();
if( file.exists() && !file.delete() )
{
- throw new LifecycleException( "Unable to delete existing file: " + file );
+ throw new IOException( "Unable to delete existing file: " + file );
}
}
}
[2/5] zest-java git commit: non-checked EntityFinderException
Posted by pa...@apache.org.
non-checked EntityFinderException
Removed explicit throws declaration from tests where appropriate
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/5514dd1a
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/5514dd1a
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/5514dd1a
Branch: refs/heads/develop
Commit: 5514dd1a457dacb96a5b7dd4fcf0c0b2f1e4d747
Parents: 4618a2e
Author: Paul Merlin <pa...@apache.org>
Authored: Mon Dec 5 14:54:48 2016 +0100
Committer: Paul Merlin <pa...@apache.org>
Committed: Mon Dec 5 15:45:26 2016 +0100
----------------------------------------------------------------------
.../runtime/query/IterableQuerySourceTest.java | 28 --------------------
.../zest/spi/query/EntityFinderException.java | 3 +--
.../test/indexing/AbstractEntityFinderTest.java | 24 -----------------
.../test/indexing/AbstractNamedQueryTest.java | 24 -----------------
.../zest/test/indexing/AbstractQueryTest.java | 27 -------------------
.../elasticsearch/ElasticSearchQueryTest.java | 2 --
.../org/apache/zest/index/rdf/RdfQueryTest.java | 2 --
.../sql/postgresql/PostgreSQLQueryTest.java | 3 ---
8 files changed, 1 insertion(+), 112 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5514dd1a/core/runtime/src/test/java/org/apache/zest/runtime/query/IterableQuerySourceTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/query/IterableQuerySourceTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/query/IterableQuerySourceTest.java
index d36e659..fd297ce 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/query/IterableQuerySourceTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/query/IterableQuerySourceTest.java
@@ -51,7 +51,6 @@ import org.apache.zest.runtime.query.model.entities.DomainEntity;
import org.apache.zest.runtime.query.model.entities.PetEntity;
import org.apache.zest.runtime.query.model.values.ContactValue;
import org.apache.zest.runtime.query.model.values.ContactsValue;
-import org.apache.zest.spi.query.EntityFinderException;
import org.apache.zest.test.EntityTestAssembler;
import static org.junit.Assert.assertTrue;
@@ -158,7 +157,6 @@ public class IterableQuerySourceTest
@Test
public void givenQueryWhenExecutedReturnAll()
- throws EntityFinderException
{
final QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
final Query<Person> query = qb.newQuery( Network.persons() );
@@ -168,7 +166,6 @@ public class IterableQuerySourceTest
@Test
public void givenEqQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Domain> qb = qbf.newQueryBuilder( Domain.class );
final Nameable nameable = templateFor( Nameable.class );
@@ -180,7 +177,6 @@ public class IterableQuerySourceTest
@Test
public void givenMixinTypeQueryWhenExecutedReturnAll()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class );
Query<Nameable> query = qb.newQuery( Network.nameables() );
@@ -194,7 +190,6 @@ public class IterableQuerySourceTest
@Test
public void givenEqQueryOnValueWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person personTemplate = templateFor( Person.class );
@@ -207,7 +202,6 @@ public class IterableQuerySourceTest
@Test
public void givenEqQueryOnAssociationAndPropertyWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -219,7 +213,6 @@ public class IterableQuerySourceTest
@Test
public void givenEqQueryOnAssociationWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -232,7 +225,6 @@ public class IterableQuerySourceTest
@Test
public void givenGeQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -244,7 +236,6 @@ public class IterableQuerySourceTest
@Test
public void givenAndQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class );
Person person = templateFor( Person.class );
@@ -256,7 +247,6 @@ public class IterableQuerySourceTest
@Test
public void givenMultipleAndQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class );
Person person = templateFor( Person.class );
@@ -270,7 +260,6 @@ public class IterableQuerySourceTest
@Test
public void givenOrQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -285,7 +274,6 @@ public class IterableQuerySourceTest
@Test
public void givenMultipleOrQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -301,7 +289,6 @@ public class IterableQuerySourceTest
@Test
public void givenOrQueryOnFemalesWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Female> qb = qbf.newQueryBuilder( Female.class );
Person person = templateFor( Person.class );
@@ -316,7 +303,6 @@ public class IterableQuerySourceTest
@Test
public void givenNotQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -330,7 +316,6 @@ public class IterableQuerySourceTest
@Test
public void givenIsNotNullQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -342,7 +327,6 @@ public class IterableQuerySourceTest
@Test
public void givenIsNullQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -354,7 +338,6 @@ public class IterableQuerySourceTest
@Test
public void givenIsNotNullOnMixinTypeWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Male person = templateFor( Male.class );
@@ -366,7 +349,6 @@ public class IterableQuerySourceTest
@Test
public void givenIsNullOnMixinTypeWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Male> qb = qbf.newQueryBuilder( Male.class );
Male person = templateFor( Male.class );
@@ -378,7 +360,6 @@ public class IterableQuerySourceTest
@Test
public void givenIsNullOnAssociationWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Male person = templateFor( Male.class );
@@ -390,7 +371,6 @@ public class IterableQuerySourceTest
@Test
public void givenOrderAndMaxResultsQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class );
// should return only 2 entities
@@ -406,7 +386,6 @@ public class IterableQuerySourceTest
@Test
public void givenOrderAndFirstAndMaxResultsQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class );
// should return only 3 entities starting with forth one
@@ -423,7 +402,6 @@ public class IterableQuerySourceTest
@Test
public void givenOrderByOnMixinTypeQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class );
// should return all Nameable entities sorted by name
@@ -438,7 +416,6 @@ public class IterableQuerySourceTest
@Test
public void givenGtAndOrderByQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class );
// should return all Nameable entities with a name > "D" sorted by name
@@ -455,7 +432,6 @@ public class IterableQuerySourceTest
@Test
public void givenGtAndOrderByDescendingQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
// should return all Persons born after 1973 (Ann and Joe Doe) sorted descending by name
@@ -469,7 +445,6 @@ public class IterableQuerySourceTest
@Test
public void givenOrderByMultipleQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
// should return all Persons sorted by name of the city they were born, and then by year they were born
@@ -482,7 +457,6 @@ public class IterableQuerySourceTest
@Test
public void givenMatchesQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class );
Nameable nameable = templateFor( Nameable.class );
@@ -499,7 +473,6 @@ public class IterableQuerySourceTest
// TODO solve ManyAssociation filtering for iterables
// @Test
public void givenOneOfQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -510,7 +483,6 @@ public class IterableQuerySourceTest
@Test
public void givenManyAssociationContainsQueryWhenExecutedThenReturnCorrect()
- throws EntityFinderException
{
QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5514dd1a/core/spi/src/main/java/org/apache/zest/spi/query/EntityFinderException.java
----------------------------------------------------------------------
diff --git a/core/spi/src/main/java/org/apache/zest/spi/query/EntityFinderException.java b/core/spi/src/main/java/org/apache/zest/spi/query/EntityFinderException.java
index 68670d9..4d91f0f 100644
--- a/core/spi/src/main/java/org/apache/zest/spi/query/EntityFinderException.java
+++ b/core/spi/src/main/java/org/apache/zest/spi/query/EntityFinderException.java
@@ -22,8 +22,7 @@ package org.apache.zest.spi.query;
/**
* Entity Finder Exception.
*/
-public class EntityFinderException
- extends Exception
+public class EntityFinderException extends RuntimeException
{
public EntityFinderException( final String message )
{
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5514dd1a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractEntityFinderTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractEntityFinderTest.java b/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractEntityFinderTest.java
index 0538448..a7af4c3 100644
--- a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractEntityFinderTest.java
+++ b/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractEntityFinderTest.java
@@ -35,7 +35,6 @@ import org.apache.zest.api.query.grammar.OrderBy;
import org.apache.zest.api.service.ServiceReference;
import org.apache.zest.api.structure.Module;
import org.apache.zest.spi.query.EntityFinder;
-import org.apache.zest.spi.query.EntityFinderException;
import org.apache.zest.spi.query.IndexExporter;
import org.apache.zest.test.indexing.model.Domain;
import org.apache.zest.test.indexing.model.Female;
@@ -111,7 +110,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script01()
- throws EntityFinderException
{
// should return all persons (Joe, Ann, Jack Doe)
Iterable<EntityReference> entities = entityFinder.findEntities(
@@ -125,7 +123,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script02()
- throws EntityFinderException
{
Nameable nameable = templateFor( Nameable.class );
// should return Gaming domain
@@ -140,7 +137,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script03()
- throws EntityFinderException
{
// should return all entities
Iterable<EntityReference> entities = entityFinder.findEntities(
@@ -154,7 +150,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script04()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Joe and Ann Doe
@@ -169,7 +164,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script05()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Joe Doe
@@ -184,7 +178,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script06()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Joe and Ann Doe
@@ -200,7 +193,6 @@ public abstract class AbstractEntityFinderTest
@Test
@SuppressWarnings( "unchecked" )
public void script07()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Jack Doe
@@ -216,7 +208,6 @@ public abstract class AbstractEntityFinderTest
@Test
@SuppressWarnings( "unchecked" )
public void script08()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Jack and Ann Doe
@@ -232,7 +223,6 @@ public abstract class AbstractEntityFinderTest
@Test
@SuppressWarnings( "unchecked" )
public void script09()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Ann Doe
@@ -247,7 +237,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script10()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Joe and Jack Doe
@@ -262,7 +251,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script11()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Joe Doe
@@ -277,7 +265,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script12()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
// should return Ann and Jack Doe
@@ -292,7 +279,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script13()
- throws EntityFinderException
{
Male person = templateFor( Male.class );
// should return Jack Doe
@@ -307,7 +293,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script14()
- throws EntityFinderException
{
Male person = templateFor( Male.class );
// should return Joe Doe
@@ -322,7 +307,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script15()
- throws EntityFinderException
{
Male person = templateFor( Male.class );
// should return Ann and Joe Doe
@@ -337,7 +321,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script16()
- throws EntityFinderException
{
// should return only 2 entities
final List<EntityReference> references = StreamSupport.stream(
@@ -351,7 +334,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script17()
- throws EntityFinderException
{
// should return only 2 entities starting with third one
final List<EntityReference> references = StreamSupport.stream(
@@ -365,7 +347,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script18()
- throws EntityFinderException
{
// should return all Nameable entities sorted by name
Nameable nameable = templateFor( Nameable.class );
@@ -386,7 +367,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script19()
- throws EntityFinderException
{
// should return all Nameable entities with a name > "B" sorted by name
Nameable nameable = templateFor( Nameable.class );
@@ -413,7 +393,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script20()
- throws EntityFinderException
{
// should return all Persons born after 1973 (Ann and Joe Doe) sorted descending by name
Person person = templateFor( Person.class );
@@ -431,7 +410,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script21()
- throws EntityFinderException
{
// should return all Persons sorted name of the city they were born
Person person = templateFor( Person.class );
@@ -449,7 +427,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script22()
- throws EntityFinderException
{
Nameable nameable = templateFor( Nameable.class );
// should return Jack and Joe Doe
@@ -464,7 +441,6 @@ public abstract class AbstractEntityFinderTest
@Test
public void script23()
- throws EntityFinderException
{
Nameable nameable = templateFor( Nameable.class );
// Try using variables
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5514dd1a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractNamedQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractNamedQueryTest.java b/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractNamedQueryTest.java
index a348304..e2605f7 100644
--- a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractNamedQueryTest.java
+++ b/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractNamedQueryTest.java
@@ -28,7 +28,6 @@ import org.apache.zest.api.injection.scope.Structure;
import org.apache.zest.api.query.Query;
import org.apache.zest.api.query.grammar.OrderBy;
import org.apache.zest.api.structure.Module;
-import org.apache.zest.spi.query.EntityFinderException;
import org.apache.zest.spi.query.IndexExporter;
import org.apache.zest.test.indexing.model.Domain;
import org.apache.zest.test.indexing.model.Female;
@@ -86,7 +85,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script01()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -97,7 +95,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script02()
- throws EntityFinderException
{
final Query<Domain> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Domain.class )
@@ -108,7 +105,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script03()
- throws EntityFinderException
{
final Query<Nameable> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Nameable.class )
@@ -120,7 +116,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script04()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -131,7 +126,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script05()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -142,7 +136,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script06()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -153,7 +146,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script07()
- throws EntityFinderException
{
final Query<Nameable> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Nameable.class )
@@ -164,7 +156,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script08()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -175,7 +166,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script09()
- throws EntityFinderException
{
final Query<Female> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Female.class )
@@ -186,7 +176,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script10()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -197,7 +186,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script11()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -208,7 +196,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script12()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -219,7 +206,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script13()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -230,7 +216,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script14()
- throws EntityFinderException
{
final Query<Male> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Male.class )
@@ -241,7 +226,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script15()
- throws EntityFinderException
{
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Person.class )
@@ -252,7 +236,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script16()
- throws EntityFinderException
{
Nameable nameable = templateFor( Nameable.class );
final Query<Nameable> query = unitOfWork.newQuery( this.moduleInstance
@@ -266,7 +249,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script17()
- throws EntityFinderException
{
Nameable nameable = templateFor( Nameable.class );
Predicate<Composite> predicate = queries.get( "script17" );
@@ -282,7 +264,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script18()
- throws EntityFinderException
{
Nameable nameable = templateFor( Nameable.class );
Predicate<Composite> predicate = queries.get( "script18" );
@@ -297,7 +278,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script19()
- throws EntityFinderException
{
Nameable nameable = templateFor( Nameable.class );
final Query<Nameable> query = unitOfWork.newQuery( this.moduleInstance
@@ -310,7 +290,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script20()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
@@ -323,7 +302,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script21()
- throws EntityFinderException
{
Person person = templateFor( Person.class );
final Query<Person> query = unitOfWork.newQuery( this.moduleInstance
@@ -336,7 +314,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script22()
- throws EntityFinderException
{
final Query<Nameable> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Nameable.class )
@@ -347,7 +324,6 @@ public abstract class AbstractNamedQueryTest
@Test
public void script24()
- throws EntityFinderException
{
final Query<Domain> query = unitOfWork.newQuery( this.moduleInstance
.newQueryBuilder( Domain.class )
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5514dd1a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java
----------------------------------------------------------------------
diff --git a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java b/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java
index 05c038e..8e639c3 100644
--- a/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java
+++ b/core/testsupport/src/main/java/org/apache/zest/test/indexing/AbstractQueryTest.java
@@ -36,7 +36,6 @@ import org.apache.zest.api.query.Query;
import org.apache.zest.api.query.QueryBuilder;
import org.apache.zest.api.query.grammar.OrderBy;
import org.apache.zest.api.structure.Module;
-import org.apache.zest.spi.query.EntityFinderException;
import org.apache.zest.spi.query.IndexExporter;
import org.apache.zest.test.indexing.model.Account;
import org.apache.zest.test.indexing.model.City;
@@ -92,7 +91,6 @@ public abstract class AbstractQueryTest
@Test
public void script01()
- throws EntityFinderException
{
final QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
final Query<Person> query = unitOfWork.newQuery( qb );
@@ -102,7 +100,6 @@ public abstract class AbstractQueryTest
@Test
public void script02()
- throws EntityFinderException
{
final QueryBuilder<Domain> qb = this.moduleInstance.newQueryBuilder( Domain.class );
final Nameable nameable = templateFor( Nameable.class );
@@ -113,7 +110,6 @@ public abstract class AbstractQueryTest
@Test
public void script03()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = this.moduleInstance.newQueryBuilder( Nameable.class );
Query<Nameable> query = unitOfWork.newQuery( qb );
@@ -124,7 +120,6 @@ public abstract class AbstractQueryTest
@Test
public void script04()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person personTemplate = templateFor( Person.class );
@@ -136,7 +131,6 @@ public abstract class AbstractQueryTest
@Test
public void script04_ne()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person personTemplate = templateFor( Person.class );
@@ -148,7 +142,6 @@ public abstract class AbstractQueryTest
@Test
public void script05()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -164,7 +157,6 @@ public abstract class AbstractQueryTest
@Test
public void script06()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -176,7 +168,6 @@ public abstract class AbstractQueryTest
@Test
@SuppressWarnings( "unchecked" )
public void script07()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = this.moduleInstance.newQueryBuilder( Nameable.class );
Person person = templateFor( Person.class );
@@ -189,7 +180,6 @@ public abstract class AbstractQueryTest
@Test
@SuppressWarnings( "unchecked" )
public void script08()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -202,7 +192,6 @@ public abstract class AbstractQueryTest
@Test
@SuppressWarnings( "unchecked" )
public void script09()
- throws EntityFinderException
{
QueryBuilder<Female> qb = this.moduleInstance.newQueryBuilder( Female.class );
Person person = templateFor( Person.class );
@@ -214,7 +203,6 @@ public abstract class AbstractQueryTest
@Test
public void script10()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -225,7 +213,6 @@ public abstract class AbstractQueryTest
@Test
public void script11()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -236,7 +223,6 @@ public abstract class AbstractQueryTest
@Test
public void script12()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -247,7 +233,6 @@ public abstract class AbstractQueryTest
@Test
public void script12_ne()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -258,7 +243,6 @@ public abstract class AbstractQueryTest
@Test
public void script13()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Male person = templateFor( Male.class );
@@ -269,7 +253,6 @@ public abstract class AbstractQueryTest
@Test
public void script14()
- throws EntityFinderException
{
QueryBuilder<Male> qb = this.moduleInstance.newQueryBuilder( Male.class );
Male person = templateFor( Male.class );
@@ -280,7 +263,6 @@ public abstract class AbstractQueryTest
@Test
public void script15()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Male person = templateFor( Male.class );
@@ -291,7 +273,6 @@ public abstract class AbstractQueryTest
@Test
public void script16()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = this.moduleInstance.newQueryBuilder( Nameable.class );
// should return only 2 entities
@@ -305,7 +286,6 @@ public abstract class AbstractQueryTest
@Test
public void script17()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = this.moduleInstance.newQueryBuilder( Nameable.class );
// should return only 3 entities starting with forth one
@@ -320,7 +300,6 @@ public abstract class AbstractQueryTest
@Test
public void script18()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = this.moduleInstance.newQueryBuilder( Nameable.class );
// should return all Nameable entities sorted by name
@@ -334,7 +313,6 @@ public abstract class AbstractQueryTest
@Test
public void script19()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = this.moduleInstance.newQueryBuilder( Nameable.class );
// should return all Nameable entities with a name > "D" sorted by name
@@ -347,7 +325,6 @@ public abstract class AbstractQueryTest
@Test
public void script20()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
// should return all Persons born after 1973 (Ann and Joe Doe) sorted descending by name
@@ -360,7 +337,6 @@ public abstract class AbstractQueryTest
@Test
public void script21()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
// should return all Persons sorted by name of the city they were born, and then by year they were born
@@ -373,7 +349,6 @@ public abstract class AbstractQueryTest
@Test
public void script22()
- throws EntityFinderException
{
QueryBuilder<Nameable> qb = this.moduleInstance.newQueryBuilder( Nameable.class );
Nameable nameable = templateFor( Nameable.class );
@@ -385,7 +360,6 @@ public abstract class AbstractQueryTest
@Test
public void script23()
- throws EntityFinderException
{
QueryBuilder<Person> qb = this.moduleInstance.newQueryBuilder( Person.class );
Person person = templateFor( Person.class );
@@ -397,7 +371,6 @@ public abstract class AbstractQueryTest
@Test
public void script24()
- throws EntityFinderException
{
final QueryBuilder<Domain> qb = this.moduleInstance.newQueryBuilder( Domain.class );
final Nameable nameable = templateFor( Nameable.class );
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5514dd1a/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryTest.java b/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryTest.java
index dfc9bab..1c8d284 100644
--- a/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryTest.java
+++ b/extensions/indexing-elasticsearch/src/test/java/org/apache/zest/index/elasticsearch/ElasticSearchQueryTest.java
@@ -27,7 +27,6 @@ import org.apache.zest.bootstrap.ModuleAssembly;
import org.apache.zest.index.elasticsearch.assembly.ESClientIndexQueryAssembler;
import org.apache.zest.library.fileconfig.FileConfigurationAssembler;
import org.apache.zest.library.fileconfig.FileConfigurationOverride;
-import org.apache.zest.spi.query.EntityFinderException;
import org.apache.zest.test.EntityTestAssembler;
import org.apache.zest.test.indexing.AbstractQueryTest;
import org.apache.zest.test.util.NotYetImplemented;
@@ -98,7 +97,6 @@ public class ElasticSearchQueryTest extends AbstractQueryTest
@Test
@Override
public void script23()
- throws EntityFinderException
{
super.script23();
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5514dd1a/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryTest.java b/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryTest.java
index 7c6971c..454f6d4 100644
--- a/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryTest.java
+++ b/extensions/indexing-rdf/src/test/java/org/apache/zest/index/rdf/RdfQueryTest.java
@@ -25,7 +25,6 @@ import org.apache.zest.bootstrap.ModuleAssembly;
import org.apache.zest.bootstrap.unitofwork.DefaultUnitOfWorkAssembler;
import org.apache.zest.index.rdf.assembly.RdfNativeSesameStoreAssembler;
import org.apache.zest.library.rdf.repository.NativeConfiguration;
-import org.apache.zest.spi.query.EntityFinderException;
import org.apache.zest.test.EntityTestAssembler;
import org.apache.zest.test.indexing.AbstractQueryTest;
import org.junit.Ignore;
@@ -59,7 +58,6 @@ public class RdfQueryTest
@Ignore( "oneOf() Query Expression not supported by RDF Indexing" )
@Override
public void script23()
- throws EntityFinderException
{
super.script23();
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/5514dd1a/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java
----------------------------------------------------------------------
diff --git a/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java b/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java
index 503269f..a054e4a 100644
--- a/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java
+++ b/extensions/indexing-sql/src/test/java/org/apache/zest/index/sql/postgresql/PostgreSQLQueryTest.java
@@ -24,7 +24,6 @@ import org.junit.Ignore;
import org.junit.Test;
import org.apache.zest.bootstrap.AssemblyException;
import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.spi.query.EntityFinderException;
import org.apache.zest.test.indexing.AbstractQueryTest;
import static org.apache.zest.test.util.Assume.assumeConnectivity;
@@ -77,7 +76,6 @@ public class PostgreSQLQueryTest
@Ignore( "NeSpecification is not supported by SQL Indexing" )
@Override
public void script04_ne()
- throws EntityFinderException
{
super.script04_ne();
}
@@ -86,7 +84,6 @@ public class PostgreSQLQueryTest
@Ignore( "NeSpecification is not supported by SQL Indexing" )
@Override
public void script12_ne()
- throws EntityFinderException
{
super.script04_ne();
}
[3/5] zest-java git commit: non-checked AssemblyException
Posted by pa...@apache.org.
non-checked AssemblyException
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/9be87aae
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/9be87aae
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/9be87aae
Branch: refs/heads/develop
Commit: 9be87aaea3065e81d60616b94525a185e90564be
Parents: 5514dd1
Author: Paul Merlin <pa...@apache.org>
Authored: Mon Dec 5 16:52:06 2016 +0100
Committer: Paul Merlin <pa...@apache.org>
Committed: Mon Dec 5 16:52:06 2016 +0100
----------------------------------------------------------------------
.../main/java/org/apache/zest/bootstrap/AssemblyException.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/9be87aae/core/bootstrap/src/main/java/org/apache/zest/bootstrap/AssemblyException.java
----------------------------------------------------------------------
diff --git a/core/bootstrap/src/main/java/org/apache/zest/bootstrap/AssemblyException.java b/core/bootstrap/src/main/java/org/apache/zest/bootstrap/AssemblyException.java
index d7648ef..1fcb544 100644
--- a/core/bootstrap/src/main/java/org/apache/zest/bootstrap/AssemblyException.java
+++ b/core/bootstrap/src/main/java/org/apache/zest/bootstrap/AssemblyException.java
@@ -23,8 +23,7 @@ package org.apache.zest.bootstrap;
/**
* Thrown by ModuleAssembly if the Assembler tries to make an invalid assembly.
*/
-public class AssemblyException
- extends Exception
+public class AssemblyException extends RuntimeException
{
public AssemblyException()
{
[4/5] zest-java git commit: api: Initializables can throw Exception
Posted by pa...@apache.org.
api: Initializables can throw Exception
Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/ccb54f3a
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/ccb54f3a
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/ccb54f3a
Branch: refs/heads/develop
Commit: ccb54f3a745c318173389b05c1b12355ad67a80a
Parents: 9be87aa
Author: Paul Merlin <pa...@apache.org>
Authored: Mon Dec 5 20:15:59 2016 +0100
Committer: Paul Merlin <pa...@apache.org>
Committed: Tue Dec 6 09:35:54 2016 +0100
----------------------------------------------------------------------
.../java/org/apache/zest/api/mixin/Initializable.java | 6 ++----
.../zest/api/mixin/InitializationException.java | 14 ++------------
.../org/apache/zest/api/object/ObjectFactory.java | 5 +++--
.../org/apache/zest/runtime/composite/MixinModel.java | 4 ++--
.../org/apache/zest/runtime/object/ObjectModel.java | 5 +++--
.../apache/zest/runtime/mixin/InitializableTest.java | 3 ---
.../zest/runtime/service/ComplexActivatableTest.java | 2 --
.../org/apache/zest/library/alarm/AlarmStatus.java | 2 --
.../service/ServiceCircuitBreakerMixin.java | 2 --
.../library/rest/client/RequestWriterDelegator.java | 3 +--
.../library/rest/client/ResponseReaderDelegator.java | 3 +--
.../rest/server/restlet/RequestReaderDelegator.java | 2 --
.../rest/server/restlet/ResponseWriterDelegator.java | 2 --
.../zest/sample/forum/service/BootstrapData.java | 13 +------------
14 files changed, 15 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/core/api/src/main/java/org/apache/zest/api/mixin/Initializable.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/mixin/Initializable.java b/core/api/src/main/java/org/apache/zest/api/mixin/Initializable.java
index 473559f..04c6b91 100644
--- a/core/api/src/main/java/org/apache/zest/api/mixin/Initializable.java
+++ b/core/api/src/main/java/org/apache/zest/api/mixin/Initializable.java
@@ -30,9 +30,7 @@ public interface Initializable
/**
* Initialize the fragment
*
- * @throws org.apache.zest.api.mixin.InitializationException
- * if something went wrong
+ * @throws Exception if something went wrong
*/
- void initialize()
- throws InitializationException;
+ void initialize() throws Exception;
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/core/api/src/main/java/org/apache/zest/api/mixin/InitializationException.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/mixin/InitializationException.java b/core/api/src/main/java/org/apache/zest/api/mixin/InitializationException.java
index 6b3092f..3826779 100644
--- a/core/api/src/main/java/org/apache/zest/api/mixin/InitializationException.java
+++ b/core/api/src/main/java/org/apache/zest/api/mixin/InitializationException.java
@@ -20,7 +20,7 @@
package org.apache.zest.api.mixin;
/**
- * Thrown when a Fragment or object could not be instantiated.
+ * Thrown when a Fragment or object could not be initialized.
*/
public class InitializationException
extends RuntimeException
@@ -31,18 +31,8 @@ public class InitializationException
{
}
- public InitializationException( String message )
- {
- super( message );
- }
-
public InitializationException( String message, Throwable cause )
{
super( message, cause );
}
-
- public InitializationException( Throwable cause )
- {
- super( cause );
- }
-}
\ No newline at end of file
+}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/core/api/src/main/java/org/apache/zest/api/object/ObjectFactory.java
----------------------------------------------------------------------
diff --git a/core/api/src/main/java/org/apache/zest/api/object/ObjectFactory.java b/core/api/src/main/java/org/apache/zest/api/object/ObjectFactory.java
index bb9d7cf..d694c48 100644
--- a/core/api/src/main/java/org/apache/zest/api/object/ObjectFactory.java
+++ b/core/api/src/main/java/org/apache/zest/api/object/ObjectFactory.java
@@ -42,9 +42,10 @@ public interface ObjectFactory
/**
* Inject an existing instance. Only fields and methods will be called.
*
- * @param instance
+ * @param instance instance
+ * @param uses dependencies
*
- * @throws ConstructionException
+ * @throws ConstructionException if it was not possible to construct the Object dependencies
*/
void injectTo( Object instance, Object... uses )
throws ConstructionException;
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinModel.java
index cf6af21..621237d 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/composite/MixinModel.java
@@ -139,11 +139,11 @@ public final class MixinModel
{
( (Initializable) mixin ).initialize();
}
- catch( InitializationException e )
+ catch( Exception e )
{
List<Class<?>> compositeType = compositeInstance.types().collect( Collectors.toList() );
String message = "Unable to initialize " + mixinClass + " in composite " + compositeType;
- throw new ConstructionException( message, e );
+ throw new ConstructionException( new InitializationException( message, e ) );
}
}
return mixin;
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/core/runtime/src/main/java/org/apache/zest/runtime/object/ObjectModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/zest/runtime/object/ObjectModel.java b/core/runtime/src/main/java/org/apache/zest/runtime/object/ObjectModel.java
index e35b840..554a026 100644
--- a/core/runtime/src/main/java/org/apache/zest/runtime/object/ObjectModel.java
+++ b/core/runtime/src/main/java/org/apache/zest/runtime/object/ObjectModel.java
@@ -134,9 +134,10 @@ public final class ObjectModel
{
( (Initializable) instance ).initialize();
}
- catch( InitializationException e )
+ catch( Exception e )
{
- throw new ConstructionException( "Unable to initialize " + objectType, e );
+ String message = "Unable to initialize " + objectType;
+ throw new ConstructionException( new InitializationException( message, e ) );
}
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java
index 87df3a9..c3f7a6c 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java
@@ -23,7 +23,6 @@ package org.apache.zest.runtime.mixin;
import org.junit.Test;
import org.apache.zest.api.composite.TransientComposite;
import org.apache.zest.api.mixin.Initializable;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.mixin.Mixins;
import org.apache.zest.bootstrap.AssemblyException;
import org.apache.zest.bootstrap.ModuleAssembly;
@@ -72,7 +71,6 @@ public class InitializableTest
boolean ok = false;
public void initialize()
- throws InitializationException
{
ok = true;
}
@@ -89,7 +87,6 @@ public class InitializableTest
boolean ok = false;
public void initialize()
- throws InitializationException
{
ok = true;
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java
index b396a32..c8ada7c 100644
--- a/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java
+++ b/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java
@@ -23,7 +23,6 @@ import org.junit.Test;
import org.apache.zest.api.activation.ActivatorAdapter;
import org.apache.zest.api.injection.scope.This;
import org.apache.zest.api.mixin.Initializable;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.mixin.Mixins;
import org.apache.zest.api.property.Property;
import org.apache.zest.api.service.ServiceComposite;
@@ -83,7 +82,6 @@ public class ComplexActivatableTest
private SuperType me;
public void initialize()
- throws InitializationException
{
me.greeting().set( "Hello" );
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/libraries/alarm/src/main/java/org/apache/zest/library/alarm/AlarmStatus.java
----------------------------------------------------------------------
diff --git a/libraries/alarm/src/main/java/org/apache/zest/library/alarm/AlarmStatus.java b/libraries/alarm/src/main/java/org/apache/zest/library/alarm/AlarmStatus.java
index a4f9ee9..51a3463 100644
--- a/libraries/alarm/src/main/java/org/apache/zest/library/alarm/AlarmStatus.java
+++ b/libraries/alarm/src/main/java/org/apache/zest/library/alarm/AlarmStatus.java
@@ -26,7 +26,6 @@ import java.util.ResourceBundle;
import org.apache.zest.api.common.Optional;
import org.apache.zest.api.injection.scope.This;
import org.apache.zest.api.mixin.Initializable;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.mixin.Mixins;
import org.apache.zest.api.property.Property;
import org.apache.zest.api.value.ValueComposite;
@@ -99,7 +98,6 @@ public interface AlarmStatus extends ValueComposite
@Override
public void initialize()
- throws InitializationException
{
if( state.creationDate().get() == null )
{
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/libraries/circuitbreaker/src/main/java/org/apache/zest/library/circuitbreaker/service/ServiceCircuitBreakerMixin.java
----------------------------------------------------------------------
diff --git a/libraries/circuitbreaker/src/main/java/org/apache/zest/library/circuitbreaker/service/ServiceCircuitBreakerMixin.java b/libraries/circuitbreaker/src/main/java/org/apache/zest/library/circuitbreaker/service/ServiceCircuitBreakerMixin.java
index a00e764..0a01ddd 100644
--- a/libraries/circuitbreaker/src/main/java/org/apache/zest/library/circuitbreaker/service/ServiceCircuitBreakerMixin.java
+++ b/libraries/circuitbreaker/src/main/java/org/apache/zest/library/circuitbreaker/service/ServiceCircuitBreakerMixin.java
@@ -21,7 +21,6 @@ package org.apache.zest.library.circuitbreaker.service;
import org.apache.zest.api.injection.scope.Uses;
import org.apache.zest.api.mixin.Initializable;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.service.ServiceDescriptor;
import org.apache.zest.library.circuitbreaker.CircuitBreaker;
@@ -40,7 +39,6 @@ public class ServiceCircuitBreakerMixin
@Override
public void initialize()
- throws InitializationException
{
circuitBreaker = descriptor.metaInfo( CircuitBreaker.class );
}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/RequestWriterDelegator.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/RequestWriterDelegator.java b/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/RequestWriterDelegator.java
index d96af5c..cd985d6 100644
--- a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/RequestWriterDelegator.java
+++ b/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/RequestWriterDelegator.java
@@ -25,7 +25,6 @@ import java.util.List;
import java.util.ResourceBundle;
import org.apache.zest.api.injection.scope.Structure;
import org.apache.zest.api.mixin.Initializable;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.structure.Module;
import org.apache.zest.library.rest.client.spi.RequestWriter;
import org.restlet.Request;
@@ -48,7 +47,7 @@ public class RequestWriterDelegator
private Module module;
@Override
- public void initialize() throws InitializationException
+ public void initialize()
{
Logger logger = LoggerFactory.getLogger( getClass() );
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/ResponseReaderDelegator.java
----------------------------------------------------------------------
diff --git a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/ResponseReaderDelegator.java b/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/ResponseReaderDelegator.java
index c018a39..c9926aa 100644
--- a/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/ResponseReaderDelegator.java
+++ b/libraries/rest-client/src/main/java/org/apache/zest/library/rest/client/ResponseReaderDelegator.java
@@ -25,7 +25,6 @@ import java.util.List;
import java.util.ResourceBundle;
import org.apache.zest.api.injection.scope.Structure;
import org.apache.zest.api.mixin.Initializable;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.structure.Module;
import org.apache.zest.library.rest.client.spi.ResponseReader;
import org.restlet.Response;
@@ -45,7 +44,7 @@ public class ResponseReaderDelegator
private Module module;
@Override
- public void initialize() throws InitializationException
+ public void initialize()
{
Logger logger = LoggerFactory.getLogger( getClass() );
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/RequestReaderDelegator.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/RequestReaderDelegator.java b/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/RequestReaderDelegator.java
index 61447d8..cd35901 100644
--- a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/RequestReaderDelegator.java
+++ b/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/RequestReaderDelegator.java
@@ -28,7 +28,6 @@ import org.apache.zest.api.identity.Identity;
import org.apache.zest.api.identity.StringIdentity;
import org.apache.zest.api.injection.scope.Service;
import org.apache.zest.api.injection.scope.Structure;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.service.ServiceReference;
import org.apache.zest.api.structure.Module;
import org.apache.zest.library.rest.server.spi.RequestReader;
@@ -50,7 +49,6 @@ public class RequestReaderDelegator
Module module;
public void init( @Service Iterable<ServiceReference<RequestReader>> requestReaderReferences )
- throws InitializationException
{
Logger logger = LoggerFactory.getLogger( getClass() );
Identity requestreaderdelegator = new StringIdentity("requestreaderdelegator");
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/ResponseWriterDelegator.java
----------------------------------------------------------------------
diff --git a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/ResponseWriterDelegator.java b/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/ResponseWriterDelegator.java
index 66a17d3..ea5c77c 100644
--- a/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/ResponseWriterDelegator.java
+++ b/libraries/rest-server/src/main/java/org/apache/zest/library/rest/server/restlet/ResponseWriterDelegator.java
@@ -27,7 +27,6 @@ import org.apache.zest.api.identity.Identity;
import org.apache.zest.api.identity.StringIdentity;
import org.apache.zest.api.injection.scope.Service;
import org.apache.zest.api.injection.scope.Structure;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.service.ServiceReference;
import org.apache.zest.api.structure.Module;
import org.apache.zest.library.rest.server.spi.ResponseWriter;
@@ -47,7 +46,6 @@ public class ResponseWriterDelegator
Module module;
public void init( @Service Iterable<ServiceReference<ResponseWriter>> resultWriters )
- throws InitializationException
{
Logger logger = LoggerFactory.getLogger( getClass() );
Identity responsewriterdelegator = new StringIdentity( "responsewriterdelegator" );
http://git-wip-us.apache.org/repos/asf/zest-java/blob/ccb54f3a/samples/forum/src/main/java/org/apache/zest/sample/forum/service/BootstrapData.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/apache/zest/sample/forum/service/BootstrapData.java b/samples/forum/src/main/java/org/apache/zest/sample/forum/service/BootstrapData.java
index 42153d5..bfba693 100644
--- a/samples/forum/src/main/java/org/apache/zest/sample/forum/service/BootstrapData.java
+++ b/samples/forum/src/main/java/org/apache/zest/sample/forum/service/BootstrapData.java
@@ -22,13 +22,11 @@ package org.apache.zest.sample.forum.service;
import org.apache.zest.api.activation.ActivatorAdapter;
import org.apache.zest.api.activation.Activators;
import org.apache.zest.api.injection.scope.Structure;
-import org.apache.zest.api.mixin.InitializationException;
import org.apache.zest.api.mixin.Mixins;
import org.apache.zest.api.service.ServiceComposite;
import org.apache.zest.api.service.ServiceReference;
import org.apache.zest.api.unitofwork.NoSuchEntityException;
import org.apache.zest.api.unitofwork.UnitOfWork;
-import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException;
import org.apache.zest.api.unitofwork.UnitOfWorkFactory;
import org.apache.zest.sample.forum.data.entity.Forums;
import org.apache.zest.sample.forum.data.entity.Users;
@@ -41,14 +39,12 @@ import org.apache.zest.sample.forum.data.entity.Users;
public interface BootstrapData
extends ServiceComposite
{
-
void insertInitialData()
throws Exception;
class Activator
extends ActivatorAdapter<ServiceReference<BootstrapData>>
{
-
@Override
public void afterActivation( ServiceReference<BootstrapData> activated )
throws Exception
@@ -87,14 +83,7 @@ public interface BootstrapData
unitOfWork.newEntity( Users.class, Users.USERS_ID );
}
- try
- {
- unitOfWork.complete();
- }
- catch( UnitOfWorkCompletionException e )
- {
- throw new InitializationException( e );
- }
+ unitOfWork.complete();
}
}
}