You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@polygene.apache.org by ni...@apache.org on 2015/07/30 21:48:59 UTC
[60/80] zest-java git commit: Stage 2 of the namespace change. Bulk
of documentation fixed.
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java
new file mode 100644
index 0000000..a823adc
--- /dev/null
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi55/IssueTest.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.zest.regression.qi55;
+
+import org.junit.Test;
+import org.apache.zest.api.injection.scope.Uses;
+import org.apache.zest.bootstrap.AssemblyException;
+import org.apache.zest.bootstrap.ModuleAssembly;
+import org.apache.zest.test.AbstractQi4jTest;
+
+import static org.junit.Assert.assertEquals;
+
+public class IssueTest
+ extends AbstractQi4jTest
+{
+ public void assemble( ModuleAssembly module )
+ throws AssemblyException
+ {
+ module.objects( AClass.class );
+ }
+
+ @Test
+ public void objectWithGenericUsage()
+ {
+ assertEquals( "Using - Test string", module.
+ newObject( AClass.class, "Test string" ).
+ uses() );
+ }
+
+ public static class AClass<T>
+ {
+ @Uses
+ T value;
+
+ public String uses()
+ {
+ return "Using - " + value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/apache/zest/regression/qi59/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi59/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi59/IssueTest.java
new file mode 100644
index 0000000..99d62b0
--- /dev/null
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi59/IssueTest.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2008, Rickard Öberg. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.apache.zest.regression.qi59;
+
+import org.junit.Test;
+import org.apache.zest.api.entity.EntityComposite;
+import org.apache.zest.api.property.Property;
+import org.apache.zest.api.unitofwork.UnitOfWork;
+import org.apache.zest.bootstrap.AssemblyException;
+import org.apache.zest.bootstrap.ModuleAssembly;
+import org.apache.zest.library.constraints.annotation.NotEmpty;
+import org.apache.zest.test.AbstractQi4jTest;
+import org.apache.zest.test.EntityTestAssembler;
+
+import static org.junit.Assert.fail;
+
+/**
+ * Test for QI-59
+ */
+public class IssueTest
+ extends AbstractQi4jTest
+{
+ public void assemble( ModuleAssembly module )
+ throws AssemblyException
+ {
+ module.entities( TestCase.class );
+ new EntityTestAssembler().assemble( module );
+ }
+
+ @Test
+ public void givenEntityWithConstrainedPropertyWhenInvalidPropertyValueSetThenThrowException()
+ {
+ UnitOfWork uow = module.newUnitOfWork();
+
+ try
+ {
+ TestCase testCase = uow.newEntity( TestCase.class );
+
+ testCase.someProperty().set( null );
+
+ uow.complete();
+ fail( "Should not be allowed to set invalid property value" );
+ }
+ catch( Exception e )
+ {
+ uow.discard();
+ }
+ }
+
+ @Test
+ public void givenEntityWithComplexConstrainedPropertyWhenInvalidPropertyValueSetThenThrowException()
+ {
+ UnitOfWork uow = module.newUnitOfWork();
+
+ try
+ {
+ TestCase testCase = uow.newEntity( TestCase.class );
+
+ testCase.otherProperty().set( "" );
+
+ uow.complete();
+ fail( "Should not be allowed to set invalid property value" );
+ }
+ catch( Exception e )
+ {
+ uow.discard();
+ }
+ }
+
+ interface TestCase
+ extends EntityComposite
+ {
+ Property<String> someProperty();
+
+ @NotEmpty
+ Property<String> otherProperty();
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java
new file mode 100644
index 0000000..00ad687
--- /dev/null
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi65/IssueTest.java
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.zest.regression.qi65;
+
+import org.junit.Test;
+import org.apache.zest.api.composite.TransientComposite;
+import org.apache.zest.api.mixin.Mixins;
+import org.apache.zest.bootstrap.AssemblyException;
+import org.apache.zest.bootstrap.ModuleAssembly;
+import org.apache.zest.test.AbstractQi4jTest;
+
+public class IssueTest
+ extends AbstractQi4jTest
+{
+ private final static Class<?> CLAZZ = Object.class;
+ private final static String METHOD_NAME = "toString";
+ private final static Class<?> PARAM_TYPES[] = { };
+
+ public void assemble( ModuleAssembly module )
+ throws AssemblyException
+ {
+ module.transients( TestComposite.class );
+ }
+
+ @Test( expected = IllegalArgumentException.class )
+ public void constraintOnMethodParameter()
+ throws SecurityException, NoSuchMethodException
+ {
+ TestComposite test = module.newTransient( TestComposite.class );
+
+ test.someMethod( null );
+ }
+
+ @Mixins( TestMixin.class )
+ public interface TestComposite
+ extends TransientComposite
+ {
+ String someMethod( String value );
+ }
+
+ public static abstract class TestMixin
+ implements TestComposite
+ {
+ public String someMethod( String value )
+ {
+ return value + " " + value;
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java
new file mode 100644
index 0000000..ea43caa
--- /dev/null
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi74/IssueTest.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2008 Sonny Gill. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zest.regression.qi74;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.zest.api.composite.TransientBuilder;
+import org.apache.zest.api.composite.TransientComposite;
+import org.apache.zest.api.constraint.ConstraintViolationException;
+import org.apache.zest.api.property.Property;
+import org.apache.zest.bootstrap.AssemblyException;
+import org.apache.zest.bootstrap.ModuleAssembly;
+import org.apache.zest.test.AbstractQi4jTest;
+
+public class IssueTest
+ extends AbstractQi4jTest
+{
+ public void assemble( ModuleAssembly module )
+ throws AssemblyException
+ {
+ module.transients( ValueHolder.class );
+ }
+
+ @Test
+ public void testConstraintCheckedOnCompsiteCreation()
+ {
+ try
+ {
+ TransientBuilder<ValueHolder> builder = module.newTransientBuilder( ValueHolder.class );
+ builder.newInstance();
+ Assert.fail( "NotNull constraint violated but no exception is raised" );
+ }
+ catch( ConstraintViolationException e )
+ {
+ // expected
+ }
+ }
+
+ static interface ValueHolder
+ extends TransientComposite
+ {
+ Property<String> val();
+ }
+}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java
new file mode 100644
index 0000000..d142bf6
--- /dev/null
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi78/IssueTest.java
@@ -0,0 +1,94 @@
+/*
+ * Copyright 2008 Sonny Gill. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zest.regression.qi78;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.apache.zest.api.structure.Application;
+import org.apache.zest.api.structure.ApplicationDescriptor;
+import org.apache.zest.api.structure.LayerDescriptor;
+import org.apache.zest.bootstrap.ApplicationAssembler;
+import org.apache.zest.bootstrap.ApplicationAssembly;
+import org.apache.zest.bootstrap.ApplicationAssemblyFactory;
+import org.apache.zest.bootstrap.AssemblyException;
+import org.apache.zest.bootstrap.Energy4Java;
+import org.apache.zest.bootstrap.LayerAssembly;
+import org.apache.zest.functional.HierarchicalVisitorAdapter;
+
+public class IssueTest
+{
+ @Test
+ public void testLayersCanBeCreatedInOrderDifferentFromTheirDependency()
+ throws AssemblyException
+ {
+ Energy4Java qi4j = new Energy4Java();
+
+ Application app = qi4j.newApplication( new ApplicationAssembler()
+ {
+ public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory )
+ throws AssemblyException
+ {
+ ApplicationAssembly assembly = applicationFactory.newApplicationAssembly();
+
+ LayerAssembly domainLayer = assembly.layer( null );
+ domainLayer.setName( "Domain" );
+
+ LayerAssembly infrastructureLayer = assembly.layer( null );
+ infrastructureLayer.setName( "Infrastructure" );
+
+ domainLayer.uses( infrastructureLayer );
+
+ return assembly;
+ }
+ } );
+ ApplicationDescriptor model = app.descriptor();
+ model.accept( new HierarchicalVisitorAdapter<Object, Object, RuntimeException>()
+ {
+ @Override
+ public boolean visitEnter( Object visited )
+ throws RuntimeException
+ {
+ return visited instanceof ApplicationDescriptor;
+ }
+
+ @Override
+ public boolean visitLeave( Object visited )
+ throws RuntimeException
+ {
+ return visited instanceof LayerDescriptor;
+ }
+
+ @Override
+ public boolean visit( Object visited )
+ throws RuntimeException
+ {
+ if( visited instanceof LayerDescriptor )
+ {
+ Iterable<? extends LayerDescriptor> usedLayers = ( (LayerDescriptor) visited ).usedLayers()
+ .layers();
+ for( LayerDescriptor usedLayerModel : usedLayers )
+ {
+ Assert.assertNotNull( "Used layer model is null", usedLayerModel );
+ }
+ }
+
+ return false;
+ }
+ } );
+ }
+}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/apache/zest/regression/qi94/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/apache/zest/regression/qi94/IssueTest.java b/core/runtime/src/test/java/org/apache/zest/regression/qi94/IssueTest.java
new file mode 100644
index 0000000..0ce42de
--- /dev/null
+++ b/core/runtime/src/test/java/org/apache/zest/regression/qi94/IssueTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2008 Richard Wallace. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied.
+ *
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.zest.regression.qi94;
+
+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.property.Property;
+import org.apache.zest.api.unitofwork.UnitOfWork;
+import org.apache.zest.bootstrap.AssemblyException;
+import org.apache.zest.bootstrap.ModuleAssembly;
+import org.apache.zest.test.AbstractQi4jTest;
+import org.apache.zest.test.EntityTestAssembler;
+
+import static org.junit.Assert.assertEquals;
+
+public class IssueTest
+ extends AbstractQi4jTest
+{
+ @SuppressWarnings( "unchecked" )
+ public void assemble( ModuleAssembly aModule )
+ throws AssemblyException
+ {
+ aModule.entities( Item.class, ItemType.class );
+ new EntityTestAssembler().assemble( aModule );
+ }
+
+ @Test
+ public void entityBuilderAssociationTypeIsNotNull()
+ {
+ UnitOfWork uow = module.newUnitOfWork();
+ try
+ {
+ EntityBuilder<Item> builder = uow.newEntityBuilder( Item.class );
+ assertEquals( ItemType.class, qi4j.api()
+ .entityDescriptorFor( builder.instance() )
+ .state()
+ .getAssociationByName( "typeOfItem" )
+ .type() );
+ }
+ finally
+ {
+ uow.discard();
+ }
+ }
+
+ interface Item
+ extends EntityComposite
+ {
+ Association<ItemType> typeOfItem();
+ }
+
+ interface ItemType
+ extends EntityComposite
+ {
+ Property<String> name();
+ }
+}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/constraints/PropertyConstraintTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/constraints/PropertyConstraintTest.java b/core/runtime/src/test/java/org/qi4j/constraints/PropertyConstraintTest.java
deleted file mode 100644
index 6fa21e0..0000000
--- a/core/runtime/src/test/java/org/qi4j/constraints/PropertyConstraintTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Copyright 2008 Niclas Hedhman. All rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.constraints;
-
-import java.util.Collection;
-import org.apache.zest.api.composite.TransientBuilder;
-import org.apache.zest.api.composite.TransientComposite;
-import org.apache.zest.api.constraint.ConstraintViolation;
-import org.apache.zest.api.constraint.ConstraintViolationException;
-import org.apache.zest.api.constraint.Constraints;
-import org.apache.zest.api.property.Property;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.library.constraints.MinLengthConstraint;
-import org.apache.zest.library.constraints.annotation.Matches;
-import org.apache.zest.library.constraints.annotation.MinLength;
-import org.apache.zest.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-public class PropertyConstraintTest
- extends AbstractQi4jTest
-{
- @org.junit.Test
- public void givenConstraintOnPropertyWhenInvalidValueThenThrowException()
- throws Throwable
- {
- TransientBuilder<Test> builder = module.newTransientBuilder( Test.class );
- builder.prototype().test().set( "XXXXXX" );
- Test test = builder.newInstance();
- try
- {
- test.test().set( "YY" );
- fail( "Should have thrown a ConstraintViolationException." );
- }
- catch( ConstraintViolationException e )
- {
- Collection<ConstraintViolation> violations = e.constraintViolations();
- assertEquals( 2, violations.size() );
- }
- }
-
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.transients( TestComposite.class );
- }
-
- @Constraints( { MinLengthConstraint.class } )
- public interface TestComposite
- extends Test, TransientComposite
- {
- }
-
- public interface Test
- {
- @MinLength( 3 )
- @Matches( "X*" )
- Property<String> test();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi230/Qi230IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi230/Qi230IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi230/Qi230IssueTest.java
deleted file mode 100644
index 0cd5bd8..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi230/Qi230IssueTest.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2010, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.qi4j.regression.qi230;
-
-import org.junit.Test;
-import org.apache.zest.api.Qi4j;
-import org.apache.zest.api.composite.Composite;
-import org.apache.zest.api.concern.ConcernOf;
-import org.apache.zest.api.concern.Concerns;
-import org.apache.zest.api.injection.scope.Service;
-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.mixin.NoopMixin;
-import org.apache.zest.api.service.ServiceComposite;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-
-/**
- * JAVADOC
- */
-public class Qi230IssueTest
- extends AbstractQi4jTest
-{
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.services( Some.class ).withMixins( NoopMixin.class ).withConcerns( OtherConcern.class );
-// module.services( Some.class );
- module.services( Result.class );
- }
-
- @Test
- public void whenDerefencingInsideConcernThisExpectItToWork()
- throws Exception
- {
- Result result = module.findService( Result.class ).get();
- Some some = module.findService( Some.class ).get();
- assertEquals( "method()", some.method() );
- assertEquals( some.identity(), result.some().identity() );
- assertEquals( some.identity().get(), result.some().identity().get() );
- }
-
- @Mixins( ResultMixin.class )
- public interface Result
- extends ServiceComposite
- {
- void execute( Some value );
-
- Some some();
- }
-
- public static abstract class ResultMixin
- implements Result
- {
-
- private Some value;
-
- public void execute( Some value )
- {
- this.value = value;
- }
-
- public Some some()
- {
- return value;
- }
- }
-
- @Concerns( OtherConcern.class )
- @Mixins( NoopMixin.class )
- public interface Other
- {
- void other();
- }
-
- @Mixins( SomeMixin.class )
- public interface Some
- extends ServiceComposite
-// extends ServiceComposite, Other
- {
- String method();
- }
-
- public abstract static class SomeMixin
- implements Some
- {
- @This
- private Other other;
-
- public String method()
- {
- other.other();
- return "method()";
- }
- }
-
- public static class OtherConcern
- extends ConcernOf<Other>
- implements Other
- {
- @Structure
- private Qi4j api;
-
- @This
- private Composite me;
-
- @Service
- private Result result;
-
- public void other()
- {
- Composite value = api.dereference( me );
- result.execute( (Some) value );
- next.other();
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi377/InterfaceCollisionWithRelatedReturnTypesTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi377/InterfaceCollisionWithRelatedReturnTypesTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi377/InterfaceCollisionWithRelatedReturnTypesTest.java
deleted file mode 100644
index bd9f2fb..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi377/InterfaceCollisionWithRelatedReturnTypesTest.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2013, Chris Chapman. All Rights Reserved.
- * Copyright (c) 2014, Paul Merlin. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi377;
-
-import org.junit.Test;
-import org.apache.zest.api.association.Association;
-import org.apache.zest.api.association.ManyAssociation;
-import org.apache.zest.api.common.Optional;
-import org.apache.zest.api.entity.Identity;
-import org.apache.zest.api.property.Property;
-import org.apache.zest.api.unitofwork.UnitOfWork;
-import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-import org.apache.zest.test.EntityTestAssembler;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-
-public class InterfaceCollisionWithRelatedReturnTypesTest
- extends AbstractQi4jTest
-{
-
- @Override
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- new EntityTestAssembler().assemble( module );
- module.entities( Employee.class, Company.class );
- }
-
- @Test
- public void shouldBeAbleToSetNameToTheCompany()
- throws UnitOfWorkCompletionException
- {
- String identity;
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- Company startUp = uow.newEntity( Company.class );
- startUp.name().set( "Acme" );
- identity = ( (Identity) startUp ).identity().get();
- uow.complete();
- }
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- Company startUp = uow.get( Company.class, identity );
- assertThat( startUp.name().get(), equalTo( "Acme" ) );
-
- SalesTeam sales = uow.get( SalesTeam.class, identity );
- assertThat( sales.name().get(), equalTo( "Acme" ) );
-
- ResearchTeam research = uow.get( ResearchTeam.class, identity );
- assertThat( research.name().get(), equalTo( "Acme" ) );
- }
- }
-
- @Test
- public void shouldBeAbleToSetLeadToTheCompany()
- throws UnitOfWorkCompletionException
- {
- String identity;
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- Company startUp = uow.newEntity( Company.class );
- Employee niclas = uow.newEntity( Employee.class );
-
- startUp.lead().set( niclas );
- identity = ( (Identity) startUp ).identity().get();
-
- uow.complete();
- }
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- Company startUp = uow.get( Company.class, identity );
- Employee niclas = startUp.lead().get();
- assertThat( niclas, notNullValue() );
-
- SalesTeam sales = uow.get( SalesTeam.class, identity );
- assertThat( sales.lead().get(), equalTo( niclas ) );
-
- ResearchTeam research = uow.get( ResearchTeam.class, identity );
- assertThat( research.lead().get(), equalTo( niclas ) );
- }
- }
-
- @Test
- public void shouldBeAbleToSetLeadToTheSalesTeam()
- {
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- SalesTeam startUp = uow.newEntity( SalesTeam.class );
- Employee niclas = uow.newEntity( Employee.class );
-
- startUp.lead().set( niclas );
- }
- }
-
- @Test
- public void shouldBeAbleToSetLeadToTheResearchTeam()
- {
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- ResearchTeam startUp = uow.newEntity( ResearchTeam.class );
- Employee niclas = uow.newEntity( Employee.class );
-
- startUp.lead().set( niclas );
- }
- }
-
- @Test
- public void shouldBeAbleToAddEmployeesToTheCompany()
- {
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- Company startUp = uow.newEntity( Company.class );
- Employee niclas = uow.newEntity( Employee.class );
-
- // To which team is Niclas added? Seems to be the interface listed first in the interface declaration?
- // This contrived example is probably just bad design...
- startUp.employees().add( niclas );
- }
- }
-
- @Test
- public void shouldBeAbleToAddEmployeesToTheSalesTeam()
- {
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- SalesTeam startUp = uow.newEntity( SalesTeam.class );
- Employee niclas = uow.newEntity( Employee.class );
-
- startUp.employees().add( niclas );
- }
- }
-
- @Test
- public void shouldBeAbleToAddEmployeesToTheResearchTeam()
- {
- try( UnitOfWork uow = module.newUnitOfWork() )
- {
- ResearchTeam startUp = uow.newEntity( ResearchTeam.class );
- Employee niclas = uow.newEntity( Employee.class );
-
- startUp.employees().add( niclas );
- }
- }
-
- public interface Employee
- {
- }
-
- public interface SalesTeam
- {
- @Optional
- Property<String> name();
-
- @Optional
- Association<Employee> lead();
-
- ManyAssociation<Employee> employees();
- }
-
- public interface ResearchTeam
- {
- @Optional
- Property<String> name();
-
- @Optional
- Association<Employee> lead();
-
- ManyAssociation<Employee> employees();
- }
-
- /**
- * This compiles, unlike the example in {@link InterfaceCollisionWithUnrelatedReturnTypesTest}.
- */
- public interface Company
- extends SalesTeam, ResearchTeam
- {
- }
-
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi377/InterfaceCollisionWithUnrelatedReturnTypesTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi377/InterfaceCollisionWithUnrelatedReturnTypesTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi377/InterfaceCollisionWithUnrelatedReturnTypesTest.java
deleted file mode 100644
index ce8c73b..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi377/InterfaceCollisionWithUnrelatedReturnTypesTest.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 2013, Chris Chapman. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi377;
-
-import org.apache.zest.api.common.UseDefaults;
-import org.apache.zest.api.property.Property;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-
-public class InterfaceCollisionWithUnrelatedReturnTypesTest
- extends AbstractQi4jTest
-{
-
- @Override
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- }
-
- public interface Person
- {
- @UseDefaults
- Property<String> name();
- }
-
- public interface Robot
- {
- @UseDefaults
- Property<Integer> name();
- }
-
- /**
- * DOESN'T COMPILE!!!
- * java: types org.qi4j.regression.qi377.InterfaceCollisionWithUnrelatedReturnTypesTest.Robot and org.qi4j.regression.qi377.InterfaceCollisionWithUnrelatedReturnTypesTest.Person are incompatible; both define name(), but with unrelated return types
- */
-// public interface TeamMember extends Person, Robot {}
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java
deleted file mode 100644
index 457845e..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi377/IssueTest.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 2013, Chris Chapman. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi377;
-
-import org.junit.Test;
-import org.apache.zest.api.common.UseDefaults;
-import org.apache.zest.api.property.Property;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.junit.Assert.assertThat;
-
-public class IssueTest
- extends AbstractQi4jTest
-{
-
- @Override
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.transients( TeamMember.class );
- }
-
- @Test
- public void propertyNameCollisionsShouldWork()
- {
- TeamMember m = module.newTransient( TeamMember.class );
- m.name().set( "Niclas" );
- Person p = m;
- p.name().set( "Chris" );
- Employee e = m;
- e.name().set( "Paul" );
-
- assertThat( m.name().get(), equalTo( "Paul" ) );
- assertThat( e.name().get(), equalTo( "Paul" ) );
- assertThat( p.name().get(), equalTo( "Paul" ) );
- }
-
- public interface Person
- {
- @UseDefaults
- Property<String> name();
- }
-
- public interface Employee
- {
- @UseDefaults
- Property<String> name();
- }
-
- public interface TeamMember
- extends Person, Employee
- {
- }
-
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi377/SetAssociationInSideEffectTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi377/SetAssociationInSideEffectTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi377/SetAssociationInSideEffectTest.java
deleted file mode 100644
index 95cdc67..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi377/SetAssociationInSideEffectTest.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * Copyright (c) 2013, Chris Chapman. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi377;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.reflect.Method;
-import org.junit.Test;
-import org.apache.zest.api.association.Association;
-import org.apache.zest.api.common.AppliesTo;
-import org.apache.zest.api.common.Optional;
-import org.apache.zest.api.entity.EntityComposite;
-import org.apache.zest.api.injection.scope.This;
-import org.apache.zest.api.mixin.Mixins;
-import org.apache.zest.api.sideeffect.GenericSideEffect;
-import org.apache.zest.api.sideeffect.SideEffects;
-import org.apache.zest.api.unitofwork.UnitOfWork;
-import org.apache.zest.api.usecase.UsecaseBuilder;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-import org.apache.zest.test.EntityTestAssembler;
-
-import static org.hamcrest.core.Is.is;
-import static org.hamcrest.core.IsNull.nullValue;
-import static org.hamcrest.core.IsSame.theInstance;
-import static org.junit.Assert.assertThat;
-
-public class SetAssociationInSideEffectTest
- extends AbstractQi4jTest
-{
- @Override
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- new EntityTestAssembler().assemble( module );
-
- module.entities( Pianist.class, Steinway.class );
- }
-
- @Test
- public void whenSettingAnAssociationInASideEffectExpectItToWork()
- {
- try( UnitOfWork uow = module.newUnitOfWork( UsecaseBuilder.newUsecase( "Purchase Steinway" ) ) )
- {
- Pianist chris = uow.newEntity( Pianist.class, "Chris" );
- Steinway modelD = uow.newEntity( Steinway.class, "ModelD-274" );
-
- assertThat( modelD.owner().get(), is( nullValue() ) );
-
- chris.purchase( modelD );
-
- assertThat( modelD.owner().get(), is( theInstance( (Owner) chris ) ) );
- }
- }
-
- @Mixins( PianistMixin.class )
- @SideEffects( ChangeOwnerSideEffect.class )
- public interface Pianist
- extends Owner, EntityComposite
- {
- @Optional
- Association<Steinway> steinway();
-
- @ChangesOwner
- void purchase( Steinway piano );
- }
-
- public static abstract class PianistMixin
- implements Pianist
- {
- @Override
- public void purchase( Steinway piano )
- {
- steinway().set( piano );
- }
- }
-
- public interface Steinway
- extends Ownable, EntityComposite
- {
- }
-
- public interface Owner
- {
- }
-
- public interface Ownable
- {
- @Optional
- Association<Owner> owner();
- }
-
- @AppliesTo( ChangesOwner.class )
- public static class ChangeOwnerSideEffect
- extends GenericSideEffect
- {
- @This
- Owner owner;
-
- @Override
- protected void invoke( Method method, Object[] args )
- throws Throwable
- {
- Ownable ownable = (Ownable) args[ 0];
- ownable.owner().set( owner );
- }
- }
-
- @Retention( RetentionPolicy.RUNTIME )
- public @interface ChangesOwner
- {
- }
-
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
deleted file mode 100644
index 2b52818..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi377/ValueCollisionWithRelatedReturnTypesTest.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Copyright (c) 2013, Chris Chapman. All Rights Reserved.
- * Copyright (c) 2014, Paul Merlin. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi377;
-
-import org.junit.Test;
-import org.apache.zest.api.entity.Identity;
-import org.apache.zest.api.association.Association;
-import org.apache.zest.api.association.ManyAssociation;
-import org.apache.zest.api.common.Optional;
-import org.apache.zest.api.property.Property;
-import org.apache.zest.api.value.ValueBuilder;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-
-public class ValueCollisionWithRelatedReturnTypesTest
- extends AbstractQi4jTest
-{
- @Override
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.values( Employee.class, Company.class );
- }
-
- @Test
- public void shouldBeAbleToSetNameToTheCompany()
- {
- ValueBuilder<Company> builder = module.newValueBuilder( Company.class );
- builder.prototype().name().set( "Acme" );
- Company startUp = builder.newInstance();
- }
-
- @Test
- public void shouldBeAbleToSetLeadToTheCompany()
- {
- Company startUp = module.newValue( Company.class );
- ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
- builder.prototype().identity().set( "niclas" );
- Employee niclas = builder.newInstance();
- startUp.lead().set( niclas );
- }
-
- @Test
- public void shouldBeAbleToSetLeadToTheSalesTeam()
- {
- SalesTeam startUp = module.newValue( SalesTeam.class );
- ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
- builder.prototype().identity().set( "niclas" );
- Employee niclas = builder.newInstance();
- startUp.lead().set( niclas );
- }
-
- @Test
- public void shouldBeAbleToSetLeadToTheResearchTeam()
- {
- ResearchTeam startUp = module.newValue( ResearchTeam.class );
- ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
- builder.prototype().identity().set( "niclas" );
- Employee niclas = builder.newInstance();
- startUp.lead().set( niclas );
- }
-
- @Test
- public void shouldBeAbleToAddEmployeesToTheCompany()
- {
- Company startUp = module.newValue( Company.class );
- ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
- builder.prototype().identity().set( "niclas" );
- Employee niclas = builder.newInstance();
- startUp.employees().add( niclas );
- }
-
- @Test
- public void shouldBeAbleToAddEmployeesToTheSalesTeam()
- {
- SalesTeam startUp = module.newValue( SalesTeam.class );
- ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
- builder.prototype().identity().set( "niclas" );
- Employee niclas = builder.newInstance();
- startUp.employees().add( niclas );
- }
-
- @Test
- public void shouldBeAbleToAddEmployeesToTheResearchTeam()
- {
- ResearchTeam startUp = module.newValue( ResearchTeam.class );
- ValueBuilder<Employee> builder = module.newValueBuilder( Employee.class );
- builder.prototype().identity().set( "niclas" );
- Employee niclas = builder.newInstance();
- startUp.employees().add( niclas );
- }
-
- public interface Employee
- extends Identity
- {
- }
-
- public interface SalesTeam
- {
- @Optional
- Property<String> name();
-
- @Optional
- Association<Employee> lead();
-
- ManyAssociation<Employee> employees();
- }
-
- public interface ResearchTeam
- {
- @Optional
- Property<String> name();
-
- @Optional
- Association<Employee> lead();
-
- ManyAssociation<Employee> employees();
- }
-
- /**
- * This compiles, unlike the example in {@link InterfaceCollisionWithUnrelatedReturnTypesTest}.
- */
- public interface Company
- extends SalesTeam, ResearchTeam
- {
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi382/Qi382Test.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi382/Qi382Test.java b/core/runtime/src/test/java/org/qi4j/regression/qi382/Qi382Test.java
deleted file mode 100644
index 2938172..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi382/Qi382Test.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright 2013 Niclas Hedhman.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi382;
-
-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.injection.scope.Structure;
-import org.apache.zest.api.injection.scope.This;
-import org.apache.zest.api.mixin.Mixins;
-import org.apache.zest.api.structure.Module;
-import org.apache.zest.api.unitofwork.UnitOfWork;
-import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException;
-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.AbstractQi4jTest;
-import org.apache.zest.valueserialization.orgjson.OrgJsonValueSerializationService;
-
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.hamcrest.core.IsNull.notNullValue;
-import static org.junit.Assert.assertThat;
-
-public class Qi382Test extends AbstractQi4jTest
-{
-
- @Override
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.addServices( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
- module.addServices( MemoryEntityStoreService.class );
- module.entities( Car.class, Person.class );
- }
-
- @Test
- public void givenCreationOfTwoEntitiesWhenAssigningOneToOtherExpectCompletionToSucceed()
- throws UnitOfWorkCompletionException
- {
- try( UnitOfWork unitOfWork = module.newUnitOfWork() )
- {
- Car car = unitOfWork.newEntity( Car.class, "Ferrari" );
- unitOfWork.complete();
- }
- try( UnitOfWork unitOfWork = module.newUnitOfWork() )
- {
- Car car = unitOfWork.get( Car.class, "Ferrari" );
- assertThat( car, notNullValue() );
- Person p = unitOfWork.get( Person.class, "Niclas" );
- assertThat( p, notNullValue() );
- assertThat( p.car().get(), equalTo( car ) );
- }
- }
-
- @Mixins( Car.CarMixin.class )
- public interface Car extends EntityComposite, Lifecycle
- {
-
- static class CarMixin implements Lifecycle
- {
- @This
- private Car me;
-
- @Structure
- private Module module;
-
- @Override
- public void create()
- throws LifecycleException
- {
- UnitOfWork unitOfWork = module.currentUnitOfWork();
- EntityBuilder<Person> builder = unitOfWork.newEntityBuilder( Person.class, "Niclas" );
- builder.instance().car().set( me );
- builder.newInstance();
- }
-
- @Override
- public void remove()
- throws LifecycleException
- {
-
- }
- }
- }
-
- public interface Person extends EntityComposite
- {
- Association<Car> car();
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi383/Qi383Test.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi383/Qi383Test.java b/core/runtime/src/test/java/org/qi4j/regression/qi383/Qi383Test.java
deleted file mode 100644
index 6b199c4..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi383/Qi383Test.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2013 Niclas Hedhman.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi383;
-
-import org.junit.Test;
-import org.apache.zest.api.entity.EntityComposite;
-import org.apache.zest.api.unitofwork.EntityCompositeAlreadyExistsException;
-import org.apache.zest.api.unitofwork.UnitOfWork;
-import org.apache.zest.api.unitofwork.UnitOfWorkCompletionException;
-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.AbstractQi4jTest;
-import org.apache.zest.valueserialization.orgjson.OrgJsonValueSerializationService;
-
-public class Qi383Test extends AbstractQi4jTest
-{
- @Override
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.addServices( OrgJsonValueSerializationService.class ).taggedWith( ValueSerialization.Formats.JSON );
- module.addServices( MemoryEntityStoreService.class );
- module.entities( Car.class );
- }
-
- @Test( expected = EntityCompositeAlreadyExistsException.class )
- public void givenUnitOfWorkInProgressWhenAddingSameEntityTwiceExpectException()
- throws UnitOfWorkCompletionException
- {
- try( UnitOfWork unitOfWork = module.newUnitOfWork() )
- {
- unitOfWork.newEntity( Car.class, "Ferrari" );
- unitOfWork.newEntity( Car.class, "Ford" );
- unitOfWork.newEntity( Car.class, "Ferrari" );
- unitOfWork.complete();
- }
- }
-
- public interface Car extends EntityComposite
- {
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi53/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi53/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi53/IssueTest.java
deleted file mode 100644
index 5a2806c..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi53/IssueTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.qi4j.regression.qi53;
-
-import org.junit.Test;
-import org.apache.zest.api.composite.TransientBuilder;
-import org.apache.zest.api.composite.TransientBuilderFactory;
-import org.apache.zest.api.composite.TransientComposite;
-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.property.Immutable;
-import org.apache.zest.api.property.Property;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-
-public class IssueTest
- extends AbstractQi4jTest
-{
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.transients( CostPerUnitComposite.class );
- }
-
- @Test
- public void genericPropertiesAndParameters()
- throws SecurityException, NoSuchMethodException
- {
- TransientBuilder<CostPerUnitComposite> builder = module.newTransientBuilder( CostPerUnitComposite.class );
- builder.prototype().unit().set( new Unit<Integer>( 10 ) );
- CostPerUnitComposite test = builder.newInstance();
- assertEquals( 10, test.unit().get().value );
- assertEquals( 50, test.toCostPer( new Unit<Integer>( 50 ) ).unit().get().value );
- }
-
- public interface CostPerUnit
- {
- @Immutable
- Property<Unit<?>> unit();
-
- CostPerUnit toCostPer( Unit<?> unit );
- }
-
- public static class Unit<T>
- {
- private T value;
-
- public Unit( T value )
- {
- this.value = value;
- }
-
- T get()
- {
- return value;
- }
- }
-
- public static abstract class CostPerUnitMixin
- implements CostPerUnit
- {
-
- @This
- CostPerUnit costPerUnit;
- @Structure
- TransientBuilderFactory builderFactory;
-
- public CostPerUnit toCostPer( Unit<?> unit )
- {
- TransientBuilder<CostPerUnitComposite> builder =
- builderFactory.newTransientBuilder( CostPerUnitComposite.class );
-
- builder.prototype().unit().set( unit );
- return builder.newInstance();
- }
- }
-
- @Mixins( { CostPerUnitMixin.class } )
- public interface CostPerUnitComposite
- extends CostPerUnit, TransientComposite
- {
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi55/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi55/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi55/IssueTest.java
deleted file mode 100644
index 74862c1..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi55/IssueTest.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.qi4j.regression.qi55;
-
-import org.junit.Test;
-import org.apache.zest.api.injection.scope.Uses;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-
-import static org.junit.Assert.assertEquals;
-
-public class IssueTest
- extends AbstractQi4jTest
-{
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.objects( AClass.class );
- }
-
- @Test
- public void objectWithGenericUsage()
- {
- assertEquals( "Using - Test string", module.
- newObject( AClass.class, "Test string" ).
- uses() );
- }
-
- public static class AClass<T>
- {
- @Uses
- T value;
-
- public String uses()
- {
- return "Using - " + value;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi59/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi59/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi59/IssueTest.java
deleted file mode 100644
index 7008045..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi59/IssueTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (c) 2008, Rickard Öberg. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-package org.qi4j.regression.qi59;
-
-import org.junit.Test;
-import org.apache.zest.api.entity.EntityComposite;
-import org.apache.zest.api.property.Property;
-import org.apache.zest.api.unitofwork.UnitOfWork;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.library.constraints.annotation.NotEmpty;
-import org.apache.zest.test.AbstractQi4jTest;
-import org.apache.zest.test.EntityTestAssembler;
-
-import static org.junit.Assert.fail;
-
-/**
- * Test for QI-59
- */
-public class IssueTest
- extends AbstractQi4jTest
-{
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.entities( TestCase.class );
- new EntityTestAssembler().assemble( module );
- }
-
- @Test
- public void givenEntityWithConstrainedPropertyWhenInvalidPropertyValueSetThenThrowException()
- {
- UnitOfWork uow = module.newUnitOfWork();
-
- try
- {
- TestCase testCase = uow.newEntity( TestCase.class );
-
- testCase.someProperty().set( null );
-
- uow.complete();
- fail( "Should not be allowed to set invalid property value" );
- }
- catch( Exception e )
- {
- uow.discard();
- }
- }
-
- @Test
- public void givenEntityWithComplexConstrainedPropertyWhenInvalidPropertyValueSetThenThrowException()
- {
- UnitOfWork uow = module.newUnitOfWork();
-
- try
- {
- TestCase testCase = uow.newEntity( TestCase.class );
-
- testCase.otherProperty().set( "" );
-
- uow.complete();
- fail( "Should not be allowed to set invalid property value" );
- }
- catch( Exception e )
- {
- uow.discard();
- }
- }
-
- interface TestCase
- extends EntityComposite
- {
- Property<String> someProperty();
-
- @NotEmpty
- Property<String> otherProperty();
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi65/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi65/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi65/IssueTest.java
deleted file mode 100644
index b386407..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi65/IssueTest.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.qi4j.regression.qi65;
-
-import org.junit.Test;
-import org.apache.zest.api.composite.TransientComposite;
-import org.apache.zest.api.mixin.Mixins;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-
-public class IssueTest
- extends AbstractQi4jTest
-{
- private final static Class<?> CLAZZ = Object.class;
- private final static String METHOD_NAME = "toString";
- private final static Class<?> PARAM_TYPES[] = { };
-
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.transients( TestComposite.class );
- }
-
- @Test( expected = IllegalArgumentException.class )
- public void constraintOnMethodParameter()
- throws SecurityException, NoSuchMethodException
- {
- TestComposite test = module.newTransient( TestComposite.class );
-
- test.someMethod( null );
- }
-
- @Mixins( TestMixin.class )
- public interface TestComposite
- extends TransientComposite
- {
- String someMethod( String value );
- }
-
- public static abstract class TestMixin
- implements TestComposite
- {
- public String someMethod( String value )
- {
- return value + " " + value;
- }
- }
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi74/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi74/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi74/IssueTest.java
deleted file mode 100644
index c2ca0db..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi74/IssueTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright 2008 Sonny Gill. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi74;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.apache.zest.api.composite.TransientBuilder;
-import org.apache.zest.api.composite.TransientComposite;
-import org.apache.zest.api.constraint.ConstraintViolationException;
-import org.apache.zest.api.property.Property;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-
-public class IssueTest
- extends AbstractQi4jTest
-{
- public void assemble( ModuleAssembly module )
- throws AssemblyException
- {
- module.transients( ValueHolder.class );
- }
-
- @Test
- public void testConstraintCheckedOnCompsiteCreation()
- {
- try
- {
- TransientBuilder<ValueHolder> builder = module.newTransientBuilder( ValueHolder.class );
- builder.newInstance();
- Assert.fail( "NotNull constraint violated but no exception is raised" );
- }
- catch( ConstraintViolationException e )
- {
- // expected
- }
- }
-
- static interface ValueHolder
- extends TransientComposite
- {
- Property<String> val();
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi78/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi78/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi78/IssueTest.java
deleted file mode 100644
index f1477c7..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi78/IssueTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright 2008 Sonny Gill. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi78;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.apache.zest.api.structure.Application;
-import org.apache.zest.api.structure.ApplicationDescriptor;
-import org.apache.zest.api.structure.LayerDescriptor;
-import org.apache.zest.bootstrap.ApplicationAssembler;
-import org.apache.zest.bootstrap.ApplicationAssembly;
-import org.apache.zest.bootstrap.ApplicationAssemblyFactory;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.Energy4Java;
-import org.apache.zest.bootstrap.LayerAssembly;
-import org.apache.zest.functional.HierarchicalVisitorAdapter;
-
-public class IssueTest
-{
- @Test
- public void testLayersCanBeCreatedInOrderDifferentFromTheirDependency()
- throws AssemblyException
- {
- Energy4Java qi4j = new Energy4Java();
-
- Application app = qi4j.newApplication( new ApplicationAssembler()
- {
- public ApplicationAssembly assemble( ApplicationAssemblyFactory applicationFactory )
- throws AssemblyException
- {
- ApplicationAssembly assembly = applicationFactory.newApplicationAssembly();
-
- LayerAssembly domainLayer = assembly.layer( null );
- domainLayer.setName( "Domain" );
-
- LayerAssembly infrastructureLayer = assembly.layer( null );
- infrastructureLayer.setName( "Infrastructure" );
-
- domainLayer.uses( infrastructureLayer );
-
- return assembly;
- }
- } );
- ApplicationDescriptor model = app.descriptor();
- model.accept( new HierarchicalVisitorAdapter<Object, Object, RuntimeException>()
- {
- @Override
- public boolean visitEnter( Object visited )
- throws RuntimeException
- {
- return visited instanceof ApplicationDescriptor;
- }
-
- @Override
- public boolean visitLeave( Object visited )
- throws RuntimeException
- {
- return visited instanceof LayerDescriptor;
- }
-
- @Override
- public boolean visit( Object visited )
- throws RuntimeException
- {
- if( visited instanceof LayerDescriptor )
- {
- Iterable<? extends LayerDescriptor> usedLayers = ( (LayerDescriptor) visited ).usedLayers()
- .layers();
- for( LayerDescriptor usedLayerModel : usedLayers )
- {
- Assert.assertNotNull( "Used layer model is null", usedLayerModel );
- }
- }
-
- return false;
- }
- } );
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/runtime/src/test/java/org/qi4j/regression/qi94/IssueTest.java
----------------------------------------------------------------------
diff --git a/core/runtime/src/test/java/org/qi4j/regression/qi94/IssueTest.java b/core/runtime/src/test/java/org/qi4j/regression/qi94/IssueTest.java
deleted file mode 100644
index 80f4016..0000000
--- a/core/runtime/src/test/java/org/qi4j/regression/qi94/IssueTest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright 2008 Richard Wallace. All Rights Reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied.
- *
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.qi4j.regression.qi94;
-
-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.property.Property;
-import org.apache.zest.api.unitofwork.UnitOfWork;
-import org.apache.zest.bootstrap.AssemblyException;
-import org.apache.zest.bootstrap.ModuleAssembly;
-import org.apache.zest.test.AbstractQi4jTest;
-import org.apache.zest.test.EntityTestAssembler;
-
-import static org.junit.Assert.assertEquals;
-
-public class IssueTest
- extends AbstractQi4jTest
-{
- @SuppressWarnings( "unchecked" )
- public void assemble( ModuleAssembly aModule )
- throws AssemblyException
- {
- aModule.entities( Item.class, ItemType.class );
- new EntityTestAssembler().assemble( aModule );
- }
-
- @Test
- public void entityBuilderAssociationTypeIsNotNull()
- {
- UnitOfWork uow = module.newUnitOfWork();
- try
- {
- EntityBuilder<Item> builder = uow.newEntityBuilder( Item.class );
- assertEquals( ItemType.class, qi4j.api()
- .entityDescriptorFor( builder.instance() )
- .state()
- .getAssociationByName( "typeOfItem" )
- .type() );
- }
- finally
- {
- uow.discard();
- }
- }
-
- interface Item
- extends EntityComposite
- {
- Association<ItemType> typeOfItem();
- }
-
- interface ItemType
- extends EntityComposite
- {
- Property<String> name();
- }
-}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/spi/src/docs/spi.txt
----------------------------------------------------------------------
diff --git a/core/spi/src/docs/spi.txt b/core/spi/src/docs/spi.txt
index 32fc8b2..1e54c11 100644
--- a/core/spi/src/docs/spi.txt
+++ b/core/spi/src/docs/spi.txt
@@ -21,7 +21,7 @@
source=core/spi/dev-status.xml
--------------
-The Zest™ Core Runtime has a number of extension points, which we call the _Qi4j Core Extension SPI_. These are defined
+The Zest™ Core Runtime has a number of extension points, which we call the _Zest Core Extension SPI_. These are defined
interfaces used *only* by the Core Runtime and *never* directly by application code. <<extensions>> are assembled in
applications during the bootstrap phase.
@@ -37,7 +37,7 @@ There are currently 5 Core SPI extensions;
Zest™ Runtime Extensions implementations may depend on Zest™ Libraries, but Libraries are NOT ALLOWED to depend on
Extensions. Applications code is NOT ALLOWED to depend on extensions. And application code SHOULD NOT depend on the
-Core Extension SPI. If you think that is needed, please contact qi4j-dev forum at Google Groups, to see if your usecase
+Core Extension SPI. If you think that is needed, please contact users@dev.apache.org mailing list, to see if your usecase
can be solved in a support manner, or that we need to extend the Core API to support it.
:leveloffset: {level3}
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/core/testsupport/src/docs/testsupport.txt
----------------------------------------------------------------------
diff --git a/core/testsupport/src/docs/testsupport.txt b/core/testsupport/src/docs/testsupport.txt
index f3c9585..f45ca30 100644
--- a/core/testsupport/src/docs/testsupport.txt
+++ b/core/testsupport/src/docs/testsupport.txt
@@ -33,7 +33,7 @@ In most cases, you will probably use the AbstractQi4jTest class to simplify star
[snippet,java]
--------------
-source=tutorials/hello/src/test/java/org/qi4j/tutorials/hello/HelloTest.java
+source=tutorials/hello/src/test/java/org/apache/zest/tutorials/hello/HelloTest.java
tag=step1
--------------
@@ -42,15 +42,15 @@ What goes into that module is declared in the assembly() method;
[snippet,java]
--------------
-source=tutorials/hello/src/test/java/org/qi4j/tutorials/hello/HelloTest.java
+source=tutorials/hello/src/test/java/org/apache/zest/tutorials/hello/HelloTest.java
tag=step2
--------------
-In this case we declare that we have a ValueComposite of type org.qi4j.tutorials.hello.Hello which looks like
+In this case we declare that we have a ValueComposite of type org.apache.zest.tutorials.hello.Hello which looks like
[snippet,java]
--------------
-source=tutorials/hello/src/main/java/org/qi4j/tutorials/hello/Hello.java
+source=tutorials/hello/src/main/java/org/apache/zest/tutorials/hello/Hello.java
tag=body
--------------
@@ -61,7 +61,7 @@ And then we create the actual test;
[snippet,java]
--------------
-source=tutorials/hello/src/test/java/org/qi4j/tutorials/hello/HelloTest.java
+source=tutorials/hello/src/test/java/org/apache/zest/tutorials/hello/HelloTest.java
tag=step3
--------------
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/cache-ehcache/src/docs/cache-ehcache.txt
----------------------------------------------------------------------
diff --git a/extensions/cache-ehcache/src/docs/cache-ehcache.txt b/extensions/cache-ehcache/src/docs/cache-ehcache.txt
index 32c8bc8..36444f6 100644
--- a/extensions/cache-ehcache/src/docs/cache-ehcache.txt
+++ b/extensions/cache-ehcache/src/docs/cache-ehcache.txt
@@ -40,7 +40,7 @@ Assembly is done using the provided Assembler:
[snippet,java]
----
-source=extensions/cache-ehcache/src/test/java/org/qi4j/cache/ehcache/EhCacheTest.java
+source=extensions/cache-ehcache/src/test/java/org/apache/zest/cache/ehcache/EhCacheTest.java
tag=assembly
----
@@ -51,6 +51,6 @@ Here are the configuration properties for the EhCache EntityStore Cache:
[snippet,java]
----
-source=extensions/cache-ehcache/src/main/java/org/qi4j/cache/ehcache/EhCacheConfiguration.java
+source=extensions/cache-ehcache/src/main/java/org/apache/zest/cache/ehcache/EhCacheConfiguration.java
tag=config
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/cache-memcache/src/docs/cache-memcache.txt
----------------------------------------------------------------------
diff --git a/extensions/cache-memcache/src/docs/cache-memcache.txt b/extensions/cache-memcache/src/docs/cache-memcache.txt
index 5cd5081..12a075e 100644
--- a/extensions/cache-memcache/src/docs/cache-memcache.txt
+++ b/extensions/cache-memcache/src/docs/cache-memcache.txt
@@ -47,7 +47,7 @@ Assembly is done using the +MemcacheAssembler+:
[snippet,java]
----
-source=extensions/cache-memcache/src/test/java/org/qi4j/cache/memcache/MemcacheCachePoolTest.java
+source=extensions/cache-memcache/src/test/java/org/apache/zest/cache/memcache/MemcacheCachePoolTest.java
tag=assembly
----
@@ -58,7 +58,7 @@ Here are the configuration properties for the Memcache EntityStore Cache:
[snippet,java]
----
-source=extensions/cache-memcache/src/main/java/org/qi4j/cache/memcache/MemcacheConfiguration.java
+source=extensions/cache-memcache/src/main/java/org/apache/zest/cache/memcache/MemcacheConfiguration.java
tag=config
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/entitystore-file/src/docs/es-file.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-file/src/docs/es-file.txt b/extensions/entitystore-file/src/docs/es-file.txt
index 1cf25cc..9c5057d 100644
--- a/extensions/entitystore-file/src/docs/es-file.txt
+++ b/extensions/entitystore-file/src/docs/es-file.txt
@@ -37,7 +37,7 @@ Assembly is done as follows:
[snippet,java]
----
-source=extensions/entitystore-file/src/test/java/org/qi4j/entitystore/file/FileEntityStoreTest.java
+source=extensions/entitystore-file/src/test/java/org/apache/zest/entitystore/file/FileEntityStoreTest.java
tag=assembly
----
@@ -47,7 +47,7 @@ Here are the configuration properties for the File EntityStore:
[snippet,java]
----
-source=extensions/entitystore-file/src/main/java/org/qi4j/entitystore/file/FileEntityStoreConfiguration.java
+source=extensions/entitystore-file/src/main/java/org/apache/zest/entitystore/file/FileEntityStoreConfiguration.java
tag=config
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/entitystore-hazelcast/src/docs/es-hazelcast.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-hazelcast/src/docs/es-hazelcast.txt b/extensions/entitystore-hazelcast/src/docs/es-hazelcast.txt
index e9b3dbf..cb02522 100644
--- a/extensions/entitystore-hazelcast/src/docs/es-hazelcast.txt
+++ b/extensions/entitystore-hazelcast/src/docs/es-hazelcast.txt
@@ -35,7 +35,7 @@ Assembly is done using the provided Assembler:
[snippet,java]
----
-source=extensions/entitystore-hazelcast/src/test/java/org/qi4j/entitystore/hazelcast/HazelcastEntityStoreTest.java
+source=extensions/entitystore-hazelcast/src/test/java/org/apache/zest/entitystore/hazelcast/HazelcastEntityStoreTest.java
tag=assembly
----
@@ -45,7 +45,7 @@ Here are the configuration properties for the Hazelcast EntityStore:
[snippet,java]
----
-source=extensions/entitystore-hazelcast/src/main/java/org/qi4j/entitystore/hazelcast/HazelcastConfiguration.java
+source=extensions/entitystore-hazelcast/src/main/java/org/apache/zest/entitystore/hazelcast/HazelcastConfiguration.java
tag=config
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/entitystore-jclouds/src/docs/es-jclouds.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jclouds/src/docs/es-jclouds.txt b/extensions/entitystore-jclouds/src/docs/es-jclouds.txt
index baaddf2..6067168 100644
--- a/extensions/entitystore-jclouds/src/docs/es-jclouds.txt
+++ b/extensions/entitystore-jclouds/src/docs/es-jclouds.txt
@@ -44,7 +44,7 @@ Assembly is done using the provided Assembler:
[snippet,java]
----
-source=extensions/entitystore-jclouds/src/test/java/org/qi4j/entitystore/jclouds/JCloudsTransientTest.java
+source=extensions/entitystore-jclouds/src/test/java/org/apache/zest/entitystore/jclouds/JCloudsTransientTest.java
tag=assembly
----
@@ -54,6 +54,6 @@ Here are the configuration properties for the JClouds EntityStore:
[snippet,java]
----
-source=extensions/entitystore-jclouds/src/main/java/org/qi4j/entitystore/jclouds/JCloudsMapEntityStoreConfiguration.java
+source=extensions/entitystore-jclouds/src/main/java/org/apache/zest/entitystore/jclouds/JCloudsMapEntityStoreConfiguration.java
tag=config
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/entitystore-jdbm/src/docs/es-jdbm.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-jdbm/src/docs/es-jdbm.txt b/extensions/entitystore-jdbm/src/docs/es-jdbm.txt
index 7a90daa..0c6d3c8 100644
--- a/extensions/entitystore-jdbm/src/docs/es-jdbm.txt
+++ b/extensions/entitystore-jdbm/src/docs/es-jdbm.txt
@@ -35,7 +35,7 @@ Assembly is done using the provided Assembler:
[snippet,java]
----
-source=extensions/entitystore-jdbm/src/test/java/org/qi4j/entitystore/jdbm/DocumentationSupport.java
+source=extensions/entitystore-jdbm/src/test/java/org/apache/zest/entitystore/jdbm/DocumentationSupport.java
tag=UsingAssembler
----
@@ -45,7 +45,7 @@ Here are the configuration properties for the JDBM EntityStore:
[snippet,java]
----
-source=extensions/entitystore-jdbm/src/main/java/org/qi4j/entitystore/jdbm/JdbmConfiguration.java
+source=extensions/entitystore-jdbm/src/main/java/org/apache/zest/entitystore/jdbm/JdbmConfiguration.java
tag=config
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/entitystore-leveldb/src/docs/es-leveldb.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-leveldb/src/docs/es-leveldb.txt b/extensions/entitystore-leveldb/src/docs/es-leveldb.txt
index ffbc16a..8fae082 100644
--- a/extensions/entitystore-leveldb/src/docs/es-leveldb.txt
+++ b/extensions/entitystore-leveldb/src/docs/es-leveldb.txt
@@ -43,7 +43,7 @@ Assembly is done using the provided Assembler:
[snippet,java]
----
-source=extensions/entitystore-leveldb/src/test/java/org/qi4j/entitystore/leveldb/JavaLevelDBEntityStoreTest.java
+source=extensions/entitystore-leveldb/src/test/java/org/apache/zest/entitystore/leveldb/JavaLevelDBEntityStoreTest.java
tag=assembly
----
@@ -53,7 +53,7 @@ Here are the configuration properties for the LevelDB EntityStore:
[snippet,java]
----
-source=extensions/entitystore-leveldb/src/main/java/org/qi4j/entitystore/leveldb/LevelDBEntityStoreConfiguration.java
+source=extensions/entitystore-leveldb/src/main/java/org/apache/zest/entitystore/leveldb/LevelDBEntityStoreConfiguration.java
tag=config
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/entitystore-memory/src/docs/es-memory.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-memory/src/docs/es-memory.txt b/extensions/entitystore-memory/src/docs/es-memory.txt
index 93da628..9bba9af 100644
--- a/extensions/entitystore-memory/src/docs/es-memory.txt
+++ b/extensions/entitystore-memory/src/docs/es-memory.txt
@@ -35,7 +35,7 @@ Assembly is done as follows:
[snippet,java]
----
-source=extensions/entitystore-memory/src/test/java/org/qi4j/entitystore/memory/MemoryEntityStoreTest.java
+source=extensions/entitystore-memory/src/test/java/org/apache/zest/entitystore/memory/MemoryEntityStoreTest.java
tag=assembly
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/entitystore-mongodb/src/docs/es-mongodb.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-mongodb/src/docs/es-mongodb.txt b/extensions/entitystore-mongodb/src/docs/es-mongodb.txt
index c24746f..8c7e55e 100644
--- a/extensions/entitystore-mongodb/src/docs/es-mongodb.txt
+++ b/extensions/entitystore-mongodb/src/docs/es-mongodb.txt
@@ -36,7 +36,7 @@ Assembly is done using the provided Assembler:
[snippet,java]
----
-source=extensions/entitystore-mongodb/src/test/java/org/qi4j/entitystore/mongodb/MongoMapEntityStoreTest.java
+source=extensions/entitystore-mongodb/src/test/java/org/apache/zest/entitystore/mongodb/MongoMapEntityStoreTest.java
tag=assembly
----
@@ -46,6 +46,6 @@ Here are the configuration properties for the MongoDB EntityStore:
[snippet,java]
----
-source=extensions/entitystore-mongodb/src/main/java/org/qi4j/entitystore/mongodb/MongoEntityStoreConfiguration.java
+source=extensions/entitystore-mongodb/src/main/java/org/apache/zest/entitystore/mongodb/MongoEntityStoreConfiguration.java
tag=config
----
http://git-wip-us.apache.org/repos/asf/zest-java/blob/fc41bb18/extensions/entitystore-preferences/src/docs/es-preferences.txt
----------------------------------------------------------------------
diff --git a/extensions/entitystore-preferences/src/docs/es-preferences.txt b/extensions/entitystore-preferences/src/docs/es-preferences.txt
index 5727b5f..dfb111b 100644
--- a/extensions/entitystore-preferences/src/docs/es-preferences.txt
+++ b/extensions/entitystore-preferences/src/docs/es-preferences.txt
@@ -37,6 +37,6 @@ Assembly is done using the provided Assembler:
[snippet,java]
----
-source=extensions/entitystore-preferences/src/test/java/org/qi4j/entitystore/DocumentationSupport.java
+source=extensions/entitystore-preferences/src/test/java/org/apache/zest/entitystore/DocumentationSupport.java
tag=assembly
----