polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [2/3] polygene-java git commit: POLYGENE-265 - method argument names are now used in Constraint Violations. POLYGENE-264 - Consolidated how the ConstraintViolationException works. POLYGENE-262 - NoSuchCompositeException and subtypes changed name to NoSuc
Date Mon, 19 Jun 2017 07:44:20 GMT
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsInstance.java
index ff53af8..98f6ab9 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsInstance.java
@@ -26,14 +26,10 @@ import java.lang.reflect.Member;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.stream.Stream;
 import org.apache.polygene.api.common.Optional;
-import org.apache.polygene.api.constraint.ConstraintViolation;
+import org.apache.polygene.api.constraint.ValueConstraintViolation;
 import org.apache.polygene.api.constraint.ConstraintViolationException;
 
-/**
- * JAVADOC
- */
 public final class ValueConstraintsInstance
 {
     private static final Optional OPTIONAL;
@@ -43,7 +39,6 @@ public final class ValueConstraintsInstance
         OPTIONAL = new OptionalDummy();
     }
 
-    @SuppressWarnings( "raw" )
     private final List<ConstraintInstance> constraints;
     private String name;
     private boolean optional;
@@ -60,9 +55,9 @@ public final class ValueConstraintsInstance
     }
 
     @SuppressWarnings( { "raw", "unchecked" } )
-    public List<ConstraintViolation> checkConstraints( Object value )
+    public List<ValueConstraintViolation> checkConstraints( Object value )
     {
-        List<ConstraintViolation> violations = null;
+        List<ValueConstraintViolation> violations = null;
 
         // Check optional first - this avoids NPE's in constraints
         if( optional )
@@ -77,11 +72,11 @@ public final class ValueConstraintsInstance
             if( value == null )
             {
                 violations = new ArrayList<>();
-                violations.add( new ConstraintViolation( name, OPTIONAL, null ) );
+                violations.add( new ValueConstraintViolation( name, OPTIONAL, null ) );
             }
         }
 
-        if( violations == null && value != null )
+        if( violations == null )
         {
             for( ConstraintInstance constraint : constraints )
             {
@@ -102,7 +97,7 @@ public final class ValueConstraintsInstance
                     {
                         violations = new ArrayList<>();
                     }
-                    ConstraintViolation violation = new ConstraintViolation( name, constraint.annotation(), value );
+                    ValueConstraintViolation violation = new ValueConstraintViolation( name, constraint.annotation(), value );
                     violations.add( violation );
                 }
             }
@@ -116,11 +111,21 @@ public final class ValueConstraintsInstance
 
     public void checkConstraints( Object value, AccessibleObject accessor )
     {
-        List<ConstraintViolation> violations = checkConstraints( value );
+        List<ValueConstraintViolation> violations = checkConstraints( value );
         if( !violations.isEmpty() )
         {
-            Stream<Class<?>> empty = Stream.empty();
-            throw new ConstraintViolationException( "", empty, (Member) accessor, violations );
+            for( ValueConstraintViolation violation : violations )
+            {
+                if( accessor instanceof Member )
+                {
+                    Member member = (Member) accessor;
+                    String methodName =  member.getName();
+                    violation.setMixinType( member.getDeclaringClass() );
+                    violation.setMethodName( methodName );
+                }
+
+            }
+            throw new ConstraintViolationException( violations );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsModel.java b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsModel.java
index 5568881..3e95209 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/composite/ValueConstraintsModel.java
@@ -20,13 +20,11 @@
 
 package org.apache.polygene.runtime.composite;
 
+import java.util.Collections;
 import java.util.List;
 import org.apache.polygene.api.util.HierarchicalVisitor;
 import org.apache.polygene.api.util.VisitableHierarchy;
 
-/**
- * JAVADOC
- */
 public final class ValueConstraintsModel
     implements VisitableHierarchy<Object, Object>
 {
@@ -43,17 +41,13 @@ public final class ValueConstraintsModel
 
     public ValueConstraintsInstance newInstance()
     {
-        return new ValueConstraintsInstance( constraintModels, name, optional );
+        List<AbstractConstraintModel> models = isConstrained() ? this.constraintModels : Collections.emptyList();
+        return new ValueConstraintsInstance( models, name, optional );
     }
 
     public boolean isConstrained()
     {
-        if( !constraintModels.isEmpty() )
-        {
-            return true;
-        }
-
-        return !optional;
+        return !constraintModels.isEmpty() || !optional;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java
index 6893225..386a592 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/entity/EntityInstance.java
@@ -20,8 +20,6 @@
 package org.apache.polygene.runtime.entity;
 
 import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.List;
 import java.util.Objects;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -299,12 +297,11 @@ public final class EntityInstance
         }
         catch( ConstraintViolationException e )
         {
-            List<? extends Type> entityModelList = entityModel.types().collect( toList() );
-            throw new ConstraintViolationException( reference.identity(),
-                                                    entityModelList,
-                                                    e.mixinTypeName(),
-                                                    e.methodName(),
-                                                    e.constraintViolations() );
+            e.setCompositeDescriptor( descriptor() );
+            e.setIdentity( entityState.entityReference().identity() );
+            e.setInstanceString( proxy.toString() );
+            e.setCompositeDescriptor( entityModel );
+            throw e;
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/ServiceInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/ServiceInjectionProviderFactory.java b/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/ServiceInjectionProviderFactory.java
index f3dc70c..f6542e5 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/ServiceInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/ServiceInjectionProviderFactory.java
@@ -27,7 +27,7 @@ import java.util.ArrayList;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.stream.Stream;
-import org.apache.polygene.api.service.NoSuchServiceException;
+import org.apache.polygene.api.service.NoSuchServiceTypeException;
 import org.apache.polygene.api.service.ServiceReference;
 import org.apache.polygene.api.service.qualifier.Qualifier;
 import org.apache.polygene.api.util.Classes;
@@ -203,7 +203,7 @@ public final class ServiceInjectionProviderFactory
                                   .filter( serviceQualifier ).findFirst().orElse( null );
                 }
             }
-            catch( NoSuchServiceException e )
+            catch( NoSuchServiceTypeException e )
             {
                 return null;
             }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/UsesInjectionProviderFactory.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/UsesInjectionProviderFactory.java b/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/UsesInjectionProviderFactory.java
index 6b21d29..0ebf7e2 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/UsesInjectionProviderFactory.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/injection/provider/UsesInjectionProviderFactory.java
@@ -20,8 +20,8 @@
 package org.apache.polygene.runtime.injection.provider;
 
 import java.lang.reflect.Constructor;
-import org.apache.polygene.api.composite.NoSuchTransientException;
-import org.apache.polygene.api.object.NoSuchObjectException;
+import org.apache.polygene.api.composite.NoSuchTransientTypeException;
+import org.apache.polygene.api.object.NoSuchObjectTypeException;
 import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.api.util.AccessibleObjects;
 import org.apache.polygene.bootstrap.InvalidInjectionException;
@@ -83,13 +83,13 @@ public final class UsesInjectionProviderFactory
                     }
                     usesObject = moduleInstance.newTransient( injectionType, uses.toArray() );
                 }
-                catch( NoSuchTransientException e )
+                catch( NoSuchTransientTypeException e )
                 {
                     try
                     {
                         usesObject = moduleInstance.newObject( injectionType, uses.toArray() );
                     }
-                    catch( NoSuchObjectException e1 )
+                    catch( NoSuchObjectTypeException e1 )
                     {
                         // Could not instantiate an instance - to try instantiate as plain class
                         try

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java b/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
index 984d8c4..7ca4395 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/property/PropertyModel.java
@@ -31,7 +31,7 @@ import java.util.function.BiFunction;
 import java.util.stream.Stream;
 import org.apache.polygene.api.common.MetaInfo;
 import org.apache.polygene.api.common.QualifiedName;
-import org.apache.polygene.api.constraint.ConstraintViolation;
+import org.apache.polygene.api.constraint.ValueConstraintViolation;
 import org.apache.polygene.api.constraint.ConstraintViolationException;
 import org.apache.polygene.api.entity.Queryable;
 import org.apache.polygene.api.property.DefaultValues;
@@ -286,12 +286,7 @@ public class PropertyModel
         {
             if( constraints != null )
             {
-                List<ConstraintViolation> violations = constraints.checkConstraints( value );
-                if( !violations.isEmpty() )
-                {
-                    Stream<Class<?>> empty = Stream.empty();
-                    throw new ConstraintViolationException( "", empty, (Member) accessor, violations );
-                }
+                constraints.checkConstraints( value, accessor );
             }
         }
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/query/QueryBuilderFactoryImpl.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/query/QueryBuilderFactoryImpl.java b/core/runtime/src/main/java/org/apache/polygene/runtime/query/QueryBuilderFactoryImpl.java
index 0f572ea..e01af28 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/query/QueryBuilderFactoryImpl.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/query/QueryBuilderFactoryImpl.java
@@ -23,7 +23,7 @@ import java.util.Objects;
 import org.apache.polygene.api.query.NotQueryableException;
 import org.apache.polygene.api.query.QueryBuilder;
 import org.apache.polygene.api.query.QueryBuilderFactory;
-import org.apache.polygene.api.service.NoSuchServiceException;
+import org.apache.polygene.api.service.NoSuchServiceTypeException;
 import org.apache.polygene.api.service.ServiceFinder;
 import org.apache.polygene.api.service.ServiceReference;
 import org.apache.polygene.spi.query.EntityFinder;
@@ -61,7 +61,7 @@ public final class QueryBuilderFactoryImpl
             serviceReference = finder.findService( EntityFinder.class );
             return new QueryBuilderImpl<>( serviceReference.get(), resultType, null );
         }
-        catch( NoSuchServiceException e )
+        catch( NoSuchServiceTypeException e )
         {
             return new QueryBuilderImpl<>( null, resultType, null );
         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
index 20fa0f7..9422816 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/structure/ModuleInstance.java
@@ -37,14 +37,14 @@ import org.apache.polygene.api.association.AssociationDescriptor;
 import org.apache.polygene.api.common.ConstructionException;
 import org.apache.polygene.api.composite.Composite;
 import org.apache.polygene.api.composite.ModelDescriptor;
-import org.apache.polygene.api.composite.NoSuchTransientException;
+import org.apache.polygene.api.composite.NoSuchTransientTypeException;
 import org.apache.polygene.api.composite.TransientBuilder;
 import org.apache.polygene.api.composite.TransientBuilderFactory;
 import org.apache.polygene.api.composite.TransientDescriptor;
 import org.apache.polygene.api.entity.EntityReference;
 import org.apache.polygene.api.identity.IdentityGenerator;
 import org.apache.polygene.api.metrics.MetricsProvider;
-import org.apache.polygene.api.object.NoSuchObjectException;
+import org.apache.polygene.api.object.NoSuchObjectTypeException;
 import org.apache.polygene.api.object.ObjectDescriptor;
 import org.apache.polygene.api.object.ObjectFactory;
 import org.apache.polygene.api.property.Property;
@@ -53,7 +53,7 @@ import org.apache.polygene.api.query.QueryBuilder;
 import org.apache.polygene.api.query.QueryBuilderFactory;
 import org.apache.polygene.api.serialization.Serialization;
 import org.apache.polygene.api.serialization.SerializationException;
-import org.apache.polygene.api.service.NoSuchServiceException;
+import org.apache.polygene.api.service.NoSuchServiceTypeException;
 import org.apache.polygene.api.service.ServiceFinder;
 import org.apache.polygene.api.service.ServiceReference;
 import org.apache.polygene.api.structure.LayerDescriptor;
@@ -63,7 +63,7 @@ import org.apache.polygene.api.structure.TypeLookup;
 import org.apache.polygene.api.type.HasTypes;
 import org.apache.polygene.api.unitofwork.UnitOfWorkException;
 import org.apache.polygene.api.unitofwork.UnitOfWorkFactory;
-import org.apache.polygene.api.value.NoSuchValueException;
+import org.apache.polygene.api.value.NoSuchValueTypeException;
 import org.apache.polygene.api.value.ValueBuilder;
 import org.apache.polygene.api.value.ValueBuilderFactory;
 import org.apache.polygene.api.value.ValueDescriptor;
@@ -166,15 +166,15 @@ public class ModuleInstance
     // Implementation of ObjectFactory
     @Override
     public <T> T newObject( Class<T> mixinType, Object... uses )
-        throws NoSuchObjectException
+        throws NoSuchObjectTypeException
     {
         Objects.requireNonNull( mixinType, "mixinType" );
         ObjectDescriptor model = typeLookup.lookupObjectModel( mixinType );
 
         if( model == null )
         {
-            throw new NoSuchObjectException( mixinType.getName(), name(),
-                                             typeLookup.allObjects().flatMap( HasTypes::types ) );
+            throw new NoSuchObjectTypeException( mixinType.getName(), name(),
+                                                 typeLookup.allObjects().flatMap( HasTypes::types ) );
         }
 
         InjectionContext injectionContext = new InjectionContext( model.module(), UsesInstance.EMPTY_USES.use( uses ) );
@@ -190,8 +190,8 @@ public class ModuleInstance
 
         if( model == null )
         {
-            throw new NoSuchObjectException( instance.getClass().getName(), name(),
-                                             typeLookup.allObjects().flatMap( HasTypes::types ) );
+            throw new NoSuchObjectTypeException( instance.getClass().getName(), name(),
+                                                 typeLookup.allObjects().flatMap( HasTypes::types ) );
         }
 
         InjectionContext injectionContext = new InjectionContext( model.module(), UsesInstance.EMPTY_USES.use( uses ) );
@@ -201,14 +201,14 @@ public class ModuleInstance
     // Implementation of TransientBuilderFactory
     @Override
     public <T> TransientBuilder<T> newTransientBuilder( Class<T> mixinType )
-        throws NoSuchTransientException
+        throws NoSuchTransientTypeException
     {
         Objects.requireNonNull( mixinType, "mixinType" );
         TransientDescriptor model = typeLookup.lookupTransientModel( mixinType );
 
         if( model == null )
         {
-            throw new NoSuchTransientException( mixinType.getName(), name(), typeLookup );
+            throw new NoSuchTransientTypeException( mixinType.getName(), name(), typeLookup );
         }
 
         Map<AccessibleObject, Property<?>> properties = new HashMap<>();
@@ -228,7 +228,7 @@ public class ModuleInstance
 
     @Override
     public <T> T newTransient( final Class<T> mixinType, Object... uses )
-        throws NoSuchTransientException, ConstructionException
+        throws NoSuchTransientTypeException, ConstructionException
     {
         return newTransientBuilder( mixinType ).use( uses ).newInstance();
     }
@@ -236,21 +236,21 @@ public class ModuleInstance
     // Implementation of ValueBuilderFactory
     @Override
     public <T> T newValue( Class<T> mixinType )
-        throws NoSuchValueException, ConstructionException
+        throws NoSuchValueTypeException, ConstructionException
     {
         return newValueBuilder( mixinType ).newInstance();
     }
 
     @Override
     public <T> ValueBuilder<T> newValueBuilder( Class<T> mixinType )
-        throws NoSuchValueException
+        throws NoSuchValueTypeException
     {
         Objects.requireNonNull( mixinType, "mixinType" );
         ValueDescriptor compositeModelModule = typeLookup.lookupValueModel( mixinType );
 
         if( compositeModelModule == null )
         {
-            throw new NoSuchValueException( mixinType.getName(), name(), typeLookup );
+            throw new NoSuchValueTypeException( mixinType.getName(), name(), typeLookup );
         }
 
         StateResolver stateResolver = new InitialStateResolver( compositeModelModule.module() );
@@ -274,7 +274,7 @@ public class ModuleInstance
 
         if( compositeModelModule == null )
         {
-            throw new NoSuchValueException( mixinType.getName(), name(), typeLookup );
+            throw new NoSuchValueTypeException( mixinType.getName(), name(), typeLookup );
         }
 
         StateResolver stateResolver = new FunctionStateResolver(
@@ -332,7 +332,7 @@ public class ModuleInstance
 
         if( model == null )
         {
-            throw new NoSuchValueException( valueType.getName(), name(), typeLookup );
+            throw new NoSuchValueTypeException( valueType.getName(), name(), typeLookup );
         }
 
         return new ValueBuilderWithPrototype<>( model, this, prototype );
@@ -340,14 +340,14 @@ public class ModuleInstance
 
     @Override
     public <T> T newValueFromSerializedState( Class<T> mixinType, String serializedState )
-        throws NoSuchValueException, ConstructionException
+        throws NoSuchValueTypeException, ConstructionException
     {
         Objects.requireNonNull( mixinType, "mixinType" );
         ValueDescriptor model = typeLookup.lookupValueModel( mixinType );
 
         if( model == null )
         {
-            throw new NoSuchValueException( mixinType.getName(), name(), typeLookup );
+            throw new NoSuchValueTypeException( mixinType.getName(), name(), typeLookup );
         }
 
         try
@@ -369,7 +369,7 @@ public class ModuleInstance
 
     @Override
     public <T> ServiceReference<T> findService( Class<T> serviceType )
-        throws NoSuchServiceException
+        throws NoSuchServiceTypeException
     {
         return findService( (Type) serviceType );
     }
@@ -380,7 +380,7 @@ public class ModuleInstance
         ModelDescriptor serviceModel = typeLookup.lookupServiceModel( serviceType );
         if( serviceModel == null )
         {
-            throw new NoSuchServiceException( serviceType.getTypeName(), name(), typeLookup );
+            throw new NoSuchServiceTypeException( serviceType.getTypeName(), name(), typeLookup );
         }
         return findServiceReferenceInstance( serviceModel );
     }
@@ -482,7 +482,7 @@ public class ModuleInstance
                     {
                         store = findService( EntityStore.class ).get();
                     }
-                    catch( NoSuchServiceException e )
+                    catch( NoSuchServiceTypeException e )
                     {
                         throw new UnitOfWorkException( "No EntityStore service available in module " + name() );
                     }
@@ -505,7 +505,7 @@ public class ModuleInstance
                     {
                         uowf = findService( UnitOfWorkFactory.class ).get();
                     }
-                    catch( NoSuchServiceException e )
+                    catch( NoSuchServiceTypeException e )
                     {
                         throw new UnitOfWorkException( "No UnitOfWorkFactory service available in module " + name() );
                     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
index 91f975d..d92ad72 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueBuilderInstance.java
@@ -22,7 +22,7 @@ package org.apache.polygene.runtime.value;
 import org.apache.polygene.api.association.AssociationStateHolder;
 import org.apache.polygene.api.common.ConstructionException;
 import org.apache.polygene.api.composite.Composite;
-import org.apache.polygene.api.value.NoSuchValueException;
+import org.apache.polygene.api.value.NoSuchValueTypeException;
 import org.apache.polygene.api.value.ValueBuilder;
 import org.apache.polygene.api.value.ValueDescriptor;
 import org.apache.polygene.runtime.composite.StateResolver;
@@ -86,7 +86,7 @@ public final class ValueBuilderInstance<T>
 
         if( valueModel == null )
         {
-            throw new NoSuchValueException( valueType.getName(), currentModule.name(), currentModule.typeLookup() );
+            throw new NoSuchValueTypeException( valueType.getName(), currentModule.name(), currentModule.typeLookup() );
         }
         return new ValueBuilderWithPrototype<>( valueModel, currentModule, prototype() ).newInstance();
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueModel.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueModel.java b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueModel.java
index b79b298..9338deb 100644
--- a/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueModel.java
+++ b/core/runtime/src/main/java/org/apache/polygene/runtime/value/ValueModel.java
@@ -20,15 +20,20 @@
 
 package org.apache.polygene.runtime.value;
 
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
+import java.util.ArrayList;
 import java.util.List;
-import java.util.stream.Stream;
+import org.apache.polygene.api.association.AssociationDescriptor;
 import org.apache.polygene.api.common.MetaInfo;
 import org.apache.polygene.api.common.Visibility;
+import org.apache.polygene.api.constraint.ValueConstraintViolation;
 import org.apache.polygene.api.constraint.ConstraintViolationException;
+import org.apache.polygene.api.entity.EntityDescriptor;
+import org.apache.polygene.api.identity.HasIdentity;
+import org.apache.polygene.api.identity.Identity;
 import org.apache.polygene.api.structure.ModuleDescriptor;
+import org.apache.polygene.api.structure.TypeLookup;
 import org.apache.polygene.api.type.ValueCompositeType;
+import org.apache.polygene.api.unitofwork.NoSuchEntityTypeException;
 import org.apache.polygene.api.util.Classes;
 import org.apache.polygene.api.value.ValueDescriptor;
 import org.apache.polygene.runtime.composite.CompositeMethodsModel;
@@ -37,6 +42,7 @@ import org.apache.polygene.runtime.composite.MixinModel;
 import org.apache.polygene.runtime.composite.MixinsModel;
 import org.apache.polygene.runtime.composite.UsesInstance;
 import org.apache.polygene.runtime.injection.InjectionContext;
+import org.apache.polygene.runtime.property.PropertyInstance;
 import org.apache.polygene.runtime.unitofwork.UnitOfWorkInstance;
 
 /**
@@ -54,10 +60,11 @@ public final class ValueModel extends CompositeModel
                        final MixinsModel mixinsModel,
                        final ValueStateModel stateModel,
                        final CompositeMethodsModel compositeMethodsModel
-    )
+                     )
     {
         super( module, types, visibility, metaInfo, mixinsModel, stateModel, compositeMethodsModel );
-
+// TODO: When TypeLookup's lazy loading can be disabled during Model building, then uncomment the following line.
+//        checkAssociationVisibility();
         valueType = ValueCompositeType.of( this );
     }
 
@@ -77,6 +84,8 @@ public final class ValueModel extends CompositeModel
     void checkConstraints( ValueStateInstance state )
         throws ConstraintViolationException
     {
+        List<ValueConstraintViolation> violations = new ArrayList<>();
+
         stateModel.properties().forEach(
             propertyModel ->
             {
@@ -86,11 +95,10 @@ public final class ValueModel extends CompositeModel
                 }
                 catch( ConstraintViolationException e )
                 {
-                    throw new ConstraintViolationException( "<builder>", propertyModel.valueType()
-                        .types(), (Member) propertyModel.accessor(), e.constraintViolations() );
+                    violations.addAll( e.constraintViolations() );
                 }
             }
-        );
+                                       );
 
         // IF no UnitOfWork is active, then the Association checks shouldn't be done.
         if( UnitOfWorkInstance.getCurrent().empty() )
@@ -106,21 +114,73 @@ public final class ValueModel extends CompositeModel
                 }
                 catch( ConstraintViolationException e )
                 {
-                    Stream<? extends Type> types = Classes.interfacesOf( associationModel.type() );
-                    throw new ConstraintViolationException( "<builder>", types,
-                                                            (Member) associationModel.accessor(),
-                                                            e.constraintViolations() );
+                    try
+                    {
+                        PropertyInstance<Identity> identityProperty = state.propertyFor( HasIdentity.IDENTITY_METHOD );
+                        e.setIdentity( identityProperty.get() );
+                    }
+                    catch( IllegalArgumentException e1 )
+                    {
+                        // ignore. Is not a HasIdentity instance
+                    }
+                    throw e;
                 }
             }
-        );
+                                                               );
 
         ( (ValueStateModel) stateModel ).manyAssociations().forEach(
-            model -> model.checkAssociationConstraints( state.manyAssociationFor( model.accessor() ) )
-        );
+            model ->
+            {
+                try
+                {
+                    model.checkAssociationConstraints( state.manyAssociationFor( model.accessor() ) );
+                }
+                catch( ConstraintViolationException e )
+                {
+                    try
+                    {
+                        PropertyInstance<Identity> identityProperty = state.propertyFor( HasIdentity.IDENTITY_METHOD );
+                        e.setIdentity( identityProperty.get() );
+                    }
+                    catch( IllegalArgumentException e1 )
+                    {
+                        // ignore. is not a HasIdentity value
+                    }
+                    throw e;
+
+                }
+            }
+                                                                   );
 
         ( (ValueStateModel) stateModel ).namedAssociations().forEach(
-            model -> model.checkAssociationConstraints( state.namedAssociationFor( model.accessor() ) )
-        );
+            model ->
+            {
+                try
+                {
+                    model.checkAssociationConstraints( state.namedAssociationFor( model.accessor() ) );
+                }
+                catch( ConstraintViolationException e )
+                {
+                    PropertyInstance<Identity> propertyInstance = state.propertyFor( HasIdentity.IDENTITY_METHOD );
+                    throw e;
+
+                }
+            }
+                                                                    );
+        if( ! violations.isEmpty() )
+        {
+            ConstraintViolationException exception = new ConstraintViolationException( violations );
+            try
+            {
+                PropertyInstance<Identity> identityProperty = state.propertyFor( HasIdentity.IDENTITY_METHOD );
+                exception.setIdentity(identityProperty.get());
+            }
+            catch( IllegalArgumentException e )
+            {
+                // ignore, there is no Identity.
+            }
+            throw exception;
+        }
     }
 
     public ValueInstance newValueInstance( ValueStateInstance state )
@@ -140,4 +200,24 @@ public final class ValueModel extends CompositeModel
         // Return
         return instance;
     }
+
+    private void checkAssociationVisibility()
+    {
+        // All referenced entity types in any Associations must be visible from the module of this ValueModel.
+        TypeLookup lookup = module.typeLookup();
+        ValueStateModel stateModel = (ValueStateModel) this.stateModel;
+        stateModel.associations().forEach( model -> checkModel( lookup, model ) );
+        stateModel.manyAssociations().forEach( model -> checkModel( lookup, model ) );
+        stateModel.namedAssociations().forEach( model -> checkModel( lookup, model ) );
+    }
+
+    private void checkModel( TypeLookup lookup, AssociationDescriptor model )
+    {
+        Class<?> rawClass = Classes.RAW_CLASS.apply( model.type() );
+        List<EntityDescriptor> descriptors = lookup.lookupEntityModels( rawClass );
+        if( descriptors.size() == 0 )
+        {
+            throw new NoSuchEntityTypeException( rawClass.getName(), module.name(), lookup );
+        }
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/constraints/PropertyConstraintTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/constraints/PropertyConstraintTest.java b/core/runtime/src/test/java/org/apache/polygene/constraints/PropertyConstraintTest.java
index ca3b1fa..51b9e93 100644
--- a/core/runtime/src/test/java/org/apache/polygene/constraints/PropertyConstraintTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/constraints/PropertyConstraintTest.java
@@ -22,7 +22,7 @@ package org.apache.polygene.constraints;
 import java.util.Collection;
 import org.apache.polygene.api.composite.TransientBuilder;
 import org.apache.polygene.api.composite.TransientComposite;
-import org.apache.polygene.api.constraint.ConstraintViolation;
+import org.apache.polygene.api.constraint.ValueConstraintViolation;
 import org.apache.polygene.api.constraint.ConstraintViolationException;
 import org.apache.polygene.api.constraint.Constraints;
 import org.apache.polygene.api.property.Property;
@@ -53,7 +53,7 @@ public class PropertyConstraintTest
         }
         catch( ConstraintViolationException e )
         {
-            Collection<ConstraintViolation> violations = e.constraintViolations();
+            Collection<ValueConstraintViolation> violations = e.constraintViolations();
             assertEquals( 2, violations.size() );
         }
     }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/composite/CompositeFactoryImplTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/composite/CompositeFactoryImplTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/composite/CompositeFactoryImplTest.java
index f13c0b0..adb0ccb 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/composite/CompositeFactoryImplTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/composite/CompositeFactoryImplTest.java
@@ -26,7 +26,7 @@ import org.apache.polygene.test.AbstractPolygeneTest;
 import org.junit.Test;
 import org.apache.polygene.api.common.AppliesTo;
 import org.apache.polygene.api.common.AppliesToFilter;
-import org.apache.polygene.api.composite.NoSuchTransientException;
+import org.apache.polygene.api.composite.NoSuchTransientTypeException;
 import org.apache.polygene.api.composite.TransientBuilder;
 import org.apache.polygene.api.composite.TransientComposite;
 import org.apache.polygene.api.mixin.Mixins;
@@ -46,7 +46,7 @@ public class CompositeFactoryImplTest
     }
 
     @SuppressWarnings( "unchecked" )
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void testNewInstanceNotExtendingComposite()
         throws Exception
     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsTest.java
index f70ced7..ad9def8 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/composite/InterfaceDefaultMethodsTest.java
@@ -46,7 +46,10 @@ import static org.junit.Assert.assertThat;
 public class InterfaceDefaultMethodsTest extends AbstractPolygeneTest
 {
     @BeforeClass
-    public static void assumeJavaVersionIs8() { assumeJavaVersion( 8 ); }
+    public static void assumeJavaVersionIs8()
+    {
+        assumeJavaVersion( 8 );
+    }
 
     public interface DefaultMethods
     {
@@ -236,6 +239,8 @@ public class InterfaceDefaultMethodsTest extends AbstractPolygeneTest
         catch( ConstraintViolationException ex )
         {
             assertThat( ex.getMessage(), containsString( "sayHello" ) );
+            assertThat( ex.getMessage(), containsString( "DefaultMethodsConstraints" ) );
+            assertThat( ex.getMessage(), containsString( "NotEmpty" ) );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/constraints/ConstraintsTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/constraints/ConstraintsTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/constraints/ConstraintsTest.java
index f560439..f7d40d5 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/constraints/ConstraintsTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/constraints/ConstraintsTest.java
@@ -29,7 +29,7 @@ import org.apache.polygene.api.common.Optional;
 import org.apache.polygene.api.composite.TransientComposite;
 import org.apache.polygene.api.constraint.Constraint;
 import org.apache.polygene.api.constraint.ConstraintDeclaration;
-import org.apache.polygene.api.constraint.ConstraintViolation;
+import org.apache.polygene.api.constraint.ValueConstraintViolation;
 import org.apache.polygene.api.constraint.ConstraintViolationException;
 import org.apache.polygene.api.constraint.Constraints;
 import org.apache.polygene.api.constraint.Name;
@@ -66,7 +66,7 @@ public class ConstraintsTest
         }
         catch( ConstraintViolationException e )
         {
-            Collection<ConstraintViolation> violations = e.constraintViolations();
+            Collection<ValueConstraintViolation> violations = e.constraintViolations();
             assertEquals( 2, violations.size() );
 //            assertEquals( MyOne.class.getName(), e.mixinTypeName() );
         }
@@ -87,7 +87,7 @@ public class ConstraintsTest
         }
         catch( ConstraintViolationException e )
         {
-            Collection<ConstraintViolation> violations = e.constraintViolations();
+            Collection<ValueConstraintViolation> violations = e.constraintViolations();
             assertEquals( 2, violations.size() );
 //            assertEquals( MyOne.class.getName(), e.mixinTypeName() );
         }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectBuilderFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectBuilderFactoryTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectBuilderFactoryTest.java
index 39cb71c..9a6c49f 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectBuilderFactoryTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectBuilderFactoryTest.java
@@ -23,7 +23,7 @@ package org.apache.polygene.runtime.objects;
 import org.apache.polygene.api.activation.ActivationException;
 import org.apache.polygene.api.injection.scope.Structure;
 import org.apache.polygene.api.injection.scope.Uses;
-import org.apache.polygene.api.object.NoSuchObjectException;
+import org.apache.polygene.api.object.NoSuchObjectTypeException;
 import org.apache.polygene.api.structure.Module;
 import org.apache.polygene.bootstrap.SingletonAssembler;
 import org.junit.Assert;
@@ -43,7 +43,7 @@ public class ObjectBuilderFactoryTest
      *
      * @throws Exception expected
      */
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void newBuilderForUnregisteredObject()
         throws Exception
     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java
index 59c5a98..ed0171a 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/objects/ObjectVisibilityTest.java
@@ -27,7 +27,7 @@ import org.apache.polygene.api.identity.Identity;
 import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.injection.scope.Structure;
 import org.apache.polygene.api.mixin.Mixins;
-import org.apache.polygene.api.object.NoSuchObjectException;
+import org.apache.polygene.api.object.NoSuchObjectTypeException;
 import org.apache.polygene.api.service.ServiceComposite;
 import org.apache.polygene.api.structure.Application;
 import org.apache.polygene.api.structure.Module;
@@ -131,7 +131,7 @@ public class ObjectVisibilityTest
         service.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromServiceWhenAccessingBesideModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
@@ -145,35 +145,35 @@ public class ObjectVisibilityTest
         service.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromServiceWhenAccessingBelowLayerVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromServiceWhenAccessingBelowModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromServiceWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromServiceWhenAccessingAboveLayerVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromServiceWhenAccessingAboveModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
@@ -270,7 +270,7 @@ public class ObjectVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromEntityWhenAccessingBesideModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -306,7 +306,7 @@ public class ObjectVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromEntityWhenAccessingBelowLayerVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -324,7 +324,7 @@ public class ObjectVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromEntityWhenAccessingBelowModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -342,7 +342,7 @@ public class ObjectVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromEntityWhenAccessingAboveApplicationVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -360,7 +360,7 @@ public class ObjectVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromEntityWhenAccessingAboveLayerVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -378,7 +378,7 @@ public class ObjectVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromEntityWhenAccessingAboveModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -431,7 +431,7 @@ public class ObjectVisibilityTest
         value.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromValueWhenAccessingBesideModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
@@ -445,35 +445,35 @@ public class ObjectVisibilityTest
         value.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromValueWhenAccessingBelowLayerVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromValueWhenAccessingBelowModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromValueWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromValueWhenAccessingAboveLayerVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromValueWhenAccessingAboveModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
@@ -515,7 +515,7 @@ public class ObjectVisibilityTest
         transientt.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromTransientWhenAccessingBesideModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
@@ -529,35 +529,35 @@ public class ObjectVisibilityTest
         transientt.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromTransientWhenAccessingBelowLayerVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromTransientWhenAccessingBelowModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromTransientWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromTransientWhenAccessingAboveLayerVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromTransientWhenAccessingAboveModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
@@ -599,7 +599,7 @@ public class ObjectVisibilityTest
         object.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromObjectWhenAccessingBesideModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
@@ -613,35 +613,35 @@ public class ObjectVisibilityTest
         object.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromObjectWhenAccessingBelowLayerVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromObjectWhenAccessingBelowModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromObjectWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromObjectWhenAccessingAboveLayerVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchObjectException.class )
+    @Test( expected = NoSuchObjectTypeException.class )
     public void givenFromObjectWhenAccessingAboveModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java
index e82a092..9d51f48 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/service/ServiceVisibilityTest.java
@@ -27,7 +27,7 @@ import org.apache.polygene.api.identity.Identity;
 import org.apache.polygene.api.identity.StringIdentity;
 import org.apache.polygene.api.injection.scope.Structure;
 import org.apache.polygene.api.mixin.Mixins;
-import org.apache.polygene.api.service.NoSuchServiceException;
+import org.apache.polygene.api.service.NoSuchServiceTypeException;
 import org.apache.polygene.api.service.ServiceComposite;
 import org.apache.polygene.api.structure.Application;
 import org.apache.polygene.api.structure.Module;
@@ -130,7 +130,7 @@ public class ServiceVisibilityTest
         service.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromServiceWhenAccessingBesideModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
@@ -144,35 +144,35 @@ public class ServiceVisibilityTest
         service.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromServiceWhenAccessingBelowLayerVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromServiceWhenAccessingBelowModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromServiceWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromServiceWhenAccessingAboveLayerVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromServiceWhenAccessingAboveModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
@@ -269,7 +269,7 @@ public class ServiceVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromEntityWhenAccessingBesideModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -305,7 +305,7 @@ public class ServiceVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromEntityWhenAccessingBelowLayerVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -323,7 +323,7 @@ public class ServiceVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromEntityWhenAccessingBelowModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -341,7 +341,7 @@ public class ServiceVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromEntityWhenAccessingAboveApplicationVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -359,7 +359,7 @@ public class ServiceVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromEntityWhenAccessingAboveLayerVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -377,7 +377,7 @@ public class ServiceVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromEntityWhenAccessingAboveModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -430,7 +430,7 @@ public class ServiceVisibilityTest
         value.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromValueWhenAccessingBesideModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
@@ -444,35 +444,35 @@ public class ServiceVisibilityTest
         value.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromValueWhenAccessingBelowLayerVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromValueWhenAccessingBelowModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromValueWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromValueWhenAccessingAboveLayerVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromValueWhenAccessingAboveModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
@@ -514,7 +514,7 @@ public class ServiceVisibilityTest
         transientt.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromTransientWhenAccessingBesideModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
@@ -528,35 +528,35 @@ public class ServiceVisibilityTest
         transientt.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromTransientWhenAccessingBelowLayerVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromTransientWhenAccessingBelowModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromTransientWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromTransientWhenAccessingAboveLayerVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromTransientWhenAccessingAboveModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
@@ -598,7 +598,7 @@ public class ServiceVisibilityTest
         object.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromObjectWhenAccessingBesideModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
@@ -612,35 +612,35 @@ public class ServiceVisibilityTest
         object.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromObjectWhenAccessingBelowLayerVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromObjectWhenAccessingBelowModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromObjectWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromObjectWhenAccessingAboveLayerVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchServiceException.class )
+    @Test( expected = NoSuchServiceTypeException.class )
     public void givenFromObjectWhenAccessingAboveModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/structure/MixinVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/structure/MixinVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/structure/MixinVisibilityTest.java
index a1ee0e9..1174e2b 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/structure/MixinVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/structure/MixinVisibilityTest.java
@@ -23,7 +23,7 @@ package org.apache.polygene.runtime.structure;
 import org.apache.polygene.api.common.Optional;
 import org.apache.polygene.api.common.Visibility;
 import org.apache.polygene.api.composite.AmbiguousTypeException;
-import org.apache.polygene.api.composite.NoSuchTransientException;
+import org.apache.polygene.api.composite.NoSuchTransientTypeException;
 import org.apache.polygene.api.composite.TransientBuilder;
 import org.apache.polygene.api.composite.TransientBuilderFactory;
 import org.apache.polygene.api.injection.scope.Structure;
@@ -97,7 +97,7 @@ public class MixinVisibilityTest
         assertEquals( "abc", object.test2() );
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void testMixinInLayerIsNotVisible()
         throws Exception
     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/structure/PrivateCompositeVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/structure/PrivateCompositeVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/structure/PrivateCompositeVisibilityTest.java
index 701201a..70ef4b8 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/structure/PrivateCompositeVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/structure/PrivateCompositeVisibilityTest.java
@@ -21,7 +21,7 @@
 package org.apache.polygene.runtime.structure;
 
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.composite.NoSuchTransientException;
+import org.apache.polygene.api.composite.NoSuchTransientTypeException;
 import org.apache.polygene.api.composite.TransientBuilderFactory;
 import org.apache.polygene.api.composite.TransientComposite;
 import org.apache.polygene.api.injection.scope.Structure;
@@ -39,7 +39,7 @@ import org.junit.Test;
  */
 public class PrivateCompositeVisibilityTest
 {
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void testPrivateCompositeVisibility()
         throws Exception
     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientBuilderFactoryTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientBuilderFactoryTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientBuilderFactoryTest.java
index 9383841..95dbfff 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientBuilderFactoryTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientBuilderFactoryTest.java
@@ -25,7 +25,7 @@ import org.hamcrest.core.IsEqual;
 import org.junit.Test;
 import org.apache.polygene.api.activation.ActivationException;
 import org.apache.polygene.api.common.UseDefaults;
-import org.apache.polygene.api.composite.NoSuchTransientException;
+import org.apache.polygene.api.composite.NoSuchTransientTypeException;
 import org.apache.polygene.api.composite.TransientComposite;
 import org.apache.polygene.api.concern.Concerns;
 import org.apache.polygene.api.concern.GenericConcern;
@@ -52,7 +52,7 @@ public class TransientBuilderFactoryTest
      *
      * @throws Exception expected
      */
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void newBuilderForUnregisteredComposite()
         throws Exception
     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/559b38a5/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java b/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
index ba92bf1..c71d526 100644
--- a/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
+++ b/core/runtime/src/test/java/org/apache/polygene/runtime/transients/TransientVisibilityTest.java
@@ -21,7 +21,7 @@
 package org.apache.polygene.runtime.transients;
 
 import org.apache.polygene.api.common.Visibility;
-import org.apache.polygene.api.composite.NoSuchTransientException;
+import org.apache.polygene.api.composite.NoSuchTransientTypeException;
 import org.apache.polygene.api.composite.TransientBuilder;
 import org.apache.polygene.api.composite.TransientComposite;
 import org.apache.polygene.api.entity.EntityComposite;
@@ -130,7 +130,7 @@ public class TransientVisibilityTest
         service.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromServiceWhenAccessingBesideModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
@@ -144,35 +144,35 @@ public class TransientVisibilityTest
         service.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromServiceWhenAccessingBelowLayerVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromServiceWhenAccessingBelowModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromServiceWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromServiceWhenAccessingAboveLayerVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
         service.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromServiceWhenAccessingAboveModuleVisibleExpectException()
     {
         FromService service = module.findService( FromService.class ).get();
@@ -269,7 +269,7 @@ public class TransientVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromEntityWhenAccessingBesideModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -305,7 +305,7 @@ public class TransientVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromEntityWhenAccessingBelowLayerVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -323,7 +323,7 @@ public class TransientVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromEntityWhenAccessingBelowModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -341,7 +341,7 @@ public class TransientVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromEntityWhenAccessingAboveApplicationVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -359,7 +359,7 @@ public class TransientVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromEntityWhenAccessingAboveLayerVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -377,7 +377,7 @@ public class TransientVisibilityTest
         }
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromEntityWhenAccessingAboveModuleVisibleExpectException()
     {
         UnitOfWork unitOfWork = uowf.newUnitOfWork();
@@ -430,7 +430,7 @@ public class TransientVisibilityTest
         value.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromValueWhenAccessingBesideModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
@@ -444,35 +444,35 @@ public class TransientVisibilityTest
         value.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromValueWhenAccessingBelowLayerVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromValueWhenAccessingBelowModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromValueWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromValueWhenAccessingAboveLayerVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
         value.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromValueWhenAccessingAboveModuleVisibleExpectException()
     {
         FromValue value = module.newValue( FromValue.class );
@@ -514,7 +514,7 @@ public class TransientVisibilityTest
         transientt.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromTransientWhenAccessingBesideModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
@@ -528,35 +528,35 @@ public class TransientVisibilityTest
         transientt.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromTransientWhenAccessingBelowLayerVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromTransientWhenAccessingBelowModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromTransientWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromTransientWhenAccessingAboveLayerVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
         transientt.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromTransientWhenAccessingAboveModuleVisibleExpectException()
     {
         FromTransient transientt = module.newTransient( FromTransient.class );
@@ -598,7 +598,7 @@ public class TransientVisibilityTest
         object.besideLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromObjectWhenAccessingBesideModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
@@ -612,35 +612,35 @@ public class TransientVisibilityTest
         object.belowApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromObjectWhenAccessingBelowLayerVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.belowLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromObjectWhenAccessingBelowModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.belowModuleVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromObjectWhenAccessingAboveApplicationVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.aboveApplicationVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromObjectWhenAccessingAboveLayerVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );
         object.aboveLayerVisible();
     }
 
-    @Test( expected = NoSuchTransientException.class )
+    @Test( expected = NoSuchTransientTypeException.class )
     public void givenFromObjectWhenAccessingAboveModuleVisibleExpectException()
     {
         FromObject object = module.newObject( FromObject.class );


Mime
View raw message