http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI256Test.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI256Test.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI256Test.java index b99b4e1..2eb3bf4 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI256Test.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/QI256Test.java @@ -14,12 +14,12 @@ package org.apache.zest.runtime.composite; -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.AbstractZestTest; +import org.junit.Test; /** * JAVADOC @@ -38,40 +38,40 @@ public class QI256Test } @Mixins( { TestTransient.TestTransientMixin.class } ) - public static interface TestTransient + public interface TestTransient extends TransientComposite { - public void declaredMethodThatThrowsCustomException(); + void declaredMethodThatThrowsCustomException(); - public void invokeDeclaredPublicMethodThatThrowsCustomException(); + void invokeDeclaredPublicMethodThatThrowsCustomException(); - public void invokePrivateMethodThatThrowsCustomException(); + void invokePrivateMethodThatThrowsCustomException(); - public void invokeProtectedMethodThatThrowsCustomException(); + void invokeProtectedMethodThatThrowsCustomException(); - public void invokeUndeclaredPublicMethodThatThrowsCustomException(); + void invokeUndeclaredPublicMethodThatThrowsCustomException(); - public void declaredMethodThatThrowsBuiltinInheritedException(); + void declaredMethodThatThrowsBuiltinInheritedException(); - public void invokeDeclaredPublicMethodThatThrowsBuiltinInheritedException(); + void invokeDeclaredPublicMethodThatThrowsBuiltinInheritedException(); - public void invokePrivateMethodThatThrowsBuiltinInheritedException(); + void invokePrivateMethodThatThrowsBuiltinInheritedException(); - public void invokeProtectedMethodThatThrowsBuiltinInheritedException(); + void invokeProtectedMethodThatThrowsBuiltinInheritedException(); - public void invokeUndeclaredPublicMethodThatThrowsBuiltinInheritedException(); + void invokeUndeclaredPublicMethodThatThrowsBuiltinInheritedException(); - public void declaredMethodThatThrowsBuiltinException(); + void declaredMethodThatThrowsBuiltinException(); - public void invokeDeclaredPublicMethodThatThrowsBuiltinException(); + void invokeDeclaredPublicMethodThatThrowsBuiltinException(); - public void invokePrivateMethodThatThrowsBuiltinException(); + void invokePrivateMethodThatThrowsBuiltinException(); - public void invokeProtectedMethodThatThrowsBuiltinException(); + void invokeProtectedMethodThatThrowsBuiltinException(); - public void invokeUndeclaredPublicMethodThatThrowsBuiltinException(); + void invokeUndeclaredPublicMethodThatThrowsBuiltinException(); - public abstract class TestTransientMixin + abstract class TestTransientMixin implements TestTransient { public void declaredMethodThatThrowsCustomException() @@ -209,14 +209,14 @@ public class QI256Test public void invokeCustomExceptionThrowingMethod() throws Throwable { - this.module.newTransient( TestTransient.class ).declaredMethodThatThrowsCustomException(); + this.transientBuilderFactory.newTransient( TestTransient.class ).declaredMethodThatThrowsCustomException(); } @Test( expected = TestException.class ) public void invokeDeclaredPublicMethodWhichInvokesCustomExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeDeclaredPublicMethodThatThrowsCustomException(); } @@ -225,7 +225,7 @@ public class QI256Test public void invokeUndeclaredPublicMethodWhichInvokesCustomExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeUndeclaredPublicMethodThatThrowsCustomException(); } @@ -234,14 +234,14 @@ public class QI256Test public void invokePrivateMethodWhichInvokesCustomExceptionThrowingMethod() throws Throwable { - this.module.newTransient( TestTransient.class ).invokePrivateMethodThatThrowsCustomException(); + this.transientBuilderFactory.newTransient( TestTransient.class ).invokePrivateMethodThatThrowsCustomException(); } @Test( expected = TestException.class ) public void invokeProtectedMethodWhichInvokesCustomExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeProtectedMethodThatThrowsCustomException(); } @@ -250,7 +250,7 @@ public class QI256Test public void invokeBuiltinInheritedExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .declaredMethodThatThrowsBuiltinInheritedException(); } @@ -259,7 +259,7 @@ public class QI256Test public void invokeDeclaredPublicMethodWhichInvokesBuiltinInheritedExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeDeclaredPublicMethodThatThrowsBuiltinInheritedException(); } @@ -268,7 +268,7 @@ public class QI256Test public void invokeUndeclaredPublicMethodWhichInvokesBuiltinInheritedExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeUndeclaredPublicMethodThatThrowsBuiltinInheritedException(); } @@ -277,7 +277,7 @@ public class QI256Test public void invokePrivateMethodWhichInvokesBuiltinInheritedExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokePrivateMethodThatThrowsBuiltinInheritedException(); } @@ -286,7 +286,7 @@ public class QI256Test public void invokeProtectedMethodWhichInvokesBuiltinInheritedExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeProtectedMethodThatThrowsBuiltinInheritedException(); } @@ -295,7 +295,7 @@ public class QI256Test public void invokeBuiltinExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .declaredMethodThatThrowsBuiltinInheritedException(); } @@ -304,7 +304,7 @@ public class QI256Test public void invokeDeclaredPublicMethodWhichInvokesBuiltinExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeDeclaredPublicMethodThatThrowsBuiltinInheritedException(); } @@ -313,7 +313,7 @@ public class QI256Test public void invokeUndeclaredPublicMethodWhichInvokesBuiltinExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeUndeclaredPublicMethodThatThrowsBuiltinInheritedException(); } @@ -322,7 +322,7 @@ public class QI256Test public void invokePrivateMethodWhichInvokesBuiltinExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokePrivateMethodThatThrowsBuiltinInheritedException(); } @@ -331,7 +331,7 @@ public class QI256Test public void invokeProtectedMethodWhichInvokesBuiltinExceptionThrowingMethod() throws Throwable { - this.module + this.transientBuilderFactory .newTransient( TestTransient.class ) .invokeProtectedMethodThatThrowsBuiltinInheritedException(); }
http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/composite/TransientAsClassTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/composite/TransientAsClassTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/composite/TransientAsClassTest.java index 5d7839b..7c145ef 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/composite/TransientAsClassTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/composite/TransientAsClassTest.java @@ -68,7 +68,7 @@ public class TransientAsClassTest @Test public void test() { - UnderTest underTest = module.newTransient( UnderTest.class ); + UnderTest underTest = transientBuilderFactory.newTransient( UnderTest.class ); assertThat( underTest.foo(), equalTo( "foo bar" ) ); } } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/concerns/GenericConcernTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/concerns/GenericConcernTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/concerns/GenericConcernTest.java index d243c64..b65ee90 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/concerns/GenericConcernTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/concerns/GenericConcernTest.java @@ -43,7 +43,7 @@ public class GenericConcernTest public void testNestedUnitOfWork() { UnitOfWork uow = uowf.newUnitOfWork(); - Some some = module.newTransient( Some.class ); + Some some = transientBuilderFactory.newTransient( Some.class ); some.doStuff(); uow.discard(); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/concerns/ModuleConcernTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/concerns/ModuleConcernTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/concerns/ModuleConcernTest.java index 97fa16d..b17596d 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/concerns/ModuleConcernTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/concerns/ModuleConcernTest.java @@ -57,7 +57,7 @@ public class ModuleConcernTest @Test public void testModuleConcerns() { - module.newTransient( Foo.class ).test( "Foo", 42 ); + transientBuilderFactory.newTransient( Foo.class ).test( "Foo", 42 ); assertThat( "Concern has executed", ok, equalTo( true ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/constraints/ConstraintsTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/constraints/ConstraintsTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/constraints/ConstraintsTest.java index 3aeeb95..83eace3 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/constraints/ConstraintsTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/constraints/ConstraintsTest.java @@ -53,7 +53,7 @@ public class ConstraintsTest public void givenCompositeWithConstraintsWhenInstantiatedThenUseDeclarationOnComposite() throws Throwable { - MyOne my = module.newTransient( MyOneComposite.class ); + MyOne my = transientBuilderFactory.newTransient( MyOneComposite.class ); ArrayList<String> list = new ArrayList<String>(); list.add( "zout" ); my.doSomething( "habba", list ); @@ -74,7 +74,7 @@ public class ConstraintsTest public void givenCompositeWithoutConstraintsWhenInstantiatedThenUseDeclarationOnConstraint() throws Throwable { - MyOne my = module.newTransient( MyOneComposite2.class ); + MyOne my = transientBuilderFactory.newTransient( MyOneComposite2.class ); ArrayList<String> list = new ArrayList<String>(); list.add( "zout" ); my.doSomething( "habba", list ); @@ -94,7 +94,7 @@ public class ConstraintsTest @Test public void givenConstrainedGenericWildcardParameterWhenInvokedThenUseConstraint() { - MyOne myOne = module.newTransient( MyOneComposite.class ); + MyOne myOne = transientBuilderFactory.newTransient( MyOneComposite.class ); ArrayList<String> list = new ArrayList<String>(); list.add( "Foo" ); myOne.doSomething2( list ); @@ -103,7 +103,7 @@ public class ConstraintsTest @Test public void givenCompositeConstraintWhenInvokedThenUseAllConstraints() { - MyOne myOne = module.newTransient( MyOneComposite.class ); + MyOne myOne = transientBuilderFactory.newTransient( MyOneComposite.class ); ArrayList<String> list = new ArrayList<String>(); list.add( "Foo" ); myOne.doSomething3( list ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/defaults/UseDefaultsTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/defaults/UseDefaultsTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/defaults/UseDefaultsTest.java index 2bce838..affc53d 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/defaults/UseDefaultsTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/defaults/UseDefaultsTest.java @@ -44,7 +44,7 @@ public class UseDefaultsTest @Test public void givenPropertyWithUseDefaultsWhenInstantiatedThenPropertiesAreDefaulted() { - TransientBuilder<TestComposite> builder = module.newTransientBuilder( TestComposite.class ); + TransientBuilder<TestComposite> builder = transientBuilderFactory.newTransientBuilder( TestComposite.class ); TestComposite testComposite = builder.newInstance(); assertThat( "nullInt is null", testComposite.nullInt().get(), nullValue() ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/ActivatorInjectionTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/ActivatorInjectionTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/ActivatorInjectionTest.java index 9af6dd1..9ed6f08 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/ActivatorInjectionTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/ActivatorInjectionTest.java @@ -163,8 +163,8 @@ public class ActivatorInjectionTest @Test public void test() { - assertThat( module.findService( ServiceA.class ).get().what(), equalTo( "A" ) ); - assertThat( module.findService( ServiceB.class ).get().what(), equalTo( "B" ) ); + assertThat( serviceFinder.findService( ServiceA.class ).get().what(), equalTo( "A" ) ); + assertThat( serviceFinder.findService( ServiceB.class ).get().what(), equalTo( "B" ) ); } } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/ServiceInjectionTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/ServiceInjectionTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/ServiceInjectionTest.java index fbf691e..76c47f4 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/ServiceInjectionTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/ServiceInjectionTest.java @@ -77,12 +77,12 @@ public class ServiceInjectionTest assertEquals( "X", user.testSingle() ); assertEquals( "Foo", user.testIdentity() ); - assertEquals( "XX", user.testIterable() ); assertEquals( "FooX", user.testServiceReference() ); - assertEquals( "FooXBarX", user.testIterableServiceReferences() ); assertEquals( "Bar", user.testQualifier() ); assertEquals( "A", user.testStringIterable() ); assertEquals( new Long( 1L ), user.testLongIterable() ); + assertEquals( "FooXBarX", user.testIterableServiceReferences() ); + assertEquals( "XX", user.testIterable() ); } @Test @@ -192,12 +192,16 @@ public class ServiceInjectionTest { @Service MyService service; + @Service MyServiceComposite serviceComposite; + @Service Iterable<MyService> services; + @Service ServiceReference<MyService> serviceRef; + @Service Iterable<ServiceReference<MyService>> serviceRefs; http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateInjectionTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateInjectionTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateInjectionTest.java index 2c654d7..30a3e10 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateInjectionTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateInjectionTest.java @@ -52,7 +52,7 @@ public class StateInjectionTest throws Exception { TransientBuilder<PropertyFieldInjectionComposite> pficBuilder = - module.newTransientBuilder( StateInjectionTest.PropertyFieldInjectionComposite.class ); + transientBuilderFactory.newTransientBuilder( StateInjectionTest.PropertyFieldInjectionComposite.class ); pficBuilder.prototype().testField().set( "X" ); PropertyFieldInjectionComposite pfic = pficBuilder.newInstance(); assertThat( "Test field", pfic.testField().get(), is( equalTo( "X" ) ) ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateParameterInjectionTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateParameterInjectionTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateParameterInjectionTest.java index b69b313..36afbf8 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateParameterInjectionTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/StateParameterInjectionTest.java @@ -50,7 +50,7 @@ public class StateParameterInjectionTest throws Exception { TransientBuilder<PropertyParameterInjectionComposite> pficBuilder = - module.newTransientBuilder( PropertyParameterInjectionComposite.class ); + transientBuilderFactory.newTransientBuilder( PropertyParameterInjectionComposite.class ); pficBuilder.prototype().testField().set( "X" ); pficBuilder.prototype().namedField().set( "Y" ); PropertyParameterInjectionComposite pfic = pficBuilder.newInstance(); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/StructureInjectionTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/StructureInjectionTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/StructureInjectionTest.java index 80cc85e..475818e 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/StructureInjectionTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/StructureInjectionTest.java @@ -51,7 +51,7 @@ public class StructureInjectionTest @Test public void injectedStructureForCompositeBuilderFactory() { - StructureInjectionComposite sic = module.newTransient( StructureInjectionComposite.class ); + StructureInjectionComposite sic = transientBuilderFactory.newTransient( StructureInjectionComposite.class ); assertThat( "Injected CompositeBuilderFactory", sic.getCompositeBuilderFactory(), is( notNullValue() ) ); } @@ -61,7 +61,7 @@ public class StructureInjectionTest @Test public void injectedStructureForObjectBuilderFactory() { - StructureInjectionComposite sic = module.newTransient( StructureInjectionComposite.class ); + StructureInjectionComposite sic = transientBuilderFactory.newTransient( StructureInjectionComposite.class ); assertThat( "Injected ObjectBuilderFactory", sic.getObjectFactory(), is( notNullValue() ) ); } @@ -71,7 +71,7 @@ public class StructureInjectionTest @Test public void injectedStructureForUnitOfWorkFactory() { - StructureInjectionComposite sic = module.newTransient( StructureInjectionComposite.class ); + StructureInjectionComposite sic = transientBuilderFactory.newTransient( StructureInjectionComposite.class ); assertThat( "Injected UnitOfWorkFactory", sic.getUnitOfWorkFactory(), is( notNullValue() ) ); } @@ -81,7 +81,7 @@ public class StructureInjectionTest @Test public void injectedStructureForServiceLocator() { - StructureInjectionComposite sic = module.newTransient( StructureInjectionComposite.class ); + StructureInjectionComposite sic = transientBuilderFactory.newTransient( StructureInjectionComposite.class ); assertThat( "Injected ServiceLocator", sic.getServiceLocator(), is( notNullValue() ) ); } @@ -91,7 +91,7 @@ public class StructureInjectionTest @Test public void injectedStructureForModuleBinding() { - StructureInjectionComposite sic = module.newTransient( StructureInjectionComposite.class ); + StructureInjectionComposite sic = transientBuilderFactory.newTransient( StructureInjectionComposite.class ); assertThat( "Injected Module", sic.getModule(), is( notNullValue() ) ); } @@ -101,7 +101,7 @@ public class StructureInjectionTest @Test public void injectedStructureForZest() { - StructureInjectionComposite sic = module.newTransient( StructureInjectionComposite.class ); + StructureInjectionComposite sic = transientBuilderFactory.newTransient( StructureInjectionComposite.class ); assertThat( "Injected Zest", sic.getZest(), is( notNullValue() ) ); } @@ -111,7 +111,7 @@ public class StructureInjectionTest @Test public void injectedStructureForZestSpi() { - StructureInjectionComposite sic = module.newTransient( StructureInjectionComposite.class ); + StructureInjectionComposite sic = transientBuilderFactory.newTransient( StructureInjectionComposite.class ); assertThat( "Injected ZestSPI", sic.getZestSpi(), is( notNullValue() ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/ThisInjectionTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/ThisInjectionTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/ThisInjectionTest.java index 7d071fd..6638de5 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/ThisInjectionTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/ThisInjectionTest.java @@ -54,7 +54,7 @@ public class ThisInjectionTest public void givenCompositeWithThisInjectionsWhenInstantiatedThenCompositeIsInjected() throws Exception { - TestComposite testComposite = module.newTransient( TestComposite.class ); + TestComposite testComposite = transientBuilderFactory.newTransient( TestComposite.class ); assertThat( "Injection worked", testComposite.isInjected() && sideEffectInjected, is( equalTo( true ) ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericClassTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericClassTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericClassTest.java index fe37567..0fdb0e9 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericClassTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericClassTest.java @@ -40,7 +40,7 @@ public class UsesGenericClassTest @Test public void givenMixinUsesGenericClassWhenUseClassThenInjectWorks() { - TransientBuilder<TestCase> builder = module.newTransientBuilder( TestCase.class ); + TransientBuilder<TestCase> builder = transientBuilderFactory.newTransientBuilder( TestCase.class ); builder.use( UsesGenericClassTest.class ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericListTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericListTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericListTest.java index bf69ba0..364bb62 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericListTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGenericListTest.java @@ -44,7 +44,7 @@ public class UsesGenericListTest @Test public void givenMixinUsesGenericListWhenUseListThenInjectWorks() { - TransientBuilder<TestCase> builder = module.newTransientBuilder( TestCase.class ); + TransientBuilder<TestCase> builder = transientBuilderFactory.newTransientBuilder( TestCase.class ); ArrayList<String> list = new ArrayList<String>(); list.add( "Hello" ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGraphTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGraphTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGraphTest.java index 129f399..d354f6a 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGraphTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesGraphTest.java @@ -40,7 +40,7 @@ public class UsesGraphTest public void givenGraphDependenciesWhenInstantiateAThenGetSameReferences() { D d = new D(); - A a = module.newObject( A.class, module.newObject( C.class, d ), d ); + A a = objectFactory.newObject( A.class, objectFactory.newObject( C.class, d ), d ); Assert.assertThat( "Same reference expected", a.c, equalTo( a.b.c ) ); Assert.assertThat( "Same reference expected", a.d, equalTo( a.b.c.d ) ); @@ -49,7 +49,7 @@ public class UsesGraphTest @Test public void givenGraphDependenciesWhenInstantiateUsingBuildersThenDontGetSameReferences() { - A a = module.newObject( A.class ); + A a = objectFactory.newObject( A.class ); Assert.assertThat( "Same reference not expected", a.c, not( equalTo( a.b.c ) ) ); Assert.assertThat( "Same reference not expected", a.d, not( equalTo( a.b.c.d ) ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesInjectionTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesInjectionTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesInjectionTest.java index 19666b5..30837ed 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesInjectionTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/injection/UsesInjectionTest.java @@ -42,9 +42,9 @@ public class UsesInjectionTest throws Exception { ToBeInjected toBeInjected = new ToBeInjected(); - assertThat( "Injected object", module.newObject( InjectionTarget.class, toBeInjected, true ) + assertThat( "Injected object", objectFactory.newObject( InjectionTarget.class, toBeInjected, true ) .getUsedObject(), is( equalTo( toBeInjected ) ) ); - assertThat( "Injected boolean", module.newObject( InjectionTarget.class, toBeInjected, true ) + assertThat( "Injected boolean", objectFactory.newObject( InjectionTarget.class, toBeInjected, true ) .isUsedBoolean(), is( equalTo( true ) ) ); } @@ -52,14 +52,14 @@ public class UsesInjectionTest public void givenUsedObjectBuilderWhenUseWithBuilderThenInjectNewInstance() throws Exception { - assertThat( "Injected object", module.newObject( InjectionTarget.class, module.newObject( ToBeInjected.class ), true ), is( notNullValue() ) ); + assertThat( "Injected object", objectFactory.newObject( InjectionTarget.class, objectFactory.newObject( ToBeInjected.class ), true ), is( notNullValue() ) ); } @Test public void givenNoUsesWhenBuilderNewInstanceThenInjectNewInstance() throws Exception { - assertThat( "Injected object", module.newObject( InjectionTarget.class, true ), is( notNullValue() ) ); + assertThat( "Injected object", objectFactory.newObject( InjectionTarget.class, true ), is( notNullValue() ) ); } public static class InjectionTarget http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ServiceInstantiationTests.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ServiceInstantiationTests.java b/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ServiceInstantiationTests.java index c34e1cd..bed3111 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ServiceInstantiationTests.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ServiceInstantiationTests.java @@ -46,7 +46,7 @@ public class ServiceInstantiationTests public void whenCreatingServiceCompositeGivenAServiceCompositeThenSucceed() throws Exception { - ServiceReference<My> service = module.findService( My.class ); + ServiceReference<My> service = serviceFinder.findService( My.class ); Assert.assertEquals( "HabbaZout", service.get().doSomething() ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/TransientInstantiationTests.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/TransientInstantiationTests.java b/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/TransientInstantiationTests.java index bea66f9..7941baa 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/TransientInstantiationTests.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/TransientInstantiationTests.java @@ -39,7 +39,7 @@ public class TransientInstantiationTests public void whenCreatingServiceCompositeGivenAServiceCompositeThenSucceed() throws Exception { - TransientBuilder<My> builder = module.newTransientBuilder( My.class ); + TransientBuilder<My> builder = transientBuilderFactory.newTransientBuilder( My.class ); My my = builder.newInstance(); Assert.assertEquals( "Niclas", my.doSomething() ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ValueInstantiationTests.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ValueInstantiationTests.java b/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ValueInstantiationTests.java index e2387b5..dc115a0 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ValueInstantiationTests.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/instantiation/ValueInstantiationTests.java @@ -46,7 +46,7 @@ public class ValueInstantiationTests // valueBuilderFactory.newValueBuilder() try { - module.newValueBuilder( null ); + valueBuilderFactory.newValueBuilder( null ); fail( "NullArgumentException was expected." ); } catch( NullArgumentException e ) @@ -57,7 +57,7 @@ public class ValueInstantiationTests // valueBuilderFactory.newValue(); try { - module.newValue( null ); + valueBuilderFactory.newValue( null ); fail( "NullArgumentException was expected." ); } catch( NullArgumentException e ) @@ -68,8 +68,8 @@ public class ValueInstantiationTests //module.newValueFromSerializedState(); try { - module.newValueFromSerializedState( null, "abc:123" ); - ValueBuilder<My> builder = module.newValueBuilder( null ); + valueBuilderFactory.newValueFromSerializedState( null, "abc:123" ); + ValueBuilder<My> builder = valueBuilderFactory.newValueBuilder( null ); fail( "NullArgumentException was expected." ); } catch( NullArgumentException e ) @@ -82,7 +82,7 @@ public class ValueInstantiationTests public void whenCreatingServiceCompositeGivenAServiceCompositeThenSucceed() throws Exception { - ValueBuilder<My> builder = module.newValueBuilder( My.class ); + ValueBuilder<My> builder = valueBuilderFactory.newValueBuilder( My.class ); My my = builder.newInstance(); Assert.assertEquals( "Niclas", my.doSomething() ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyMixinTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyMixinTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyMixinTest.java index d3ec351..f63d0b8 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyMixinTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyMixinTest.java @@ -46,7 +46,7 @@ public class AssemblyMixinTest @Test public void testAssemblyMixins() { - assertThat( "Custom mixin has executed", module.newTransient( Foo.class ) + assertThat( "Custom mixin has executed", transientBuilderFactory.newTransient( Foo.class ) .test( "Foo", 42 ), equalTo( "Foo/42" ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyRoleTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyRoleTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyRoleTest.java index 80efede..1d3e2bb 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyRoleTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/AssemblyRoleTest.java @@ -48,14 +48,14 @@ public class AssemblyRoleTest @Test public void testAssemblyTypesCustomMixin() { - FooComposite2 composite2 = module.newTransient( FooComposite2.class ); + FooComposite2 composite2 = transientBuilderFactory.newTransient( FooComposite2.class ); assertThat( "Custom mixin has executed", ( (Foo) composite2 ).test( "Foo", 42 ), equalTo( "Foo/42" ) ); } @Test public void testAssemblyTypesDefaultMixin() { - FooComposite composite = module.newTransient( FooComposite.class ); + FooComposite composite = transientBuilderFactory.newTransient( FooComposite.class ); assertThat( "Default mixin has executed", ( (Foo) composite ).test( "Foo", 42 ), equalTo( "Foo 42" ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java index df58cfe..36ed443 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/InitializableTest.java @@ -43,14 +43,14 @@ public class InitializableTest @Test public void givenCompositeWithInitializableMixinWhenInstantiatedThenInvokeInitialize() { - TestComposite instance = module.newTransient( TestComposite.class ); + TestComposite instance = transientBuilderFactory.newTransient( TestComposite.class ); assertThat( "mixin has been initialized", instance.ok(), equalTo( true ) ); } @Test public void givenObjectImplementingInitializableWhenInstantiatedThenInvokeInitialize() { - TestObject instance = module.newObject( TestObject.class ); + TestObject instance = objectFactory.newObject( TestObject.class ); assertThat( "object has been initialized", instance.ok(), equalTo( true ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/JDKMixinTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/JDKMixinTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/JDKMixinTest.java index 66888eb..4808f8a 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/JDKMixinTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/JDKMixinTest.java @@ -134,7 +134,7 @@ public class JDKMixinTest { List<ServiceReference<JSONSerializableMap>> services = toList( filter( EXTENDS_IDENTITY_SPEC, - module.findServices( JSONSerializableMap.class ) ) ); + serviceFinder.findServices( JSONSerializableMap.class ) ) ); assertThat( services.size(), equalTo( 1 ) ); assertThat( services.get( 0 ).identity(), equalTo( EXTENDS_IDENTITY ) ); @@ -154,7 +154,7 @@ public class JDKMixinTest { List<ServiceReference<JSONSerializableMap>> services = toList( filter( COMPOSE_IDENTITY_SPEC, - module.findServices( JSONSerializableMap.class ) ) ); + serviceFinder.findServices( JSONSerializableMap.class ) ) ); assertThat( services.size(), equalTo( 1 ) ); assertThat( services.get( 0 ).identity(), equalTo( COMPOSE_IDENTITY ) ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MethodInterceptionMixinTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MethodInterceptionMixinTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MethodInterceptionMixinTest.java index 63aad6e..86f50f9 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MethodInterceptionMixinTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MethodInterceptionMixinTest.java @@ -46,7 +46,7 @@ public class MethodInterceptionMixinTest @Test public void whenMixinCallsPublicMethodExpectInvocationStackToBeCalled() { - ServiceReference<SomeService> service = module.findService( SomeService.class ); + ServiceReference<SomeService> service = serviceFinder.findService( SomeService.class ); Collection<String> result1 = service.get().result(); assertEquals( "Concern should have been called.", 1, result1.size() ); assertEquals( "Concern should have been called.", "Concern1", result1.iterator().next() ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinPrecedenceTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinPrecedenceTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinPrecedenceTest.java index 609e14a..ef8157b 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinPrecedenceTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinPrecedenceTest.java @@ -45,21 +45,21 @@ public class MixinPrecedenceTest @Test public void whenMultipleTypedMixinsPrecedence() { - TestComposite1 instance = module.newTransient( TestComposite1.class ); + TestComposite1 instance = transientBuilderFactory.newTransient( TestComposite1.class ); assertThat( "Mixin precedence", instance.AMethod(), equalTo( "A1" ) ); } @Test public void whenGenericAndTypedMixinPrecedence() { - TestComposite2 instance = module.newTransient( TestComposite2.class ); + TestComposite2 instance = transientBuilderFactory.newTransient( TestComposite2.class ); assertThat( "Typed mixin is chosen over generic mixin", instance.AMethod(), equalTo( "A1" ) ); } @Test public void whenMultipleGenericMixinsPrecedence() { - TestComposite3 instance = module.newTransient( TestComposite3.class ); + TestComposite3 instance = transientBuilderFactory.newTransient( TestComposite3.class ); assertEquals( "GM1", instance.AMethod() ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinsOnThisInjectionTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinsOnThisInjectionTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinsOnThisInjectionTest.java index 8a77bca..5070f47 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinsOnThisInjectionTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/MixinsOnThisInjectionTest.java @@ -39,7 +39,7 @@ public class MixinsOnThisInjectionTest @Test public void givenCompositeWithThisInjectionAndNoMixinDeclarationWhenBindingCompositeThenUseInterfaceDeclaredMixin() { - TestCase TestCase = module.newTransient( TestCase.class ); + TestCase TestCase = transientBuilderFactory.newTransient( TestCase.class ); assertThat( "Composite can be instantiated", TestCase.sayHello(), equalTo( "Hello" ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/PrivateMixinTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/PrivateMixinTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/PrivateMixinTest.java index 98a24d5..b1b25a4 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/PrivateMixinTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/PrivateMixinTest.java @@ -45,7 +45,7 @@ public class PrivateMixinTest @Test public void privateMixinFieldAndConstructorInjection() { - SpeakComposite test = module.newTransient( SpeakComposite.class ); + SpeakComposite test = transientBuilderFactory.newTransient( SpeakComposite.class ); assertThat( "Speak", test.speak(), is( equalTo( "I say it works!" ) ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/mixin/Qi228Test.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/Qi228Test.java b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/Qi228Test.java index 00fd3fc..7493f1a 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/mixin/Qi228Test.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/mixin/Qi228Test.java @@ -41,7 +41,7 @@ public class Qi228Test public void test1() throws Exception { - SomeLogic service = module.findService( SomeLogic.class ).get(); + SomeLogic service = serviceFinder.findService( SomeLogic.class ).get(); try { service.getNumbers(); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/property/ImmutablePropertyTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/property/ImmutablePropertyTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/property/ImmutablePropertyTest.java index 1ec9207..bc88bd1 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/property/ImmutablePropertyTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/property/ImmutablePropertyTest.java @@ -47,7 +47,7 @@ public final class ImmutablePropertyTest private Location createLocation( String locationName ) { - TransientBuilder<Location> locationBuilder = module.newTransientBuilder( Location.class ); + TransientBuilder<Location> locationBuilder = transientBuilderFactory.newTransientBuilder( Location.class ); Location locState = locationBuilder.prototypeFor( Location.class ); locState.name().set( locationName ); return locationBuilder.newInstance(); @@ -62,7 +62,7 @@ public final class ImmutablePropertyTest @Test public final void testCreationWithStateOfComposite() { - TransientBuilder<Location> locationBuilder = module.newTransientBuilder( Location.class ); + TransientBuilder<Location> locationBuilder = transientBuilderFactory.newTransientBuilder( Location.class ); Location locState = locationBuilder.prototype(); locState.name().set( KUALA_LUMPUR ); Location location = locationBuilder.newInstance(); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyEqualityTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyEqualityTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyEqualityTest.java index 0daf7b8..6910ce1 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyEqualityTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyEqualityTest.java @@ -19,6 +19,7 @@ package org.apache.zest.runtime.property; import java.math.BigDecimal; import java.math.BigInteger; import java.util.Date; +import org.apache.zest.api.value.ValueBuilderFactory; import org.joda.time.DateTime; import org.joda.time.LocalDate; import org.joda.time.LocalDateTime; @@ -123,11 +124,11 @@ public class PropertyEqualityTest @Test public void givenValuesOfTheSameTypeWhenTestingPropertyDescriptorEqualityExpectEquals() { - Some some = buildSomeValue( module ); + Some some = buildSomeValue(valueBuilderFactory); ValueDescriptor someDescriptor = zest.api().valueDescriptorFor( some ); PropertyDescriptor someCharPropDesc = someDescriptor.state().findPropertyModelByName( "characterProperty" ); - Some other = buildSomeValue( module ); + Some other = buildSomeValue( valueBuilderFactory ); ValueDescriptor otherDescriptor = zest.api().valueDescriptorFor( other ); PropertyDescriptor otherCharPropDesc = otherDescriptor.state().findPropertyModelByName( "characterProperty" ); @@ -142,11 +143,11 @@ public class PropertyEqualityTest @Test public void givenValuesOfCommonTypesWhenTestingPropertyDescriptorEqualityExpectEquals() { - Some some = buildSomeValue( module ); + Some some = buildSomeValue( valueBuilderFactory ); ValueDescriptor someDescriptor = zest.api().valueDescriptorFor( some ); PropertyDescriptor someCharPropDesc = someDescriptor.state().findPropertyModelByName( "characterProperty" ); - PrimitivesValue primitive = buildPrimitivesValue( module ); + PrimitivesValue primitive = buildPrimitivesValue( valueBuilderFactory ); ValueDescriptor primitiveDescriptor = zest.api().valueDescriptorFor( primitive ); PropertyDescriptor primitiveCharPropDesc = primitiveDescriptor.state().findPropertyModelByName( "characterProperty" ); @@ -161,11 +162,11 @@ public class PropertyEqualityTest @Test public void givenValuesOfDifferentTypesWhenTestingPropertyDescriptorEqualityExpectNotEquals() { - Some some = buildSomeValue( module ); + Some some = buildSomeValue( valueBuilderFactory ); ValueDescriptor someDescriptor = zest.api().valueDescriptorFor( some ); PropertyDescriptor someCharPropDesc = someDescriptor.state().findPropertyModelByName( "characterProperty" ); - Other other = buildOtherValue( module ); + Other other = buildOtherValue( valueBuilderFactory ); ValueDescriptor otherDescriptor = zest.api().valueDescriptorFor( other ); PropertyDescriptor otherCharPropDesc = otherDescriptor.state().findPropertyModelByName( "characterProperty" ); @@ -183,10 +184,10 @@ public class PropertyEqualityTest @Test public void givenValuesOfDifferentTypesAndSameStateWhenTestingPropertyStateEqualityExpectEquals() { - PrimitivesValue primitives = buildPrimitivesValue( module ); - Some some = buildSomeValue( module ); - Some some2 = buildSomeValue( module ); - Other other = buildOtherValue( module ); + PrimitivesValue primitives = buildPrimitivesValue( valueBuilderFactory ); + Some some = buildSomeValue( valueBuilderFactory ); + Some some2 = buildSomeValue( valueBuilderFactory ); + Other other = buildOtherValue( valueBuilderFactory ); assertThat( "Property state equal", 'q', allOf( equalTo( primitives.characterProperty().get() ), @@ -207,8 +208,8 @@ public class PropertyEqualityTest @Test public void givenValuesOfTheSameTypeAndSameStateWhenTestingPropertyEqualityExpectEquals() { - Some some = buildSomeValue( module ); - Some some2 = buildSomeValue( module ); + Some some = buildSomeValue( valueBuilderFactory ); + Some some2 = buildSomeValue( valueBuilderFactory ); assertThat( "Property equals", some.characterProperty(), equalTo( some2.characterProperty() ) ); @@ -220,8 +221,8 @@ public class PropertyEqualityTest @Test public void givenValuesOfTheSameTypeWithDifferentStateWhenTestingPropertyEqualityExpectNotEquals() { - Some some = buildSomeValue( module ); - Some some2 = buildSomeValueWithDifferentState( module ); + Some some = buildSomeValue( valueBuilderFactory ); + Some some2 = buildSomeValueWithDifferentState( valueBuilderFactory ); assertThat( "Property not equals", some.characterProperty(), not( equalTo( some2.characterProperty() ) ) ); @@ -233,8 +234,8 @@ public class PropertyEqualityTest @Test public void givenValuesOfCommonTypesAndSameStateWhenTestingPropertyEqualityExpectEquals() { - Some some = buildSomeValue( module ); - PrimitivesValue primitive = buildPrimitivesValue( module ); + Some some = buildSomeValue( valueBuilderFactory ); + PrimitivesValue primitive = buildPrimitivesValue( valueBuilderFactory ); assertThat( "Property equal", some.characterProperty(), equalTo( primitive.characterProperty() ) ); @@ -243,8 +244,8 @@ public class PropertyEqualityTest @Test public void givenValuesOfCommonTypesWithDifferentStateWhenTestingPropertyEqualityExpectNotEquals() { - Some some = buildSomeValue( module ); - PrimitivesValue primitive = buildPrimitivesValueWithDifferentState( module ); + Some some = buildSomeValue( valueBuilderFactory ); + PrimitivesValue primitive = buildPrimitivesValueWithDifferentState( valueBuilderFactory ); assertThat( "Property not equal", some.characterProperty(), not( equalTo( primitive.characterProperty() ) ) ); @@ -253,8 +254,8 @@ public class PropertyEqualityTest @Test public void givenValuesOfDifferentTypesAndSameStateWhenTestingPropertyEqualityExpectNotEquals() { - Some some = buildSomeValue( module ); - Other other = buildOtherValue( module ); + Some some = buildSomeValue( valueBuilderFactory ); + Other other = buildOtherValue( valueBuilderFactory ); assertThat( "Property not equal", some.characterProperty(), not( equalTo( other.characterProperty() ) ) ); @@ -263,8 +264,8 @@ public class PropertyEqualityTest @Test public void givenValuesOfDifferentTypesWithDifferentStateWhenTestingPropertyEqualityExpectNotEquals() { - Some some = buildSomeValue( module ); - Other other = buildOtherValue( module ); + Some some = buildSomeValue( valueBuilderFactory ); + Other other = buildOtherValue( valueBuilderFactory ); assertThat( "Property not equal", some.characterProperty(), not( equalTo( other.characterProperty() ) ) ); @@ -273,11 +274,11 @@ public class PropertyEqualityTest // // -----------------------------------:: Values factory methods ::-------------------------------------------------- // - public static PrimitivesValue buildPrimitivesValue( Module module ) + public static PrimitivesValue buildPrimitivesValue( ValueBuilderFactory vbf ) { PrimitivesValue primitive; { - ValueBuilder<PrimitivesValue> builder = module.newValueBuilder( PrimitivesValue.class ); + ValueBuilder<PrimitivesValue> builder = vbf.newValueBuilder( PrimitivesValue.class ); builder.prototype().characterProperty().set( 'q' ); builder.prototype().stringProperty().set( "foo" ); builder.prototype().booleanProperty().set( true ); @@ -293,11 +294,11 @@ public class PropertyEqualityTest return primitive; } - public static PrimitivesValue buildPrimitivesValueWithDifferentState( Module module ) + public static PrimitivesValue buildPrimitivesValueWithDifferentState( ValueBuilderFactory vbf ) { PrimitivesValue primitive; { - ValueBuilder<PrimitivesValue> builder = module.newValueBuilder( PrimitivesValue.class ); + ValueBuilder<PrimitivesValue> builder = vbf.newValueBuilder( PrimitivesValue.class ); builder.prototype().characterProperty().set( 'i' ); builder.prototype().stringProperty().set( "bar" ); builder.prototype().booleanProperty().set( false ); @@ -313,11 +314,11 @@ public class PropertyEqualityTest return primitive; } - public static Some buildSomeValue( Module module ) + public static Some buildSomeValue(ValueBuilderFactory vbf) { Some some; { - ValueBuilder<Some> builder = module.newValueBuilder( Some.class ); + ValueBuilder<Some> builder = vbf.newValueBuilder( Some.class ); builder.prototype().characterProperty().set( 'q' ); builder.prototype().stringProperty().set( "foo" ); builder.prototype().booleanProperty().set( true ); @@ -339,11 +340,11 @@ public class PropertyEqualityTest return some; } - public static Some buildSomeValueWithDifferentState( Module module ) + public static Some buildSomeValueWithDifferentState( ValueBuilderFactory vbf ) { Some some; { - ValueBuilder<Some> builder = module.newValueBuilder( Some.class ); + ValueBuilder<Some> builder = vbf.newValueBuilder( Some.class ); builder.prototype().characterProperty().set( 'i' ); builder.prototype().stringProperty().set( "bar" ); builder.prototype().booleanProperty().set( false ); @@ -365,11 +366,11 @@ public class PropertyEqualityTest return some; } - public static AnotherSome buildAnotherSomeValue( Module module ) + public static AnotherSome buildAnotherSomeValue( ValueBuilderFactory vbf ) { AnotherSome anotherSome; { - ValueBuilder<AnotherSome> builder = module.newValueBuilder( AnotherSome.class ); + ValueBuilder<AnotherSome> builder = vbf.newValueBuilder( AnotherSome.class ); builder.prototype().characterProperty().set( 'q' ); builder.prototype().stringProperty().set( "foo" ); builder.prototype().booleanProperty().set( true ); @@ -391,11 +392,11 @@ public class PropertyEqualityTest return anotherSome; } - public static AnotherSome buildAnotherSomeValueWithDifferentState( Module module ) + public static AnotherSome buildAnotherSomeValueWithDifferentState( ValueBuilderFactory vbf ) { AnotherSome anotherSome; { - ValueBuilder<AnotherSome> builder = module.newValueBuilder( AnotherSome.class ); + ValueBuilder<AnotherSome> builder = vbf.newValueBuilder( AnotherSome.class ); builder.prototype().characterProperty().set( 'i' ); builder.prototype().stringProperty().set( "bar" ); builder.prototype().booleanProperty().set( false ); @@ -417,11 +418,11 @@ public class PropertyEqualityTest return anotherSome; } - public static Other buildOtherValue( Module module ) + public static Other buildOtherValue( ValueBuilderFactory vbf ) { Other other; { - ValueBuilder<Other> builder = module.newValueBuilder( Other.class ); + ValueBuilder<Other> builder = vbf.newValueBuilder( Other.class ); builder.prototype().characterProperty().set( 'q' ); other = builder.newInstance(); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyStringArrayTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyStringArrayTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyStringArrayTest.java index a2c65d0..6410311 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyStringArrayTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyStringArrayTest.java @@ -43,7 +43,7 @@ public class PropertyStringArrayTest { TestComposite instance; { - TransientBuilder<TestComposite> builder = module.newTransientBuilder( TestComposite.class ); + TransientBuilder<TestComposite> builder = transientBuilderFactory.newTransientBuilder( TestComposite.class ); builder.prototype().array().set( new String[]{ "Foo", "Bar" } ); instance = builder.newInstance(); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyTest.java index 13ac188..be80bf4 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/property/PropertyTest.java @@ -59,7 +59,7 @@ public class PropertyTest { Company company; { - TransientBuilder<Company> builder = module.newTransientBuilder( Company.class ); + TransientBuilder<Company> builder = transientBuilderFactory.newTransientBuilder( Company.class ); builder.prototype().name().set( "JayWay" ); company = builder.newInstance(); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/property/ValueNestedBuilderTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/property/ValueNestedBuilderTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/property/ValueNestedBuilderTest.java index 1f51610..e23af89 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/property/ValueNestedBuilderTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/property/ValueNestedBuilderTest.java @@ -79,7 +79,7 @@ public class ValueNestedBuilderTest @Test public void testInner() { - ValueBuilder<InnerValue> innerBuilder = module.newValueBuilder( InnerValue.class ); + ValueBuilder<InnerValue> innerBuilder = valueBuilderFactory.newValueBuilder( InnerValue.class ); InnerValue inner = innerBuilder.prototype(); inner.listProp().set( new ArrayList<String>() ); inner.mapProp().set( new HashMap<String, String>() ); @@ -90,12 +90,12 @@ public class ValueNestedBuilderTest @Test public void testOuter() { - ValueBuilder<InnerValue> innerBuilder = module.newValueBuilder( InnerValue.class ); + ValueBuilder<InnerValue> innerBuilder = valueBuilderFactory.newValueBuilder( InnerValue.class ); InnerValue inner = innerBuilder.prototype(); inner.listProp().set( new ArrayList<String>() ); inner.mapProp().set( new HashMap<String, String>() ); inner = innerBuilder.newInstance(); - ValueBuilder<OuterValue> outerBuilder = module.newValueBuilder( OuterValue.class ); + ValueBuilder<OuterValue> outerBuilder = valueBuilderFactory.newValueBuilder( OuterValue.class ); OuterValue outer = outerBuilder.prototype(); List<InnerValue> inners = new ArrayList<InnerValue>(); inners.add( inner ); @@ -108,7 +108,7 @@ public class ValueNestedBuilderTest @Test public void testDefaultedInner() { - ValueBuilder<InnerDefaultedValue> innerBuilder = module.newValueBuilder( InnerDefaultedValue.class ); + ValueBuilder<InnerDefaultedValue> innerBuilder = valueBuilderFactory.newValueBuilder( InnerDefaultedValue.class ); InnerDefaultedValue inner = innerBuilder.newInstance(); // If we reach this point, value creation went well } @@ -116,9 +116,9 @@ public class ValueNestedBuilderTest @Test public void testDefaultedOuter() { - ValueBuilder<InnerDefaultedValue> innerBuilder = module.newValueBuilder( InnerDefaultedValue.class ); + ValueBuilder<InnerDefaultedValue> innerBuilder = valueBuilderFactory.newValueBuilder( InnerDefaultedValue.class ); InnerDefaultedValue inner = innerBuilder.newInstance(); - ValueBuilder<OuterDefaultedValue> outerBuilder = module.newValueBuilder( OuterDefaultedValue.class ); + ValueBuilder<OuterDefaultedValue> outerBuilder = valueBuilderFactory.newValueBuilder( OuterDefaultedValue.class ); OuterDefaultedValue outer = outerBuilder.prototype(); List<InnerDefaultedValue> inners = new ArrayList<InnerDefaultedValue>(); inners.add( inner ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/query/NonQueryableTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/query/NonQueryableTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/query/NonQueryableTest.java index 2e3b67b..e8fc34b 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/query/NonQueryableTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/query/NonQueryableTest.java @@ -45,7 +45,7 @@ public class NonQueryableTest UnitOfWork unitOfWork = uowf.newUnitOfWork(); try { - QueryBuilder<Abc> builder = module.newQueryBuilder( Abc.class ); + QueryBuilder<Abc> builder = queryBuilderFactory.newQueryBuilder( Abc.class ); Abc proto = templateFor( Abc.class ); builder.where( eq( proto.isValid(), Boolean.TRUE ) ); Assert.fail( "Exception was expected." ); @@ -66,7 +66,7 @@ public class NonQueryableTest UnitOfWork unitOfWork = uowf.newUnitOfWork(); try { - module.newQueryBuilder( Abc2.class ); + queryBuilderFactory.newQueryBuilder( Abc2.class ); Assert.fail( "Exception was expected." ); } catch( QueryException e ) http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/query/QueryBuilderFactoryImplTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/query/QueryBuilderFactoryImplTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/query/QueryBuilderFactoryImplTest.java index f91b424..0a46ae9 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/query/QueryBuilderFactoryImplTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/query/QueryBuilderFactoryImplTest.java @@ -56,7 +56,7 @@ public class QueryBuilderFactoryImplTest throws Exception { super.setUp(); - composites = new ArrayList<TestComposite>(); + composites = new ArrayList<>(); composites.add( newInstance( "A", 6 ) ); composites.add( newInstance( "B", 2 ) ); composites.add( newInstance( "C", 3 ) ); @@ -68,7 +68,7 @@ public class QueryBuilderFactoryImplTest @Test public void givenPlainQueryWhenFindEntityExpectFirstEntityReturned() { - Query<TestComposite> query = module.newQueryBuilder( TestComposite.class ).newQuery( composites ); + Query<TestComposite> query = queryBuilderFactory.newQueryBuilder( TestComposite.class ).newQuery( composites ); assertEquals( "A", query.find().a().get() ); assertEquals( 6, query.count() ); } @@ -76,7 +76,7 @@ public class QueryBuilderFactoryImplTest @Test public void givenPlainQueryWhenOrderByFirstPropertyExpectOrderedResult() { - Query<TestComposite> query = module.newQueryBuilder( TestComposite.class ).newQuery( composites ); + Query<TestComposite> query = queryBuilderFactory.newQueryBuilder( TestComposite.class ).newQuery( composites ); TestComposite template = templateFor( TestComposite.class ); query.orderBy( orderBy( template.a() ) ); verifyOrder( query, "612345" ); @@ -85,7 +85,7 @@ public class QueryBuilderFactoryImplTest @Test public void givenPlainQueryWhenOrderBySecondPropertyExpectOrderedResult() { - Query<TestComposite> query = module.newQueryBuilder( TestComposite.class ).newQuery( composites ); + Query<TestComposite> query = queryBuilderFactory.newQueryBuilder( TestComposite.class ).newQuery( composites ); TestComposite template = templateFor( TestComposite.class ); query.orderBy( orderBy( template.b() ) ); verifyOrder( query, "123456" ); @@ -94,7 +94,7 @@ public class QueryBuilderFactoryImplTest @Test public void givenPlainQueryWhenOrderByTwoPropertiesExpectOrderedResult() { - Query<TestComposite> query = module.newQueryBuilder( TestComposite.class ).newQuery( composites ); + Query<TestComposite> query = queryBuilderFactory.newQueryBuilder( TestComposite.class ).newQuery( composites ); TestComposite template = templateFor( TestComposite.class ); query.orderBy( orderBy( template.a() ), orderBy( template.b() ) ); verifyOrder( query, "162345" ); @@ -103,7 +103,7 @@ public class QueryBuilderFactoryImplTest @Test public void givenPlainQueryWhenMaxedResultExpectLimitedResult() { - Query<TestComposite> query = module.newQueryBuilder( TestComposite.class ).newQuery( composites ); + Query<TestComposite> query = queryBuilderFactory.newQueryBuilder( TestComposite.class ).newQuery( composites ); query.maxResults( 5 ); verifyOrder( query, "62345" ); } @@ -111,7 +111,7 @@ public class QueryBuilderFactoryImplTest @Test public void givenPlainQueryWhenFirstResultIsBeyondFirstElementExpectLimitedResult() { - Query<TestComposite> query = module.newQueryBuilder( TestComposite.class ).newQuery( composites ); + Query<TestComposite> query = queryBuilderFactory.newQueryBuilder( TestComposite.class ).newQuery( composites ); query.firstResult( 2 ); verifyOrder( query, "3451" ); } @@ -119,7 +119,7 @@ public class QueryBuilderFactoryImplTest @Test public void givenWhereQueryWhenWhereClauseLimitsToRangeExpectLimitedResult() { - final QueryBuilder<TestComposite> qb = module.newQueryBuilder( TestComposite.class ); + final QueryBuilder<TestComposite> qb = queryBuilderFactory.newQueryBuilder( TestComposite.class ); TestComposite template = templateFor( TestComposite.class ); Query<TestComposite> query = qb.where( and( @@ -145,7 +145,7 @@ public class QueryBuilderFactoryImplTest private TestComposite newInstance( String a, int b ) { TransientBuilder<TestComposite> builder = - module.newTransientBuilder( TestComposite.class ); + transientBuilderFactory.newTransientBuilder( TestComposite.class ); TestComposite instance = builder.prototype(); instance.a().set( a ); instance.b().set( b ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java index 3e9eb97..1ff3ee8 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/service/ComplexActivatableTest.java @@ -43,7 +43,7 @@ public class ComplexActivatableTest @Test public void validateThatApplicationGotAssembled() { - ServiceReference<SuperType> reference = module.findService( SuperType.class ); + ServiceReference<SuperType> reference = serviceFinder.findService( SuperType.class ); assertEquals( "Hello, World", reference.get().sayHello() ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/service/ConfigurationTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/service/ConfigurationTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/service/ConfigurationTest.java index 577dc80..97780f6 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/service/ConfigurationTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/service/ConfigurationTest.java @@ -56,8 +56,6 @@ public class ConfigurationTest public void whenConfiguredThenSayHelloWorks() throws Exception { - module.injectTo( this ); - UnitOfWork unit = uowf.newUnitOfWork(); EntityBuilder<HelloWorldConfiguration> entityBuilder = unit.newEntityBuilder( HelloWorldConfiguration.class, service .identity() ); @@ -74,8 +72,6 @@ public class ConfigurationTest public void whenUnconfiguredThenSayHelloGivesDefaults() throws Exception { - module.injectTo( this ); - assertThat( "result is correct", service.get().sayHello(), equalTo( "Hello World" ) ); } @@ -83,8 +79,6 @@ public class ConfigurationTest public void givenConfiguredServiceWhenReconfiguredAndRefreshedThenNewConfigurationIsUsed() throws Exception { - module.injectTo( this ); - HelloWorldConfiguration config; { http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/service/ServiceFinderTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/service/ServiceFinderTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/service/ServiceFinderTest.java index 55998b0..4f56ae4 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/service/ServiceFinderTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/service/ServiceFinderTest.java @@ -43,7 +43,7 @@ public class ServiceFinderTest extends AbstractZestTest @Test public void givenServiceCompileTimeWeavingWhenFindingServiceBySuperTypeExceptServiceToBeFound() { - ServiceReference<MyCompileTimeService> service = module.findService( MyCompileTimeService.class ); + ServiceReference<MyCompileTimeService> service = serviceFinder.findService( MyCompileTimeService.class ); assertThat( service, notNullValue() ); assertThat( service.get(), notNullValue() ); assertThat( service.get().doSomething(), equalTo( "Niclas" ) ); @@ -52,7 +52,7 @@ public class ServiceFinderTest extends AbstractZestTest @Test public void givenServiceRuntimeWeavingWhenFindingServiceBySuperTypeExceptServiceToBeFound() { - ServiceReference<MyRuntimeService> service = module.findService( MyRuntimeService.class ); + ServiceReference<MyRuntimeService> service = serviceFinder.findService( MyRuntimeService.class ); assertThat( service, notNullValue() ); assertThat( service.get(), notNullValue() ); assertThat( service.get().doSomething(), equalTo( "Niclas" ) ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/GenericSideEffectTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/GenericSideEffectTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/GenericSideEffectTest.java index 2a8e97a..87d7c69 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/GenericSideEffectTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/GenericSideEffectTest.java @@ -49,7 +49,7 @@ public class GenericSideEffectTest @Test public void testGenericSideEffect() { - SomeComposite some = module.newTransient( SomeComposite.class ); + SomeComposite some = transientBuilderFactory.newTransient( SomeComposite.class ); Property<Integer> count = some.count(); assertThat( "count is zero", count.get(), equalTo( 0 ) ); some.doStuff(); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/ModuleSideEffectTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/ModuleSideEffectTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/ModuleSideEffectTest.java index e2246db..b97fd30 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/ModuleSideEffectTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/ModuleSideEffectTest.java @@ -43,7 +43,7 @@ public class ModuleSideEffectTest @Test public void testModuleSideEffect() { - module.newTransient( Foo.class ).test( "Foo", 42 ); + transientBuilderFactory.newTransient( Foo.class ).test( "Foo", 42 ); Assert.assertThat( "SideEffect has been called", ok, CoreMatchers.equalTo( true ) ); } http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/SpecificSideEffectTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/SpecificSideEffectTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/SpecificSideEffectTest.java index 6c909f3..7b021be 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/SpecificSideEffectTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/sideeffects/SpecificSideEffectTest.java @@ -46,7 +46,7 @@ public class SpecificSideEffectTest @Test public void specificSideEffect() { - SomeComposite some = module.newTransient( SomeComposite.class ); + SomeComposite some = transientBuilderFactory.newTransient( SomeComposite.class ); Property<Integer> count = some.count(); assertThat( "count is zero", count.get(), equalTo( 0 ) ); some.doStuff(); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java index 4cc78cc..5e6e528 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/structure/CompositeDescriptorTest.java @@ -36,7 +36,7 @@ public class CompositeDescriptorTest throws Throwable { // Test with Standard composite - AddressComposite address = module.newTransient( AddressComposite.class ); + AddressComposite address = transientBuilderFactory.newTransient( AddressComposite.class ); TransientDescriptor addressDescriptor = spi.transientDescriptorFor( address ); assertNotNull( addressDescriptor ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/structure/ModuleTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/structure/ModuleTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/structure/ModuleTest.java index 353f9b9..0a78e0f 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/structure/ModuleTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/structure/ModuleTest.java @@ -104,7 +104,7 @@ public class ModuleTest Application app = givenFixture1(); Module module = app.findModule( "Layer 1", "Module 1" ).newTransient( TestComposite1.class ).getModule(); - module.classLoader().loadClass( TestComposite2.class.getName() ); + module.descriptor().classLoader().loadClass( TestComposite2.class.getName() ); } @Mixins( TestMixin1.class ) http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/threaded/ContextCompositeTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/threaded/ContextCompositeTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/threaded/ContextCompositeTest.java index 2869f45..fd2fed8 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/threaded/ContextCompositeTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/threaded/ContextCompositeTest.java @@ -39,9 +39,9 @@ public class ContextCompositeTest { for( int i = 0; i < 5; i++ ) { - TransientBuilder<MyCompositeContext> builder = module.newTransientBuilder( MyCompositeContext.class ); + TransientBuilder<MyCompositeContext> builder = transientBuilderFactory.newTransientBuilder( MyCompositeContext.class ); builder.prototypeFor( MyData.class ).data().set( 0 ); - MyCompositeContext context = new CompositeContext<MyCompositeContext>( module, MyCompositeContext.class ).proxy(); + MyCompositeContext context = new CompositeContext<>( module, MyCompositeContext.class ).proxy(); Worker w1; Worker w2; http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/value/NestedValueBuilderTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/value/NestedValueBuilderTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/value/NestedValueBuilderTest.java index dfcab7c..a0c2715 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/value/NestedValueBuilderTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/value/NestedValueBuilderTest.java @@ -77,7 +77,7 @@ public class NestedValueBuilderTest @Test public void testInner() { - ValueBuilder<InnerValue> innerBuilder = module.newValueBuilder( InnerValue.class ); + ValueBuilder<InnerValue> innerBuilder = valueBuilderFactory.newValueBuilder( InnerValue.class ); InnerValue inner = innerBuilder.prototype(); inner.listProp().set( new ArrayList<String>() ); inner.mapProp().set( new HashMap<String, String>() ); @@ -106,12 +106,12 @@ public class NestedValueBuilderTest @Test public void testOuter() { - ValueBuilder<InnerValue> innerBuilder = module.newValueBuilder( InnerValue.class ); + ValueBuilder<InnerValue> innerBuilder = valueBuilderFactory.newValueBuilder( InnerValue.class ); InnerValue innerPrototype = innerBuilder.prototype(); innerPrototype.listProp().set( new ArrayList<String>() ); innerPrototype.mapProp().set( new HashMap<String, String>() ); InnerValue innerInstance = innerBuilder.newInstance(); - ValueBuilder<OuterValue> outerBuilder = module.newValueBuilder( OuterValue.class ); + ValueBuilder<OuterValue> outerBuilder = valueBuilderFactory.newValueBuilder( OuterValue.class ); OuterValue outerPrototype = outerBuilder.prototype(); List<InnerValue> inners = new ArrayList<InnerValue>(); inners.add( innerInstance ); @@ -133,7 +133,7 @@ public class NestedValueBuilderTest @Test public void testDefaultedInner() { - ValueBuilder<InnerDefaultedValue> innerBuilder = module.newValueBuilder( InnerDefaultedValue.class ); + ValueBuilder<InnerDefaultedValue> innerBuilder = valueBuilderFactory.newValueBuilder( InnerDefaultedValue.class ); InnerDefaultedValue inner = innerBuilder.newInstance(); // If we reach this point, value creation went well try @@ -159,9 +159,9 @@ public class NestedValueBuilderTest @Test public void testDefaultedOuter() { - ValueBuilder<InnerDefaultedValue> innerBuilder = module.newValueBuilder( InnerDefaultedValue.class ); + ValueBuilder<InnerDefaultedValue> innerBuilder = valueBuilderFactory.newValueBuilder( InnerDefaultedValue.class ); InnerDefaultedValue innerInstance = innerBuilder.newInstance(); - ValueBuilder<OuterDefaultedValue> outerBuilder = module.newValueBuilder( OuterDefaultedValue.class ); + ValueBuilder<OuterDefaultedValue> outerBuilder = valueBuilderFactory.newValueBuilder( OuterDefaultedValue.class ); OuterDefaultedValue outerPrototype = outerBuilder.prototype(); List<InnerDefaultedValue> inners = new ArrayList<InnerDefaultedValue>(); inners.add( innerInstance ); http://git-wip-us.apache.org/repos/asf/zest-java/blob/dedb068e/core/runtime/src/test/java/org/apache/zest/runtime/value/ValueCompositeBasicsTest.java ---------------------------------------------------------------------- diff --git a/core/runtime/src/test/java/org/apache/zest/runtime/value/ValueCompositeBasicsTest.java b/core/runtime/src/test/java/org/apache/zest/runtime/value/ValueCompositeBasicsTest.java index 97de116..9174699 100644 --- a/core/runtime/src/test/java/org/apache/zest/runtime/value/ValueCompositeBasicsTest.java +++ b/core/runtime/src/test/java/org/apache/zest/runtime/value/ValueCompositeBasicsTest.java @@ -43,7 +43,7 @@ public class ValueCompositeBasicsTest @Test public void testEqualsForValueComposite() { - ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class ); + ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class ); builder.prototypeFor( SomeInternalState.class ).name().set( "Niclas" ); assertEquals("Niclas", builder.prototype().name()); SomeValue value1 = builder.newInstance(); @@ -57,7 +57,7 @@ public class ValueCompositeBasicsTest @Test public void testToStringForValueComposite() { - ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class ); + ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class ); builder.prototypeFor( SomeInternalState.class ).name().set( "Niclas" ); SomeValue underTest = builder.newInstance(); assertEquals( "{\"name\":\"Niclas\"}", underTest.toString() ); @@ -66,7 +66,7 @@ public class ValueCompositeBasicsTest @Test public void testToJSonForValueComposite() { - ValueBuilder<SomeValue> builder = module.newValueBuilder( SomeValue.class ); + ValueBuilder<SomeValue> builder = valueBuilderFactory.newValueBuilder( SomeValue.class ); builder.prototypeFor( SomeInternalState.class ).name().set( "Niclas" ); SomeValue underTest = builder.newInstance(); assertEquals( "{\"name\":\"Niclas\"}", underTest.toString() );
