polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nic...@apache.org
Subject [03/50] polygene-java git commit: Adding a new test suite for persistence, that is somewhat understandable and not totally non-sense. Also, it is a multi-layered application, to ensure that Type Lookups are handled correctly. JDBM was first victim to get
Date Mon, 10 Jul 2017 06:53:05 GMT
http://git-wip-us.apache.org/repos/asf/polygene-java/blob/df5fd8af/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumResource.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumResource.java
b/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumResource.java
index a5c5977..abf7c18 100644
--- a/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumResource.java
+++ b/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumResource.java
@@ -37,7 +37,7 @@ public class ForumResource
     public void resource( String segment )
         throws ResourceException
     {
-        selectFromManyAssociation( ObjectSelection.current().get( Forum.class ).boards(),
StringIdentity.fromString( segment ) );
+        selectFromManyAssociation( ObjectSelection.current().get( Forum.class ).boards(),
StringIdentity.identity( segment ) );
         subResource( BoardResource.class );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/df5fd8af/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumsResource.java
----------------------------------------------------------------------
diff --git a/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumsResource.java
b/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumsResource.java
index 931e5a2..5c14ec2 100644
--- a/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumsResource.java
+++ b/samples/forum/src/main/java/org/apache/polygene/sample/forum/rest/resource/forum/ForumsResource.java
@@ -36,7 +36,7 @@ public class ForumsResource
     public void resource( String segment )
         throws ResourceException
     {
-        select( Forum.class, StringIdentity.fromString( segment ) );
+        select( Forum.class, StringIdentity.identity( segment ) );
         subResource( ForumResource.class );
     }
 }

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/df5fd8af/samples/rental/src/main/java/org/apache/polygene/sample/rental/domain/dev/InitialData.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/apache/polygene/sample/rental/domain/dev/InitialData.java
b/samples/rental/src/main/java/org/apache/polygene/sample/rental/domain/dev/InitialData.java
index 1db4d19..0ac3450 100644
--- a/samples/rental/src/main/java/org/apache/polygene/sample/rental/domain/dev/InitialData.java
+++ b/samples/rental/src/main/java/org/apache/polygene/sample/rental/domain/dev/InitialData.java
@@ -198,7 +198,7 @@ public interface InitialData
         private RentalShop createShop( UnitOfWork uow )
             throws UnitOfWorkCompletionException
         {
-            return uow.newEntity( RentalShop.class, StringIdentity.fromString( "SHOP" ) );
+            return uow.newEntity( RentalShop.class, StringIdentity.identity( "SHOP" ) );
         }
 
         private void createCustomers( RentalShop shop )

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/df5fd8af/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/BookingPage.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/BookingPage.java
b/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/BookingPage.java
index 78815b8..4c39f73 100644
--- a/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/BookingPage.java
+++ b/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/BookingPage.java
@@ -52,7 +52,7 @@ public interface BookingPage
             Element result = dom.createElementNS( Page.XHTML, "div" );
             String bookingId = context.path();
             UnitOfWork uow = uowf.currentUnitOfWork();
-            Booking booking = uow.get( Booking.class, StringIdentity.fromString( bookingId
) );
+            Booking booking = uow.get( Booking.class, StringIdentity.identity( bookingId
) );
             Car car = booking.car().get();
             createChildNode( dom, result, car.model().get() );
             createChildNode( dom, result, car.licensePlate().get() );
@@ -73,7 +73,7 @@ public interface BookingPage
             Element result = dom.createElementNS( Page.XHTML, "div" );
             String bookingId = context.path();
             UnitOfWork uow = uowf.currentUnitOfWork();
-            Booking booking = uow.get( Booking.class, StringIdentity.fromString( bookingId
) );
+            Booking booking = uow.get( Booking.class, StringIdentity.identity( bookingId
) );
             Customer customer = booking.customer().get();
             createChildNode( dom, result, customer.name().get() );
             createChildNode( dom, result, customer.address().get().line1().get() );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/df5fd8af/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/MainPage.java
----------------------------------------------------------------------
diff --git a/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/MainPage.java
b/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/MainPage.java
index ebe24e6..328c41b 100644
--- a/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/MainPage.java
+++ b/samples/rental/src/main/java/org/apache/polygene/sample/rental/web/MainPage.java
@@ -59,7 +59,7 @@ public interface MainPage
             ArrayList<Node> nodes = new ArrayList<Node>();
             Document dom = context.dom();
             UnitOfWork uow = uowf.currentUnitOfWork();
-            RentalShop shop = uow.get( RentalShop.class, StringIdentity.fromString( "SHOP"
) );
+            RentalShop shop = uow.get( RentalShop.class, StringIdentity.identity( "SHOP"
) );
             for( Booking booking : shop.findAllBookings() )
             {
                 String plate = booking.car().get().licensePlate().get();

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/df5fd8af/tests/performance/src/main/java/org/apache/polygene/test/performance/entitystore/AbstractEntityStorePerformanceTest.java
----------------------------------------------------------------------
diff --git a/tests/performance/src/main/java/org/apache/polygene/test/performance/entitystore/AbstractEntityStorePerformanceTest.java
b/tests/performance/src/main/java/org/apache/polygene/test/performance/entitystore/AbstractEntityStorePerformanceTest.java
index fcb9524..61de7ed 100644
--- a/tests/performance/src/main/java/org/apache/polygene/test/performance/entitystore/AbstractEntityStorePerformanceTest.java
+++ b/tests/performance/src/main/java/org/apache/polygene/test/performance/entitystore/AbstractEntityStorePerformanceTest.java
@@ -243,7 +243,7 @@ public abstract class AbstractEntityStorePerformanceTest
                 UnitOfWork uow = uowf.newUnitOfWork( newUsecase( "readEntityWithComplexType
PREPARE " + bulk ) );
                 for( int i = 0; i < ITERATIONS; i++ )
                 {
-                    ComplexProduct product = uow.newEntity( ComplexProduct.class, StringIdentity.fromString(
"product" + i ) );
+                    ComplexProduct product = uow.newEntity( ComplexProduct.class, StringIdentity.identity(
"product" + i ) );
                     product.name().set( "Product " + i );
 
                     if( i % 1000 == 0 )
@@ -265,7 +265,7 @@ public abstract class AbstractEntityStorePerformanceTest
                 String id = rnd.nextInt( ITERATIONS ) + "";
                 for( int i = 0; i < ITERATIONS; i++ )
                 {
-                    ComplexProduct product = uow.get( ComplexProduct.class, StringIdentity.fromString(
"product" + id ) );
+                    ComplexProduct product = uow.get( ComplexProduct.class, StringIdentity.identity(
"product" + id ) );
                     product.name().get();
                     if( i % 100 == 0 )
                     {

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/df5fd8af/tools/envisage/src/test/java/org/apache/polygene/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
----------------------------------------------------------------------
diff --git a/tools/envisage/src/test/java/org/apache/polygene/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
b/tools/envisage/src/test/java/org/apache/polygene/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
index c150d2e..626415e 100644
--- a/tools/envisage/src/test/java/org/apache/polygene/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
+++ b/tools/envisage/src/test/java/org/apache/polygene/envisage/school/domain/person/initialdata/SamplePersonInitialData.java
@@ -94,7 +94,7 @@ public interface SamplePersonInitialData
 
         private void createPerson( UnitOfWork uow, String personId, String firstName, String
lastName )
         {
-            EntityBuilder<Person> person = uow.newEntityBuilder( Person.class, StringIdentity.fromString(
personId ) );
+            EntityBuilder<Person> person = uow.newEntityBuilder( Person.class, StringIdentity.identity(
personId ) );
 
             PersonEntity.PersonState state = person.instanceFor( PersonEntity.PersonState.class
);
             state.firstName().set( firstName );

http://git-wip-us.apache.org/repos/asf/polygene-java/blob/df5fd8af/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest4.java
----------------------------------------------------------------------
diff --git a/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest4.java
b/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest4.java
index 1608c96..dd103d8 100644
--- a/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest4.java
+++ b/tutorials/hello/src/test/java/org/apache/polygene/tutorials/hello/HelloTest4.java
@@ -35,7 +35,7 @@ import static org.junit.Assert.assertThat;
 public class HelloTest4 extends AbstractPolygeneTest
 {
 
-    public static final Identity TEST_IDENTITY = StringIdentity.fromString( "123" );
+    public static final Identity TEST_IDENTITY = StringIdentity.identity( "123" );
 
     @Override
     public void assemble( ModuleAssembly module )


Mime
View raw message