You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by mi...@apache.org on 2014/05/18 07:06:29 UTC

[01/38] git commit: [OLINGO-210] Set candidate version RC01

Repository: olingo-odata2
Updated Branches:
  refs/heads/Olingo-129_PocJpaDataStore 13b276fbd -> 5cb6e15fc


[OLINGO-210] Set candidate version RC01


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/ed22510a
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/ed22510a
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/ed22510a

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: ed22510ab968e7a3bbc5809232f399d8c847d923
Parents: 35022c4
Author: Christian Amend <ch...@apache.org>
Authored: Mon Mar 17 10:55:49 2014 +0100
Committer: Christian Amend <ch...@apache.org>
Committed: Mon Mar 17 10:55:49 2014 +0100

----------------------------------------------------------------------
 odata2-annotation-processor/annotation-processor-api/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-core/pom.xml    | 2 +-
 odata2-annotation-processor/annotation-processor-ref/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-web/pom.xml     | 2 +-
 odata2-annotation-processor/pom.xml                              | 2 +-
 odata2-dist/janos/pom.xml                                        | 2 +-
 odata2-dist/javadoc/pom.xml                                      | 2 +-
 odata2-dist/jpa/pom.xml                                          | 2 +-
 odata2-dist/lib/pom.xml                                          | 2 +-
 odata2-dist/pom.xml                                              | 2 +-
 odata2-dist/ref/pom.xml                                          | 2 +-
 odata2-jpa-processor/jpa-api/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-core/pom.xml                            | 2 +-
 odata2-jpa-processor/jpa-ref/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-web/pom.xml                             | 2 +-
 odata2-jpa-processor/pom.xml                                     | 2 +-
 odata2-lib/odata-annotation/pom.xml                              | 2 +-
 odata2-lib/odata-api/pom.xml                                     | 2 +-
 odata2-lib/odata-core/pom.xml                                    | 2 +-
 odata2-lib/odata-fit/pom.xml                                     | 2 +-
 odata2-lib/odata-ref/pom.xml                                     | 2 +-
 odata2-lib/odata-testutil/pom.xml                                | 2 +-
 odata2-lib/odata-web/pom.xml                                     | 2 +-
 odata2-lib/pom.xml                                               | 2 +-
 odata2-sample/cars-annotation-archetype/pom.xml                  | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-jpa-archetype/pom.xml                         | 2 +-
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-service-archetype/pom.xml                     | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/pom.xml                                            | 2 +-
 pom.xml                                                          | 2 +-
 32 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-annotation-processor/annotation-processor-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml
index ecbb7e0..a9e6871 100644
--- a/odata2-annotation-processor/annotation-processor-api/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-api/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml
index b12361d..8ab10bd 100644
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml
index bd247f2..a7aec8b 100644
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-annotation-processor/annotation-processor-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-web/pom.xml b/odata2-annotation-processor/annotation-processor-web/pom.xml
index 5df9a18..4a3c686 100644
--- a/odata2-annotation-processor/annotation-processor-web/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-web/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-annotation-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml
index 776a515..215a5d9 100644
--- a/odata2-annotation-processor/pom.xml
+++ b/odata2-annotation-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-dist/janos/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/janos/pom.xml b/odata2-dist/janos/pom.xml
index f6a3f81..0f2f9e8 100644
--- a/odata2-dist/janos/pom.xml
+++ b/odata2-dist/janos/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/javadoc/pom.xml b/odata2-dist/javadoc/pom.xml
index 970e018..7fefb75 100644
--- a/odata2-dist/javadoc/pom.xml
+++ b/odata2-dist/javadoc/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-dist/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/jpa/pom.xml b/odata2-dist/jpa/pom.xml
index c026647..4255c98 100644
--- a/odata2-dist/jpa/pom.xml
+++ b/odata2-dist/jpa/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-dist/lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/lib/pom.xml b/odata2-dist/lib/pom.xml
index 54b82aa..a9c37a3 100644
--- a/odata2-dist/lib/pom.xml
+++ b/odata2-dist/lib/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-dist/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/pom.xml b/odata2-dist/pom.xml
index 42f9705..8dd80a5 100644
--- a/odata2-dist/pom.xml
+++ b/odata2-dist/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-dist/ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/ref/pom.xml b/odata2-dist/ref/pom.xml
index f6c0a42..c46ab64 100644
--- a/odata2-dist/ref/pom.xml
+++ b/odata2-dist/ref/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-jpa-processor/jpa-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml
index e987876..e52d8f8 100644
--- a/odata2-jpa-processor/jpa-api/pom.xml
+++ b/odata2-jpa-processor/jpa-api/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.2.0-SNAPSHOT</version>
+		<version>1.2.0-RC01</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-jpa-processor/jpa-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml
index c9d1d2c..55c9ddf 100644
--- a/odata2-jpa-processor/jpa-core/pom.xml
+++ b/odata2-jpa-processor/jpa-core/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.2.0-SNAPSHOT</version>
+		<version>1.2.0-RC01</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index a44b7f1..309c8f2 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.2.0-SNAPSHOT</version>
+		<version>1.2.0-RC01</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index 00fabf2..c26fcbb 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-jpa-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/pom.xml b/odata2-jpa-processor/pom.xml
index c90be6f..f94a7a8 100644
--- a/odata2-jpa-processor/pom.xml
+++ b/odata2-jpa-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent-incubating</artifactId>
-      <version>1.2.0-SNAPSHOT</version>
+      <version>1.2.0-RC01</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index ba9b975..bd6ac78 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-lib/odata-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/pom.xml b/odata2-lib/odata-api/pom.xml
index 8b5a7d6..4f17929 100644
--- a/odata2-lib/odata-api/pom.xml
+++ b/odata2-lib/odata-api/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-lib/odata-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/pom.xml b/odata2-lib/odata-core/pom.xml
index 5bc2417..22ed22b 100644
--- a/odata2-lib/odata-core/pom.xml
+++ b/odata2-lib/odata-core/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.2.0-SNAPSHOT</version>
+		<version>1.2.0-RC01</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-lib/odata-fit/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/pom.xml b/odata2-lib/odata-fit/pom.xml
index c74168a..5ff8af3 100644
--- a/odata2-lib/odata-fit/pom.xml
+++ b/odata2-lib/odata-fit/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.2.0-SNAPSHOT</version>
+		<version>1.2.0-RC01</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-lib/odata-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-ref/pom.xml b/odata2-lib/odata-ref/pom.xml
index b222c5a..579d76d 100644
--- a/odata2-lib/odata-ref/pom.xml
+++ b/odata2-lib/odata-ref/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.2.0-SNAPSHOT</version>
+		<version>1.2.0-RC01</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-lib/odata-testutil/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/pom.xml b/odata2-lib/odata-testutil/pom.xml
index d030190..9b770b6 100644
--- a/odata2-lib/odata-testutil/pom.xml
+++ b/odata2-lib/odata-testutil/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-lib/odata-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-web/pom.xml b/odata2-lib/odata-web/pom.xml
index 1dab758..3067cdf 100644
--- a/odata2-lib/odata-web/pom.xml
+++ b/odata2-lib/odata-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-lib-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/pom.xml b/odata2-lib/pom.xml
index be175b3..3808618 100644
--- a/odata2-lib/pom.xml
+++ b/odata2-lib/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
index 459a1bf..94973fc 100644
--- a/odata2-sample/cars-annotation-archetype/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -16,13 +16,13 @@
   <groupId>org.apache.olingo</groupId>
   <artifactId>olingo-odata2-sample-cars-annotation-archetype-incubating</artifactId>
   <name>${project.artifactId}</name>
-  <version>1.2.0-SNAPSHOT</version>
+  <version>1.2.0-RC01</version>
   <packaging>maven-archetype</packaging>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-incubating</artifactId>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
index fb64c28..7ab54cd 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -32,7 +32,7 @@
     <version.servlet-api>2.5</version.servlet-api>
     <version.jaxrs-api>2.0-m10</version.jaxrs-api>
     <version.slf4j>1.7.1</version.slf4j>
-    <version.olingo>1.2.0-SNAPSHOT</version.olingo>
+    <version.olingo>1.2.0-RC01</version.olingo>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-sample/cars-jpa-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/pom.xml b/odata2-sample/cars-jpa-archetype/pom.xml
index a370a9f..7df2548 100644
--- a/odata2-sample/cars-jpa-archetype/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 	

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
index e4b1d33..cca19cb 100644
--- a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
-		<version.olingo>1.2.0-SNAPSHOT</version.olingo>
+		<version.olingo>1.2.0-RC01</version.olingo>
 		<version.eclipselink>2.5.1</version.eclipselink>
 		<version.javax.persistence>2.0.5</version.javax.persistence>
 	</properties>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-sample/cars-service-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/pom.xml b/odata2-sample/cars-service-archetype/pom.xml
index 68fb11e..1bfdb79 100644
--- a/odata2-sample/cars-service-archetype/pom.xml
+++ b/odata2-sample/cars-service-archetype/pom.xml
@@ -24,14 +24,14 @@
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-cars-service-archetype-incubating</artifactId>
     <name>${project.artifactId}</name>
-    <version>1.2.0-SNAPSHOT</version>
+    <version>1.2.0-RC01</version>
 
     <packaging>maven-archetype</packaging>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample-incubating</artifactId>
-        <version>1.2.0-SNAPSHOT</version>
+        <version>1.2.0-RC01</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
index 8430633..0dd0c09 100644
--- a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
 		<version.slf4j>1.7.1</version.slf4j>
-		<version.olingo>1.2.0-SNAPSHOT</version.olingo>
+		<version.olingo>1.2.0-RC01</version.olingo>
 	</properties>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index a8432e0..afb9db3 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -15,7 +15,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent-incubating</artifactId>
-      <version>1.2.0-SNAPSHOT</version>
+      <version>1.2.0-RC01</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ed22510a/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index f525cf1..d49836a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
 
 	<groupId>org.apache.olingo</groupId>
 	<artifactId>olingo-odata2-parent-incubating</artifactId>
-	<version>1.2.0-SNAPSHOT</version>
+	<version>1.2.0-RC01</version>
 	<packaging>pom</packaging>
 
 	<name>${project.artifactId}</name>


[02/38] git commit: [OLINGO-210] Set 1.3.0-SNAPSHOT version

Posted by mi...@apache.org.
[OLINGO-210] Set 1.3.0-SNAPSHOT version


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/8b54e489
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/8b54e489
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/8b54e489

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 8b54e489f8e466108c9b9df12a170f3218b98271
Parents: ed22510
Author: Christian Amend <ch...@apache.org>
Authored: Mon Mar 17 15:36:38 2014 +0100
Committer: Christian Amend <ch...@apache.org>
Committed: Mon Mar 17 15:36:38 2014 +0100

----------------------------------------------------------------------
 odata2-annotation-processor/annotation-processor-api/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-core/pom.xml    | 2 +-
 odata2-annotation-processor/annotation-processor-ref/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-web/pom.xml     | 2 +-
 odata2-annotation-processor/pom.xml                              | 2 +-
 odata2-dist/janos/pom.xml                                        | 2 +-
 odata2-dist/javadoc/pom.xml                                      | 2 +-
 odata2-dist/jpa/pom.xml                                          | 2 +-
 odata2-dist/lib/pom.xml                                          | 2 +-
 odata2-dist/pom.xml                                              | 2 +-
 odata2-dist/ref/pom.xml                                          | 2 +-
 odata2-jpa-processor/jpa-api/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-core/pom.xml                            | 2 +-
 odata2-jpa-processor/jpa-ref/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-web/pom.xml                             | 2 +-
 odata2-jpa-processor/pom.xml                                     | 2 +-
 odata2-lib/odata-annotation/pom.xml                              | 2 +-
 odata2-lib/odata-api/pom.xml                                     | 2 +-
 odata2-lib/odata-core/pom.xml                                    | 2 +-
 odata2-lib/odata-fit/pom.xml                                     | 2 +-
 odata2-lib/odata-ref/pom.xml                                     | 2 +-
 odata2-lib/odata-testutil/pom.xml                                | 2 +-
 odata2-lib/odata-web/pom.xml                                     | 2 +-
 odata2-lib/pom.xml                                               | 2 +-
 odata2-sample/cars-annotation-archetype/pom.xml                  | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-jpa-archetype/pom.xml                         | 2 +-
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-service-archetype/pom.xml                     | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/pom.xml                                            | 2 +-
 pom.xml                                                          | 2 +-
 32 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-annotation-processor/annotation-processor-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml
index a9e6871..9ef97c3 100644
--- a/odata2-annotation-processor/annotation-processor-api/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-api/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml
index 8ab10bd..47944a1 100644
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml
index a7aec8b..9381d9f 100644
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-annotation-processor/annotation-processor-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-web/pom.xml b/odata2-annotation-processor/annotation-processor-web/pom.xml
index 4a3c686..b0f7dda 100644
--- a/odata2-annotation-processor/annotation-processor-web/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-web/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-annotation-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml
index 215a5d9..a570c8c 100644
--- a/odata2-annotation-processor/pom.xml
+++ b/odata2-annotation-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-dist/janos/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/janos/pom.xml b/odata2-dist/janos/pom.xml
index 0f2f9e8..f5125e8 100644
--- a/odata2-dist/janos/pom.xml
+++ b/odata2-dist/janos/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/javadoc/pom.xml b/odata2-dist/javadoc/pom.xml
index 7fefb75..bc13bf4 100644
--- a/odata2-dist/javadoc/pom.xml
+++ b/odata2-dist/javadoc/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-dist/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/jpa/pom.xml b/odata2-dist/jpa/pom.xml
index 4255c98..06b1ce1 100644
--- a/odata2-dist/jpa/pom.xml
+++ b/odata2-dist/jpa/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-dist/lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/lib/pom.xml b/odata2-dist/lib/pom.xml
index a9c37a3..cd2e29a 100644
--- a/odata2-dist/lib/pom.xml
+++ b/odata2-dist/lib/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-dist/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/pom.xml b/odata2-dist/pom.xml
index 8dd80a5..1933db7 100644
--- a/odata2-dist/pom.xml
+++ b/odata2-dist/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-dist/ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/ref/pom.xml b/odata2-dist/ref/pom.xml
index c46ab64..c56bff3 100644
--- a/odata2-dist/ref/pom.xml
+++ b/odata2-dist/ref/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-jpa-processor/jpa-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml
index e52d8f8..662b60d 100644
--- a/odata2-jpa-processor/jpa-api/pom.xml
+++ b/odata2-jpa-processor/jpa-api/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.2.0-RC01</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-jpa-processor/jpa-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml
index 55c9ddf..158eeb8 100644
--- a/odata2-jpa-processor/jpa-core/pom.xml
+++ b/odata2-jpa-processor/jpa-core/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.2.0-RC01</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index 309c8f2..5d5bbc9 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.2.0-RC01</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index c26fcbb..36b3b8e 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-jpa-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/pom.xml b/odata2-jpa-processor/pom.xml
index f94a7a8..917b21c 100644
--- a/odata2-jpa-processor/pom.xml
+++ b/odata2-jpa-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent-incubating</artifactId>
-      <version>1.2.0-RC01</version>
+      <version>1.3.0-SNAPSHOT</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index bd6ac78..8e7e13c 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-lib/odata-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/pom.xml b/odata2-lib/odata-api/pom.xml
index 4f17929..be642e3 100644
--- a/odata2-lib/odata-api/pom.xml
+++ b/odata2-lib/odata-api/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-lib/odata-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/pom.xml b/odata2-lib/odata-core/pom.xml
index 22ed22b..eb068ac 100644
--- a/odata2-lib/odata-core/pom.xml
+++ b/odata2-lib/odata-core/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.2.0-RC01</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-lib/odata-fit/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/pom.xml b/odata2-lib/odata-fit/pom.xml
index 5ff8af3..c3fa9c4 100644
--- a/odata2-lib/odata-fit/pom.xml
+++ b/odata2-lib/odata-fit/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.2.0-RC01</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-lib/odata-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-ref/pom.xml b/odata2-lib/odata-ref/pom.xml
index 579d76d..127c749 100644
--- a/odata2-lib/odata-ref/pom.xml
+++ b/odata2-lib/odata-ref/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.2.0-RC01</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-lib/odata-testutil/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/pom.xml b/odata2-lib/odata-testutil/pom.xml
index 9b770b6..8bc27f5 100644
--- a/odata2-lib/odata-testutil/pom.xml
+++ b/odata2-lib/odata-testutil/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-lib/odata-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-web/pom.xml b/odata2-lib/odata-web/pom.xml
index 3067cdf..71515ab 100644
--- a/odata2-lib/odata-web/pom.xml
+++ b/odata2-lib/odata-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-lib-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/pom.xml b/odata2-lib/pom.xml
index 3808618..6e39b40 100644
--- a/odata2-lib/pom.xml
+++ b/odata2-lib/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
index 94973fc..293351b 100644
--- a/odata2-sample/cars-annotation-archetype/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -16,13 +16,13 @@
   <groupId>org.apache.olingo</groupId>
   <artifactId>olingo-odata2-sample-cars-annotation-archetype-incubating</artifactId>
   <name>${project.artifactId}</name>
-  <version>1.2.0-RC01</version>
+  <version>1.3.0-SNAPSHOT</version>
   <packaging>maven-archetype</packaging>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-incubating</artifactId>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
index 7ab54cd..3e76b56 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -32,7 +32,7 @@
     <version.servlet-api>2.5</version.servlet-api>
     <version.jaxrs-api>2.0-m10</version.jaxrs-api>
     <version.slf4j>1.7.1</version.slf4j>
-    <version.olingo>1.2.0-RC01</version.olingo>
+    <version.olingo>1.3.0-SNAPSHOT</version.olingo>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-sample/cars-jpa-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/pom.xml b/odata2-sample/cars-jpa-archetype/pom.xml
index 7df2548..ce73ed8 100644
--- a/odata2-sample/cars-jpa-archetype/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 	

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
index cca19cb..6cce640 100644
--- a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
-		<version.olingo>1.2.0-RC01</version.olingo>
+		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
 		<version.eclipselink>2.5.1</version.eclipselink>
 		<version.javax.persistence>2.0.5</version.javax.persistence>
 	</properties>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-sample/cars-service-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/pom.xml b/odata2-sample/cars-service-archetype/pom.xml
index 1bfdb79..6c8ce97 100644
--- a/odata2-sample/cars-service-archetype/pom.xml
+++ b/odata2-sample/cars-service-archetype/pom.xml
@@ -24,14 +24,14 @@
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-cars-service-archetype-incubating</artifactId>
     <name>${project.artifactId}</name>
-    <version>1.2.0-RC01</version>
+    <version>1.3.0-SNAPSHOT</version>
 
     <packaging>maven-archetype</packaging>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample-incubating</artifactId>
-        <version>1.2.0-RC01</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
index 0dd0c09..b2d6e83 100644
--- a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
 		<version.slf4j>1.7.1</version.slf4j>
-		<version.olingo>1.2.0-RC01</version.olingo>
+		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
 	</properties>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index afb9db3..0410dbd 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -15,7 +15,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent-incubating</artifactId>
-      <version>1.2.0-RC01</version>
+      <version>1.3.0-SNAPSHOT</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/8b54e489/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d49836a..d956e14 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
 
 	<groupId>org.apache.olingo</groupId>
 	<artifactId>olingo-odata2-parent-incubating</artifactId>
-	<version>1.2.0-RC01</version>
+	<version>1.3.0-SNAPSHOT</version>
 	<packaging>pom</packaging>
 
 	<name>${project.artifactId}</name>


[26/38] git commit: [OLINGO-251] entity writer can serialize additional links

Posted by mi...@apache.org.
[OLINGO-251] entity writer can serialize additional links

Change-Id: I84e4037eaad71baa96c82482c3b438e500b67f5e

Signed-off-by: Stephan Klevenz <sk...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/b9bcff10
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/b9bcff10
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/b9bcff10

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: b9bcff10ff51c1a3013a38d8e273edfe4af84a56
Parents: 2dd0181
Author: Klaus Straubinger <kl...@sap.com>
Authored: Wed Apr 23 09:48:48 2014 +0200
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Wed Apr 23 10:32:50 2014 +0200

----------------------------------------------------------------------
 .../api/ep/EntityProviderWriteProperties.java   | 27 +++++++++++++--
 .../ep/producer/AtomEntryEntityProducer.java    | 36 ++++++++++++--------
 .../ep/producer/JsonEntryEntityProducer.java    | 21 +++++++++---
 .../ep/ODataEntityProviderPropertiesTest.java   |  9 +++++
 .../core/ep/producer/AtomEntryProducerTest.java | 30 ++++++++++++++++
 .../producer/JsonEntryEntityProducerTest.java   | 24 +++++++++++++
 .../odata2/fit/ref/EntryJsonChangeTest.java     | 30 +++++++++++++---
 7 files changed, 152 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/b9bcff10/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
index 98cabb8..93c1082 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
@@ -43,6 +43,7 @@ public class EntityProviderWriteProperties {
   private Map<String, ODataCallback> callbacks = Collections.emptyMap();
   private URI selfLink;
   private boolean includeSimplePropertyType;
+  private Map<String, Map<String, Object>> additionalLinks;
 
   private EntityProviderWriteProperties() {}
 
@@ -118,6 +119,16 @@ public class EntityProviderWriteProperties {
     return nextLink;
   }
 
+  /**
+   * Gets the additional links that should be in the payload.
+   * @return the additional links as Map where the navigation-property name is the key and
+     *       a key predicate is the value -
+     *       a key predicate is a Map from key-property names to their values
+   */
+  public final Map<String, Map<String, Object>> getAdditionalLinks() {
+    return additionalLinks;
+  }
+
   public static ODataEntityProviderPropertiesBuilder serviceRoot(final URI serviceRoot) {
     return new ODataEntityProviderPropertiesBuilder().serviceRoot(serviceRoot);
   }
@@ -187,8 +198,7 @@ public class EntityProviderWriteProperties {
 
     /**
      * Set a expand select tree which results from $expand and $select query parameter. Usually the data structure is
-     * constructed
-     * by the uri parser.
+     * constructed by the URI parser.
      * @param expandSelectTree data structure
      * @return properties builder
      */
@@ -207,6 +217,18 @@ public class EntityProviderWriteProperties {
       return this;
     }
 
+    /**
+     * Sets additional links from this entity to other entities.
+     * @param links a Map where the navigation-property name is the key and
+     *              a key predicate is the value -
+     *              a key predicate is a Map from key-property names to their values
+     * @return properties builder
+     */
+    public ODataEntityProviderPropertiesBuilder additionalLinks(final Map<String, Map<String, Object>> links) {
+      properties.additionalLinks = links;
+      return this;
+    }
+
     public ODataEntityProviderPropertiesBuilder fromProperties(final EntityProviderWriteProperties properties) {
       this.properties.mediaResourceMimeType = properties.getMediaResourceMimeType();
       this.properties.inlineCountType = properties.getInlineCountType();
@@ -216,6 +238,7 @@ public class EntityProviderWriteProperties {
       this.properties.callbacks = properties.getCallbacks();
       this.properties.selfLink = properties.getSelfLink();
       this.properties.includeSimplePropertyType = properties.includeSimplePropertyType;
+      this.properties.additionalLinks = properties.additionalLinks;
       return this;
     }
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/b9bcff10/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java
index 307c828..95702dd 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryEntityProducer.java
@@ -58,7 +58,6 @@ import org.apache.olingo.odata2.core.commons.Encoder;
 import org.apache.olingo.odata2.core.edm.EdmDateTimeOffset;
 import org.apache.olingo.odata2.core.ep.aggregator.EntityInfoAggregator;
 import org.apache.olingo.odata2.core.ep.aggregator.EntityPropertyInfo;
-import org.apache.olingo.odata2.core.ep.aggregator.NavigationPropertyInfo;
 import org.apache.olingo.odata2.core.ep.util.FormatXml;
 
 /**
@@ -182,29 +181,36 @@ public class AtomEntryEntityProducer {
   private void appendAtomNavigationLinks(final XMLStreamWriter writer, final EntityInfoAggregator eia,
       final Map<String, Object> data) throws EntityProviderException, EdmException, URISyntaxException {
     for (String name : eia.getSelectedNavigationPropertyNames()) {
-      NavigationPropertyInfo info = eia.getNavigationPropertyInfo(name);
-      boolean isFeed = (info.getMultiplicity() == EdmMultiplicity.MANY);
-      String self = createSelfLink(eia, data, info.getName());
-      appendAtomNavigationLink(writer, self, info.getName(), isFeed, eia, data);
+      final boolean isFeed = (eia.getNavigationPropertyInfo(name).getMultiplicity() == EdmMultiplicity.MANY);
+      final Map<String, Map<String, Object>> links = properties.getAdditionalLinks();
+      final Map<String, Object> key = links == null ? null : links.get(name);
+      if (key == null || key.isEmpty()) {
+        appendAtomNavigationLink(writer, createSelfLink(eia, data, name), name, isFeed, eia, data);
+      } else {
+        final EntityInfoAggregator targetEntityInfo = EntityInfoAggregator.create(
+            eia.getEntitySet().getRelatedEntitySet((EdmNavigationProperty) eia.getEntityType().getProperty(name)));
+        appendAtomNavigationLink(writer, createSelfLink(targetEntityInfo, key, null), name, null, eia, data);
+      }
     }
   }
 
-  private void appendAtomNavigationLink(final XMLStreamWriter writer, final String self,
-      final String navigationPropertyName, final boolean isFeed, final EntityInfoAggregator eia,
+  private void appendAtomNavigationLink(final XMLStreamWriter writer, final String target,
+      final String navigationPropertyName, final Boolean isFeed, final EntityInfoAggregator eia,
       final Map<String, Object> data) throws EntityProviderException, EdmException, URISyntaxException {
     try {
       writer.writeStartElement(FormatXml.ATOM_LINK);
-      writer.writeAttribute(FormatXml.ATOM_HREF, self);
+      writer.writeAttribute(FormatXml.ATOM_HREF, target);
       writer.writeAttribute(FormatXml.ATOM_REL, Edm.NAMESPACE_REL_2007_08 + navigationPropertyName);
       writer.writeAttribute(FormatXml.ATOM_TITLE, navigationPropertyName);
-      if (isFeed) {
-        writer.writeAttribute(FormatXml.ATOM_TYPE, ContentType.APPLICATION_ATOM_XML_FEED.toString());
-        appendInlineFeed(writer, navigationPropertyName, eia, data, self);
-      } else {
-        writer.writeAttribute(FormatXml.ATOM_TYPE, ContentType.APPLICATION_ATOM_XML_ENTRY.toString());
-        appendInlineEntry(writer, navigationPropertyName, eia, data);
+      if (isFeed != null) {
+        if (isFeed) {
+          writer.writeAttribute(FormatXml.ATOM_TYPE, ContentType.APPLICATION_ATOM_XML_FEED.toString());
+          appendInlineFeed(writer, navigationPropertyName, eia, data, target);
+        } else {
+          writer.writeAttribute(FormatXml.ATOM_TYPE, ContentType.APPLICATION_ATOM_XML_ENTRY.toString());
+          appendInlineEntry(writer, navigationPropertyName, eia, data);
+        }
       }
-
       writer.writeEndElement();
     } catch (XMLStreamException e) {
       throw new EntityProviderException(EntityProviderException.COMMON, e);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/b9bcff10/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducer.java
index 6ae5677..8ad5d42 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducer.java
@@ -110,10 +110,10 @@ public class JsonEntryEntityProducer {
           if (properties.getCallbacks() != null && properties.getCallbacks().containsKey(navigationPropertyName)) {
             writeExpandedNavigationProperty(writer, entityInfo, data, type, navigationPropertyName);
           } else {
-            writeDeferredUri(navigationPropertyName);
+            writeDeferredUri(entityInfo, navigationPropertyName);
           }
         } else {
-          writeDeferredUri(navigationPropertyName);
+          writeDeferredUri(entityInfo, navigationPropertyName);
         }
       }
     }
@@ -240,10 +240,23 @@ public class JsonEntryEntityProducer {
     jsonStreamWriter.endObject();
   }
 
-  private void writeDeferredUri(final String navigationPropertyName) throws IOException {
+  private void writeDeferredUri(final EntityInfoAggregator entityInfo, final String navigationPropertyName)
+      throws IOException, EntityProviderException, EdmException {
     jsonStreamWriter.beginObject()
         .name(FormatJson.DEFERRED);
-    JsonLinkEntityProducer.appendUri(jsonStreamWriter, location + "/" + Encoder.encode(navigationPropertyName));
+    String target = null;
+    final Map<String, Map<String, Object>> links = properties.getAdditionalLinks();
+    final Map<String, Object> key = links == null ? null : links.get(navigationPropertyName);
+    if (key == null || key.isEmpty()) {
+      target = location + "/" + Encoder.encode(navigationPropertyName);
+    } else {
+      final EntityInfoAggregator targetEntityInfo = EntityInfoAggregator.create(
+          entityInfo.getEntitySet().getRelatedEntitySet(
+              (EdmNavigationProperty) entityInfo.getEntityType().getProperty(navigationPropertyName)));
+      target = (properties.getServiceRoot() == null ? "" : properties.getServiceRoot().toASCIIString())
+          + AtomEntryEntityProducer.createSelfLink(targetEntityInfo, key, null);
+    }
+    JsonLinkEntityProducer.appendUri(jsonStreamWriter, target);
     jsonStreamWriter.endObject();
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/b9bcff10/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java
index e0e85f6..b5d178e 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
 
 import java.net.URI;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -61,6 +62,8 @@ public class ODataEntityProviderPropertiesTest extends BaseTest {
     callbacks.put("aCallback", new MyCallback(null, null));
     ExpandSelectTreeNode expandSelectTree = new ExpandSelectTreeNodeImpl();
     URI selfLink = new URI("http://some.uri");
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String,Object>>();
+    links.put("aNavigationProperty", Collections.<String, Object> emptyMap());
     final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
         .callbacks(callbacks)
         .expandSelectTree(expandSelectTree)
@@ -70,6 +73,7 @@ public class ODataEntityProviderPropertiesTest extends BaseTest {
         .nextLink("http://localhost")
         .selfLink(selfLink)
         .includeSimplePropertyType(true)
+        .additionalLinks(links)
         .build();
 
     assertEquals("Wrong amount of callbacks.", 1, properties.getCallbacks().size());
@@ -82,6 +86,7 @@ public class ODataEntityProviderPropertiesTest extends BaseTest {
     assertEquals("Wrong inline count.", Integer.valueOf(1), properties.getInlineCount());
     assertEquals("Wrong nextLink", "http://localhost", properties.getNextLink());
     assertTrue("Simple property types should be true", properties.isIncludeSimplePropertyType());
+    assertEquals(Collections.emptyMap(), properties.getAdditionalLinks().get("aNavigationProperty"));
   }
 
   @Test
@@ -101,6 +106,8 @@ public class ODataEntityProviderPropertiesTest extends BaseTest {
     callbacks.put("aCallback", new MyCallback(null, null));
     ExpandSelectTreeNode expandSelectTree = new ExpandSelectTreeNodeImpl();
     URI selfLink = new URI("http://some.uri");
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String,Object>>();
+    links.put("aNavigationProperty", Collections.<String, Object> emptyMap());
     final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
         .callbacks(callbacks)
         .expandSelectTree(expandSelectTree)
@@ -110,6 +117,7 @@ public class ODataEntityProviderPropertiesTest extends BaseTest {
         .nextLink("http://localhost")
         .selfLink(selfLink)
         .includeSimplePropertyType(true)
+        .additionalLinks(links)
         .build();
 
     //
@@ -127,5 +135,6 @@ public class ODataEntityProviderPropertiesTest extends BaseTest {
     assertEquals("Wrong inline count.", Integer.valueOf(1), fromProperties.getInlineCount());
     assertEquals("Wrong nextLink", "http://localhost", fromProperties.getNextLink());
     assertTrue("Simple property types should be true", fromProperties.isIncludeSimplePropertyType());
+    assertEquals(Collections.emptyMap(), fromProperties.getAdditionalLinks().get("aNavigationProperty"));
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/b9bcff10/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
index dd36e11..c4bcb22 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
@@ -720,6 +720,36 @@ public class AtomEntryProducerTest extends AbstractProviderTest {
   }
 
   @Test
+  public void additionalLink() throws Exception {
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
+    links.put("nr_Building", buildingData);
+    final ODataResponse response = createAtomEntityProvider().writeEntry(
+        MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms"), roomData,
+         EntityProviderWriteProperties.serviceRoot(BASE_URI).additionalLinks(links).build());
+    final String xmlString = verifyResponse(response);
+
+    assertXpathExists("/a:entry/a:link[@title='nr_Building']", xmlString);
+    assertXpathNotExists("/a:entry/a:link[@href=\"Rooms('1')/nr_Building\"]", xmlString);
+    assertXpathExists("/a:entry/a:link[@href=\"Buildings('1')\"]", xmlString);
+    assertXpathNotExists("/a:entry/a:link[@type='application/atom+xml;type=entry']", xmlString);
+  }
+
+  @Test
+  public void additionalLinkToOneOfMany() throws Exception {
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
+    links.put("nr_Employees", employeeData);
+    final ODataResponse response = createAtomEntityProvider().writeEntry(
+        MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms"), roomData,
+         EntityProviderWriteProperties.serviceRoot(BASE_URI).additionalLinks(links).build());
+    final String xmlString = verifyResponse(response);
+
+    assertXpathExists("/a:entry/a:link[@title='nr_Employees']", xmlString);
+    assertXpathNotExists("/a:entry/a:link[@href=\"Rooms('1')/nr_Employees\"]", xmlString);
+    assertXpathExists("/a:entry/a:link[@href=\"Employees('1')\"]", xmlString);
+    assertXpathNotExists("/a:entry/a:link[@type='application/atom+xml;type=feed']", xmlString);
+  }
+
+  @Test
   public void serializeWithCustomSrcAttributeOnEmployee() throws Exception {
     AtomEntityProvider ser = createAtomEntityProvider();
     Map<String, Object> localEmployeeData = new HashMap<String, Object>(employeeData);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/b9bcff10/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducerTest.java
index 0a6f08a..8efd99a 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonEntryEntityProducerTest.java
@@ -737,6 +737,30 @@ public class JsonEntryEntityProducerTest extends BaseTest {
     assertEquals("right", jsonMap.get("content_type"));
   }
 
+  @Test
+  public void additionalLink() throws Exception {
+    final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
+    Map<String, Object> data = new HashMap<String, Object>();
+    data.put("Id", "1");
+    Map<String, Object> key = new HashMap<String, Object>();
+    key.put("Id", "3");
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
+    links.put("nr_Building", key);
+    final EntityProviderWriteProperties properties = EntityProviderWriteProperties
+        .serviceRoot(URI.create(BASE_URI))
+        .additionalLinks(links)
+        .build();
+
+    final ODataResponse response = new JsonEntityProvider().writeEntry(entitySet, data, properties);
+    final String json = verifyResponse(response);
+    assertEquals("{\"d\":{\"__metadata\":{\"id\":\"" + BASE_URI + "Rooms('1')\","
+        + "\"uri\":\"" + BASE_URI + "Rooms('1')\",\"type\":\"RefScenario.Room\"},"
+        + "\"Id\":\"1\",\"Name\":null,\"Seats\":null,\"Version\":null,"
+        + "\"nr_Employees\":{\"__deferred\":{\"uri\":\"" + BASE_URI + "Rooms('1')/nr_Employees\"}},"
+        + "\"nr_Building\":{\"__deferred\":{\"uri\":\"" + BASE_URI + "Buildings('3')\"}}}}",
+        json);
+  }
+
   private String verifyResponse(final ODataResponse response) throws IOException {
     assertNotNull(response);
     assertNotNull(response.getEntity());

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/b9bcff10/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java
index 8fd04ce..9c1df43 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java
@@ -21,10 +21,18 @@ package org.apache.olingo.odata2.fit.ref;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+
 import org.apache.http.HttpResponse;
 import org.apache.olingo.odata2.api.commons.HttpContentType;
 import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
 import org.apache.olingo.odata2.api.commons.ODataHttpMethod;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.ep.EntityProvider;
+import org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties;
+import org.apache.olingo.odata2.testutil.helper.StringHelper;
 import org.apache.olingo.odata2.testutil.server.ServletType;
 import org.junit.Test;
 
@@ -74,10 +82,24 @@ public class EntryJsonChangeTest extends AbstractRefTest {
 
   @Test
   public void createEntryWithLink() throws Exception {
-    final String requestBody = "{\"Id\":\"99\",\"Name\":\"new room\",\"Seats\":19,\"Version\":42,"
-        + "\"nr_Building\":{\"__deferred\":{\"uri\":\"" + getEndpoint() + "Buildings('1')\"}}}";
-    final HttpResponse response =
-        postUri("Rooms()", requestBody, HttpContentType.APPLICATION_JSON, HttpStatusCodes.CREATED);
+    HttpResponse response = callUri("$metadata");
+    final EdmEntitySet linkedEntitySet = EntityProvider.readMetadata(response.getEntity().getContent(), false)
+        .getDefaultEntityContainer().getEntitySet("Rooms");
+    getBody(response);
+    Map<String, Object> data = new HashMap<String, Object>();
+    data.put("Id", "99");
+    data.put("Name", "new room");
+    data.put("Seats", 19);
+    data.put("Version", 42);
+    Map<String, Object> key = new HashMap<String, Object>();
+    key.put("Id", "1");
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String,Object>>();
+    links.put("nr_Building", key);
+    final String requestBody = StringHelper.inputStreamToString(
+        (InputStream) EntityProvider.writeEntry(HttpContentType.APPLICATION_JSON, linkedEntitySet, data,
+            EntityProviderWriteProperties.serviceRoot(getEndpoint()).additionalLinks(links).build())
+            .getEntity());
+    response = postUri("Rooms()", requestBody, HttpContentType.APPLICATION_JSON, HttpStatusCodes.CREATED);
     assertFalse(getBody(response).isEmpty());
     checkUri("Rooms('104')/nr_Building?$format=json");
     assertEquals("{\"d\":{\"Name\":\"Building 1\"}}", getBody(callUri("Rooms('104')/nr_Building/Name?$format=json")));


[19/38] git commit: [OLINGO-185] Add missing Licence Header

Posted by mi...@apache.org.
[OLINGO-185] Add missing Licence Header


Signed-off-by: Chandan V A <ch...@sap.com>

Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/bf7da39c
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/bf7da39c
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/bf7da39c

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: bf7da39ce5a1753ec43b4ded05e63768ac169207
Parents: 6a9335f
Author: Chandan V A <ch...@sap.com>
Authored: Wed Apr 2 17:38:20 2014 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Wed Apr 2 17:38:20 2014 +0530

----------------------------------------------------------------------
 .../odata2/jpa/processor/ref/model/NoteKey.java   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/bf7da39c/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
index 69309d6..6ca1067 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
@@ -1,3 +1,21 @@
+/*******************************************************************************
+ * 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.olingo.odata2.jpa.processor.ref.model;
 
 import java.io.Serializable;


[37/38] git commit: [OLINGO-239] Improved test

Posted by mi...@apache.org.
[OLINGO-239] Improved test


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/f86e307f
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/f86e307f
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/f86e307f

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: f86e307fe5479bbf962b8212ad09d240ac91e177
Parents: aa7bf82
Author: Michael Bolz <mi...@apache.org>
Authored: Mon May 12 15:09:25 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Mon May 12 15:09:30 2014 +0200

----------------------------------------------------------------------
 .../odata2/annotation/processor/core/util/ClassHelperTest.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f86e307f/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
index 4da0960..bcd955a 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
@@ -64,7 +64,7 @@ public class ClassHelperTest {
   @Test(expected = ClassFormatError.class)
   public void loadFromSpaceDir() throws Exception {
     URL currentPath = Thread.currentThread().getContextClassLoader().getResource(".");
-    File folder = new File(currentPath.getFile(), "space space/package");
+    File folder = new File(currentPath.toURI().getSchemeSpecificPart(), "space space/package");
     folder.mkdirs();
     File classFile = new File(folder, "Invalid.class");
     classFile.createNewFile();


[13/38] git commit: Run code clean up (again)

Posted by mi...@apache.org.
Run code clean up (again)


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/c8cdf378
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/c8cdf378
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/c8cdf378

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: c8cdf3785facd2f9aad529bab4e90f5fdabf445e
Parents: f6ffb05
Author: Michael Bolz <mi...@apache.org>
Authored: Wed Mar 26 13:31:13 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Wed Mar 26 13:31:13 2014 +0100

----------------------------------------------------------------------
 .../core/edm/AnnotationEdmProvider.java         | 62 ++++++++++----------
 .../core/edm/AnnotationEdmProviderTest.java     |  2 +-
 .../processor/ref/EntryJsonCreateTest.java      | 16 ++---
 .../olingo/odata2/api/ep/EntityProvider.java    |  8 +--
 .../olingo/odata2/core/ODataContextImpl.java    |  2 +-
 .../core/ep/consumer/JsonEntryConsumer.java     |  4 +-
 .../ep/consumer/JsonErrorDocumentConsumer.java  | 13 ++--
 .../ep/consumer/XmlErrorDocumentConsumer.java   |  9 +--
 .../core/servlet/ODataExceptionWrapper.java     |  2 +-
 .../olingo/odata2/core/servlet/RestUtil.java    | 18 +++---
 .../consumer/XmlErrorDocumentConsumerTest.java  | 56 +++++++++---------
 .../BasicContentNegotiationTest.java            |  2 +-
 .../odata2/testutil/fit/AbstractFitTest.java    |  4 +-
 .../odata2/testutil/server/TestServer.java      | 28 ++++-----
 14 files changed, 115 insertions(+), 111 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
index 984a677..9c46da2 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
@@ -497,37 +497,37 @@ public class AnnotationEdmProvider extends EdmProvider {
       return navProp;
     }
 
-    //    private EdmSimpleTypeKind getEdmSimpleType(Class<?> type) {
-    //      if (type == String.class) {
-    //        return EdmType.String;
-    //      } else if (type == boolean.class || type == Boolean.class) {
-    //        return EdmType.Boolean;
-    //      } else if (type == byte.class || type == Byte.class) {
-    //        return EdmType.SByte;
-    //      } else if (type == short.class || type == Short.class) {
-    //        return EdmType.Int16;
-    //      } else if (type == int.class || type == Integer.class) {
-    //        return EdmType.Int32;
-    //      } else if (type == long.class || type == Long.class) {
-    //        return EdmType.Int64;
-    //      } else if (type == double.class || type == Double.class) {
-    //        return EdmType.Double;
-    //      } else if (type == float.class || type == Float.class) {
-    //        return EdmType.Single;
-    //      } else if (type == BigInteger.class || type == BigDecimal.class) {
-    //        return EdmType.Decimal;
-    //      } else if (type == Byte[].class || type == byte[].class) {
-    //        return EdmType.Binary;
-    //      } else if (type == Date.class) {
-    //        return EdmType.DateTime;
-    //      } else if (type == Calendar.class) {
-    //        return EdmType.DateTimeOffset;
-    //      } else if (type == UUID.class) {
-    //        return EdmType.Guid;
-    //      } else {
-    //        throw new UnsupportedOperationException("Not yet supported type '" + type + "'.");
-    //      }
-    //    }
+    // private EdmSimpleTypeKind getEdmSimpleType(Class<?> type) {
+    // if (type == String.class) {
+    // return EdmType.String;
+    // } else if (type == boolean.class || type == Boolean.class) {
+    // return EdmType.Boolean;
+    // } else if (type == byte.class || type == Byte.class) {
+    // return EdmType.SByte;
+    // } else if (type == short.class || type == Short.class) {
+    // return EdmType.Int16;
+    // } else if (type == int.class || type == Integer.class) {
+    // return EdmType.Int32;
+    // } else if (type == long.class || type == Long.class) {
+    // return EdmType.Int64;
+    // } else if (type == double.class || type == Double.class) {
+    // return EdmType.Double;
+    // } else if (type == float.class || type == Float.class) {
+    // return EdmType.Single;
+    // } else if (type == BigInteger.class || type == BigDecimal.class) {
+    // return EdmType.Decimal;
+    // } else if (type == Byte[].class || type == byte[].class) {
+    // return EdmType.Binary;
+    // } else if (type == Date.class) {
+    // return EdmType.DateTime;
+    // } else if (type == Calendar.class) {
+    // return EdmType.DateTimeOffset;
+    // } else if (type == UUID.class) {
+    // return EdmType.Guid;
+    // } else {
+    // throw new UnsupportedOperationException("Not yet supported type '" + type + "'.");
+    // }
+    // }
 
     private EdmType getEdmType(final Class<?> type) {
       if (type == String.class) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
index 84e9192..30c87bb 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
@@ -359,7 +359,7 @@ public class AnnotationEdmProviderTest {
     PropertyRef imageFormat = getPropertyRef(keyReferences, "ImageFormat");
     assertEquals("ImageFormat", imageFormat.getName());
 
-    //    assertEquals(0, photo.getNavigationProperties().size());
+    // assertEquals(0, photo.getNavigationProperties().size());
     assertNull(photo.getNavigationProperties());
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
index 90b0384..b661d77 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
@@ -137,14 +137,14 @@ public class EntryJsonCreateTest extends AbstractRefJsonTest {
 
   private static final String JSON_EMPLOYEE = "{" +
       "    \"d\": {" +
-      //      "        \"__metadata\": {" + 
-      //      "            \"id\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," + 
-      //      "            \"uri\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," + 
-      //      "            \"type\": \"RefScenario.Employee\"," + 
-      //      "            \"content_type\": \"application/octet-stream\"," + 
-      //      "            \"media_src\": \"Employees('1')/$value\"," + 
-      //      "            \"edit_media\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')/$value\"" + 
-      //      "        }," + 
+      // "        \"__metadata\": {" +
+      // "            \"id\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," +
+      // "            \"uri\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," +
+      // "            \"type\": \"RefScenario.Employee\"," +
+      // "            \"content_type\": \"application/octet-stream\"," +
+      // "            \"media_src\": \"Employees('1')/$value\"," +
+      // "            \"edit_media\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')/$value\"" +
+      // "        }," +
       "        \"EmployeeId\": \"1\"," +
       "        \"EmployeeName\": \"Douglas\"," +
       "        \"Age\": 42," +

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
index b43e448..f989d4a 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
@@ -424,7 +424,7 @@ public final class EntityProvider {
     /**
      * Read (de-serialize) data from error document as {@link InputStream} and provide according
      * {@link ODataErrorContext}.
-     *
+     * 
      * @param errorDocument error document which is read
      * @param contentType format of content in the given input stream
      * @return read error document
@@ -811,9 +811,9 @@ public final class EntityProvider {
   }
 
   /**
-   * Read (de-serialize) data from error document as {@link InputStream} and provide according
-   * {@link ODataErrorContext}.
-   *
+   * Read (de-serialize) data from error document as {@link InputStream} and provide according {@link ODataErrorContext}
+   * .
+   * 
    * @param errorDocument error document which is read
    * @param contentType format of content in the given input stream
    * @return read error document

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataContextImpl.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataContextImpl.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataContextImpl.java
index 3a75f73..d38664e 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataContextImpl.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataContextImpl.java
@@ -36,7 +36,7 @@ import org.apache.olingo.odata2.api.uri.PathInfo;
 import org.apache.olingo.odata2.core.debug.ODataDebugResponseWrapper;
 
 /**
- * Context. 
+ * Context.
  */
 public class ODataContextImpl implements ODataContext {
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
index 9f452e4..11350b1 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
@@ -133,8 +133,8 @@ public class JsonEntryConsumer {
 
   /**
    * Ensure that instance field {@link #resultEntry} exists.
-   * If it not already exists create an instance (as well as all other necessary objects like:
-   * {@link #properties}, {@link #mediaMetadata}, {@link #entryMetadata}, {@link #expandSelectTree}).
+   * If it not already exists create an instance (as well as all other necessary objects like: {@link #properties},
+   * {@link #mediaMetadata}, {@link #entryMetadata}, {@link #expandSelectTree}).
    */
   private void ensureODataEntryExists() {
     if (resultEntry == null) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
index 3b065d0..9348b2a 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
@@ -6,9 +6,9 @@
  * 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
@@ -40,7 +40,8 @@ import com.google.gson.stream.JsonToken;
 public class JsonErrorDocumentConsumer {
   /** Default used charset for reader */
   private static final String DEFAULT_CHARSET = "UTF-8";
-  /** Map containing language code (language - country) to Locale mapping
+  /**
+   * Map containing language code (language - country) to Locale mapping
    * based on Locale.getAvailableLocales()
    * */
   private final static Map<String, Locale> AVAILABLE_LOCALES = new HashMap<String, Locale>();
@@ -53,7 +54,7 @@ public class JsonErrorDocumentConsumer {
 
   /**
    * Deserialize / read OData error document in ODataErrorContext.
-   *
+   * 
    * @param errorDocument OData error document in JSON format
    * @return created ODataErrorContext based on input stream content.
    * @throws EntityProviderException if an exception during read / deserialization occurs.
@@ -130,7 +131,7 @@ public class JsonErrorDocumentConsumer {
     String innerError = reader.nextString();
     errorContext.setInnerError(innerError);
     // implementation for OData v2 Section 2.2.8.1.2 JSON Error Response
-    //    (RFC4627 Section 2.2 -> https://www.ietf.org/rfc/rfc4627.txt))
+    // (RFC4627 Section 2.2 -> https://www.ietf.org/rfc/rfc4627.txt))
     // currently not provided
   }
 
@@ -176,7 +177,7 @@ public class JsonErrorDocumentConsumer {
 
   /**
    * Read the string value from the JsonReader or 'null' if no value is available.
-   *
+   * 
    * @param reader to read from
    * @return the string value or 'null'
    * @throws IOException if an exception occurs

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
index e69f896..d584951 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -6,9 +6,9 @@
  * 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
@@ -38,7 +38,8 @@ import org.apache.olingo.odata2.core.ep.util.FormatXml;
  * Consuming (read / deserialization) for OData error document in XML format.
  */
 public class XmlErrorDocumentConsumer {
-  /** Map containing language code (language - country) to Locale mapping
+  /**
+   * Map containing language code (language - country) to Locale mapping
    * based on Locale.getAvailableLocales()
    * */
   private final static Map<String, Locale> AVAILABLE_LOCALES = new HashMap<String, Locale>();
@@ -51,7 +52,7 @@ public class XmlErrorDocumentConsumer {
 
   /**
    * Deserialize / read OData error document in ODataErrorContext.
-   *
+   * 
    * @param errorDocument OData error document in XML format
    * @return created ODataErrorContext based on input stream content.
    * @throws EntityProviderException if an exception during read / deserialization occurs.

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataExceptionWrapper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataExceptionWrapper.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataExceptionWrapper.java
index 643e03d..7edd411 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataExceptionWrapper.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataExceptionWrapper.java
@@ -84,7 +84,7 @@ public class ODataExceptionWrapper {
 
       ODataResponse oDataResponse;
       // if (callback != null) {
-      //   oDataResponse = handleErrorCallback(callback);
+      // oDataResponse = handleErrorCallback(callback);
       // } else {
       oDataResponse = EntityProvider.writeErrorDocument(errorContext);
       // }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/RestUtil.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/RestUtil.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/RestUtil.java
index 3339723..e5b5555 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/RestUtil.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/RestUtil.java
@@ -49,17 +49,17 @@ import org.apache.olingo.odata2.core.commons.Decoder;
 public class RestUtil {
   private static final String REG_EX_OPTIONAL_WHITESPACE = "\\s?";
 
-  //RFC 2616, 3.9: qvalue = ("0"["." 0*3DIGIT]) | ("1"["." 0*3("0")])
+  // RFC 2616, 3.9: qvalue = ("0"["." 0*3DIGIT]) | ("1"["." 0*3("0")])
   private static final String REG_EX_QVALUE = "q=((?:1(?:\\.0{0,3})?)|(?:0(?:\\.[0-9]{0,3})?))";
 
-  //RFC 2616, 14.1: the media-range parameters
+  // RFC 2616, 14.1: the media-range parameters
   private static final String REG_EX_PARAMETER = "(?:;\\s*(?:(?:[^qQ].*)|(?:[qQ]\\s*=\\s*(?:[^01].*))))*";
   private static final Pattern REG_EX_ACCEPT =
       Pattern.compile("([a-z\\*\\s]+/[a-zA-Z\\+\\*\\-=\\s]+" + REG_EX_PARAMETER + ")");
   private static final Pattern REG_EX_ACCEPT_WITH_Q_FACTOR =
       Pattern.compile(REG_EX_ACCEPT + "(?:" + REG_EX_OPTIONAL_WHITESPACE + REG_EX_QVALUE + ")?");
 
-  //RFC 2616, 14.4: language-range  = ((1*8ALPHA *("-" 1*8ALPHA)) | "*")
+  // RFC 2616, 14.4: language-range = ((1*8ALPHA *("-" 1*8ALPHA)) | "*")
   private static final Pattern REG_EX_ACCEPT_LANGUAGES =
       Pattern.compile("((?:\\*)|(?:[a-z]{1,8}(?:\\-[a-zA-Z]{1,8})?))");
   private static final Pattern REG_EX_ACCEPT_LANGUAGES_WITH_Q_FACTOR =
@@ -85,12 +85,12 @@ public class RestUtil {
   }
 
   /*
-   * Parses query parameters.    
+   * Parses query parameters.
    */
   public static Map<String, String> extractQueryParameters(final String queryString) {
     Map<String, String> queryParametersMap = new HashMap<String, String>();
     if (queryString != null) {
-      //At first the queryString will be decoded.
+      // At first the queryString will be decoded.
       List<String> queryParameters = Arrays.asList(Decoder.decode(queryString).split("\\&"));
       for (String param : queryParameters) {
         int indexOfEqualSign = param.indexOf("=");
@@ -105,7 +105,7 @@ public class RestUtil {
   }
 
   /*
-   * Parses Accept-Language header. Returns a list sorted by quality parameter   
+   * Parses Accept-Language header. Returns a list sorted by quality parameter
    */
   public static List<Locale> extractAcceptableLanguage(final String acceptableLanguageHeader) {
     List<Locale> acceptLanguages = new ArrayList<Locale>();
@@ -123,7 +123,7 @@ public class RestUtil {
     }
     for (Accept accept : acceptTree) {
       String languageRange = accept.getValue();
-      //The languageRange has to be splitted in language tag and country tag         
+      // The languageRange has to be splitted in language tag and country tag
       int indexOfMinus = languageRange.indexOf("-");
       Locale locale;
       if (indexOfMinus < 0) {
@@ -140,7 +140,7 @@ public class RestUtil {
   }
 
   /*
-   * Parses Accept header. Returns a list of media ranges sorted by quality parameter   
+   * Parses Accept header. Returns a list of media ranges sorted by quality parameter
    */
   public static List<String> extractAcceptHeaders(final String acceptHeader) {
     TreeSet<Accept> acceptTree = getAcceptTree();
@@ -347,7 +347,7 @@ public class RestUtil {
 
   /*
    * The class is used in order to sort headers by "q" parameter.
-   * The object of this class contains a value of the Accept header or Accept-Language header and value of the 
+   * The object of this class contains a value of the Accept header or Accept-Language header and value of the
    * quality parameter.
    */
   private static class Accept {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
index 4106bcd..55ceb1d 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
@@ -18,15 +18,18 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.core.ep.consumer;
 
-import org.apache.olingo.odata2.api.ep.EntityProviderException;
-import org.apache.olingo.odata2.api.processor.ODataErrorContext;
-import org.apache.olingo.odata2.testutil.helper.StringHelper;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
 
 import java.io.InputStream;
 import java.util.Locale;
 
-import static org.junit.Assert.*;
+import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
 
 /**
  *  
@@ -34,33 +37,33 @@ import static org.junit.Assert.*;
 public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
 
   private static final String XML_ERROR_DOCUMENT_SIMPLE =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_NULL_LOCALE =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:lang=\"\">Message</message>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"\">Message</message>\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_INNER_ERROR =
-  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
           "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
           "\t<code>ErrorCode</code>\n" +
           "\t<message xml:lang=\"en-US\">Message</message>\n" +
           "<innererror>Some InnerError</innererror>\n" +
           "</error>";
   private static final String XML_ERROR_DOCUMENT_INVALID_XML =
-  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
           "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
           "\t<code>ErrorCode</CODE>\n" +
           "\t<message xml:lang=\"en-US\">Message</message>\n" +
           "</error>";
   /* error document with name 'locale' instead of 'lang' for message object */
   private static final String XML_ERROR_DOCUMENT_UNKNOWN_CONTENT =
-  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
           "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
           "\t<code>ErrorCode</code>\n" +
           "\t<message xml:locale=\"en-US\">Message</message>\n" +
@@ -68,23 +71,23 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
           "</error>";
   /* error document without value for message object */
   private static final String XML_ERROR_DOCUMENT_EMPTY_MESSAGE =
-  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
           "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
           "\t<code>ErrorCode</code>\n" +
           "\t<message xml:lang=\"en-US\" />\n" +
           "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_MESSAGE =
-  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
           "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
           "\t<code>ErrorCode</code>\n" +
           "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_CODE =
-  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
           "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
           "\t<message xml:lang=\"en-US\">Message</message>\n" +
           "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_ERROR =
-  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
           "<errorForMe xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
           "\t<code>ErrorCode</code>\n" +
           "\t<message xml:lang=\"en-US\">Message</message>\n" +
@@ -125,7 +128,6 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
     assertNull("Expected NULL for locale", error.getLocale());
   }
 
-
   @Test
   public void innerError() throws Exception {
     InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_INNER_ERROR);
@@ -157,7 +159,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-              EntityProviderException.INVALID_STATE, e.getMessageReference());
+          EntityProviderException.INVALID_STATE, e.getMessageReference());
       throw e;
     }
   }
@@ -193,7 +195,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-              EntityProviderException.INVALID_STATE, e.getMessageReference());
+          EntityProviderException.INVALID_STATE, e.getMessageReference());
       throw e;
     }
   }
@@ -206,7 +208,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-              EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+          EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
       assertTrue(e.getMessage().contains("code"));
       throw e;
     }
@@ -220,7 +222,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-              EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+          EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
       assertTrue(e.getMessage().contains("message"));
       throw e;
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
index 8533e42..a8315bd 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
@@ -197,7 +197,7 @@ public class BasicContentNegotiationTest extends AbstractContentNegotiationTest
     final HttpResponse response = new DefaultHttpClient().execute(get);
 
     final String contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
-    //    assertEquals(expectedResponseContentType, contentType);
+    // assertEquals(expectedResponseContentType, contentType);
     try {
 
       assertEquals(ContentType.APPLICATION_XML, ContentType.create(contentType));

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
index 7345c84..6134fe8 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
@@ -62,8 +62,8 @@ public abstract class AbstractFitTest extends BaseTest {
     return Arrays.asList(a);
   }
 
-  //  public AbstractFitTest() {
-  //  }
+  // public AbstractFitTest() {
+  // }
 
   protected URI getEndpoint() {
     return server.getEndpoint();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/c8cdf378/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
index 87e57ca..3e2c097 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
@@ -154,22 +154,22 @@ public class TestServer {
     return contextHandler;
   }
 
-  //  private ServletContextHandler createODataContextHandler(final Class<? extends ODataServiceFactory> factoryClass)
-  //      throws InstantiationException, IllegalAccessException, ClassNotFoundException {
-  //    String odataServlet = "org.apache.olingo.odata2.core.servlet.ODataServlet";
-  //    final HttpServlet httpServlet = (HttpServlet) Class.forName(odataServlet).newInstance();
-  //    final ServletHolder odataServletHolder = new ServletHolder(httpServlet);
-  //    odataServletHolder.setInitParameter(ODataServiceFactory.FACTORY_LABEL, factoryClass.getCanonicalName());
+  // private ServletContextHandler createODataContextHandler(final Class<? extends ODataServiceFactory> factoryClass)
+  // throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+  // String odataServlet = "org.apache.olingo.odata2.core.servlet.ODataServlet";
+  // final HttpServlet httpServlet = (HttpServlet) Class.forName(odataServlet).newInstance();
+  // final ServletHolder odataServletHolder = new ServletHolder(httpServlet);
+  // odataServletHolder.setInitParameter(ODataServiceFactory.FACTORY_LABEL, factoryClass.getCanonicalName());
   //
-  //    if (pathSplit > 0) {
-  //      odataServletHolder.setInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL, Integer.toString(pathSplit));
-  //    }
+  // if (pathSplit > 0) {
+  // odataServletHolder.setInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL, Integer.toString(pathSplit));
+  // }
   //
-  //    final ServletContextHandler contextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
-  //    contextHandler.setContextPath("/abc");
-  //    contextHandler.addServlet(odataServletHolder, path + "/*");
-  //    return contextHandler;
-  //  }
+  // final ServletContextHandler contextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+  // contextHandler.setContextPath("/abc");
+  // contextHandler.addServlet(odataServletHolder, path + "/*");
+  // return contextHandler;
+  // }
 
   public void startServer(final ODataService service) {
     startServer(FitStaticServiceFactory.class);


[15/38] git commit: [OLINGO-196] Added tests and improved innerError handling (XML/JSON)

Posted by mi...@apache.org.
[OLINGO-196] Added tests and improved innerError handling (XML/JSON)


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/1f37db3e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/1f37db3e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/1f37db3e

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 1f37db3e9b84f074bf9450cc2c7565ccb3fc9cf1
Parents: 6a5fc6c
Author: Michael Bolz <mi...@apache.org>
Authored: Thu Mar 27 09:16:14 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Thu Mar 27 09:28:28 2014 +0100

----------------------------------------------------------------------
 .../ep/consumer/JsonErrorDocumentConsumer.java  |  37 ++---
 .../ep/consumer/XmlErrorDocumentConsumer.java   |  23 +--
 .../consumer/JsonErrorDocumentConsumerTest.java |  16 +-
 .../consumer/XmlErrorDocumentConsumerTest.java  | 148 +++++++++++--------
 4 files changed, 123 insertions(+), 101 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1f37db3e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
index 5f5610b..32253d1 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
@@ -127,11 +127,12 @@ public class JsonErrorDocumentConsumer {
   }
 
   private void parseInnerError(final JsonReader reader, final ODataErrorContext errorContext) throws IOException {
-    if(reader.peek() == JsonToken.STRING) {
+    JsonToken token = reader.peek();
+    if (token == JsonToken.STRING) {
       // implementation for parse content as provided by JsonErrorDocumentProducer
       String innerError = reader.nextString();
       errorContext.setInnerError(innerError);
-    } else if(reader.peek() == JsonToken.BEGIN_OBJECT) {
+    } else if (token == JsonToken.BEGIN_OBJECT) {
       // implementation for OData v2 Section 2.2.8.1.2 JSON Error Response
       // (RFC4627 Section 2.2 -> https://www.ietf.org/rfc/rfc4627.txt))
       // currently partial provided
@@ -139,33 +140,33 @@ public class JsonErrorDocumentConsumer {
     }
   }
 
-
-  private String readJson(JsonReader reader) throws  IOException {
+  private String readJson(final JsonReader reader) throws IOException {
     StringBuilder sb = new StringBuilder();
 
-    while(reader.hasNext()) {
-      if(reader.peek() == JsonToken.NAME) {
-        if(sb.length() > 0) {
+    while (reader.hasNext()) {
+      JsonToken token = reader.peek();
+      if (token == JsonToken.NAME) {
+        if (sb.length() > 0) {
           sb.append(",");
         }
         String name = reader.nextName();
         sb.append("\"").append(name).append("\"").append(":");
-      } else if(reader.peek() == JsonToken.BEGIN_OBJECT) {
+      } else if (token == JsonToken.BEGIN_OBJECT) {
         reader.beginObject();
-        sb.append("{");
-        sb.append(readJson(reader));
-        sb.append("}");
+        sb.append("{")
+            .append(readJson(reader))
+            .append("}");
         reader.endObject();
-      } else if(reader.peek() == JsonToken.BEGIN_ARRAY) {
+      } else if (token == JsonToken.BEGIN_ARRAY) {
         reader.beginArray();
-        sb.append("[");
-        sb.append(readJson(reader));
-        sb.append("]");
+        sb.append("[")
+            .append(readJson(reader))
+            .append("]");
         reader.endArray();
       } else {
-        sb.append("\"");
-        sb.append(reader.nextString());
-        sb.append("\"");
+        sb.append("\"")
+            .append(reader.nextString())
+            .append("\"");
       }
     }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1f37db3e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
index 4b6b8ac..661e5c7 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -139,38 +139,29 @@ public class XmlErrorDocumentConsumer {
     return notFinished(reader, FormatXml.M_ERROR);
   }
 
-  private boolean notFinished(final XMLStreamReader reader, String tagName) throws XMLStreamException {
+  private boolean notFinished(final XMLStreamReader reader, final String tagName) throws XMLStreamException {
     boolean finished = reader.isEndElement() && tagName.equals(reader.getLocalName());
     return !finished && reader.hasNext();
   }
 
   private void handleInnerError(final XMLStreamReader reader, final ODataErrorContext errorContext)
       throws XMLStreamException {
-    reader.next();
-    String innerError = null;
-    if(reader.isCharacters()) {
-      innerError = reader.getText();
-    } else if(reader.isStartElement()) {
-      innerError = handleComplexInnerError(reader);
-    }
-    errorContext.setInnerError(innerError);
-  }
 
-  private String handleComplexInnerError(XMLStreamReader reader) throws XMLStreamException {
     StringBuilder sb = new StringBuilder();
-    while(notFinished(reader, FormatXml.M_INNER_ERROR)) {
-      if(reader.hasName()) {
+    while (notFinished(reader, FormatXml.M_INNER_ERROR)) {
+      if (reader.hasName() && !FormatXml.M_INNER_ERROR.equals(reader.getLocalName())) {
         sb.append("<");
-        if(reader.isEndElement()) {
+        if (reader.isEndElement()) {
           sb.append("/");
         }
         sb.append(reader.getLocalName()).append(">");
-      } else if(reader.isCharacters()) {
+      } else if (reader.isCharacters()) {
         sb.append(reader.getText());
       }
       reader.next();
     }
-    return sb.toString();
+
+    errorContext.setInnerError(sb.toString());
   }
 
   private void handleMessage(final XMLStreamReader reader, final ODataErrorContext errorContext)

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1f37db3e/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
index 9776289..e5d6c65 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
@@ -43,14 +43,14 @@ public class JsonErrorDocumentConsumerTest extends AbstractConsumerTest {
   private static final String JSON_ERROR_DOCUMENT_INNER_ERROR = "{\"error\":{\"code\":\"ErrorCode\"," +
       "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, \"innererror\":\"Some InnerError\"}}";
   private static final String JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX = "{\"error\":{\"code\":\"ErrorCode\"," +
-          "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
-          "\"innererror\":{\"moreInner\":\"More Inner Error\"}}}";
+      "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
+      "\"innererror\":{\"moreInner\":\"More Inner Error\"}}}";
   private static final String JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX_OBJECT = "{\"error\":{\"code\":\"ErrorCode\"," +
-          "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
-          "\"innererror\":{\"moreInner\":\"More Inner Error\",\"secondInner\":\"Second\"}}}";
+      "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
+      "\"innererror\":{\"moreInner\":\"More Inner Error\",\"secondInner\":\"Second\"}}}";
   private static final String JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX_ARRAY = "{\"error\":{\"code\":\"ErrorCode\"," +
-          "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
-          "\"innererror\":{\"innerArray\":[\"More Inner Error\",\"Second\"]}}}";
+      "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
+      "\"innererror\":{\"innerArray\":[\"More Inner Error\",\"Second\"]}}}";
   private static final String JSON_ERROR_DOCUMENT_INVALID_JSON = "\"error\":{\"code\":\"ErrorCode\"," +
       "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}}}";
   /* error document with name 'locale' instead of 'lang' for message object */
@@ -119,7 +119,7 @@ public class JsonErrorDocumentConsumerTest extends AbstractConsumerTest {
     assertEquals("Wrong message", "Message", error.getMessage());
     assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
     assertEquals("Wrong inner error",
-            "{\"moreInner\":\"More Inner Error\",\"secondInner\":\"Second\"}", error.getInnerError());
+        "{\"moreInner\":\"More Inner Error\",\"secondInner\":\"Second\"}", error.getInnerError());
   }
 
   @Test
@@ -131,7 +131,7 @@ public class JsonErrorDocumentConsumerTest extends AbstractConsumerTest {
     assertEquals("Wrong message", "Message", error.getMessage());
     assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
     assertEquals("Wrong inner error",
-            "{\"innerArray\":[\"More Inner Error\"\"Second\"]}", error.getInnerError());
+        "{\"innerArray\":[\"More Inner Error\"\"Second\"]}", error.getInnerError());
   }
 
   @Test(expected = EntityProviderException.class)

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1f37db3e/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
index ff3cc4f..7092808 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
@@ -6,9 +6,9 @@
  * 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
@@ -37,70 +37,70 @@ import org.junit.Test;
 public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
 
   private static final String XML_ERROR_DOCUMENT_SIMPLE =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_NULL_LOCALE =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:lang=\"\">Message</message>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"\">Message</message>\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_INNER_ERROR =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
-                  "<innererror>Some InnerError</innererror>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "<innererror>Some InnerError</innererror>\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_INNER_ERROR_COMPLEX =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
-                  "<innererror>" +
-                  "<moreInner>More Inner Error</moreInner>" +
-                  "</innererror>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "<innererror>" +
+          "<moreInner>More Inner Error</moreInner>" +
+          "</innererror>\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_INVALID_XML =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</CODE>\n" +
-                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</CODE>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "</error>";
   /* error document with name 'locale' instead of 'lang' for message object */
   private static final String XML_ERROR_DOCUMENT_UNKNOWN_CONTENT =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:locale=\"en-US\">Message</message>\n" +
-                  "\t<privateMessage>Secret</privateMessage>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:locale=\"en-US\">Message</message>\n" +
+          "\t<privateMessage>Secret</privateMessage>\n" +
+          "</error>";
   /* error document without value for message object */
   private static final String XML_ERROR_DOCUMENT_EMPTY_MESSAGE =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:lang=\"en-US\" />\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\" />\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_MESSAGE =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_CODE =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
-                  "</error>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_ERROR =
-          "<?xml version='1.0' encoding='UTF-8'?>\n" +
-                  "<errorForMe xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-                  "\t<code>ErrorCode</code>\n" +
-                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
-                  "</errorForMe>";
+      "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<errorForMe xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "</errorForMe>";
   private XmlErrorDocumentConsumer xedc = new XmlErrorDocumentConsumer();
 
   @Test
@@ -159,6 +159,36 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
     assertEquals("Wrong inner error", "<moreInner>More Inner Error</moreInner>", error.getInnerError());
   }
 
+  @Test
+  public void innerErrorComplexTwo() throws Exception {
+    String innerErrorText = "<firstTag>tagText</firstTag><secondTag>secondText</secondTag>";
+    String innerError = "<innererror>" + innerErrorText + "</innererror>";
+    String errorDocument = XML_ERROR_DOCUMENT_INNER_ERROR_COMPLEX.replaceAll(
+        "<innererror.*error>", innerError);
+    InputStream in = StringHelper.encapsulate(errorDocument);
+    ODataErrorContext error = xedc.readError(in);
+
+    assertEquals("Wrong content type", "application/xml", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong inner error", innerErrorText, error.getInnerError());
+  }
+
+  @Test
+  public void innerErrorComplexMoreCharacters() throws Exception {
+    String innerErrorText = "\n\t<firstTag>tagText</firstTag>\n<secondTag>secondText</secondTag>\n";
+    String innerError = "<innererror>" + innerErrorText + "</innererror>";
+    String errorDocument = XML_ERROR_DOCUMENT_INNER_ERROR_COMPLEX.replaceAll(
+        "<innererror.*error>", innerError);
+    InputStream in = StringHelper.encapsulate(errorDocument);
+    ODataErrorContext error = xedc.readError(in);
+
+    assertEquals("Wrong content type", "application/xml", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong inner error", innerErrorText, error.getInnerError());
+  }
+
   @Test(expected = EntityProviderException.class)
   public void invalidJson() throws EntityProviderException {
     InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_INVALID_XML);
@@ -179,7 +209,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-              EntityProviderException.INVALID_STATE, e.getMessageReference());
+          EntityProviderException.INVALID_STATE, e.getMessageReference());
       throw e;
     }
   }
@@ -215,7 +245,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-              EntityProviderException.INVALID_STATE, e.getMessageReference());
+          EntityProviderException.INVALID_STATE, e.getMessageReference());
       throw e;
     }
   }
@@ -228,7 +258,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-              EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+          EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
       assertTrue(e.getMessage().contains("code"));
       throw e;
     }
@@ -242,7 +272,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-              EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+          EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
       assertTrue(e.getMessage().contains("message"));
       throw e;
     }


[07/38] git commit: [OLINGO-210] Set 1.3.0-SNAPSHOT version

Posted by mi...@apache.org.
[OLINGO-210] Set 1.3.0-SNAPSHOT version


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/5f87f643
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/5f87f643
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/5f87f643

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 5f87f64330a724c803d8f70bbf061983fb45d77e
Parents: 73da5c4
Author: Christian Amend <ch...@apache.org>
Authored: Mon Mar 24 16:17:25 2014 +0100
Committer: Christian Amend <ch...@apache.org>
Committed: Mon Mar 24 16:17:25 2014 +0100

----------------------------------------------------------------------
 odata2-annotation-processor/annotation-processor-api/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-core/pom.xml    | 2 +-
 odata2-annotation-processor/annotation-processor-ref/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-web/pom.xml     | 2 +-
 odata2-annotation-processor/pom.xml                              | 2 +-
 odata2-dist/janos/pom.xml                                        | 2 +-
 odata2-dist/javadoc/pom.xml                                      | 2 +-
 odata2-dist/jpa/pom.xml                                          | 2 +-
 odata2-dist/lib/pom.xml                                          | 2 +-
 odata2-dist/pom.xml                                              | 2 +-
 odata2-dist/ref/pom.xml                                          | 2 +-
 odata2-jpa-processor/jpa-api/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-core/pom.xml                            | 2 +-
 odata2-jpa-processor/jpa-ref/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-web/pom.xml                             | 2 +-
 odata2-jpa-processor/pom.xml                                     | 2 +-
 odata2-lib/odata-annotation/pom.xml                              | 2 +-
 odata2-lib/odata-api/pom.xml                                     | 2 +-
 odata2-lib/odata-core/pom.xml                                    | 2 +-
 odata2-lib/odata-fit/pom.xml                                     | 2 +-
 odata2-lib/odata-ref/pom.xml                                     | 2 +-
 odata2-lib/odata-testutil/pom.xml                                | 2 +-
 odata2-lib/odata-web/pom.xml                                     | 2 +-
 odata2-lib/pom.xml                                               | 2 +-
 odata2-sample/cars-annotation-archetype/pom.xml                  | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-jpa-archetype/pom.xml                         | 2 +-
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-service-archetype/pom.xml                     | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/pom.xml                                            | 2 +-
 pom.xml                                                          | 2 +-
 32 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-annotation-processor/annotation-processor-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml
index a85b263..b0c3bdb 100644
--- a/odata2-annotation-processor/annotation-processor-api/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-api/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml
index 09ea4cc..c91fba4 100644
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml
index f466317..c014d2e 100644
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-annotation-processor/annotation-processor-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-web/pom.xml b/odata2-annotation-processor/annotation-processor-web/pom.xml
index 4eb901c..64e5742 100644
--- a/odata2-annotation-processor/annotation-processor-web/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-web/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-annotation-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml
index 7802fd7..4df2244 100644
--- a/odata2-annotation-processor/pom.xml
+++ b/odata2-annotation-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-dist/janos/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/janos/pom.xml b/odata2-dist/janos/pom.xml
index 985f70b..441358a 100644
--- a/odata2-dist/janos/pom.xml
+++ b/odata2-dist/janos/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/javadoc/pom.xml b/odata2-dist/javadoc/pom.xml
index a9f032f..081d3f2 100644
--- a/odata2-dist/javadoc/pom.xml
+++ b/odata2-dist/javadoc/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-dist/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/jpa/pom.xml b/odata2-dist/jpa/pom.xml
index 67b16e5..ea4b142 100644
--- a/odata2-dist/jpa/pom.xml
+++ b/odata2-dist/jpa/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-dist/lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/lib/pom.xml b/odata2-dist/lib/pom.xml
index fba7d2c..937f1ed 100644
--- a/odata2-dist/lib/pom.xml
+++ b/odata2-dist/lib/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-dist/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/pom.xml b/odata2-dist/pom.xml
index d5d6a83..4c69edf 100644
--- a/odata2-dist/pom.xml
+++ b/odata2-dist/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-dist/ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/ref/pom.xml b/odata2-dist/ref/pom.xml
index 063fd21..674c4b1 100644
--- a/odata2-dist/ref/pom.xml
+++ b/odata2-dist/ref/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-jpa-processor/jpa-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml
index ef32790..69b80d6 100644
--- a/odata2-jpa-processor/jpa-api/pom.xml
+++ b/odata2-jpa-processor/jpa-api/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.2.0</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-jpa-processor/jpa-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml
index e510637..08f3be0 100644
--- a/odata2-jpa-processor/jpa-core/pom.xml
+++ b/odata2-jpa-processor/jpa-core/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.2.0</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index 2719e36..c981b62 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.2.0</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index 715df01..3c6c978 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-jpa-processor</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-jpa-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/pom.xml b/odata2-jpa-processor/pom.xml
index 980147f..e422512 100644
--- a/odata2-jpa-processor/pom.xml
+++ b/odata2-jpa-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent</artifactId>
-      <version>1.2.0</version>
+      <version>1.3.0-SNAPSHOT</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index 845c420..53795bd 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib</artifactId>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-lib/odata-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/pom.xml b/odata2-lib/odata-api/pom.xml
index edad6ee..53e2d58 100644
--- a/odata2-lib/odata-api/pom.xml
+++ b/odata2-lib/odata-api/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-lib/odata-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/pom.xml b/odata2-lib/odata-core/pom.xml
index f65716d..44c9232 100644
--- a/odata2-lib/odata-core/pom.xml
+++ b/odata2-lib/odata-core/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.2.0</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-lib/odata-fit/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/pom.xml b/odata2-lib/odata-fit/pom.xml
index 58f7061..301d180 100644
--- a/odata2-lib/odata-fit/pom.xml
+++ b/odata2-lib/odata-fit/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.2.0</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-lib/odata-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-ref/pom.xml b/odata2-lib/odata-ref/pom.xml
index 33f90d0..84a49d5 100644
--- a/odata2-lib/odata-ref/pom.xml
+++ b/odata2-lib/odata-ref/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.2.0</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-lib/odata-testutil/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/pom.xml b/odata2-lib/odata-testutil/pom.xml
index 938c081..49738a1 100644
--- a/odata2-lib/odata-testutil/pom.xml
+++ b/odata2-lib/odata-testutil/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib</artifactId>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-lib/odata-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-web/pom.xml b/odata2-lib/odata-web/pom.xml
index 6e84d8c..0f6e5e7 100644
--- a/odata2-lib/odata-web/pom.xml
+++ b/odata2-lib/odata-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-lib</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/pom.xml b/odata2-lib/pom.xml
index ba4f3f1..933db60 100644
--- a/odata2-lib/pom.xml
+++ b/odata2-lib/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
index be07b76..d565f61 100644
--- a/odata2-sample/cars-annotation-archetype/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -16,13 +16,13 @@
   <groupId>org.apache.olingo</groupId>
   <artifactId>olingo-odata2-sample-cars-annotation-archetype</artifactId>
   <name>${project.artifactId}</name>
-  <version>1.2.0</version>
+  <version>1.3.0-SNAPSHOT</version>
   <packaging>maven-archetype</packaging>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample</artifactId>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
index dfb3bd3..73e58d6 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -32,7 +32,7 @@
     <version.servlet-api>2.5</version.servlet-api>
     <version.jaxrs-api>2.0-m10</version.jaxrs-api>
     <version.slf4j>1.7.1</version.slf4j>
-    <version.olingo>1.2.0</version.olingo>
+    <version.olingo>1.3.0-SNAPSHOT</version.olingo>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-sample/cars-jpa-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/pom.xml b/odata2-sample/cars-jpa-archetype/pom.xml
index 0786edb..6089703 100644
--- a/odata2-sample/cars-jpa-archetype/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 	

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
index e7f8cde..39628c0 100644
--- a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
-		<version.olingo>1.2.0</version.olingo>
+		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
 		<version.eclipselink>2.5.1</version.eclipselink>
 		<version.javax.persistence>2.0.5</version.javax.persistence>
 	</properties>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-sample/cars-service-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/pom.xml b/odata2-sample/cars-service-archetype/pom.xml
index f9fb407..e6f434e 100644
--- a/odata2-sample/cars-service-archetype/pom.xml
+++ b/odata2-sample/cars-service-archetype/pom.xml
@@ -24,14 +24,14 @@
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-cars-service-archetype</artifactId>
     <name>${project.artifactId}</name>
-    <version>1.2.0</version>
+    <version>1.3.0-SNAPSHOT</version>
 
     <packaging>maven-archetype</packaging>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample</artifactId>
-        <version>1.2.0</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
index 9c09d10..83e7237 100644
--- a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
 		<version.slf4j>1.7.1</version.slf4j>
-		<version.olingo>1.2.0</version.olingo>
+		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
 	</properties>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index f06c4f4..ce867ab 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -15,7 +15,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent</artifactId>
-      <version>1.2.0</version>
+      <version>1.3.0-SNAPSHOT</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5f87f643/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index a5b67e7..55700ca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
 
 	<groupId>org.apache.olingo</groupId>
 	<artifactId>olingo-odata2-parent</artifactId>
-	<version>1.2.0</version>
+	<version>1.3.0-SNAPSHOT</version>
 	<packaging>pom</packaging>
 
 	<name>${project.artifactId}</name>


[33/38] git commit: [OLINGO-256] Minor code clean up

Posted by mi...@apache.org.
[OLINGO-256] Minor code clean up


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/1ac8e7d3
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/1ac8e7d3
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/1ac8e7d3

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 1ac8e7d33152fc5a03bbb6e4cd42537cf130743d
Parents: a938080
Author: Michael Bolz <mi...@apache.org>
Authored: Tue Apr 29 11:09:44 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Tue Apr 29 11:09:44 2014 +0200

----------------------------------------------------------------------
 .../odata2/core/batch/BatchRequestParser.java   | 84 +++++++++++---------
 .../odata2/core/batch/BatchRequestWriter.java   | 13 +--
 2 files changed, 55 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1ac8e7d3/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
index 1211cf8..6584ee9 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
@@ -155,8 +155,7 @@ public class BatchRequestParser {
 
   private BatchRequestPart parseMultipart(final Scanner scanner, final String boundary, final boolean isChangeSet)
       throws BatchException {
-    List<ODataRequest> requests = new ArrayList<ODataRequest>();
-    BatchRequestPart multipart;
+
     if (scanner.hasNext("--" + boundary + REG_EX_ZERO_OR_MORE_WHITESPACES)) {
       scanner.next();
       currentLineNumber++;
@@ -168,41 +167,9 @@ public class BatchRequestParser {
         throw new BatchException(BatchException.MISSING_CONTENT_TYPE);
       }
       if (isChangeSet) {
-        if (HttpContentType.APPLICATION_HTTP.equalsIgnoreCase(contentType)) {
-          validateEncoding(mimeHeaders.get(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING.toLowerCase(Locale.ENGLISH)));
-          parseNewLine(scanner);// mandatory
-
-          requests.add(parseRequest(scanner, true, boundary));
-          multipart = new BatchRequestPartImpl(false, requests);
-        } else {
-          throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent(HttpContentType.APPLICATION_HTTP));
-        }
+        return parseBatchRequestPartInChangeset(scanner, boundary, mimeHeaders, contentType);
       } else {
-        if (HttpContentType.APPLICATION_HTTP.equalsIgnoreCase(contentType)) {
-          validateEncoding(mimeHeaders.get(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING.toLowerCase(Locale.ENGLISH)));
-          parseNewLine(scanner);// mandatory
-          requests.add(parseRequest(scanner, false, boundary));
-          multipart = new BatchRequestPartImpl(false, requests);
-        } else if (contentType.matches(REG_EX_OPTIONAL_WHITESPACE + HttpContentType.MULTIPART_MIXED + ANY_CHARACTERS)) {
-          String changeSetBoundary = getBoundary(contentType);
-          if (boundary.equals(changeSetBoundary)) {
-            throw new BatchException(BatchException.INVALID_CHANGESET_BOUNDARY.addContent(currentLineNumber));
-          }
-          List<ODataRequest> changeSetRequests = new LinkedList<ODataRequest>();
-          parseNewLine(scanner);// mandatory
-          Pattern changeSetCloseDelimiter =
-              Pattern.compile("--" + changeSetBoundary + "--" + REG_EX_ZERO_OR_MORE_WHITESPACES);
-          while (!scanner.hasNext(changeSetCloseDelimiter)) {
-            BatchRequestPart part = parseMultipart(scanner, changeSetBoundary, true);
-            changeSetRequests.addAll(part.getRequests());
-          }
-          scanner.next(changeSetCloseDelimiter);
-          currentLineNumber++;
-          multipart = new BatchRequestPartImpl(true, changeSetRequests);
-        } else {
-          throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent(HttpContentType.MULTIPART_MIXED
-              + " or " + HttpContentType.APPLICATION_HTTP));
-        }
+        return parseBatchRequestPart(scanner, boundary, mimeHeaders, contentType);
       }
     } else if (scanner.hasNext(boundary + REG_EX_ZERO_OR_MORE_WHITESPACES)) {
       currentLineNumber++;
@@ -215,8 +182,51 @@ public class BatchRequestParser {
       currentLineNumber++;
       throw new BatchException(BatchException.MISSING_BOUNDARY_DELIMITER.addContent(currentLineNumber));
     }
-    return multipart;
+  }
+
+  private BatchRequestPart parseBatchRequestPart(final Scanner scanner, final String boundary,
+                                                 final Map<String, String> mimeHeaders,
+                                                 final String contentType) throws BatchException {
+    if (HttpContentType.APPLICATION_HTTP.equalsIgnoreCase(contentType)) {
+      validateEncoding(mimeHeaders.get(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING.toLowerCase(Locale.ENGLISH)));
+      parseNewLine(scanner);// mandatory
+      List<ODataRequest> requests = new ArrayList<ODataRequest>(1);
+      requests.add(parseRequest(scanner, false, boundary));
+      return new BatchRequestPartImpl(false, requests);
+    } else if (contentType.matches(REG_EX_OPTIONAL_WHITESPACE + HttpContentType.MULTIPART_MIXED + ANY_CHARACTERS)) {
+      String changeSetBoundary = getBoundary(contentType);
+      if (boundary.equals(changeSetBoundary)) {
+        throw new BatchException(BatchException.INVALID_CHANGESET_BOUNDARY.addContent(currentLineNumber));
+      }
+      List<ODataRequest> changeSetRequests = new LinkedList<ODataRequest>();
+      parseNewLine(scanner);// mandatory
+      Pattern changeSetCloseDelimiter =
+          Pattern.compile("--" + changeSetBoundary + "--" + REG_EX_ZERO_OR_MORE_WHITESPACES);
+      while (!scanner.hasNext(changeSetCloseDelimiter)) {
+        BatchRequestPart part = parseMultipart(scanner, changeSetBoundary, true);
+        changeSetRequests.addAll(part.getRequests());
+      }
+      scanner.next(changeSetCloseDelimiter);
+      currentLineNumber++;
+      return new BatchRequestPartImpl(true, changeSetRequests);
+    } else {
+      throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent(HttpContentType.MULTIPART_MIXED
+          + " or " + HttpContentType.APPLICATION_HTTP));
+    }
+  }
 
+  private BatchRequestPart parseBatchRequestPartInChangeset(final Scanner scanner, final String boundary,
+                                                            final Map<String, String> mimeHeaders,
+                                                            final String contentType) throws BatchException {
+    if (HttpContentType.APPLICATION_HTTP.equalsIgnoreCase(contentType)) {
+      validateEncoding(mimeHeaders.get(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING.toLowerCase(Locale.ENGLISH)));
+      parseNewLine(scanner);// mandatory
+      List<ODataRequest> requests = new ArrayList<ODataRequest>(1);
+      requests.add(parseRequest(scanner, true, boundary));
+      return new BatchRequestPartImpl(false, requests);
+    } else {
+      throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent(HttpContentType.APPLICATION_HTTP));
+    }
   }
 
   private ODataRequest parseRequest(final Scanner scanner, final boolean isChangeSet, final String boundary)

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1ac8e7d3/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
index 40cf0e0..63453c2 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
@@ -38,6 +38,8 @@ public class BatchRequestWriter {
   private static final String COLON = ":";
   private static final String SP = " ";
   private static final String LF = "\r\n";
+  public static final String BOUNDARY_PREAMBLE = "changeset";
+  public static final String HTTP_1_1 = "HTTP/1.1";
   private String batchBoundary;
   private StringBuilder writer = new StringBuilder();
 
@@ -48,7 +50,7 @@ public class BatchRequestWriter {
       throw new IllegalArgumentException();
     }
     for (BatchPart batchPart : batchParts) {
-      writer.append("--" + boundary).append(LF);
+      writer.append("--").append(boundary).append(LF);
       if (batchPart instanceof BatchChangeSet) {
         appendChangeSet((BatchChangeSet) batchPart);
       } else if (batchPart instanceof BatchQueryPart) {
@@ -64,9 +66,9 @@ public class BatchRequestWriter {
   }
 
   private void appendChangeSet(final BatchChangeSet batchChangeSet) {
-    String boundary = BatchHelper.generateBoundary("changeset");
+    String boundary = BatchHelper.generateBoundary(BOUNDARY_PREAMBLE);
     while (boundary.equals(batchBoundary) || !boundary.matches(REG_EX_BOUNDARY)) {
-      boundary = BatchHelper.generateBoundary("changeset");
+      boundary = BatchHelper.generateBoundary(BOUNDARY_PREAMBLE);
     }
     writer.append(HttpHeaders.CONTENT_TYPE).append(COLON).append(SP).append(
         HttpContentType.MULTIPART_MIXED + "; boundary=" + boundary).append(LF);
@@ -83,7 +85,8 @@ public class BatchRequestWriter {
     boolean isContentLengthPresent = false;
     writer.append(HttpHeaders.CONTENT_TYPE).append(COLON).append(SP).append(HttpContentType.APPLICATION_HTTP)
         .append(LF);
-    writer.append(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING).append(COLON).append(SP).append("binary").append(LF);
+    writer.append(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING).append(COLON).append(SP)
+            .append(BatchHelper.BINARY_ENCODING).append(LF);
     if (contentId != null) {
       writer.append(BatchHelper.HTTP_CONTENT_ID).append(COLON).append(SP).append(contentId).append(LF);
     }
@@ -92,7 +95,7 @@ public class BatchRequestWriter {
       isContentLengthPresent = true;
     }
     writer.append(LF);
-    writer.append(method).append(SP).append(uri).append(SP).append("HTTP/1.1");
+    writer.append(method).append(SP).append(uri).append(SP).append(HTTP_1_1);
     writer.append(LF);
 
     if (!isContentLengthPresent && body != null && !body.isEmpty()) {


[14/38] git commit: [OLINGO-196] Improved innerError handling (XML/JSON)

Posted by mi...@apache.org.
[OLINGO-196] Improved innerError handling (XML/JSON)


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/6a5fc6ce
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/6a5fc6ce
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/6a5fc6ce

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 6a5fc6ce6d41329360f63688fb8bc2ddf14c63b6
Parents: c8cdf37
Author: Michael Bolz <mi...@apache.org>
Authored: Wed Mar 26 15:10:37 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Wed Mar 26 15:10:37 2014 +0100

----------------------------------------------------------------------
 .../ep/consumer/JsonErrorDocumentConsumer.java  |  49 +++++++-
 .../ep/consumer/XmlErrorDocumentConsumer.java   |  31 ++++-
 .../consumer/JsonErrorDocumentConsumerTest.java |  44 +++++++
 .../consumer/XmlErrorDocumentConsumerTest.java  | 124 +++++++++++--------
 4 files changed, 188 insertions(+), 60 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/6a5fc6ce/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
index 9348b2a..5f5610b 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
@@ -127,12 +127,49 @@ public class JsonErrorDocumentConsumer {
   }
 
   private void parseInnerError(final JsonReader reader, final ODataErrorContext errorContext) throws IOException {
-    // implementation for parse content as provided by JsonErrorDocumentProducer
-    String innerError = reader.nextString();
-    errorContext.setInnerError(innerError);
-    // implementation for OData v2 Section 2.2.8.1.2 JSON Error Response
-    // (RFC4627 Section 2.2 -> https://www.ietf.org/rfc/rfc4627.txt))
-    // currently not provided
+    if(reader.peek() == JsonToken.STRING) {
+      // implementation for parse content as provided by JsonErrorDocumentProducer
+      String innerError = reader.nextString();
+      errorContext.setInnerError(innerError);
+    } else if(reader.peek() == JsonToken.BEGIN_OBJECT) {
+      // implementation for OData v2 Section 2.2.8.1.2 JSON Error Response
+      // (RFC4627 Section 2.2 -> https://www.ietf.org/rfc/rfc4627.txt))
+      // currently partial provided
+      errorContext.setInnerError(readJson(reader));
+    }
+  }
+
+
+  private String readJson(JsonReader reader) throws  IOException {
+    StringBuilder sb = new StringBuilder();
+
+    while(reader.hasNext()) {
+      if(reader.peek() == JsonToken.NAME) {
+        if(sb.length() > 0) {
+          sb.append(",");
+        }
+        String name = reader.nextName();
+        sb.append("\"").append(name).append("\"").append(":");
+      } else if(reader.peek() == JsonToken.BEGIN_OBJECT) {
+        reader.beginObject();
+        sb.append("{");
+        sb.append(readJson(reader));
+        sb.append("}");
+        reader.endObject();
+      } else if(reader.peek() == JsonToken.BEGIN_ARRAY) {
+        reader.beginArray();
+        sb.append("[");
+        sb.append(readJson(reader));
+        sb.append("]");
+        reader.endArray();
+      } else {
+        sb.append("\"");
+        sb.append(reader.nextString());
+        sb.append("\"");
+      }
+    }
+
+    return sb.toString();
   }
 
   private void parseMessage(final JsonReader reader, final ODataErrorContext errorContext)

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/6a5fc6ce/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
index d584951..4b6b8ac 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -136,16 +136,43 @@ public class XmlErrorDocumentConsumer {
   }
 
   private boolean notFinished(final XMLStreamReader reader) throws XMLStreamException {
-    boolean finished = reader.isEndElement() && FormatXml.M_ERROR.equals(reader.getLocalName());
+    return notFinished(reader, FormatXml.M_ERROR);
+  }
+
+  private boolean notFinished(final XMLStreamReader reader, String tagName) throws XMLStreamException {
+    boolean finished = reader.isEndElement() && tagName.equals(reader.getLocalName());
     return !finished && reader.hasNext();
   }
 
   private void handleInnerError(final XMLStreamReader reader, final ODataErrorContext errorContext)
       throws XMLStreamException {
-    String innerError = reader.getElementText();
+    reader.next();
+    String innerError = null;
+    if(reader.isCharacters()) {
+      innerError = reader.getText();
+    } else if(reader.isStartElement()) {
+      innerError = handleComplexInnerError(reader);
+    }
     errorContext.setInnerError(innerError);
   }
 
+  private String handleComplexInnerError(XMLStreamReader reader) throws XMLStreamException {
+    StringBuilder sb = new StringBuilder();
+    while(notFinished(reader, FormatXml.M_INNER_ERROR)) {
+      if(reader.hasName()) {
+        sb.append("<");
+        if(reader.isEndElement()) {
+          sb.append("/");
+        }
+        sb.append(reader.getLocalName()).append(">");
+      } else if(reader.isCharacters()) {
+        sb.append(reader.getText());
+      }
+      reader.next();
+    }
+    return sb.toString();
+  }
+
   private void handleMessage(final XMLStreamReader reader, final ODataErrorContext errorContext)
       throws XMLStreamException {
     String lang = reader.getAttributeValue(Edm.NAMESPACE_XML_1998, FormatXml.XML_LANG);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/6a5fc6ce/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
index 204498d..9776289 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
@@ -42,6 +42,15 @@ public class JsonErrorDocumentConsumerTest extends AbstractConsumerTest {
       "\"message\":{\"lang\":null,\"value\":\"Message\"}}}";
   private static final String JSON_ERROR_DOCUMENT_INNER_ERROR = "{\"error\":{\"code\":\"ErrorCode\"," +
       "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, \"innererror\":\"Some InnerError\"}}";
+  private static final String JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX = "{\"error\":{\"code\":\"ErrorCode\"," +
+          "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
+          "\"innererror\":{\"moreInner\":\"More Inner Error\"}}}";
+  private static final String JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX_OBJECT = "{\"error\":{\"code\":\"ErrorCode\"," +
+          "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
+          "\"innererror\":{\"moreInner\":\"More Inner Error\",\"secondInner\":\"Second\"}}}";
+  private static final String JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX_ARRAY = "{\"error\":{\"code\":\"ErrorCode\"," +
+          "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, " +
+          "\"innererror\":{\"innerArray\":[\"More Inner Error\",\"Second\"]}}}";
   private static final String JSON_ERROR_DOCUMENT_INVALID_JSON = "\"error\":{\"code\":\"ErrorCode\"," +
       "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}}}";
   /* error document with name 'locale' instead of 'lang' for message object */
@@ -90,6 +99,41 @@ public class JsonErrorDocumentConsumerTest extends AbstractConsumerTest {
     assertEquals("Wrong inner error", "Some InnerError", error.getInnerError());
   }
 
+  @Test
+  public void innerErrorComplex() throws Exception {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX);
+    ODataErrorContext error = jedc.readError(in);
+
+    assertEquals("Wrong content type", "application/json", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong inner error", "{\"moreInner\":\"More Inner Error\"}", error.getInnerError());
+  }
+
+  @Test
+  public void innerErrorComplexObject() throws Exception {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX_OBJECT);
+    ODataErrorContext error = jedc.readError(in);
+
+    assertEquals("Wrong content type", "application/json", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong inner error",
+            "{\"moreInner\":\"More Inner Error\",\"secondInner\":\"Second\"}", error.getInnerError());
+  }
+
+  @Test
+  public void innerErrorComplexArray() throws Exception {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_INNER_ERROR_COMPLEX_ARRAY);
+    ODataErrorContext error = jedc.readError(in);
+
+    assertEquals("Wrong content type", "application/json", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong inner error",
+            "{\"innerArray\":[\"More Inner Error\"\"Second\"]}", error.getInnerError());
+  }
+
   @Test(expected = EntityProviderException.class)
   public void invalidJson() throws EntityProviderException {
     InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_INVALID_JSON);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/6a5fc6ce/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
index 55ceb1d..ff3cc4f 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
@@ -6,9 +6,9 @@
  * 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
@@ -32,66 +32,75 @@ import org.apache.olingo.odata2.testutil.helper.StringHelper;
 import org.junit.Test;
 
 /**
- *  
+ *
  */
 public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
 
   private static final String XML_ERROR_DOCUMENT_SIMPLE =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<code>ErrorCode</code>\n" +
-          "\t<message xml:lang=\"en-US\">Message</message>\n" +
-          "</error>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
+                  "</error>";
   private static final String XML_ERROR_DOCUMENT_NULL_LOCALE =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<code>ErrorCode</code>\n" +
-          "\t<message xml:lang=\"\">Message</message>\n" +
-          "</error>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:lang=\"\">Message</message>\n" +
+                  "</error>";
   private static final String XML_ERROR_DOCUMENT_INNER_ERROR =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<code>ErrorCode</code>\n" +
-          "\t<message xml:lang=\"en-US\">Message</message>\n" +
-          "<innererror>Some InnerError</innererror>\n" +
-          "</error>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
+                  "<innererror>Some InnerError</innererror>\n" +
+                  "</error>";
+  private static final String XML_ERROR_DOCUMENT_INNER_ERROR_COMPLEX =
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
+                  "<innererror>" +
+                  "<moreInner>More Inner Error</moreInner>" +
+                  "</innererror>\n" +
+                  "</error>";
   private static final String XML_ERROR_DOCUMENT_INVALID_XML =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<code>ErrorCode</CODE>\n" +
-          "\t<message xml:lang=\"en-US\">Message</message>\n" +
-          "</error>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</CODE>\n" +
+                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
+                  "</error>";
   /* error document with name 'locale' instead of 'lang' for message object */
   private static final String XML_ERROR_DOCUMENT_UNKNOWN_CONTENT =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<code>ErrorCode</code>\n" +
-          "\t<message xml:locale=\"en-US\">Message</message>\n" +
-          "\t<privateMessage>Secret</privateMessage>\n" +
-          "</error>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:locale=\"en-US\">Message</message>\n" +
+                  "\t<privateMessage>Secret</privateMessage>\n" +
+                  "</error>";
   /* error document without value for message object */
   private static final String XML_ERROR_DOCUMENT_EMPTY_MESSAGE =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<code>ErrorCode</code>\n" +
-          "\t<message xml:lang=\"en-US\" />\n" +
-          "</error>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:lang=\"en-US\" />\n" +
+                  "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_MESSAGE =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<code>ErrorCode</code>\n" +
-          "</error>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_CODE =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<message xml:lang=\"en-US\">Message</message>\n" +
-          "</error>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
+                  "</error>";
   private static final String XML_ERROR_DOCUMENT_MISSING_ERROR =
-      "<?xml version='1.0' encoding='UTF-8'?>\n" +
-          "<errorForMe xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
-          "\t<code>ErrorCode</code>\n" +
-          "\t<message xml:lang=\"en-US\">Message</message>\n" +
-          "</errorForMe>";
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<errorForMe xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
+                  "</errorForMe>";
   private XmlErrorDocumentConsumer xedc = new XmlErrorDocumentConsumer();
 
   @Test
@@ -139,6 +148,17 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
     assertEquals("Wrong inner error", "Some InnerError", error.getInnerError());
   }
 
+  @Test
+  public void innerErrorComplex() throws Exception {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_INNER_ERROR_COMPLEX);
+    ODataErrorContext error = xedc.readError(in);
+
+    assertEquals("Wrong content type", "application/xml", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong inner error", "<moreInner>More Inner Error</moreInner>", error.getInnerError());
+  }
+
   @Test(expected = EntityProviderException.class)
   public void invalidJson() throws EntityProviderException {
     InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_INVALID_XML);
@@ -159,7 +179,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-          EntityProviderException.INVALID_STATE, e.getMessageReference());
+              EntityProviderException.INVALID_STATE, e.getMessageReference());
       throw e;
     }
   }
@@ -195,7 +215,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-          EntityProviderException.INVALID_STATE, e.getMessageReference());
+              EntityProviderException.INVALID_STATE, e.getMessageReference());
       throw e;
     }
   }
@@ -208,7 +228,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-          EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+              EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
       assertTrue(e.getMessage().contains("code"));
       throw e;
     }
@@ -222,7 +242,7 @@ public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
       fail("Expected exception was not thrown");
     } catch (EntityProviderException e) {
       assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
-          EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+              EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
       assertTrue(e.getMessage().contains("message"));
       throw e;
     }


[38/38] git commit: Merge branch 'master' into Olingo-129_PocJpaDataStore

Posted by mi...@apache.org.
Merge branch 'master' into Olingo-129_PocJpaDataStore


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/5cb6e15f
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/5cb6e15f
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/5cb6e15f

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 5cb6e15fc683d2b1b4934a537613ab46d976ca6a
Parents: 13b276f f86e307
Author: Michael Bolz <mi...@apache.org>
Authored: Sun May 18 00:04:06 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Sun May 18 00:04:06 2014 +0200

----------------------------------------------------------------------
 DISCLAIMER                                      |  16 --
 README                                          |   2 +-
 .../annotation-processor-api/pom.xml            |   8 +-
 .../processor/api/AnnotationServiceFactory.java |   2 +-
 .../annotation-processor-core/pom.xml           |  16 +-
 .../processor/core/ListsProcessor.java          |  11 +-
 .../core/edm/AnnotationEdmProvider.java         |  62 ++--
 .../processor/core/util/AnnotationHelper.java   |   2 +-
 .../core/util/AnnotationRuntimeException.java   |   8 +-
 .../processor/core/util/ClassHelper.java        |  53 ++--
 .../core/edm/AnnotationEdmProviderTest.java     |   2 +-
 .../processor/core/util/ClassHelperTest.java    |  33 ++-
 .../annotation-processor-ref/pom.xml            |  16 +-
 .../annotation/processor/ref/model/City.java    |   2 +-
 .../processor/ref/model/Location.java           |   2 +-
 .../processor/ref/AbstractRefJsonTest.java      |   2 +-
 .../processor/ref/AbstractRefTest.java          |   2 +-
 .../processor/ref/AbstractRefXmlTest.java       |   2 +-
 .../processor/ref/EntryJsonCreateTest.java      |  60 ++--
 .../processor/ref/ServiceJsonTest.java          |   2 +-
 .../processor/ref/ServiceXmlTest.java           |   2 +-
 .../annotation-processor-web/pom.xml            |  10 +-
 odata2-annotation-processor/pom.xml             |   6 +-
 odata2-dist/janos/pom.xml                       |  16 +-
 .../janos/src/main/assembly/janos-assembly.xml  |  10 +-
 odata2-dist/javadoc/pom.xml                     |   6 +-
 odata2-dist/jpa/pom.xml                         |  16 +-
 .../jpa/src/main/assembly/jpa-assembly.xml      |  10 +-
 odata2-dist/lib/pom.xml                         |  12 +-
 .../lib/src/main/assembly/lib-assembly.xml      |   6 +-
 odata2-dist/pom.xml                             |   6 +-
 odata2-dist/ref/pom.xml                         |  22 +-
 odata2-jpa-processor/jpa-api/pom.xml            |   8 +-
 .../processor/api/ODataJPAServiceFactory.java   |  17 ++
 .../jpa/processor/api/OnJPAWriteContent.java    |  54 ++++
 .../api/exception/ODataJPARuntimeException.java |   4 +
 odata2-jpa-processor/jpa-core/pom.xml           |  14 +-
 .../processor/core/access/data/JPAEntity.java   |  66 +++--
 .../core/access/data/JPAEntityParser.java       | 105 +++++++
 .../core/access/model/JPAEdmNameBuilder.java    |   6 +-
 .../core/access/model/JPATypeConvertor.java     |  41 ++-
 .../core/model/JPAEdmFunctionImport.java        |   1 -
 .../processor/core/model/JPAEdmProperty.java    |   9 +-
 .../main/resources/jpaprocessor_msg.properties  |   2 +
 .../JPAEntityParserTestForStaticMethods.java    |  79 +++++
 .../core/access/data/JPAEntityTest.java         |  71 ++++-
 .../access/model/JPAEdmNameBuilderTest.java     |   4 +-
 .../processor/core/mock/ODataContextMock.java   |  14 +
 .../core/mock/ODataJPAContextMock.java          |   1 +
 .../core/mock/ODataJPAServiceFactoryMock.java   |  47 +++
 .../core/mock/OnJPAWriteContentMock.java        |  58 ++++
 .../processor/core/mock/data/EdmMockUtilV2.java |  57 +++-
 .../processor/core/mock/data/JPATypeMock.java   |  63 ++++
 .../core/mock/data/ODataEntryMockUtil.java      |  16 +-
 .../model/JPACustomProcessorNegativeMock.java   |   2 +-
 .../core/model/JPAEdmAssociationTest.java       |  10 +-
 odata2-jpa-processor/jpa-ref/pom.xml            |  44 ++-
 .../ref/converter/BlobToByteConverter.java      |  64 +++++
 .../jpa/processor/ref/model/Material.java       |  21 ++
 .../odata2/jpa/processor/ref/model/Note.java    |  13 +-
 .../odata2/jpa/processor/ref/model/NoteKey.java |  83 ++++++
 .../src/main/resources/META-INF/persistence.xml |   4 +
 odata2-jpa-processor/jpa-web/pom.xml            | 236 +++++++--------
 .../ref/extension/OnDBWriteContent.java         |  55 ++++
 .../ref/web/JPAReferenceServiceFactory.java     |   4 +
 .../main/resources/SQL_Insert_Note.properties   |   2 +-
 odata2-jpa-processor/pom.xml                    |   6 +-
 odata2-lib/odata-annotation/pom.xml             |   6 +-
 odata2-lib/odata-api/pom.xml                    |   6 +-
 .../odata2/api/edm/EdmEntityContainer.java      |  22 ++
 .../olingo/odata2/api/ep/EntityProvider.java    |  24 ++
 .../api/ep/EntityProviderReadProperties.java    |  19 +-
 .../api/ep/EntityProviderWriteProperties.java   |  27 +-
 .../api/exception/ODataMessageException.java    |   8 +-
 .../olingo/odata2/api/rt/RuntimeDelegate.java   |   2 +-
 odata2-lib/odata-core/pom.xml                   |  10 +-
 .../olingo/odata2/core/ODataContextImpl.java    |   2 +-
 .../olingo/odata2/core/ODataRequestHandler.java |   9 +-
 .../odata2/core/batch/BatchRequestParser.java   | 102 ++++---
 .../odata2/core/batch/BatchRequestWriter.java   |  24 +-
 .../odata2/core/batch/BatchResponseParser.java  |  11 +-
 .../olingo/odata2/core/commons/XmlHelper.java   |   4 +
 .../olingo/odata2/core/debug/DebugInfoBody.java |   4 +-
 .../odata2/core/debug/DebugInfoException.java   |   6 +-
 .../odata2/core/debug/DebugInfoRequest.java     |   2 +-
 .../odata2/core/debug/DebugInfoResponse.java    |   4 +-
 .../odata2/core/debug/DebugInfoRuntime.java     |   4 +-
 .../odata2/core/debug/DebugInfoServer.java      |   8 +-
 .../olingo/odata2/core/debug/DebugInfoUri.java  |   8 +-
 .../core/debug/ODataDebugResponseWrapper.java   |  35 +--
 .../olingo/odata2/core/edm/EdmDouble.java       |   8 -
 .../provider/EdmEntityContainerImplProv.java    | 111 +++++++-
 .../odata2/core/ep/AtomEntityProvider.java      |   8 +
 .../core/ep/ContentTypeBasedEntityProvider.java |   3 +
 .../odata2/core/ep/JsonEntityProvider.java      |   6 +
 .../odata2/core/ep/ProviderFacadeImpl.java      |   6 +
 .../core/ep/consumer/JsonEntryConsumer.java     |  23 +-
 .../ep/consumer/JsonErrorDocumentConsumer.java  | 244 ++++++++++++++++
 .../core/ep/consumer/JsonFeedConsumer.java      |   3 +-
 .../core/ep/consumer/JsonPropertyConsumer.java  |  33 ++-
 .../core/ep/consumer/XmlEntityConsumer.java     |   7 +-
 .../core/ep/consumer/XmlEntryConsumer.java      |  42 +--
 .../ep/consumer/XmlErrorDocumentConsumer.java   | 184 ++++++++++++
 .../core/ep/consumer/XmlFeedConsumer.java       |   2 +-
 .../core/ep/consumer/XmlPropertyConsumer.java   |  32 ++-
 .../ep/producer/AtomEntryEntityProducer.java    |  36 ++-
 .../ep/producer/JsonEntryEntityProducer.java    |  21 +-
 .../odata2/core/rest/ODataSubLocator.java       |   2 +-
 .../odata2/core/rt/RuntimeDelegateImpl.java     |   2 +-
 .../core/servlet/ODataExceptionWrapper.java     |   2 +-
 .../odata2/core/servlet/ODataServlet.java       |   2 +-
 .../olingo/odata2/core/servlet/RestUtil.java    |  18 +-
 .../odata2/core/ContentNegotiatorTest.java      |   8 +
 .../core/batch/BatchRequestParserTest.java      |   2 +
 .../odata2/core/batch/BatchRequestTest.java     | 285 +++++++++++++++++++
 .../core/batch/BatchRequestWriterTest.java      |  22 +-
 .../core/batch/BatchResponseParserTest.java     |   1 -
 .../odata2/core/batch/BatchResponseTest.java    | 141 +++++++++
 .../debug/ODataDebugResponseWrapperTest.java    |  30 +-
 .../EdmEntityContainerImplProvTest.java         | 105 +++++--
 .../ep/ODataEntityProviderPropertiesTest.java   |   9 +
 .../odata2/core/ep/ProviderFacadeImplTest.java  |  35 ++-
 .../core/ep/consumer/JsonEntryConsumerTest.java |  27 ++
 .../consumer/JsonEntryDeepInsertEntryTest.java  |  18 ++
 .../consumer/JsonErrorDocumentConsumerTest.java | 233 +++++++++++++++
 .../core/ep/consumer/JsonFeedConsumerTest.java  |   2 +
 .../ep/consumer/JsonPropertyConsumerTest.java   |  53 +++-
 .../core/ep/consumer/XmlEntityConsumerTest.java |  19 +-
 .../consumer/XmlErrorDocumentConsumerTest.java  | 280 ++++++++++++++++++
 .../core/ep/consumer/XmlFeedConsumerTest.java   |  27 ++
 .../ep/consumer/XmlPropertyConsumerTest.java    | 103 +++++--
 .../core/ep/producer/AtomEntryProducerTest.java |  30 ++
 .../producer/JsonEntryEntityProducerTest.java   |  24 ++
 .../core/exception/ODataExceptionTest.java      |  11 +-
 .../resources/JsonInlineRoomWithInlineNull.json |  44 +++
 .../odata-core/src/test/resources/JsonRoom.json |  24 ++
 .../src/test/resources/batchResponse.batch      |   2 -
 .../src/test/resources/feed_rooms_small.xml     |  69 +++++
 odata2-lib/odata-fit/pom.xml                    |  18 +-
 .../odata2/fit/basic/ServiceResolutionTest.java |  18 ++
 .../odata2/fit/ref/AbstractRefJsonTest.java     |   2 +-
 .../odata2/fit/ref/EntryJsonChangeTest.java     |  30 +-
 .../odata2/fit/ref/FunctionImportXmlTest.java   |  68 ++++-
 .../BasicContentNegotiationTest.java            |   2 +-
 odata2-lib/odata-ref/pom.xml                    |  12 +-
 odata2-lib/odata-testutil/pom.xml               |  10 +-
 .../odata2/testutil/fit/AbstractFitTest.java    |  11 +-
 .../testutil/fit/FitStaticServiceFactory.java   |   2 +-
 .../odata2/testutil/helper/StringHelper.java    |  99 ++++++-
 .../odata2/testutil/server/TestServer.java      |  42 +--
 odata2-lib/odata-web/pom.xml                    |  10 +-
 odata2-lib/pom.xml                              |   6 +-
 odata2-sample/cars-annotation-archetype/pom.xml |   8 +-
 .../main/resources/archetype-resources/pom.xml  |  12 +-
 odata2-sample/cars-jpa-archetype/pom.xml        |   6 +-
 .../main/resources/archetype-resources/pom.xml  |  12 +-
 odata2-sample/cars-service-archetype/pom.xml    |   8 +-
 .../main/resources/archetype-resources/pom.xml  |   4 +-
 odata2-sample/pom.xml                           |   6 +-
 pom.xml                                         |  13 +-
 160 files changed, 4002 insertions(+), 849 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5cb6e15f/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5cb6e15f/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --cc odata2-annotation-processor/annotation-processor-core/pom.xml
index d6d0bc9,c91fba4..f0ac6e2
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@@ -1,19 -1,19 +1,19 @@@
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 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. -->
 +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. -->
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 -  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
  
-   <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+   <artifactId>olingo-odata2-annotation-processor-core</artifactId>
    <packaging>jar</packaging>
    <name>${project.artifactId}</name>
  

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/5cb6e15f/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --cc odata2-annotation-processor/annotation-processor-ref/pom.xml
index 47951bc,c014d2e..5ec0c5b
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@@ -1,19 -1,19 +1,19 @@@
  <?xml version="1.0" encoding="UTF-8"?>
  <!-- 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. -->
 +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. -->
  <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 -  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 +         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
  
-   <artifactId>olingo-odata2-annotation-processor-ref-incubating</artifactId>
+   <artifactId>olingo-odata2-annotation-processor-ref</artifactId>
    <packaging>jar</packaging>
    <name>${project.artifactId}</name>
  
@@@ -68,32 -68,8 +68,32 @@@
  
    <dependencies>
      <dependency>
 +      <!-- required because of auto detection of web facet 2.5 -->
 +      <groupId>javax.servlet</groupId>
 +      <artifactId>servlet-api</artifactId>
 +      <version>2.5</version>
 +      <scope>test</scope>
 +    </dependency>
 +        
 +    <dependency>
 +      <groupId>org.eclipse.persistence</groupId>
 +      <artifactId>javax.persistence</artifactId>
 +      <version>2.1.0</version>    
 +    </dependency>
 +    <dependency>
 +      <groupId>org.hsqldb</groupId>
 +      <artifactId>hsqldb</artifactId>
 +      <version>1.8.0.10</version>
 +    </dependency>
 +    <dependency>
 +      <groupId>org.eclipse.persistence</groupId>
 +      <artifactId>eclipselink</artifactId>
 +      <version>2.5.1</version>
 +    </dependency>
 +
 +    <dependency>
        <groupId>org.apache.olingo</groupId>
-       <artifactId>olingo-odata2-api-incubating</artifactId>
+       <artifactId>olingo-odata2-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>


[16/38] [OLINGO-185] Handling java.sql.Blob and java.sql.Clob in JPA processor

Posted by mi...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index 3c6c978..b84f06f 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -1,123 +1,133 @@
 <?xml version="1.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. -->
-<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
-    xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
-    <modelVersion>4.0.0</modelVersion>
+<!-- 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. -->
+<project
+	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+	<modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-jpa-processor-ref-web</artifactId>
-    <packaging>war</packaging>
-    <name>${project.artifactId}</name>
+	<artifactId>olingo-odata2-jpa-processor-ref-web</artifactId>
+	<packaging>war</packaging>
+	<name>${project.artifactId}</name>
 
-    <parent>
-        <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-jpa-processor</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
-        <relativePath>..</relativePath>
-    </parent>
+	<parent>
+		<groupId>org.apache.olingo</groupId>
+		<artifactId>olingo-odata2-jpa-processor</artifactId>
+		<version>1.3.0-SNAPSHOT</version>
+		<relativePath>..</relativePath>
+	</parent>
 
-    <build>
-        <resources>
-            <resource>
-                <directory>src/main/version</directory>
-                <filtering>true</filtering>
-                <targetPath>../${project.build.finalName}/gen</targetPath>
-            </resource>
-            <resource>
-                <directory>src/main/resources</directory>
-                <filtering>true</filtering>
-            </resource>
-        </resources>
+	<build>
+		<resources>
+			<resource>
+				<directory>src/main/version</directory>
+				<filtering>true</filtering>
+				<targetPath>../${project.build.finalName}/gen</targetPath>
+			</resource>
+			<resource>
+				<directory>src/main/resources</directory>
+				<filtering>true</filtering>
+			</resource>
+		</resources>
 
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>com.sap.research</groupId>
-                    <artifactId>nwcloud-maven-plugin</artifactId>
-                    <version>1.0.0.RELEASE</version>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.maven.plugins</groupId>
-                    <artifactId>maven-deploy-plugin</artifactId>
-                    <configuration>
-                        <skip>true</skip>
-                    </configuration>
-                </plugin>
-            </plugins>
-        </pluginManagement>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<groupId>com.sap.research</groupId>
+					<artifactId>nwcloud-maven-plugin</artifactId>
+					<version>1.0.0.RELEASE</version>
+				</plugin>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-deploy-plugin</artifactId>
+					<configuration>
+						<skip>true</skip>
+					</configuration>
+				</plugin>
+			</plugins>
+		</pluginManagement>
 
-    </build>
+	</build>
 
-    <dependencies>
-        <dependency>
-            <!-- required because of auto detection of web facet 2.5 -->
-            <groupId>javax.servlet</groupId>
-            <artifactId>servlet-api</artifactId>
-            <version>2.5</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.cxf</groupId>
-            <artifactId>cxf-rt-frontend-jaxrs</artifactId>
-            <version>${cxf.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-ref</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>1.7.1</version>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>3.8.1</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
+	<dependencies>
+		<dependency>
+			<!-- required because of auto detection of web facet 2.5 -->
+			<groupId>javax.servlet</groupId>
+			<artifactId>servlet-api</artifactId>
+			<version>2.5</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.cxf</groupId>
+			<artifactId>cxf-rt-frontend-jaxrs</artifactId>
+			<version>${cxf.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.olingo</groupId>
+			<artifactId>olingo-odata2-core</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.olingo</groupId>
+			<artifactId>olingo-odata2-api</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.olingo</groupId>
+			<artifactId>olingo-odata2-jpa-processor-api</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.olingo</groupId>
+			<artifactId>olingo-odata2-jpa-processor-core</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.apache.olingo</groupId>
+			<artifactId>olingo-odata2-jpa-processor-ref</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>org.slf4j</groupId>
+			<artifactId>slf4j-log4j12</artifactId>
+			<version>1.7.1</version>
+		</dependency>
+		<dependency>
+			<groupId>org.hsqldb</groupId>
+			<artifactId>hsqldb</artifactId>
+			<version>2.3.2</version>
+		</dependency>
 
-    <profiles>
-        <profile>
-            <id>dev</id>
-            <build>
-                <defaultGoal>cargo:run</defaultGoal>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>3.8.1</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
 
-                <plugins>
-                    <plugin>
-                        <groupId>org.codehaus.cargo</groupId>
-                        <artifactId>cargo-maven2-plugin</artifactId>
-                        <version>1.4.2</version>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-    </profiles>
+	<profiles>
+		<profile>
+			<id>dev</id>
+			<build>
+				<defaultGoal>cargo:run</defaultGoal>
+
+				<plugins>
+					<plugin>
+						<groupId>org.codehaus.cargo</groupId>
+						<artifactId>cargo-maven2-plugin</artifactId>
+						<version>1.4.2</version>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
 </project>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
new file mode 100644
index 0000000..bcd85a2
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
@@ -0,0 +1,37 @@
+package org.apache.olingo.odata2.jpa.processor.ref.extension;
+
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.SQLException;
+
+import javax.sql.rowset.serial.SerialException;
+
+import org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+import org.hsqldb.jdbc.JDBCBlob;
+import org.hsqldb.jdbc.JDBCClob;
+
+public class OnDBWriteContent implements OnJPAWriteContent {
+
+  @Override
+  public Blob getJPABlob(byte[] binaryData) throws ODataJPARuntimeException {
+    try {
+      return new JDBCBlob(binaryData);
+    } catch (SerialException e) {
+      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    } catch (SQLException e) {
+      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    }
+    return null;
+  }
+
+  @Override
+  public Clob getJPAClob(char[] characterData) throws ODataJPARuntimeException {
+    try {
+      return new JDBCClob(new String(characterData));
+    } catch (SQLException e) {
+      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    }
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java
index f21d565..938e00d 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/web/JPAReferenceServiceFactory.java
@@ -22,8 +22,10 @@ import java.util.ResourceBundle;
 
 import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
 import org.apache.olingo.odata2.jpa.processor.api.ODataJPAServiceFactory;
+import org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent;
 import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
 import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmExtension;
+import org.apache.olingo.odata2.jpa.processor.ref.extension.OnDBWriteContent;
 import org.apache.olingo.odata2.jpa.processor.ref.extension.SalesOrderProcessingExtension;
 import org.apache.olingo.odata2.jpa.processor.ref.factory.JPAEntityManagerFactory;
 
@@ -33,6 +35,7 @@ public class JPAReferenceServiceFactory extends ODataJPAServiceFactory {
   private static final String CONFIG = "serviceConfig";
   private static final String SHOW_DETAIL_ERROR = "showDetailError";
   private static final int PAGE_SIZE = 5;
+  public static final OnJPAWriteContent onDBWriteContent = new OnDBWriteContent();
 
   @Override
   public ODataJPAContext initializeODataJPAContext()
@@ -45,6 +48,7 @@ public class JPAReferenceServiceFactory extends ODataJPAServiceFactory {
         .setJPAEdmExtension((JPAEdmExtension) new SalesOrderProcessingExtension());
     oDataJPAContext.setPageSize(PAGE_SIZE);
     setErrorLevel();
+    setOnWriteJPAContent(onDBWriteContent);
 
     return oDataJPAContext;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties
index 347c37a..56b747b 100644
--- a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties
@@ -17,4 +17,4 @@
 #        under the License.
 #-------------------------------------------------------------------------------
 
-note_query_1 = insert into T_NOTE (SO_ID , text, createdBy, creationDate,creationTime) values(2, 'Test_Note_1', 'CreatedBy_1','2013-01-01 00:00:00','00:00:23');
\ No newline at end of file
+note_query_1 = insert into T_NOTE (SO_ID , text, createdBy, creationDate,creationTime) values(2, 'Test_Note_1', 'CreatedBy_1','2013-01-01','00:00:23');
\ No newline at end of file


[34/38] git commit: remove incubator lable

Posted by mi...@apache.org.
remove incubator lable


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/3887f7b1
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/3887f7b1
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/3887f7b1

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 3887f7b17134813fadf07b2117ed08981b415c57
Parents: 1ac8e7d
Author: Stephan Klevenz <sk...@apache.org>
Authored: Mon May 5 15:28:21 2014 +0200
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Mon May 5 15:28:21 2014 +0200

----------------------------------------------------------------------
 pom.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/3887f7b1/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 55700ca..2548a84 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,14 +33,14 @@
 		</license>
 	</licenses>
 
-	<url>http://olingo.incubator.apache.org</url>
+	<url>http://olingo.apache.org</url>
 
 	<mailingLists>
 		<mailingList>
 			<name>Apache Olingo Developers Mailinglist</name>
-			<archive>http://mail-archives.apache.org/mod_mbox/incubator-olingo-dev/</archive>
-			<post>mailto:dev@olingo.incubator.apache.org</post>
-			<subscribe>mailto:dev-subscribe@olingo.incubator.apache.org</subscribe>
+			<archive>http://mail-archives.apache.org/mod_mbox/olingo-dev/</archive>
+			<post>mailto:dev@olingo.apache.org</post>
+			<subscribe>mailto:dev-subscribe@olingo.apache.org</subscribe>
 		</mailingList>
 	</mailingLists>
 


[04/38] git commit: [OLINGO-210] Delete incubating from artifact name

Posted by mi...@apache.org.
[OLINGO-210] Delete incubating from artifact name


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/96f38266
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/96f38266
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/96f38266

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 96f38266ff5354980e6b991683dfa83dec6f4bb8
Parents: cfe20cb
Author: Christian Amend <ch...@apache.org>
Authored: Fri Mar 21 09:35:51 2014 +0100
Committer: Christian Amend <ch...@apache.org>
Committed: Fri Mar 21 09:35:51 2014 +0100

----------------------------------------------------------------------
 DISCLAIMER                                      | 16 ----------------
 README                                          |  2 +-
 .../annotation-processor-api/pom.xml            |  6 +++---
 .../annotation-processor-core/pom.xml           | 14 +++++++-------
 .../annotation-processor-ref/pom.xml            | 14 +++++++-------
 .../annotation-processor-web/pom.xml            |  8 ++++----
 odata2-annotation-processor/pom.xml             |  4 ++--
 odata2-dist/janos/pom.xml                       | 14 +++++++-------
 .../janos/src/main/assembly/janos-assembly.xml  | 10 +++++-----
 odata2-dist/javadoc/pom.xml                     |  4 ++--
 odata2-dist/jpa/pom.xml                         | 14 +++++++-------
 .../jpa/src/main/assembly/jpa-assembly.xml      | 10 +++++-----
 odata2-dist/lib/pom.xml                         | 10 +++++-----
 .../lib/src/main/assembly/lib-assembly.xml      |  6 +++---
 odata2-dist/pom.xml                             |  4 ++--
 odata2-dist/ref/pom.xml                         | 20 ++++++++++----------
 odata2-jpa-processor/jpa-api/pom.xml            |  6 +++---
 odata2-jpa-processor/jpa-core/pom.xml           | 12 ++++++------
 .../core/model/JPAEdmAssociationTest.java       | 10 +++++-----
 odata2-jpa-processor/jpa-ref/pom.xml            |  6 +++---
 odata2-jpa-processor/jpa-web/pom.xml            | 14 +++++++-------
 odata2-jpa-processor/pom.xml                    |  4 ++--
 odata2-lib/odata-annotation/pom.xml             |  4 ++--
 odata2-lib/odata-api/pom.xml                    |  4 ++--
 odata2-lib/odata-core/pom.xml                   |  8 ++++----
 odata2-lib/odata-fit/pom.xml                    | 16 ++++++++--------
 odata2-lib/odata-ref/pom.xml                    | 10 +++++-----
 odata2-lib/odata-testutil/pom.xml               |  8 ++++----
 odata2-lib/odata-web/pom.xml                    |  8 ++++----
 odata2-lib/pom.xml                              |  4 ++--
 odata2-sample/cars-annotation-archetype/pom.xml |  4 ++--
 .../main/resources/archetype-resources/pom.xml  | 10 +++++-----
 odata2-sample/cars-jpa-archetype/pom.xml        |  4 ++--
 .../main/resources/archetype-resources/pom.xml  | 10 +++++-----
 odata2-sample/cars-service-archetype/pom.xml    |  4 ++--
 .../main/resources/archetype-resources/pom.xml  |  2 +-
 odata2-sample/pom.xml                           |  4 ++--
 pom.xml                                         |  3 +--
 38 files changed, 147 insertions(+), 164 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/DISCLAIMER
----------------------------------------------------------------------
diff --git a/DISCLAIMER b/DISCLAIMER
deleted file mode 100644
index 05e1815..0000000
--- a/DISCLAIMER
+++ /dev/null
@@ -1,16 +0,0 @@
-Apache Olingo is an effort undergoing incubation at the Apache Software
-Foundation (ASF), sponsored by the Apache Incubator PMC. 
-
-Incubation is required of all newly accepted projects until a further review 
-indicates that the infrastructure, communications, and decision making process 
-have stabilized in a manner consistent with other successful ASF projects. 
-
-While incubation status is not necessarily a reflection of the completeness 
-or stability of the code, it does indicate that the project has yet to be 
-fully endorsed by the ASF.
-
-For more information about the incubation status of the Olingo project you
-can go to the following pages:
-
-http://olingo.incubator.apache.org/
-http://incubator.apache.org/projects/olingo.html

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/README
----------------------------------------------------------------------
diff --git a/README b/README
index 5b53ce6..222df8b 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
 ==========================
-Apache Olingo (Incubation)
+Apache Olingo
 ==========================
 
 Apache Olingo is a Java library and extensions around

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-annotation-processor/annotation-processor-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml
index 033166d..a6ad772 100644
--- a/odata2-annotation-processor/annotation-processor-api/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-api/pom.xml
@@ -24,12 +24,12 @@
 	
   <parent>
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
+    <artifactId>olingo-odata2-annotation-processor</artifactId>
     <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 
-  <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+  <artifactId>olingo-odata2-annotation-processor-api</artifactId>
   <name>${project.artifactId}</name>
 
   <build>
@@ -77,7 +77,7 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-api-incubating</artifactId>
+      <artifactId>olingo-odata2-api</artifactId>
       <version>${project.version}</version>
     </dependency>
   </dependencies>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml
index c0871b2..57fef32 100644
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@ -13,13 +13,13 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
-  <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+  <artifactId>olingo-odata2-annotation-processor-core</artifactId>
   <packaging>jar</packaging>
   <name>${project.artifactId}</name>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
+    <artifactId>olingo-odata2-annotation-processor</artifactId>
     <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
@@ -67,29 +67,29 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+      <artifactId>olingo-odata2-annotation-processor-api</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+      <artifactId>olingo-odata2-api-annotation</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-api-incubating</artifactId>
+      <artifactId>olingo-odata2-api</artifactId>
       <version>${project.version}</version>
     </dependency>
     <!-- Test dependencies -->
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-core-incubating</artifactId>
+      <artifactId>olingo-odata2-core</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-testutil-incubating</artifactId>
+      <artifactId>olingo-odata2-testutil</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml
index 5a1f2a4..12cbfda 100644
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@ -13,13 +13,13 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
-  <artifactId>olingo-odata2-annotation-processor-ref-incubating</artifactId>
+  <artifactId>olingo-odata2-annotation-processor-ref</artifactId>
   <packaging>jar</packaging>
   <name>${project.artifactId}</name>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
+    <artifactId>olingo-odata2-annotation-processor</artifactId>
     <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
@@ -69,22 +69,22 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-api-incubating</artifactId>
+      <artifactId>olingo-odata2-api</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-core-incubating</artifactId>
+      <artifactId>olingo-odata2-core</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+      <artifactId>olingo-odata2-annotation-processor-api</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+      <artifactId>olingo-odata2-annotation-processor-core</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
@@ -95,7 +95,7 @@
     <!-- Test dependencies -->
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-testutil-incubating</artifactId>
+      <artifactId>olingo-odata2-testutil</artifactId>
       <version>${project.version}</version>
       <scope>test</scope>
     </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-annotation-processor/annotation-processor-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-web/pom.xml b/odata2-annotation-processor/annotation-processor-web/pom.xml
index 2075925..54dec5a 100644
--- a/odata2-annotation-processor/annotation-processor-web/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-web/pom.xml
@@ -13,13 +13,13 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
-  <artifactId>olingo-odata2-annotation-processor-ref-web-incubating</artifactId>
+  <artifactId>olingo-odata2-annotation-processor-ref-web</artifactId>
   <packaging>war</packaging>
   <name>${project.artifactId}</name>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
+    <artifactId>olingo-odata2-annotation-processor</artifactId>
     <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
@@ -75,12 +75,12 @@
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-annotation-processor-ref-incubating</artifactId>
+      <artifactId>olingo-odata2-annotation-processor-ref</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-core-incubating</artifactId>
+      <artifactId>olingo-odata2-core</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-annotation-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml
index 2b9b17a..2d3f6d8 100644
--- a/odata2-annotation-processor/pom.xml
+++ b/odata2-annotation-processor/pom.xml
@@ -11,13 +11,13 @@
     <modelVersion>4.0.0</modelVersion>
 
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
+    <artifactId>olingo-odata2-annotation-processor</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-parent-incubating</artifactId>
+        <artifactId>olingo-odata2-parent</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/janos/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/janos/pom.xml b/odata2-dist/janos/pom.xml
index 23a66d3..7093bae 100644
--- a/odata2-dist/janos/pom.xml
+++ b/odata2-dist/janos/pom.xml
@@ -10,13 +10,13 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-dist-janos-incubating</artifactId>
+    <artifactId>olingo-odata2-dist-janos</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-dist-incubating</artifactId>
+        <artifactId>olingo-odata2-dist</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
@@ -71,31 +71,31 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+            <artifactId>olingo-odata2-api-annotation</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api-incubating</artifactId>
+            <artifactId>olingo-odata2-api</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-core-incubating</artifactId>
+            <artifactId>olingo-odata2-core</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+            <artifactId>olingo-odata2-annotation-processor-api</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+            <artifactId>olingo-odata2-annotation-processor-core</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/janos/src/main/assembly/janos-assembly.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/janos/src/main/assembly/janos-assembly.xml b/odata2-dist/janos/src/main/assembly/janos-assembly.xml
index e60d23c..9d5634b 100644
--- a/odata2-dist/janos/src/main/assembly/janos-assembly.xml
+++ b/odata2-dist/janos/src/main/assembly/janos-assembly.xml
@@ -23,11 +23,11 @@
             <useTransitiveFiltering>true</useTransitiveFiltering>
             <scope>compile</scope>
             <includes>
-                <include>org.apache.olingo:olingo-odata2-core-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-api-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-api-annotation-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-annotation-processor-api-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-annotation-processor-core-incubating</include>
+                <include>org.apache.olingo:olingo-odata2-core</include>
+                <include>org.apache.olingo:olingo-odata2-api</include>
+                <include>org.apache.olingo:olingo-odata2-api-annotation</include>
+                <include>org.apache.olingo:olingo-odata2-annotation-processor-api</include>
+                <include>org.apache.olingo:olingo-odata2-annotation-processor-core</include>
             </includes>
         </dependencySet>
     </dependencySets>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/javadoc/pom.xml b/odata2-dist/javadoc/pom.xml
index 2f82b64..067961d 100644
--- a/odata2-dist/javadoc/pom.xml
+++ b/odata2-dist/javadoc/pom.xml
@@ -10,13 +10,13 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-dist-javadoc-incubating</artifactId>
+    <artifactId>olingo-odata2-dist-javadoc</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-dist-incubating</artifactId>
+        <artifactId>olingo-odata2-dist</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/jpa/pom.xml b/odata2-dist/jpa/pom.xml
index 788fdc3..bbe0002 100644
--- a/odata2-dist/jpa/pom.xml
+++ b/odata2-dist/jpa/pom.xml
@@ -10,13 +10,13 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-dist-jpa-incubating</artifactId>
+    <artifactId>olingo-odata2-dist-jpa</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-dist-incubating</artifactId>
+        <artifactId>olingo-odata2-dist</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
@@ -71,31 +71,31 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+            <artifactId>olingo-odata2-api-annotation</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api-incubating</artifactId>
+            <artifactId>olingo-odata2-api</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-core-incubating</artifactId>
+            <artifactId>olingo-odata2-core</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-api-incubating</artifactId>
+            <artifactId>olingo-odata2-jpa-processor-api</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-core-incubating</artifactId>
+            <artifactId>olingo-odata2-jpa-processor-core</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml b/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml
index 1e2e2da..9c0c7b8 100644
--- a/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml
+++ b/odata2-dist/jpa/src/main/assembly/jpa-assembly.xml
@@ -23,11 +23,11 @@
             <useTransitiveFiltering>true</useTransitiveFiltering>
             <scope>compile</scope>
             <includes>
-                <include>org.apache.olingo:olingo-odata2-core-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-api-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-api-annotation-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-jpa-processor-api-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-jpa-processor-core-incubating</include>
+                <include>org.apache.olingo:olingo-odata2-core</include>
+                <include>org.apache.olingo:olingo-odata2-api</include>
+                <include>org.apache.olingo:olingo-odata2-api-annotation</include>
+                <include>org.apache.olingo:olingo-odata2-jpa-processor-api</include>
+                <include>org.apache.olingo:olingo-odata2-jpa-processor-core</include>
                 <include>org.eclipse.persistence:javax.persistence</include>
             </includes>
         </dependencySet>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/lib/pom.xml b/odata2-dist/lib/pom.xml
index bc4e02f..43d68dd 100644
--- a/odata2-dist/lib/pom.xml
+++ b/odata2-dist/lib/pom.xml
@@ -10,13 +10,13 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-dist-lib-incubating</artifactId>
+    <artifactId>olingo-odata2-dist-lib</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-dist-incubating</artifactId>
+        <artifactId>olingo-odata2-dist</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
@@ -71,19 +71,19 @@
     <dependencies>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+            <artifactId>olingo-odata2-api-annotation</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api-incubating</artifactId>
+            <artifactId>olingo-odata2-api</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-core-incubating</artifactId>
+            <artifactId>olingo-odata2-core</artifactId>
             <version>${project.version}</version>
             <scope>compile</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/lib/src/main/assembly/lib-assembly.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/lib/src/main/assembly/lib-assembly.xml b/odata2-dist/lib/src/main/assembly/lib-assembly.xml
index 38fb94b..2b1eb94 100644
--- a/odata2-dist/lib/src/main/assembly/lib-assembly.xml
+++ b/odata2-dist/lib/src/main/assembly/lib-assembly.xml
@@ -23,9 +23,9 @@
             <useTransitiveFiltering>true</useTransitiveFiltering>
             <scope>compile</scope>
             <includes>
-                <include>org.apache.olingo:olingo-odata2-core-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-api-incubating</include>
-                <include>org.apache.olingo:olingo-odata2-api-annotation-incubating</include>
+                <include>org.apache.olingo:olingo-odata2-core</include>
+                <include>org.apache.olingo:olingo-odata2-api</include>
+                <include>org.apache.olingo:olingo-odata2-api-annotation</include>
             </includes>
         </dependencySet>
     </dependencySets>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/pom.xml b/odata2-dist/pom.xml
index f31d9c3..64b8811 100644
--- a/odata2-dist/pom.xml
+++ b/odata2-dist/pom.xml
@@ -10,13 +10,13 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-dist-incubating</artifactId>
+    <artifactId>olingo-odata2-dist</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-parent-incubating</artifactId>
+        <artifactId>olingo-odata2-parent</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-dist/ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/ref/pom.xml b/odata2-dist/ref/pom.xml
index 62fb5ff..2cb869d 100644
--- a/odata2-dist/ref/pom.xml
+++ b/odata2-dist/ref/pom.xml
@@ -10,13 +10,13 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-dist-ref-incubating</artifactId>
+    <artifactId>olingo-odata2-dist-ref</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-dist-incubating</artifactId>
+        <artifactId>olingo-odata2-dist</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
@@ -76,42 +76,42 @@
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-core-incubating</artifactId>
+            <artifactId>olingo-odata2-core</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api-incubating</artifactId>
+            <artifactId>olingo-odata2-api</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-api-incubating</artifactId>
+            <artifactId>olingo-odata2-jpa-processor-api</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-core-incubating</artifactId>
+            <artifactId>olingo-odata2-jpa-processor-core</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-ref-incubating</artifactId>
+            <artifactId>olingo-odata2-jpa-processor-ref</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+            <artifactId>olingo-odata2-annotation-processor-api</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+            <artifactId>olingo-odata2-annotation-processor-core</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-annotation-processor-ref-incubating</artifactId>
+            <artifactId>olingo-odata2-annotation-processor-ref</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-jpa-processor/jpa-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml
index d8ca788..bbac006 100644
--- a/odata2-jpa-processor/jpa-api/pom.xml
+++ b/odata2-jpa-processor/jpa-api/pom.xml
@@ -23,12 +23,12 @@
 
 	<parent>
 		<groupId>org.apache.olingo</groupId>
-		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
+		<artifactId>olingo-odata2-jpa-processor</artifactId>
 		<version>1.2.0-RC02</version>
 		<relativePath>../</relativePath>
 	</parent>
 
-	<artifactId>olingo-odata2-jpa-processor-api-incubating</artifactId>
+	<artifactId>olingo-odata2-jpa-processor-api</artifactId>
 	<packaging>jar</packaging>
 	<name>${project.artifactId}</name>
 	
@@ -84,7 +84,7 @@
 		<!-- OData Java Library -->
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-api-incubating</artifactId>
+			<artifactId>olingo-odata2-api</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 	</dependencies>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-jpa-processor/jpa-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml
index c351821..d0525f9 100644
--- a/odata2-jpa-processor/jpa-core/pom.xml
+++ b/odata2-jpa-processor/jpa-core/pom.xml
@@ -23,12 +23,12 @@
 
 	<parent>
 		<groupId>org.apache.olingo</groupId>
-		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
+		<artifactId>olingo-odata2-jpa-processor</artifactId>
 		<version>1.2.0-RC02</version>
 		<relativePath>../</relativePath>
 	</parent>
 
-	<artifactId>olingo-odata2-jpa-processor-core-incubating</artifactId>
+	<artifactId>olingo-odata2-jpa-processor-core</artifactId>
 	<packaging>jar</packaging>
 	<name>${project.artifactId}</name>
 	
@@ -80,7 +80,7 @@
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+			<artifactId>olingo-odata2-api-annotation</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 
@@ -98,12 +98,12 @@
 		<!-- ########################## -->
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-api-incubating</artifactId>
+			<artifactId>olingo-odata2-api</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-core-incubating</artifactId>
+			<artifactId>olingo-odata2-core</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 
@@ -112,7 +112,7 @@
 		<!-- ########################## -->
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-jpa-processor-api-incubating</artifactId>
+			<artifactId>olingo-odata2-jpa-processor-api</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
index 8c3b119..186a864 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
@@ -49,19 +49,19 @@ import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAAttributeMock;
 import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.SimpleType;
 import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.SimpleType.SimpleTypeA;
 import org.easymock.EasyMock;
-import org.junit.BeforeClass;
+import org.junit.Before;
 import org.junit.Test;
 
 public class JPAEdmAssociationTest extends JPAEdmTestModelView {
 
-  private static JPAEdmAssociation objAssociation = null;
+  private JPAEdmAssociation objAssociation = null;
   private static String ASSOCIATION_NAME = "SalesOrderHeader_String";
-  private static JPAEdmAssociationTest localView = null;
+  private JPAEdmAssociationTest localView = null;
   private static final String PUNIT_NAME = "salesorderprocessing";
   private int variant;
 
-  @BeforeClass
-  public static void setup() {
+  @Before
+  public void setup() {
     localView = new JPAEdmAssociationTest();
     objAssociation = new JPAEdmAssociation(localView, localView, localView, 1);
     try {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index 4d384cf..c806fcf 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -24,12 +24,12 @@
 
 	<parent>
 		<groupId>org.apache.olingo</groupId>
-		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
+		<artifactId>olingo-odata2-jpa-processor</artifactId>
 		<version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
 
-	<artifactId>olingo-odata2-jpa-processor-ref-incubating</artifactId>
+	<artifactId>olingo-odata2-jpa-processor-ref</artifactId>
 	<packaging>jar</packaging>
 	<name>${project.artifactId}</name>
 	
@@ -94,7 +94,7 @@
 		<!-- OData Annotation Support -->
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+			<artifactId>olingo-odata2-api-annotation</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 		

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index e92010a..9801d0d 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -10,13 +10,13 @@
     xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-jpa-processor-ref-web-incubating</artifactId>
+    <artifactId>olingo-odata2-jpa-processor-ref-web</artifactId>
     <packaging>war</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
+        <artifactId>olingo-odata2-jpa-processor</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
@@ -68,27 +68,27 @@
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-core-incubating</artifactId>
+            <artifactId>olingo-odata2-core</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-api-incubating</artifactId>
+            <artifactId>olingo-odata2-api</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-api-incubating</artifactId>
+            <artifactId>olingo-odata2-jpa-processor-api</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-core-incubating</artifactId>
+            <artifactId>olingo-odata2-jpa-processor-core</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-jpa-processor-ref-incubating</artifactId>
+            <artifactId>olingo-odata2-jpa-processor-ref</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-jpa-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/pom.xml b/odata2-jpa-processor/pom.xml
index 42522e5..df6e66f 100644
--- a/odata2-jpa-processor/pom.xml
+++ b/odata2-jpa-processor/pom.xml
@@ -11,13 +11,13 @@
     <modelVersion>4.0.0</modelVersion>
 
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
+    <artifactId>olingo-odata2-jpa-processor</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-parent-incubating</artifactId>
+      <artifactId>olingo-odata2-parent</artifactId>
       <version>1.2.0-RC02</version>
       <relativePath>..</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index aaa23e8..484b72a 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -16,12 +16,12 @@
 
   <parent>
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-lib-incubating</artifactId>
+    <artifactId>olingo-odata2-lib</artifactId>
     <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 
-  <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+  <artifactId>olingo-odata2-api-annotation</artifactId>
   <name>${project.artifactId}</name>
     <build>
         <plugins>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-lib/odata-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/pom.xml b/odata2-lib/odata-api/pom.xml
index 42908a8..5c9b6c4 100644
--- a/odata2-lib/odata-api/pom.xml
+++ b/odata2-lib/odata-api/pom.xml
@@ -21,13 +21,13 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
-	<artifactId>olingo-odata2-api-incubating</artifactId>
+	<artifactId>olingo-odata2-api</artifactId>
 	<packaging>jar</packaging>
 	<name>${project.artifactId}</name>
 
 	<parent>
 		<groupId>org.apache.olingo</groupId>
-		<artifactId>olingo-odata2-lib-incubating</artifactId>
+		<artifactId>olingo-odata2-lib</artifactId>
     <version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-lib/odata-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/pom.xml b/odata2-lib/odata-core/pom.xml
index 6128d98..9933231 100644
--- a/odata2-lib/odata-core/pom.xml
+++ b/odata2-lib/odata-core/pom.xml
@@ -21,13 +21,13 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
-	<artifactId>olingo-odata2-core-incubating</artifactId>
+	<artifactId>olingo-odata2-core</artifactId>
 	<packaging>jar</packaging>
 	<name>${project.artifactId}</name>
 
 	<parent>
 		<groupId>org.apache.olingo</groupId>
-		<artifactId>olingo-odata2-lib-incubating</artifactId>
+		<artifactId>olingo-odata2-lib</artifactId>
 		<version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
@@ -172,7 +172,7 @@
 
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-api-incubating</artifactId>
+			<artifactId>olingo-odata2-api</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 		<dependency>
@@ -189,7 +189,7 @@
         <!-- Test dependencies -->
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-testutil-incubating</artifactId>
+            <artifactId>olingo-odata2-testutil</artifactId>
             <version>${project.version}</version>
             <scope>test</scope>
         </dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-lib/odata-fit/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/pom.xml b/odata2-lib/odata-fit/pom.xml
index af54825..ad91faa 100644
--- a/odata2-lib/odata-fit/pom.xml
+++ b/odata2-lib/odata-fit/pom.xml
@@ -21,13 +21,13 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
-	<artifactId>olingo-odata2-fit-incubating</artifactId>
+	<artifactId>olingo-odata2-fit</artifactId>
 	<packaging>jar</packaging>
 	<name>${project.artifactId}</name>
 
 	<parent>
 		<groupId>org.apache.olingo</groupId>
-		<artifactId>olingo-odata2-lib-incubating</artifactId>
+		<artifactId>olingo-odata2-lib</artifactId>
 		<version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
@@ -83,7 +83,7 @@
 									<artifactItems>
 										<artifactItem>
 											<groupId>org.apache.olingo</groupId>
-											<artifactId>olingo-odata2-api-incubating</artifactId>
+											<artifactId>olingo-odata2-api</artifactId>
 											<version>${project.version}</version>
 											<outputDirectory>${project.build.directory}/api_dependency</outputDirectory>
 											<overWrite>true</overWrite>
@@ -101,7 +101,7 @@
 									<artifactItems>
 										<artifactItem>
 											<groupId>org.apache.olingo</groupId>
-											<artifactId>olingo-odata2-core-incubating</artifactId>
+											<artifactId>olingo-odata2-core</artifactId>
 											<version>${project.version}</version>
 											<outputDirectory>${project.build.directory}/core_dependency</outputDirectory>
 											<overWrite>true</overWrite>
@@ -119,7 +119,7 @@
 									<artifactItems>
 										<artifactItem>
 											<groupId>org.apache.olingo</groupId>
-											<artifactId>olingo-odata2-ref-incubating</artifactId>
+											<artifactId>olingo-odata2-ref</artifactId>
 											<version>${project.version}</version>
 											<outputDirectory>${project.build.directory}/ref_dependency</outputDirectory>
 											<overWrite>true</overWrite>
@@ -188,17 +188,17 @@
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-core-incubating</artifactId>
+			<artifactId>olingo-odata2-core</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-ref-incubating</artifactId>
+			<artifactId>olingo-odata2-ref</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-testutil-incubating</artifactId>
+			<artifactId>olingo-odata2-testutil</artifactId>
 			<version>${project.version}</version>
 			<scope>test</scope>
 		</dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-lib/odata-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-ref/pom.xml b/odata2-lib/odata-ref/pom.xml
index 7f641ec..82d683f 100644
--- a/odata2-lib/odata-ref/pom.xml
+++ b/odata2-lib/odata-ref/pom.xml
@@ -21,13 +21,13 @@
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 	<modelVersion>4.0.0</modelVersion>
 
-	<artifactId>olingo-odata2-ref-incubating</artifactId>
+	<artifactId>olingo-odata2-ref</artifactId>
 	<packaging>jar</packaging>
 	<name>${project.artifactId}</name>
 
 	<parent>
 		<groupId>org.apache.olingo</groupId>
-		<artifactId>olingo-odata2-lib-incubating</artifactId>
+		<artifactId>olingo-odata2-lib</artifactId>
 		<version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
@@ -76,7 +76,7 @@
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-api-incubating</artifactId>
+			<artifactId>olingo-odata2-api</artifactId>
 			<version>${project.version}</version>
 		</dependency>
 		<dependency>
@@ -87,13 +87,13 @@
     
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-core-incubating</artifactId>
+			<artifactId>olingo-odata2-core</artifactId>
 			<version>${project.version}</version>
 			<scope>test</scope>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-testutil-incubating</artifactId>
+			<artifactId>olingo-odata2-testutil</artifactId>
 			<version>${project.version}</version>
 			<scope>test</scope>
 		</dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-lib/odata-testutil/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/pom.xml b/odata2-lib/odata-testutil/pom.xml
index c84b781..63bacfb 100644
--- a/odata2-lib/odata-testutil/pom.xml
+++ b/odata2-lib/odata-testutil/pom.xml
@@ -13,13 +13,13 @@
   xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
   <modelVersion>4.0.0</modelVersion>
 
-  <artifactId>olingo-odata2-testutil-incubating</artifactId>
+  <artifactId>olingo-odata2-testutil</artifactId>
   <packaging>jar</packaging>
   <name>${project.artifactId}</name>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-lib-incubating</artifactId>
+    <artifactId>olingo-odata2-lib</artifactId>
     <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
@@ -53,12 +53,12 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-api-incubating</artifactId>
+      <artifactId>olingo-odata2-api</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+      <artifactId>olingo-odata2-api-annotation</artifactId>
       <version>${project.version}</version>
     </dependency>
     <dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-lib/odata-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-web/pom.xml b/odata2-lib/odata-web/pom.xml
index b37811a..3b1ce26 100644
--- a/odata2-lib/odata-web/pom.xml
+++ b/odata2-lib/odata-web/pom.xml
@@ -10,13 +10,13 @@
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-ref-web-incubating</artifactId>
+    <artifactId>olingo-odata2-ref-web</artifactId>
     <packaging>war</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-lib-incubating</artifactId>
+        <artifactId>olingo-odata2-lib</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
@@ -69,12 +69,12 @@
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-ref-incubating</artifactId>
+            <artifactId>olingo-odata2-ref</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
             <groupId>org.apache.olingo</groupId>
-            <artifactId>olingo-odata2-core-incubating</artifactId>
+            <artifactId>olingo-odata2-core</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/pom.xml b/odata2-lib/pom.xml
index a449ac5..e574903 100644
--- a/odata2-lib/pom.xml
+++ b/odata2-lib/pom.xml
@@ -11,13 +11,13 @@
     <modelVersion>4.0.0</modelVersion>
 
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-lib-incubating</artifactId>
+    <artifactId>olingo-odata2-lib</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-parent-incubating</artifactId>
+        <artifactId>olingo-odata2-parent</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
index f35c2b2..c5ad861 100644
--- a/odata2-sample/cars-annotation-archetype/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -14,14 +14,14 @@
   <modelVersion>4.0.0</modelVersion>
 
   <groupId>org.apache.olingo</groupId>
-  <artifactId>olingo-odata2-sample-cars-annotation-archetype-incubating</artifactId>
+  <artifactId>olingo-odata2-sample-cars-annotation-archetype</artifactId>
   <name>${project.artifactId}</name>
   <version>1.2.0-RC02</version>
   <packaging>maven-archetype</packaging>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-sample-incubating</artifactId>
+    <artifactId>olingo-odata2-sample</artifactId>
     <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
index b1e5460..c152975 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -95,29 +95,29 @@
     <!-- Apache Olingo Library dependencies -->
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-api-incubating</artifactId>
+      <artifactId>olingo-odata2-api</artifactId>
       <version>${version.olingo}</version>
     </dependency>
     <dependency>
-      <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+      <artifactId>olingo-odata2-api-annotation</artifactId>
       <groupId>org.apache.olingo</groupId>
       <type>jar</type>
       <version>${version.olingo}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-core-incubating</artifactId>
+      <artifactId>olingo-odata2-core</artifactId>
       <version>${version.olingo}</version>
     </dependency>
     <!-- Apache Olingo Annotation Processor Extension dependencies -->
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+      <artifactId>olingo-odata2-annotation-processor-api</artifactId>
       <version>${version.olingo}</version>
     </dependency>
     <dependency>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+      <artifactId>olingo-odata2-annotation-processor-core</artifactId>
       <version>${version.olingo}</version>
     </dependency>
     <!-- Additional dependencies -->

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-sample/cars-jpa-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/pom.xml b/odata2-sample/cars-jpa-archetype/pom.xml
index f8d69f2..4a96b26 100644
--- a/odata2-sample/cars-jpa-archetype/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/pom.xml
@@ -22,12 +22,12 @@
     <modelVersion>4.0.0</modelVersion>
 	<parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-sample-incubating</artifactId>
+        <artifactId>olingo-odata2-sample</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 	
-    <artifactId>olingo-odata2-sample-cars-jpa-archetype-incubating</artifactId>
+    <artifactId>olingo-odata2-sample-cars-jpa-archetype</artifactId>
     <name>${project.artifactId}</name>
     <packaging>maven-archetype</packaging>
     <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
index 3af001e..6369839 100644
--- a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
@@ -30,31 +30,31 @@
 		<!-- OData Annotation Support -->
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+			<artifactId>olingo-odata2-api-annotation</artifactId>
 			<version>${version.olingo}</version>
 		</dependency>
 
 		<!--OData Core Support -->
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-api-incubating</artifactId>
+			<artifactId>olingo-odata2-api</artifactId>
 			<version>${version.olingo}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-core-incubating</artifactId>
+			<artifactId>olingo-odata2-core</artifactId>
 			<version>${version.olingo}</version>
 		</dependency>
 
 		<!--OData JPA Processor Support -->
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-jpa-processor-api-incubating</artifactId>
+			<artifactId>olingo-odata2-jpa-processor-api</artifactId>
 			<version>${version.olingo}</version>
 		</dependency>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-jpa-processor-core-incubating</artifactId>
+			<artifactId>olingo-odata2-jpa-processor-core</artifactId>
 			<version>${version.olingo}</version>
 		</dependency>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-sample/cars-service-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/pom.xml b/odata2-sample/cars-service-archetype/pom.xml
index 877ec04..a548807 100644
--- a/odata2-sample/cars-service-archetype/pom.xml
+++ b/odata2-sample/cars-service-archetype/pom.xml
@@ -22,7 +22,7 @@
     <modelVersion>4.0.0</modelVersion>
 
     <groupId>org.apache.olingo</groupId>
-    <artifactId>olingo-odata2-sample-cars-service-archetype-incubating</artifactId>
+    <artifactId>olingo-odata2-sample-cars-service-archetype</artifactId>
     <name>${project.artifactId}</name>
     <version>1.2.0-RC02</version>
 
@@ -30,7 +30,7 @@
 
     <parent>
         <groupId>org.apache.olingo</groupId>
-        <artifactId>olingo-odata2-sample-incubating</artifactId>
+        <artifactId>olingo-odata2-sample</artifactId>
         <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
index ddaa73d..161df3f 100644
--- a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
@@ -73,7 +73,7 @@
 	<dependencies>
 		<dependency>
 			<groupId>org.apache.olingo</groupId>
-			<artifactId>olingo-odata2-core-incubating</artifactId>
+			<artifactId>olingo-odata2-core</artifactId>
 			<version>${version.olingo}</version>
 		</dependency>
 		<dependency>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index 4279e14..ec5db93 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -8,13 +8,13 @@
     the License. --><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
     <modelVersion>4.0.0</modelVersion>
 
-    <artifactId>olingo-odata2-sample-incubating</artifactId>
+    <artifactId>olingo-odata2-sample</artifactId>
     <packaging>pom</packaging>
     <name>${project.artifactId}</name>
 
     <parent>
       <groupId>org.apache.olingo</groupId>
-      <artifactId>olingo-odata2-parent-incubating</artifactId>
+      <artifactId>olingo-odata2-parent</artifactId>
       <version>1.2.0-RC02</version>
       <relativePath>..</relativePath>
     </parent>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/96f38266/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 6c235bf..9d68eb1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -11,7 +11,7 @@
 	<modelVersion>4.0.0</modelVersion>
 
 	<groupId>org.apache.olingo</groupId>
-	<artifactId>olingo-odata2-parent-incubating</artifactId>
+	<artifactId>olingo-odata2-parent</artifactId>
 	<version>1.2.0-RC02</version>
 	<packaging>pom</packaging>
 
@@ -256,7 +256,6 @@
 							</properties>
 							<resourceBundles>
 								<resourceBundle>org.apache:apache-jar-resource-bundle:1.4</resourceBundle>
-								<resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle>
 							</resourceBundles>
 						</configuration>
 					</execution>


[35/38] git commit: [OLINGO-275] Fix for xml and verified for json

Posted by mi...@apache.org.
[OLINGO-275] Fix for xml and verified for json


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/340d7c03
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/340d7c03
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/340d7c03

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 340d7c030d8818f065246b6511a4200adc196e43
Parents: 3887f7b
Author: Christian Amend <ch...@apache.org>
Authored: Thu May 8 15:41:09 2014 +0200
Committer: Christian Amend <ch...@apache.org>
Committed: Thu May 8 15:41:09 2014 +0200

----------------------------------------------------------------------
 .../core/ep/consumer/XmlEntityConsumer.java     |  2 +-
 .../core/ep/consumer/XmlEntryConsumer.java      | 20 ++++---
 .../core/ep/consumer/XmlFeedConsumer.java       |  2 +-
 .../core/ep/consumer/JsonEntryConsumerTest.java | 27 +++++++++
 .../consumer/JsonEntryDeepInsertEntryTest.java  |  2 +
 .../core/ep/consumer/JsonFeedConsumerTest.java  |  2 +
 .../core/ep/consumer/XmlEntityConsumerTest.java | 15 ++++-
 .../core/ep/consumer/XmlFeedConsumerTest.java   | 27 +++++++++
 .../odata-core/src/test/resources/JsonRoom.json | 24 ++++++++
 .../src/test/resources/feed_rooms_small.xml     | 62 ++++++++++++++++++++
 10 files changed, 170 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
index 5d73862..acbc77f 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
@@ -87,7 +87,7 @@ public class XmlEntityConsumer {
       reader = XmlHelper.createStreamReader(content);
       EntityInfoAggregator eia = EntityInfoAggregator.create(entitySet);
 
-      return new XmlEntryConsumer().readEntry(reader, eia, properties);
+      return new XmlEntryConsumer().readEntry(reader, eia, properties, false);
     } catch (EntityProviderException e) {
       cachedException = e;
       throw cachedException;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
index a6111d1..4bc9173 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
@@ -75,10 +75,14 @@ public class XmlEntryConsumer {
   private String currentHandledStartTagName;
 
   public ODataEntry readEntry(final XMLStreamReader reader, final EntityInfoAggregator eia,
-      final EntityProviderReadProperties readProperties) throws EntityProviderException {
+      final EntityProviderReadProperties readProperties, final boolean isInline) throws EntityProviderException {
     try {
       initialize(readProperties);
 
+      if (isInline) {
+        setETag(reader);
+      }
+
       while (reader.hasNext() && !isEntryEndTag(reader)) {
         reader.nextTag();
         if (reader.isStartElement()) {
@@ -206,7 +210,10 @@ public class XmlEntryConsumer {
 
   private void readEntry(final XMLStreamReader reader) throws EntityProviderException, XMLStreamException {
     reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_ENTRY);
+    setETag(reader);
+  }
 
+  private void setETag(final XMLStreamReader reader) {
     final String etag = reader.getAttributeValue(Edm.NAMESPACE_M_2007_08, FormatXml.M_ETAG);
     entryMetadata.setEtag(etag);
   }
@@ -278,7 +285,7 @@ public class XmlEntryConsumer {
     final EntityProviderReadProperties inlineProperties = createInlineProperties(readProperties, navigationProperty);
 
     // validations
-    boolean isFeed = isInlineFeedValidated(reader, eia, atomLinkType, navigationPropertyName);
+    boolean isFeed = isInlineFeedValidated(reader, eia, atomLinkType, navigationProperty);
 
     List<ODataEntry> inlineEntries = new ArrayList<ODataEntry>();
 
@@ -288,7 +295,7 @@ public class XmlEntryConsumer {
       if (reader.isStartElement() && Edm.NAMESPACE_ATOM_2005.equals(reader.getNamespaceURI())
           && FormatXml.ATOM_ENTRY.equals(reader.getLocalName())) {
         XmlEntryConsumer xec = new XmlEntryConsumer();
-        ODataEntry inlineEntry = xec.readEntry(reader, inlineEia, inlineProperties);
+        ODataEntry inlineEntry = xec.readEntry(reader, inlineEia, inlineProperties, true);
         inlineEntries.add(inlineEntry);
       }
       // next tag
@@ -462,13 +469,13 @@ public class XmlEntryConsumer {
    * @param reader xml content reader which already points to <code><m:inline> tag</code>
    * @param eia all necessary information about the entity
    * @param type the atom type attribute value of the <code>link</code> tag
-   * @param navigationPropertyName the navigation property name of the entity
+   * @param navigationProperty the navigation property name of the entity
    * @return <code>true</code> for <code>Feed</code> and <code>false</code> for <code>Entry</code>
    * @throws EntityProviderException is thrown if at least one validation fails.
    * @throws EdmException if edm access fails
    */
   private boolean isInlineFeedValidated(final XMLStreamReader reader, final EntityInfoAggregator eia,
-      final String type, final String navigationPropertyName) throws EntityProviderException, EdmException {
+      final String type, final EdmNavigationProperty navigationProperty) throws EntityProviderException, EdmException {
     boolean isFeed = false;
     try {
       reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_M_2007_08, FormatXml.M_INLINE);
@@ -477,9 +484,6 @@ public class XmlEntryConsumer {
       if (cType == null) {
         throw new EntityProviderException(EntityProviderException.INVALID_INLINE_CONTENT.addContent("xml data"));
       }
-
-      EdmNavigationProperty navigationProperty =
-          (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);
       EdmMultiplicity navigationMultiplicity = navigationProperty.getMultiplicity();
 
       switch (navigationMultiplicity) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
index 2ffec2e..9b427d5 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumer.java
@@ -106,7 +106,7 @@ public class XmlFeedConsumer {
 
     while (reader.hasNext() && !isFeedEndTag(reader)) {
       if (FormatXml.ATOM_ENTRY.equals(reader.getLocalName())) {
-        ODataEntry entry = xec.readEntry(reader, eia, entryReadProperties);
+        ODataEntry entry = xec.readEntry(reader, eia, entryReadProperties, true);
         results.add(entry);
       } else if (FormatXml.ATOM_TOMBSTONE_DELETED_ENTRY.equals(reader.getLocalName())) {
         reader.require(XMLStreamConstants.START_ELEMENT, FormatXml.ATOM_TOMBSTONE_NAMESPACE,

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumerTest.java
index 0d4a2f4..30539fb 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumerTest.java
@@ -33,6 +33,7 @@ import java.util.TimeZone;
 import org.apache.olingo.odata2.api.edm.EdmEntitySet;
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
 import org.apache.olingo.odata2.api.ep.EntityProviderReadProperties;
+import org.apache.olingo.odata2.api.ep.entry.EntryMetadata;
 import org.apache.olingo.odata2.api.ep.entry.MediaMetadata;
 import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
 import org.apache.olingo.odata2.testutil.mock.MockFacade;
@@ -44,6 +45,7 @@ import org.junit.Test;
 public class JsonEntryConsumerTest extends AbstractConsumerTest {
 
   private static final String SIMPLE_ENTRY_BUILDING = "JsonBuilding.json";
+  private static final String SIMPLE_ENTRY_ROOM = "JsonRoom.json";
   private static final String SIMPLE_ENTRY_EMPLOYEE = "JsonEmployee.json";
   private static final String SIMPLE_ENTRY_TEAM = "JsonTeam.json";
   private static final String INVALID_ENTRY_TEAM_DOUBLE_NAME_PROPERTY = "JsonInvalidTeamDoubleNameProperty.json";
@@ -63,6 +65,31 @@ public class JsonEntryConsumerTest extends AbstractConsumerTest {
     JsonEntityConsumer xec = new JsonEntityConsumer();
     xec.readEntry(entitySet, contentBody, DEFAULT_PROPERTIES);
   }
+  
+  @Test
+  public void readSimpleRoomEntry() throws Exception {
+    ODataEntry roomEntry = prepareAndExecuteEntry(SIMPLE_ENTRY_ROOM, "Rooms", DEFAULT_PROPERTIES);
+
+    // verify
+    Map<String, Object> properties = roomEntry.getProperties();
+    assertEquals(4, properties.size());
+
+    assertEquals("1", properties.get("Id"));
+    assertEquals("Room 1", properties.get("Name"));
+    assertEquals((short) 1, properties.get("Seats"));
+    assertEquals((short) 1, properties.get("Version"));
+
+    List<String> associationUris = roomEntry.getMetadata().getAssociationUris("nr_Employees");
+    assertEquals(1, associationUris.size());
+    assertEquals("http://localhost:8080/ReferenceScenario.svc/Rooms('1')/nr_Employees", associationUris.get(0));
+
+    associationUris = roomEntry.getMetadata().getAssociationUris("nr_Building");
+    assertEquals(1, associationUris.size());
+    assertEquals("http://localhost:8080/ReferenceScenario.svc/Rooms('1')/nr_Building", associationUris.get(0));
+
+    EntryMetadata metadata = roomEntry.getMetadata();
+    assertEquals("W/\"1\"",metadata.getEtag());
+  }
 
   @SuppressWarnings("unchecked")
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java
index 1a057af..d35bbe4 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java
@@ -161,6 +161,8 @@ public class JsonEntryDeepInsertEntryTest extends AbstractConsumerTest {
 
     associationUris = innerRoom.getMetadata().getAssociationUris("nr_Building");
     assertEquals(Collections.emptyList(), associationUris);
+    
+    assertEquals("W/\"1\"", innerRoom.getMetadata().getEtag());
 
     ODataEntry innerBuilding = (ODataEntry) innerRoomProperties.get("nr_Building");
     assertNotNull(innerBuilding);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumerTest.java
index 3d9201c..6495b73 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumerTest.java
@@ -507,6 +507,8 @@ public class JsonFeedConsumerTest extends AbstractConsumerTest {
     assertNotNull(feedMetadata);
     assertEquals("http://localhost:8080/ReferenceScenario.svc/Rooms?!deltatoken=4711", feedMetadata.getDeltaLink());
 
+    assertEquals("W/\"2\"", entries.get(0).getMetadata().getEtag());
+
     List<DeletedEntryMetadata> deletedEntries = feed.getDeletedEntries();
     assertEquals(2, deletedEntries.size());
     for (DeletedEntryMetadata deletedEntry : deletedEntries) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
index 59df942..45e9861 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
@@ -804,14 +804,20 @@ public class XmlEntityConsumerTest extends AbstractXmlConsumerTest {
 
     // execute
     XmlEntityConsumer xec = new XmlEntityConsumer();
-    ODataEntry entry =
+    ODataEntry employee =
         xec.readEntry(entitySet, reqContent, EntityProviderReadProperties.init().mergeSemantic(true).build());
 
     // validate
-    assertNotNull(entry);
-    Map<String, Object> properties = entry.getProperties();
+    assertNotNull(employee);
+    Map<String, Object> properties = employee.getProperties();
     assertEquals("1", properties.get("EmployeeId"));
     assertEquals("Walter Winter", properties.get("EmployeeName"));
+    EntryMetadata employeeMetadata = employee.getMetadata();
+    assertNotNull(employeeMetadata);
+    assertEquals("W/\"1\"", employeeMetadata.getEtag());
+    
+    
+    //Inline
     ODataEntry room = (ODataEntry) properties.get("ne_Room");
     Map<String, Object> roomProperties = room.getProperties();
     assertEquals(4, roomProperties.size());
@@ -819,6 +825,9 @@ public class XmlEntityConsumerTest extends AbstractXmlConsumerTest {
     assertEquals("Room 1", roomProperties.get("Name"));
     assertEquals(Short.valueOf("1"), roomProperties.get("Seats"));
     assertEquals(Short.valueOf("1"), roomProperties.get("Version"));
+    EntryMetadata roomMetadata = room.getMetadata();
+    assertNotNull(roomMetadata);
+    assertEquals("W/1", roomMetadata.getEtag());
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumerTest.java
index 9301258..dace8eb 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlFeedConsumerTest.java
@@ -22,6 +22,7 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 
 import java.io.InputStream;
+import java.util.List;
 
 import junit.framework.Assert;
 
@@ -29,6 +30,8 @@ import org.apache.olingo.odata2.api.edm.EdmEntitySet;
 import org.apache.olingo.odata2.api.ep.EntityProvider;
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
 import org.apache.olingo.odata2.api.ep.EntityProviderReadProperties;
+import org.apache.olingo.odata2.api.ep.entry.EntryMetadata;
+import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
 import org.apache.olingo.odata2.api.ep.feed.FeedMetadata;
 import org.apache.olingo.odata2.api.ep.feed.ODataDeltaFeed;
 import org.apache.olingo.odata2.api.ep.feed.ODataFeed;
@@ -40,6 +43,30 @@ public class XmlFeedConsumerTest extends AbstractXmlConsumerTest {
   public XmlFeedConsumerTest(final StreamWriterImplType type) {
     super(type);
   }
+  
+  @Test
+  public void roomsFeedWithEtagEntries() throws Exception {
+    InputStream stream = getFileAsStream("feed_rooms_small.xml");
+    assertNotNull(stream);
+
+    ODataFeed feed =
+        EntityProvider.readFeed("application/atom+xml", MockFacade.getMockEdm().getDefaultEntityContainer()
+            .getEntitySet(
+                "Rooms"), stream, DEFAULT_PROPERTIES);
+    assertNotNull(feed);
+
+    FeedMetadata feedMetadata = feed.getFeedMetadata();
+    assertNotNull(feedMetadata);
+    assertNotNull(feedMetadata.getNextLink());
+    
+    List<ODataEntry> entries = feed.getEntries();
+    assertEquals(3, entries.size());
+    ODataEntry singleRoom = entries.get(0);
+    EntryMetadata roomMetadata = singleRoom.getMetadata();
+    assertNotNull(roomMetadata);
+    
+    assertEquals("W/\"1\"", roomMetadata.getEtag());
+  }
 
   @Test
   public void readLargeEmployeesFeed() throws Exception {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/test/resources/JsonRoom.json
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/resources/JsonRoom.json b/odata2-lib/odata-core/src/test/resources/JsonRoom.json
new file mode 100644
index 0000000..806aef2
--- /dev/null
+++ b/odata2-lib/odata-core/src/test/resources/JsonRoom.json
@@ -0,0 +1,24 @@
+{
+	"d" : {
+		"__metadata" : {
+			"id" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')",
+			"uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')",
+			"type" : "RefScenario.Room",
+			"etag" : "W/\"1\""
+		},
+		"Id" : "1",
+		"Name" : "Room 1",
+		"Seats" : 1,
+		"Version" : 1,
+		"nr_Employees" : {
+			"__deferred" : {
+				"uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')/nr_Employees"
+			}
+		},
+		"nr_Building" : {
+			"__deferred" : {
+				"uri" : "http://localhost:8080/ReferenceScenario.svc/Rooms('1')/nr_Building"
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/340d7c03/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml b/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml
new file mode 100644
index 0000000..6b8c09b
--- /dev/null
+++ b/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml
@@ -0,0 +1,62 @@
+<?xml version='1.0' encoding='utf-8'?>
+<feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="http://localhost:8080/ReferenceScenario.svc/">
+	<id>http://localhost:8080/ReferenceScenario.svc/Rooms</id>
+	<title type="text">Rooms</title>
+	<updated>2014-05-08T13:06:23Z</updated>
+	<author>
+		<name/>
+	</author>
+	<link href="Rooms" rel="self" title="Rooms"/>
+	<entry m:etag="W/&quot;1&quot;">
+		<id>http://localhost:8080/ReferenceScenario.svc/Rooms('1')</id>
+		<title type="text">Room 1</title>
+		<updated>2014-05-08T13:06:23Z</updated>
+		<category term="RefScenario.Room" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+		<link href="Rooms('1')" rel="edit" title="Room"/>
+		<link href="Rooms('1')/nr_Employees" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nr_Employees" title="nr_Employees" type="application/atom+xml;type=feed"/>
+		<link href="Rooms('1')/nr_Building" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nr_Building" title="nr_Building" type="application/atom+xml;type=entry"/>
+		<content type="application/xml">
+			<m:properties>
+				<d:Id>1</d:Id>
+				<d:Name>Room 1</d:Name>
+				<d:Seats>1</d:Seats>
+				<d:Version>1</d:Version>
+			</m:properties>
+		</content>
+	</entry>
+	<entry m:etag="W/&quot;1&quot;">
+		<id>http://localhost:8080/ReferenceScenario.svc/Rooms('10')</id>
+		<title type="text">Room 10</title>
+		<updated>2014-05-08T13:06:23Z</updated>
+		<category term="RefScenario.Room" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+		<link href="Rooms('10')" rel="edit" title="Room"/>
+		<link href="Rooms('10')/nr_Employees" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nr_Employees" title="nr_Employees" type="application/atom+xml;type=feed"/>
+		<link href="Rooms('10')/nr_Building" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nr_Building" title="nr_Building" type="application/atom+xml;type=entry"/>
+		<content type="application/xml">
+			<m:properties>
+				<d:Id>10</d:Id>
+				<d:Name>Room 10</d:Name>
+				<d:Seats>6</d:Seats>
+				<d:Version>1</d:Version>
+			</m:properties>
+		</content>
+	</entry>
+	<entry m:etag="W/&quot;1&quot;">
+		<id>http://localhost:8080/ReferenceScenario.svc/Rooms('100')</id>
+		<title type="text">Room 100</title>
+		<updated>2014-05-08T13:06:23Z</updated>
+		<category term="RefScenario.Room" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
+		<link href="Rooms('100')" rel="edit" title="Room"/>
+		<link href="Rooms('100')/nr_Employees" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nr_Employees" title="nr_Employees" type="application/atom+xml;type=feed"/>
+		<link href="Rooms('100')/nr_Building" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/nr_Building" title="nr_Building" type="application/atom+xml;type=entry"/>
+		<content type="application/xml">
+			<m:properties>
+				<d:Id>100</d:Id>
+				<d:Name>Room 100</d:Name>
+				<d:Seats>6</d:Seats>
+				<d:Version>1</d:Version>
+			</m:properties>
+		</content>
+	</entry>
+	<link href="http://localhost:8080/ReferenceScenario.svc/Rooms?$skiptoken=97" rel="next"/>
+</feed>
\ No newline at end of file


[12/38] git commit: Run code clean up (again)

Posted by mi...@apache.org.
Run code clean up (again)


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/f6ffb05e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/f6ffb05e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/f6ffb05e

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: f6ffb05e4f98afb9c27388c7bc5b8bba0fb6f68f
Parents: f57601c
Author: Michael Bolz <mi...@apache.org>
Authored: Wed Mar 26 12:59:35 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Wed Mar 26 12:59:35 2014 +0100

----------------------------------------------------------------------
 .../core/ep/consumer/XmlErrorDocumentConsumer.java      | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f6ffb05e/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
index 9eb1a8f..e69f896 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -87,7 +87,8 @@ public class XmlErrorDocumentConsumer {
     }
   }
 
-  private ODataErrorContext parserError(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException {
+  private ODataErrorContext parserError(final XMLStreamReader reader)
+      throws XMLStreamException, EntityProviderException {
     // read xml tag
     reader.require(XMLStreamConstants.START_DOCUMENT, null, null);
     reader.nextTag();
@@ -138,19 +139,22 @@ public class XmlErrorDocumentConsumer {
     return !finished && reader.hasNext();
   }
 
-  private void handleInnerError(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
+  private void handleInnerError(final XMLStreamReader reader, final ODataErrorContext errorContext)
+      throws XMLStreamException {
     String innerError = reader.getElementText();
     errorContext.setInnerError(innerError);
   }
 
-  private void handleMessage(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
+  private void handleMessage(final XMLStreamReader reader, final ODataErrorContext errorContext)
+      throws XMLStreamException {
     String lang = reader.getAttributeValue(Edm.NAMESPACE_XML_1998, FormatXml.XML_LANG);
     errorContext.setLocale(getLocale(lang));
     String message = reader.getElementText();
     errorContext.setMessage(message);
   }
 
-  private void handleCode(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
+  private void handleCode(final XMLStreamReader reader, final ODataErrorContext errorContext)
+      throws XMLStreamException {
     String code = reader.getElementText();
     errorContext.setErrorCode(code);
   }


[29/38] git commit: [OLINGO-256] Added more tests

Posted by mi...@apache.org.
[OLINGO-256] Added more tests


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/d75041c4
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/d75041c4
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/d75041c4

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: d75041c4545302ec431a23ac894ee0498aeab18a
Parents: 15abea3
Author: Michael Bolz <mi...@apache.org>
Authored: Fri Apr 25 14:14:20 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Fri Apr 25 15:07:04 2014 +0200

----------------------------------------------------------------------
 .../odata2/core/batch/BatchRequestTest.java     | 283 +++++++++++++++++++
 .../core/batch/BatchRequestWriterTest.java      |  22 +-
 .../core/batch/BatchResponseParserTest.java     |   1 -
 .../odata2/core/batch/BatchResponseTest.java    | 141 +++++++++
 .../src/test/resources/batchResponse.batch      |   2 -
 .../odata2/testutil/helper/StringHelper.java    |  82 ++++++
 6 files changed, 518 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/d75041c4/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java
new file mode 100644
index 0000000..40c3218
--- /dev/null
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java
@@ -0,0 +1,283 @@
+/*******************************************************************************
+ * 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.olingo.odata2.core.batch;
+
+import org.apache.olingo.odata2.api.batch.BatchException;
+import org.apache.olingo.odata2.api.batch.BatchRequestPart;
+import org.apache.olingo.odata2.api.client.batch.BatchChangeSet;
+import org.apache.olingo.odata2.api.client.batch.BatchChangeSetPart;
+import org.apache.olingo.odata2.api.client.batch.BatchPart;
+import org.apache.olingo.odata2.api.client.batch.BatchQueryPart;
+import org.apache.olingo.odata2.api.ep.EntityProviderBatchProperties;
+import org.apache.olingo.odata2.core.PathInfoImpl;
+import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * Test creation of a batch request with BatchRequestWriter and
+ * then parsing this request again with BatchRequestParser.
+ */
+public class BatchRequestTest {
+
+  private static final String POST = "POST";
+  private static final String GET = "GET";
+  private static final String PUT = "PUT";
+  private static final String BOUNDARY = "batch_123";
+  private static final String SERVICE_ROOT = "http://localhost/odata/";
+
+  private EntityProviderBatchProperties parseProperties;
+
+  public BatchRequestTest() throws URISyntaxException {
+    PathInfoImpl pathInfo = new PathInfoImpl();
+    pathInfo.setServiceRoot(new URI(SERVICE_ROOT));
+    parseProperties = EntityProviderBatchProperties.init().pathInfo(pathInfo).build();
+  }
+
+  private void checkMimeHeaders(final String requestBody) {
+    assertTrue(requestBody.contains("Content-Type: application/http"));
+    assertTrue(requestBody.contains("Content-Transfer-Encoding: binary"));
+  }
+
+  @Test
+  public void testBatchQueryPart() throws BatchException, IOException {
+    List<BatchPart> batch = new ArrayList<BatchPart>();
+    Map<String, String> headers = new HashMap<String, String>();
+    headers.put("Accept", "application/json");
+    BatchPart request = BatchQueryPart.method(GET).uri("Employees").headers(headers).build();
+    batch.add(request);
+
+    BatchRequestWriter writer = new BatchRequestWriter();
+    InputStream batchRequest = writer.writeBatchRequest(batch, BOUNDARY);
+    assertNotNull(batchRequest);
+
+    StringHelper.Stream batchRequestStream = StringHelper.toStream(batchRequest);
+    String requestBody = batchRequestStream.asString();
+    checkMimeHeaders(requestBody);
+
+    assertTrue(requestBody.contains("--batch_"));
+    assertTrue(requestBody.contains("GET Employees HTTP/1.1"));
+    checkHeaders(headers, requestBody);
+
+    String contentType = "multipart/mixed; boundary=" + BOUNDARY;
+    BatchRequestParser parser = new BatchRequestParser(contentType, parseProperties);
+    List<BatchRequestPart> parseResult = parser.parse(batchRequestStream.asStream());
+    assertEquals(1, parseResult.size());
+  }
+
+  @Test
+  public void testBatchChangeSet() throws IOException, BatchException {
+    List<BatchPart> batch = new ArrayList<BatchPart>();
+    Map<String, String> headers = new HashMap<String, String>();
+    headers.put("content-type", "application/json");
+    BatchChangeSetPart request = BatchChangeSetPart.method(PUT)
+        .uri("Employees('2')")
+        .body("{\"Возраст\":40}")
+        .headers(headers)
+        .contentId("111")
+        .build();
+    BatchChangeSet changeSet = BatchChangeSet.newBuilder().build();
+    changeSet.add(request);
+    batch.add(changeSet);
+
+    BatchRequestWriter writer = new BatchRequestWriter();
+    InputStream batchRequest = writer.writeBatchRequest(batch, BOUNDARY);
+    assertNotNull(batchRequest);
+
+    StringHelper.Stream batchRequestStream = StringHelper.toStream(batchRequest);
+    String requestBody = batchRequestStream.asString();
+    checkMimeHeaders(requestBody);
+    checkHeaders(headers, requestBody);
+
+    assertTrue(requestBody.contains("--batch_"));
+    assertTrue(requestBody.contains("--changeset_"));
+    assertTrue(requestBody.contains("PUT Employees('2') HTTP/1.1"));
+    assertTrue(requestBody.contains("{\"Возраст\":40}"));
+
+    String contentType = "multipart/mixed; boundary=" + BOUNDARY;
+    BatchRequestParser parser = new BatchRequestParser(contentType, parseProperties);
+    List<BatchRequestPart> parseResult = parser.parse(batchRequestStream.asStream());
+    assertEquals(1, parseResult.size());
+  }
+
+  @Test
+  public void testBatchWithGetAndPost() throws BatchException, IOException {
+    List<BatchPart> batch = new ArrayList<BatchPart>();
+    Map<String, String> headers = new HashMap<String, String>();
+    headers.put("Accept", "application/json");
+    BatchPart request = BatchQueryPart.method(GET).uri("Employees").headers(headers).contentId("000").build();
+    batch.add(request);
+
+    Map<String, String> changeSetHeaders = new HashMap<String, String>();
+    changeSetHeaders.put("content-type", "application/json");
+    String body = "/9j/4AAQSkZJRgABAQEBLAEsAAD/4RM0RXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEA";
+    BatchChangeSetPart changeRequest = BatchChangeSetPart.method(POST)
+        .uri("Employees")
+        .body(body)
+        .headers(changeSetHeaders)
+        .contentId("111")
+        .build();
+    BatchChangeSet changeSet = BatchChangeSet.newBuilder().build();
+    changeSet.add(changeRequest);
+    batch.add(changeSet);
+    BatchRequestWriter writer = new BatchRequestWriter();
+    InputStream batchRequest = writer.writeBatchRequest(batch, BOUNDARY);
+    assertNotNull(batchRequest);
+
+    StringHelper.Stream batchRequestStream = StringHelper.toStream(batchRequest);
+    String requestBody = batchRequestStream.asString();
+    checkMimeHeaders(requestBody);
+
+    checkHeaders(headers, requestBody);
+    checkHeaders(changeSetHeaders, requestBody);
+    assertTrue(requestBody.contains("GET Employees HTTP/1.1"));
+    assertTrue(requestBody.contains("POST Employees HTTP/1.1"));
+    assertTrue(requestBody.contains(body));
+
+    String contentType = "multipart/mixed; boundary=" + BOUNDARY;
+    BatchRequestParser parser = new BatchRequestParser(contentType, parseProperties);
+    List<BatchRequestPart> parseResult = parser.parse(batchRequestStream.asStream());
+    assertEquals(2, parseResult.size());
+  }
+
+  @Test
+  public void testChangeSetWithContentIdReferencing() throws BatchException, IOException {
+    List<BatchPart> batch = new ArrayList<BatchPart>();
+
+    Map<String, String> changeSetHeaders = new HashMap<String, String>();
+    changeSetHeaders.put("content-type", "application/json");
+    String body = "/9j/4AAQSkZJRgABAQEBLAEsAAD/4RM0RXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEA";
+    BatchChangeSetPart changeRequest = BatchChangeSetPart.method(POST)
+        .uri("Employees('2')")
+        .body(body)
+        .headers(changeSetHeaders)
+        .contentId("1")
+        .build();
+    BatchChangeSet changeSet = BatchChangeSet.newBuilder().build();
+    changeSet.add(changeRequest);
+
+    changeSetHeaders = new HashMap<String, String>();
+    changeSetHeaders.put("content-type", "application/json;odata=verbose");
+    BatchChangeSetPart changeRequest2 = BatchChangeSetPart.method(PUT)
+        .uri("$/ManagerId")
+        .body("{\"ManagerId\":1}")
+        .headers(changeSetHeaders)
+        .contentId("2")
+        .build();
+    changeSet.add(changeRequest2);
+    batch.add(changeSet);
+
+    BatchRequestWriter writer = new BatchRequestWriter();
+    InputStream batchRequest = writer.writeBatchRequest(batch, BOUNDARY);
+    assertNotNull(batchRequest);
+
+    StringHelper.Stream batchRequestStream = StringHelper.toStream(batchRequest);
+    String requestBody = batchRequestStream.asString();
+    checkMimeHeaders(requestBody);
+
+    assertTrue(requestBody.contains("POST Employees('2') HTTP/1.1"));
+    assertTrue(requestBody.contains("PUT $/ManagerId HTTP/1.1"));
+    assertTrue(requestBody.contains(BatchHelper.HTTP_CONTENT_ID + ": 1"));
+    assertTrue(requestBody.contains(BatchHelper.HTTP_CONTENT_ID + ": 2"));
+    assertTrue(requestBody.contains(body));
+
+    String contentType = "multipart/mixed; boundary=" + BOUNDARY;
+    BatchRequestParser parser = new BatchRequestParser(contentType, parseProperties);
+    List<BatchRequestPart> parseResult = parser.parse(batchRequestStream.asStream());
+    assertEquals(1, parseResult.size());
+  }
+
+  @Test
+  public void testBatchWithTwoChangeSets() throws BatchException, IOException {
+    List<BatchPart> batch = new ArrayList<BatchPart>();
+
+    Map<String, String> changeSetHeaders = new HashMap<String, String>();
+    changeSetHeaders.put("content-type", "application/json");
+    changeSetHeaders.put("content-Id", "111");
+    String body = "/9j/4AAQSkZJRgABAQEBLAEsAAD/4RM0RXhpZgAATU0AKgAAAAgABwESAAMAAAABAAEA";
+    BatchChangeSetPart changeRequest = BatchChangeSetPart.method(POST)
+        .uri("Employees")
+        .body(body)
+        .headers(changeSetHeaders)
+        .build();
+    BatchChangeSet changeSet = BatchChangeSet.newBuilder().build();
+    changeSet.add(changeRequest);
+    batch.add(changeSet);
+
+    Map<String, String> changeSetHeaders2 = new HashMap<String, String>();
+    changeSetHeaders2.put("content-type", "application/json;odata=verbose");
+    changeSetHeaders2.put("content-Id", "222");
+    BatchChangeSetPart changeRequest2 = BatchChangeSetPart.method(PUT)
+        .uri("Employees('2')/ManagerId")
+        .body("{\"ManagerId\":1}")
+        .headers(changeSetHeaders2)
+        .build();
+    BatchChangeSet changeSet2 = BatchChangeSet.newBuilder().build();
+    changeSet2.add(changeRequest2);
+    batch.add(changeSet2);
+
+    BatchRequestWriter writer = new BatchRequestWriter();
+    InputStream batchRequest = writer.writeBatchRequest(batch, BOUNDARY);
+    assertNotNull(batchRequest);
+
+    StringHelper.Stream batchRequestStream = StringHelper.toStream(batchRequest);
+    String requestBody = batchRequestStream.asString();
+    checkMimeHeaders(requestBody);
+
+    assertTrue(requestBody.contains("POST Employees HTTP/1.1"));
+    assertTrue(requestBody.contains("PUT Employees('2')/ManagerId HTTP/1.1"));
+
+    assertTrue(requestBody.contains(body));
+
+    String contentType = "multipart/mixed; boundary=" + BOUNDARY;
+    BatchRequestParser parser = new BatchRequestParser(contentType, parseProperties);
+    List<BatchRequestPart> parseResult = parser.parse(batchRequestStream.asStream());
+    assertEquals(2, parseResult.size());
+  }
+
+  private void checkHeaders(final Map<String, String> headers, final String requestBody) {
+    for (Map.Entry<String, String> header : headers.entrySet()) {
+      assertTrue(requestBody.contains(header.getKey() + ": " + header.getValue()));
+    }
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void testBatchQueryPartWithInvalidMethod() throws BatchException, IOException {
+    BatchQueryPart.method(PUT).uri("Employees").build();
+
+  }
+
+  @Test(expected = IllegalArgumentException.class)
+  public void testBatchChangeSetPartWithInvalidMethod() throws BatchException, IOException {
+    BatchChangeSetPart.method(GET).uri("Employees('2')").build();
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/d75041c4/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java
index 1331e73..496686d 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java
@@ -18,8 +18,13 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.core.batch;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import org.apache.olingo.odata2.api.batch.BatchException;
+import org.apache.olingo.odata2.api.client.batch.BatchChangeSet;
+import org.apache.olingo.odata2.api.client.batch.BatchChangeSetPart;
+import org.apache.olingo.odata2.api.client.batch.BatchPart;
+import org.apache.olingo.odata2.api.client.batch.BatchQueryPart;
+import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -28,13 +33,9 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.olingo.odata2.api.batch.BatchException;
-import org.apache.olingo.odata2.api.client.batch.BatchChangeSet;
-import org.apache.olingo.odata2.api.client.batch.BatchChangeSetPart;
-import org.apache.olingo.odata2.api.client.batch.BatchPart;
-import org.apache.olingo.odata2.api.client.batch.BatchQueryPart;
-import org.apache.olingo.odata2.testutil.helper.StringHelper;
-import org.junit.Test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 public class BatchRequestWriterTest {
 
@@ -59,13 +60,14 @@ public class BatchRequestWriterTest {
     BatchRequestWriter writer = new BatchRequestWriter();
     InputStream batchRequest = writer.writeBatchRequest(batch, BOUNDARY);
 
-    String requestBody = StringHelper.inputStreamToString(batchRequest);
+    String requestBody = StringHelper.toStream(batchRequest).asString();
     assertNotNull(batchRequest);
     checkMimeHeaders(requestBody);
 
     assertTrue(requestBody.contains("--batch_"));
     assertTrue(requestBody.contains("GET Employees HTTP/1.1"));
     checkHeaders(headers, requestBody);
+    assertEquals(10, StringHelper.countLines(requestBody));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/d75041c4/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseParserTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseParserTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseParserTest.java
index 06daa2a..592c054 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseParserTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseParserTest.java
@@ -48,7 +48,6 @@ public class BatchResponseParserTest {
         + "Content-length: 22" + LF
         + LF
         + "Frederic Fall MODIFIED" + LF
-        + LF
         + "--batch_123--";
 
     InputStream in = new ByteArrayInputStream(getResponse.getBytes());

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/d75041c4/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java
new file mode 100644
index 0000000..29dd774
--- /dev/null
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java
@@ -0,0 +1,141 @@
+/*******************************************************************************
+ * 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.olingo.odata2.core.batch;
+
+import org.apache.olingo.odata2.api.batch.BatchException;
+import org.apache.olingo.odata2.api.batch.BatchResponsePart;
+import org.apache.olingo.odata2.api.client.batch.BatchSingleResponse;
+import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
+import org.apache.olingo.odata2.api.processor.ODataResponse;
+import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test creation of a batch response with BatchResponseWriter and
+ * then parsing this response again with BatchResponseParser.
+ */
+public class BatchResponseTest {
+
+  @Test
+  public void testBatchResponse() throws BatchException, IOException {
+    List<BatchResponsePart> parts = new ArrayList<BatchResponsePart>();
+    ODataResponse response = ODataResponse.entity("Walter Winter")
+        .status(HttpStatusCodes.OK)
+        .contentHeader("application/json")
+        .build();
+    List<ODataResponse> responses = new ArrayList<ODataResponse>(1);
+    responses.add(response);
+    parts.add(BatchResponsePart.responses(responses).changeSet(false).build());
+
+    ODataResponse changeSetResponse = ODataResponse.status(HttpStatusCodes.NO_CONTENT).build();
+    responses = new ArrayList<ODataResponse>(1);
+    responses.add(changeSetResponse);
+    parts.add(BatchResponsePart.responses(responses).changeSet(true).build());
+
+    BatchResponseWriter writer = new BatchResponseWriter();
+    ODataResponse batchResponse = writer.writeResponse(parts);
+
+    assertEquals(202, batchResponse.getStatus().getStatusCode());
+    assertNotNull(batchResponse.getEntity());
+    String body = (String) batchResponse.getEntity();
+
+    assertTrue(body.contains("--batch"));
+    assertTrue(body.contains("--changeset"));
+    assertTrue(body.contains("HTTP/1.1 200 OK"));
+    assertTrue(body.contains("Content-Type: application/http"));
+    assertTrue(body.contains("Content-Transfer-Encoding: binary"));
+    assertTrue(body.contains("Walter Winter"));
+    assertTrue(body.contains("multipart/mixed; boundary=changeset"));
+    assertTrue(body.contains("HTTP/1.1 204 No Content"));
+
+    String contentHeader = batchResponse.getContentHeader();
+    BatchResponseParser parser = new BatchResponseParser(contentHeader);
+    List<BatchSingleResponse> result = parser.parse(new ByteArrayInputStream(body.getBytes()));
+    assertEquals(2, result.size());
+  }
+
+  @Test
+  public void testChangeSetResponse() throws BatchException, IOException {
+    List<BatchResponsePart> parts = new ArrayList<BatchResponsePart>();
+    ODataResponse changeSetResponse = ODataResponse.status(HttpStatusCodes.NO_CONTENT).build();
+    List<ODataResponse> responses = new ArrayList<ODataResponse>(1);
+    responses.add(changeSetResponse);
+    parts.add(BatchResponsePart.responses(responses).changeSet(true).build());
+
+    BatchResponseWriter writer = new BatchResponseWriter();
+    ODataResponse batchResponse = writer.writeResponse(parts);
+
+    assertEquals(202, batchResponse.getStatus().getStatusCode());
+    assertNotNull(batchResponse.getEntity());
+    String body = (String) batchResponse.getEntity();
+    assertTrue(body.contains("--batch"));
+    assertTrue(body.contains("--changeset"));
+    assertTrue(body.indexOf("--changeset") != body.lastIndexOf("--changeset"));
+    assertFalse(body.contains("HTTP/1.1 200 OK" + "\r\n"));
+    assertTrue(body.contains("Content-Type: application/http" + "\r\n"));
+    assertTrue(body.contains("Content-Transfer-Encoding: binary" + "\r\n"));
+    assertTrue(body.contains("HTTP/1.1 204 No Content" + "\r\n"));
+    assertTrue(body.contains("Content-Type: multipart/mixed; boundary=changeset"));
+
+    String contentHeader = batchResponse.getContentHeader();
+    BatchResponseParser parser = new BatchResponseParser(contentHeader);
+    List<BatchSingleResponse> result = parser.parse(new ByteArrayInputStream(body.getBytes()));
+    assertEquals(1, result.size());
+  }
+
+  @Test
+  public void testTwoChangeSetResponse() throws BatchException, IOException {
+    List<BatchResponsePart> parts = new ArrayList<BatchResponsePart>();
+    ODataResponse changeSetResponse = ODataResponse.status(HttpStatusCodes.NO_CONTENT).build();
+    ODataResponse changeSetResponseTwo = ODataResponse.status(HttpStatusCodes.NO_CONTENT).build();
+    List<ODataResponse> responses = new ArrayList<ODataResponse>(1);
+    responses.add(changeSetResponse);
+    responses.add(changeSetResponseTwo);
+    parts.add(BatchResponsePart.responses(responses).changeSet(true).build());
+
+    BatchResponseWriter writer = new BatchResponseWriter();
+    ODataResponse batchResponse = writer.writeResponse(parts);
+
+    assertEquals(202, batchResponse.getStatus().getStatusCode());
+    assertNotNull(batchResponse.getEntity());
+    String body = (String) batchResponse.getEntity();
+    assertTrue(body.contains("--batch"));
+    assertTrue(body.contains("--changeset"));
+    assertTrue(body.indexOf("--changeset") != body.lastIndexOf("--changeset"));
+    assertFalse(body.contains("HTTP/1.1 200 OK" + "\r\n"));
+    assertTrue(body.contains("Content-Type: application/http" + "\r\n"));
+    assertTrue(body.contains("Content-Transfer-Encoding: binary" + "\r\n"));
+    assertTrue(body.contains("HTTP/1.1 204 No Content" + "\r\n"));
+    assertTrue(body.contains("Content-Type: multipart/mixed; boundary=changeset"));
+
+    String contentHeader = batchResponse.getContentHeader();
+    BatchResponseParser parser = new BatchResponseParser(contentHeader);
+    StringHelper.Stream content = StringHelper.toStream(body);
+    List<BatchSingleResponse> result = parser.parse(content.asStream());
+    assertEquals(2, result.size());
+    assertEquals("Failing content:\n" + content.asString(), 19, content.countCrLf());
+  }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/d75041c4/odata2-lib/odata-core/src/test/resources/batchResponse.batch
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/resources/batchResponse.batch b/odata2-lib/odata-core/src/test/resources/batchResponse.batch
index ff65bb1..f9e043b 100644
--- a/odata2-lib/odata-core/src/test/resources/batchResponse.batch
+++ b/odata2-lib/odata-core/src/test/resources/batchResponse.batch
@@ -21,7 +21,6 @@ Content-Type: application/json
 Content-Length: 918
 
 {"d":{"__metadata":{"id":"http://localhost:19000/ClientBatchTest/Employees('7')","uri":"http://localhost:19000/ClientBatchTest/Employees('7')","type":"RefScenario.Employee","content_type":"application/octet-stream","media_src":"Employees('7')/$value","edit_media":"http://localhost:19000/ClientBatchTest/Employees('7')/$value"},"EmployeeId":"7","EmployeeName":"Employee 7","ManagerId":null,"RoomId":null,"TeamId":null,"Location":{"__metadata":{"type":"RefScenario.c_Location"},"City":{"__metadata":{"type":"RefScenario.c_City"},"PostalCode":null,"CityName":null},"Country":null},"Age":0,"EntryDate":null,"ImageUrl":null,"ne_Manager":{"__deferred":{"uri":"http://localhost:19000/ClientBatchTest/Employees('7')/ne_Manager"}},"ne_Team":{"__deferred":{"uri":"http://localhost:19000/ClientBatchTest/Employees('7')/ne_Team"}},"ne_Room":{"__deferred":{"uri":"http://localhost:19000/ClientBatchTest/Employees('7')/ne_Room"}}}}
-
 --changeset_12ks93js84d--
 
 --batch_123
@@ -35,5 +34,4 @@ Content-Type: text/plain;charset=utf-8
 Content-length: 13
 
 Frederic Fall
-
 --batch_123--
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/d75041c4/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
index 3d17fbff..1d46767 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
@@ -35,6 +35,72 @@ import org.apache.olingo.odata2.testutil.TestUtilRuntimeException;
  */
 public class StringHelper {
 
+
+  public static class Stream {
+    private final byte[] data;
+
+    private Stream(byte[] data) {
+      this.data = data;
+    }
+
+    public Stream(String content, String charset) throws UnsupportedEncodingException {
+      this(content.getBytes(charset));
+    }
+
+    public InputStream asStream() {
+      return new ByteArrayInputStream(data);
+    }
+
+    public byte[] asArray() {
+      return data;
+    }
+
+    public String asString() {
+      return asString("UTF-8");
+    }
+
+    public String asString(String charsetName) {
+      return new String(data, Charset.forName(charsetName));
+    }
+
+    public Stream print(OutputStream out) throws IOException {
+      out.write(data);
+      return this;
+    }
+
+    public Stream print() throws IOException {
+      return print(System.out);
+    }
+
+    public int countCrLf() {
+      return StringHelper.countLines(asString(), "\r\n");
+    }
+  }
+
+  public static Stream toStream(InputStream stream) throws IOException {
+    byte[] result = new byte[0];
+    byte[] tmp = new byte[8192];
+    int readCount = stream.read(tmp);
+    while (readCount >= 0) {
+      byte[] innerTmp = new byte[result.length + readCount];
+      System.arraycopy(result, 0, innerTmp, 0, result.length);
+      System.arraycopy(tmp, 0, innerTmp, result.length, readCount);
+      result = innerTmp;
+      readCount = stream.read(tmp);
+    }
+    stream.close();
+    return new Stream(result);
+  }
+
+  public static Stream toStream(String content) {
+    try {
+      return new Stream(content, "UTF-8");
+    } catch (UnsupportedEncodingException e) {
+      throw new RuntimeException("UTF-8 should be supported on each system.");
+    }
+  }
+
+
   public static String inputStreamToString(final InputStream in, final boolean preserveLineBreaks) throws IOException {
     final BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(in, Charset.forName("UTF-8")));
     final StringBuilder stringBuilder = new StringBuilder();
@@ -54,6 +120,22 @@ public class StringHelper {
     return result;
   }
 
+  public static int countLines(String content) {
+    return countLines(content, "\r\n");
+  }
+
+  public static int countLines(String content, String lineBreak) {
+    int lastPos = 0;
+    int count = -1;
+
+    while (lastPos >= 0) {
+      lastPos = content.indexOf(lineBreak, lastPos+1);
+      count++;
+    }
+
+    return count;
+  }
+
   public static String inputStreamToString(final InputStream in) throws IOException {
     return inputStreamToString(in, false);
   }


[25/38] git commit: [OLINGO-245] Fix for names of foreign key names. Properties representing foreign key are prefixed with FK

Posted by mi...@apache.org.
[OLINGO-245] Fix for names of foreign key names. 
Properties representing foreign key are prefixed with FK


Signed-off-by: Chandan V A <ch...@sap.com>

Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/2dd0181d
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/2dd0181d
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/2dd0181d

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 2dd0181d4fce203d6cf4e67367b25ffe54540340
Parents: 74dff0f
Author: Chandan V A <ch...@sap.com>
Authored: Sat Apr 19 16:07:44 2014 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Sat Apr 19 16:07:44 2014 +0530

----------------------------------------------------------------------
 .../jpa/processor/core/access/model/JPAEdmNameBuilder.java  | 6 +++++-
 .../odata2/jpa/processor/core/model/JPAEdmProperty.java     | 9 +++++----
 .../processor/core/access/model/JPAEdmNameBuilderTest.java  | 4 ++--
 3 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2dd0181d/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java
index 9c22364..1f0e152 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilder.java
@@ -58,6 +58,7 @@ public class JPAEdmNameBuilder {
   private static final String ASSOCIATIONSET_SUFFIX = "Set";
   private static final String NAVIGATION_NAME = "Details";
   private static final String UNDERSCORE = "_";
+  private static final String FK_PREFIX = "FK";
 
   public static FullQualifiedName build(final JPAEdmBaseView view, final String name) {
     FullQualifiedName fqName = new FullQualifiedName(buildNamespace(view), name);
@@ -124,7 +125,7 @@ public class JPAEdmNameBuilder {
    * ************************************************************************
    */
   public static void build(final JPAEdmPropertyView view, final boolean isComplexMode,
-      final boolean skipDefaultNaming) {
+      final boolean skipDefaultNaming, final boolean isForeignKey) {
     Attribute<?, ?> jpaAttribute = view.getJPAAttribute();
     String jpaAttributeName = jpaAttribute.getName();
     String propertyName = null;
@@ -145,6 +146,9 @@ public class JPAEdmNameBuilder {
       propertyName = Character.toUpperCase(jpaAttributeName.charAt(0)) + jpaAttributeName.substring(1);
     } else if (propertyName == null) {
       propertyName = jpaAttributeName;
+      if (isForeignKey == true) {
+        propertyName = FK_PREFIX + UNDERSCORE + propertyName;
+      }
     }
 
     view.getEdmSimpleProperty().setName(propertyName);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2dd0181d/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java
index e23f3b1..8ea02f7 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmProperty.java
@@ -210,7 +210,7 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
         switch (attributeType) {
         case BASIC:
           currentSimpleProperty = new SimpleProperty();
-          properties.add(buildSimpleProperty(currentAttribute, currentSimpleProperty));
+          properties.add(buildSimpleProperty(currentAttribute, currentSimpleProperty, false));
           if (((SingularAttribute<?, ?>) currentAttribute).isId()) {
             if (keyView == null) {
               keyView = new JPAEdmKey(JPAEdmProperty.this);
@@ -321,12 +321,13 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
 
     }
 
-    private SimpleProperty buildSimpleProperty(final Attribute<?, ?> jpaAttribute, final SimpleProperty simpleProperty)
+    private SimpleProperty buildSimpleProperty(final Attribute<?, ?> jpaAttribute, final SimpleProperty simpleProperty,
+        final boolean isFK)
         throws ODataJPAModelException,
         ODataJPARuntimeException {
 
       JPAEdmNameBuilder
-          .build((JPAEdmPropertyView) JPAEdmProperty.this, isBuildModeComplexType, skipDefaultNaming);
+          .build((JPAEdmPropertyView) JPAEdmProperty.this, isBuildModeComplexType, skipDefaultNaming, isFK);
       EdmSimpleTypeKind simpleTypeKind = JPATypeConvertor
           .convertToEdmSimpleType(jpaAttribute
               .getJavaType(), jpaAttribute);
@@ -360,7 +361,7 @@ public class JPAEdmProperty extends JPAEdmBaseViewImpl implements
               if (referencedColumn != null && referencedColumn.name().equals((joinColumn.referencedColumnName()))) {
                 currentRefAttribute = referencedAttribute;
                 currentSimpleProperty = new SimpleProperty();
-                properties.add(buildSimpleProperty(currentRefAttribute, currentSimpleProperty));
+                properties.add(buildSimpleProperty(currentRefAttribute, currentSimpleProperty, true));
                 break;
               }
             }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2dd0181d/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilderTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilderTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilderTest.java
index 542d37f..aebea64 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilderTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPAEdmNameBuilderTest.java
@@ -49,7 +49,7 @@ public class JPAEdmNameBuilderTest {
     EasyMock.expect(propertyView.getEdmSimpleProperty()).andStubReturn(simpleProperty);
     EasyMock.replay(propertyView);
 
-    JPAEdmNameBuilder.build(propertyView, false, false);
+    JPAEdmNameBuilder.build(propertyView, false, false,false);
     assertEquals("Id", simpleProperty.getName());
   }
 
@@ -69,7 +69,7 @@ public class JPAEdmNameBuilderTest {
     EasyMock.expect(propertyView.getEdmSimpleProperty()).andStubReturn(simpleProperty);
     EasyMock.replay(propertyView);
 
-    JPAEdmNameBuilder.build(propertyView, false, true);
+    JPAEdmNameBuilder.build(propertyView, false, true,false);
     assertEquals("id", simpleProperty.getName());
   }
 


[11/38] git commit: Run code clean up

Posted by mi...@apache.org.
Run code clean up


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/f57601c2
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/f57601c2
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/f57601c2

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: f57601c20793e48154b60c3a22d9191f22f98c6d
Parents: 9b1ba14
Author: Michael Bolz <mi...@apache.org>
Authored: Wed Mar 26 11:09:48 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Wed Mar 26 11:09:48 2014 +0100

----------------------------------------------------------------------
 .../processor/api/AnnotationServiceFactory.java |  2 +-
 .../processor/core/ListsProcessor.java          | 11 ++--
 .../core/edm/AnnotationEdmProvider.java         | 62 ++++++++++----------
 .../processor/core/util/AnnotationHelper.java   |  2 +-
 .../core/util/AnnotationRuntimeException.java   |  8 +--
 .../core/edm/AnnotationEdmProviderTest.java     |  2 +-
 .../processor/core/util/ClassHelperTest.java    | 12 ----
 .../annotation/processor/ref/model/City.java    |  2 +-
 .../processor/ref/model/Location.java           |  2 +-
 .../processor/ref/AbstractRefJsonTest.java      |  2 +-
 .../processor/ref/AbstractRefTest.java          |  2 +-
 .../processor/ref/AbstractRefXmlTest.java       |  2 +-
 .../processor/ref/EntryJsonCreateTest.java      | 60 +++++++++----------
 .../processor/ref/ServiceJsonTest.java          |  2 +-
 .../processor/ref/ServiceXmlTest.java           |  2 +-
 .../core/model/JPAEdmFunctionImport.java        |  1 -
 .../model/JPACustomProcessorNegativeMock.java   |  2 +-
 .../olingo/odata2/api/ep/EntityProvider.java    |  2 +-
 .../api/exception/ODataMessageException.java    |  8 +--
 .../olingo/odata2/api/rt/RuntimeDelegate.java   |  2 +-
 .../olingo/odata2/core/commons/XmlHelper.java   |  2 +-
 .../olingo/odata2/core/debug/DebugInfoBody.java |  4 +-
 .../odata2/core/debug/DebugInfoException.java   |  6 +-
 .../odata2/core/debug/DebugInfoRequest.java     |  2 +-
 .../odata2/core/debug/DebugInfoResponse.java    |  4 +-
 .../odata2/core/debug/DebugInfoRuntime.java     |  4 +-
 .../odata2/core/debug/DebugInfoServer.java      |  2 +-
 .../olingo/odata2/core/debug/DebugInfoUri.java  |  8 +--
 .../core/debug/ODataDebugResponseWrapper.java   |  4 +-
 .../olingo/odata2/core/edm/EdmDouble.java       |  8 ---
 .../ep/consumer/XmlErrorDocumentConsumer.java   | 42 ++++++-------
 .../odata2/core/rest/ODataSubLocator.java       |  2 +-
 .../odata2/core/servlet/ODataServlet.java       |  2 +-
 .../odata2/core/ep/ProviderFacadeImplTest.java  |  4 +-
 .../core/exception/ODataExceptionTest.java      | 26 ++++++--
 .../odata2/fit/ref/AbstractRefJsonTest.java     |  2 +-
 .../BasicContentNegotiationTest.java            |  2 +-
 .../odata2/testutil/fit/AbstractFitTest.java    | 11 ++--
 .../testutil/fit/FitStaticServiceFactory.java   |  2 +-
 .../odata2/testutil/server/TestServer.java      | 42 ++++++-------
 40 files changed, 179 insertions(+), 188 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java b/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
index 9db29ff..92f47e6 100644
--- a/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
+++ b/odata2-annotation-processor/annotation-processor-api/src/main/java/org/apache/olingo/odata2/annotation/processor/api/AnnotationServiceFactory.java
@@ -113,7 +113,7 @@ public abstract class AnnotationServiceFactory {
    * for model definition and data access.
    * @throws ODataException if an error during initialization occurs
    */
-  public static ODataService createAnnotationService(final Collection<Class<?>> annotatedClasses) 
+  public static ODataService createAnnotationService(final Collection<Class<?>> annotatedClasses)
       throws ODataException {
     return getInstance().createAnnotationService(annotatedClasses);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java
index 9a77940..2c18668 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/ListsProcessor.java
@@ -1516,7 +1516,6 @@ public class ListsProcessor extends DataSourceProcessor {
     }
   }
 
-
   private <T> Map<String, Object> getSimpleTypeValueMap(final T data, final List<EdmProperty> propertyPath)
       throws ODataException {
     final EdmProperty property = propertyPath.get(propertyPath.size() - 1);
@@ -1570,12 +1569,12 @@ public class ListsProcessor extends DataSourceProcessor {
       final EdmProperty property = (EdmProperty) type.getProperty(propertyName);
       if (property.isSimple()) {
         Object value = valueAccess.getPropertyType(data, property);
-        if(value != null) {
+        if (value != null) {
           typeMap.put(propertyName, value);
         }
       } else {
         Object value = valueAccess.getPropertyValue(data, property);
-        if(value == null) {
+        if (value == null) {
           Class<?> complexClass = valueAccess.getPropertyType(data, property);
           value = createInstance(complexClass);
         }
@@ -1591,7 +1590,7 @@ public class ListsProcessor extends DataSourceProcessor {
 
   private <T> void setStructuralTypeValuesFromMap(final T data, final EdmStructuralType type,
       final Map<String, Object> valueMap, final boolean merge) throws ODataException {
-    if(data == null) {
+    if (data == null) {
       throw new ODataException("Unable to set structural type values to NULL data.");
     }
     ODataContext context = getContext();
@@ -1615,7 +1614,7 @@ public class ListsProcessor extends DataSourceProcessor {
           @SuppressWarnings("unchecked")
           final Map<String, Object> values = (Map<String, Object>) value;
           Object complexData = valueAccess.getPropertyValue(data, property);
-          if(complexData == null) {
+          if (complexData == null) {
             Class<?> complexClass = valueAccess.getPropertyType(data, property);
             complexData = createInstance(complexClass);
             valueAccess.setPropertyValue(data, property, complexData);
@@ -1629,7 +1628,7 @@ public class ListsProcessor extends DataSourceProcessor {
     context.stopRuntimeMeasurement(timingHandle);
   }
 
-  private Object createInstance(Class<?> complexClass) throws ODataException {
+  private Object createInstance(final Class<?> complexClass) throws ODataException {
     try {
       return complexClass.newInstance();
     } catch (InstantiationException e) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
index cf7b94e..984a677 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProvider.java
@@ -497,37 +497,37 @@ public class AnnotationEdmProvider extends EdmProvider {
       return navProp;
     }
 
-//    private EdmSimpleTypeKind getEdmSimpleType(Class<?> type) {
-//      if (type == String.class) {
-//        return EdmType.String;
-//      } else if (type == boolean.class || type == Boolean.class) {
-//        return EdmType.Boolean;
-//      } else if (type == byte.class || type == Byte.class) {
-//        return EdmType.SByte;
-//      } else if (type == short.class || type == Short.class) {
-//        return EdmType.Int16;
-//      } else if (type == int.class || type == Integer.class) {
-//        return EdmType.Int32;
-//      } else if (type == long.class || type == Long.class) {
-//        return EdmType.Int64;
-//      } else if (type == double.class || type == Double.class) {
-//        return EdmType.Double;
-//      } else if (type == float.class || type == Float.class) {
-//        return EdmType.Single;
-//      } else if (type == BigInteger.class || type == BigDecimal.class) {
-//        return EdmType.Decimal;
-//      } else if (type == Byte[].class || type == byte[].class) {
-//        return EdmType.Binary;
-//      } else if (type == Date.class) {
-//        return EdmType.DateTime;
-//      } else if (type == Calendar.class) {
-//        return EdmType.DateTimeOffset;
-//      } else if (type == UUID.class) {
-//        return EdmType.Guid;
-//      } else {
-//        throw new UnsupportedOperationException("Not yet supported type '" + type + "'.");
-//      }
-//    }
+    //    private EdmSimpleTypeKind getEdmSimpleType(Class<?> type) {
+    //      if (type == String.class) {
+    //        return EdmType.String;
+    //      } else if (type == boolean.class || type == Boolean.class) {
+    //        return EdmType.Boolean;
+    //      } else if (type == byte.class || type == Byte.class) {
+    //        return EdmType.SByte;
+    //      } else if (type == short.class || type == Short.class) {
+    //        return EdmType.Int16;
+    //      } else if (type == int.class || type == Integer.class) {
+    //        return EdmType.Int32;
+    //      } else if (type == long.class || type == Long.class) {
+    //        return EdmType.Int64;
+    //      } else if (type == double.class || type == Double.class) {
+    //        return EdmType.Double;
+    //      } else if (type == float.class || type == Float.class) {
+    //        return EdmType.Single;
+    //      } else if (type == BigInteger.class || type == BigDecimal.class) {
+    //        return EdmType.Decimal;
+    //      } else if (type == Byte[].class || type == byte[].class) {
+    //        return EdmType.Binary;
+    //      } else if (type == Date.class) {
+    //        return EdmType.DateTime;
+    //      } else if (type == Calendar.class) {
+    //        return EdmType.DateTimeOffset;
+    //      } else if (type == UUID.class) {
+    //        return EdmType.Guid;
+    //      } else {
+    //        throw new UnsupportedOperationException("Not yet supported type '" + type + "'.");
+    //      }
+    //    }
 
     private EdmType getEdmType(final Class<?> type) {
       if (type == String.class) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java
index d7a165f..0d2ff11 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationHelper.java
@@ -452,7 +452,7 @@ public class AnnotationHelper {
 
   private Field getFieldForPropertyName(final String propertyName,
       final Class<?> resultClass, final boolean inherited) {
-    
+
     Field[] fields = resultClass.getDeclaredFields();
     for (Field field : fields) {
       EdmProperty property = field.getAnnotation(EdmProperty.class);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java
index 92183c5..177b2b7 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/AnnotationRuntimeException.java
@@ -25,16 +25,16 @@ public class AnnotationRuntimeException extends RuntimeException {
 
   /** Manual generated */
   private static final long serialVersionUID = 42L;
-  
-  public AnnotationRuntimeException(String message) {
+
+  public AnnotationRuntimeException(final String message) {
     super(message);
   }
 
-  public AnnotationRuntimeException(Throwable cause) {
+  public AnnotationRuntimeException(final Throwable cause) {
     super(cause);
   }
 
-  public AnnotationRuntimeException(String message, Throwable cause) {
+  public AnnotationRuntimeException(final String message, final Throwable cause) {
     super(message, cause);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
index 24f550a..84e9192 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/edm/AnnotationEdmProviderTest.java
@@ -359,7 +359,7 @@ public class AnnotationEdmProviderTest {
     PropertyRef imageFormat = getPropertyRef(keyReferences, "ImageFormat");
     assertEquals("ImageFormat", imageFormat.getName());
 
-//    assertEquals(0, photo.getNavigationProperties().size());
+    //    assertEquals(0, photo.getNavigationProperties().size());
     assertNull(photo.getNavigationProperties());
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
index c3cd885..393b651 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
@@ -84,17 +84,5 @@ public class ClassHelperTest {
     Long id;
     @EdmProperty
     String name;
-
-    public SimpleEntity() {}
-
-    public SimpleEntity(final Long id, final String name) {
-      this.id = id;
-      this.name = name;
-    }
-  }
-
-  @SuppressWarnings("unused")
-  private class NotAnnotatedBean {
-    private String name;
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java
index 33add0a..1cc166a 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/City.java
@@ -33,7 +33,7 @@ public class City {
   private String cityName;
 
   public City() {}
-  
+
   public City(final String postalCode, final String name) {
     this.postalCode = postalCode;
     cityName = name;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java
index 9a2b46b..52f2811 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/main/java/org/apache/olingo/odata2/annotation/processor/ref/model/Location.java
@@ -32,7 +32,7 @@ public class Location {
   private City city;
 
   public Location() {}
-  
+
   public Location(final String country, final String postalCode, final String cityName) {
     this.country = country;
     city = new City(postalCode, cityName);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java
index 7ae0e3c..5075486 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefJsonTest.java
@@ -30,7 +30,7 @@ import com.google.gson.reflect.TypeToken;
  */
 @Ignore("no test methods")
 public class AbstractRefJsonTest extends AbstractRefTest {
-  public AbstractRefJsonTest(ServletType servletType) {
+  public AbstractRefJsonTest(final ServletType servletType) {
     super(servletType);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java
index b71064c..35f6678 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefTest.java
@@ -51,7 +51,7 @@ import org.junit.Ignore;
 @Ignore("no test methods")
 public class AbstractRefTest extends AbstractFitTest {
 
-  public AbstractRefTest(ServletType servletType) {
+  public AbstractRefTest(final ServletType servletType) {
     super(servletType);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java
index a5cb671..635e605 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/AbstractRefXmlTest.java
@@ -42,7 +42,7 @@ import org.xml.sax.SAXException;
  */
 @Ignore("no test methods")
 public class AbstractRefXmlTest extends AbstractRefTest {
-  public AbstractRefXmlTest(ServletType servletType) {
+  public AbstractRefXmlTest(final ServletType servletType) {
     super(servletType);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
index 183d023..90b0384 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/EntryJsonCreateTest.java
@@ -38,7 +38,7 @@ import com.google.gson.internal.StringMap;
  */
 public class EntryJsonCreateTest extends AbstractRefJsonTest {
 
-  public EntryJsonCreateTest(ServletType servletType) {
+  public EntryJsonCreateTest(final ServletType servletType) {
     super(servletType);
   }
 
@@ -129,38 +129,38 @@ public class EntryJsonCreateTest extends AbstractRefJsonTest {
 
     StringMap<?> location = (StringMap<?>) updatedMap.get("Location");
     assertEquals("Britian", location.get("Country"));
-    
+
     StringMap<?> city = (StringMap<?>) location.get("City");
     assertEquals("12345", city.get("PostalCode"));
     assertEquals("Sample", city.get("CityName"));
   }
-  
-  private static final String JSON_EMPLOYEE = "{" + 
-      "    \"d\": {" + 
-//      "        \"__metadata\": {" + 
-//      "            \"id\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," + 
-//      "            \"uri\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," + 
-//      "            \"type\": \"RefScenario.Employee\"," + 
-//      "            \"content_type\": \"application/octet-stream\"," + 
-//      "            \"media_src\": \"Employees('1')/$value\"," + 
-//      "            \"edit_media\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')/$value\"" + 
-//      "        }," + 
-      "        \"EmployeeId\": \"1\"," + 
-      "        \"EmployeeName\": \"Douglas\"," + 
-      "        \"Age\": 42," + 
-      "        \"Location\": {" + 
-      "            \"__metadata\": {" + 
-      "                \"type\": \"RefScenario.c_Location\"" + 
-      "            }," + 
-      "            \"Country\": \"Britian\"," + 
-      "            \"City\": {" + 
-      "                \"__metadata\": {" + 
-      "                    \"type\": \"RefScenario.c_City\"" + 
-      "                }," + 
-      "                \"PostalCode\": \"12345\"," + 
-      "                \"CityName\": \"Sample\"" + 
-      "            }" + 
-      "        }" + 
-      "    }" + 
+
+  private static final String JSON_EMPLOYEE = "{" +
+      "    \"d\": {" +
+      //      "        \"__metadata\": {" + 
+      //      "            \"id\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," + 
+      //      "            \"uri\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')\"," + 
+      //      "            \"type\": \"RefScenario.Employee\"," + 
+      //      "            \"content_type\": \"application/octet-stream\"," + 
+      //      "            \"media_src\": \"Employees('1')/$value\"," + 
+      //      "            \"edit_media\": \"http://localhost:19000/abc/EntryJsonCreateTest/Employees('1')/$value\"" + 
+      //      "        }," + 
+      "        \"EmployeeId\": \"1\"," +
+      "        \"EmployeeName\": \"Douglas\"," +
+      "        \"Age\": 42," +
+      "        \"Location\": {" +
+      "            \"__metadata\": {" +
+      "                \"type\": \"RefScenario.c_Location\"" +
+      "            }," +
+      "            \"Country\": \"Britian\"," +
+      "            \"City\": {" +
+      "                \"__metadata\": {" +
+      "                    \"type\": \"RefScenario.c_City\"" +
+      "                }," +
+      "                \"PostalCode\": \"12345\"," +
+      "                \"CityName\": \"Sample\"" +
+      "            }" +
+      "        }" +
+      "    }" +
       "}";
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java
index 0a875e1..f7ec2ec 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceJsonTest.java
@@ -40,7 +40,7 @@ import org.junit.Test;
  * 
  */
 public class ServiceJsonTest extends AbstractRefTest {
-  public ServiceJsonTest(ServletType servletType) {
+  public ServiceJsonTest(final ServletType servletType) {
     super(servletType);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java
index d620f37..d0569bf 100644
--- a/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java
+++ b/odata2-annotation-processor/annotation-processor-ref/src/test/java/org/apache/olingo/odata2/annotation/processor/ref/ServiceXmlTest.java
@@ -37,7 +37,7 @@ import org.xml.sax.SAXException;
  */
 public class ServiceXmlTest extends AbstractRefXmlTest {
 
-  public ServiceXmlTest(ServletType servletType) {
+  public ServiceXmlTest(final ServletType servletType) {
     super(servletType);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java
index 2906121..60baa9d 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImport.java
@@ -77,7 +77,6 @@ public class JPAEdmFunctionImport extends JPAEdmBaseViewImpl implements JPAEdmFu
     private JPAEdmEntityTypeView jpaEdmEntityTypeView = null;
     private JPAEdmComplexTypeView jpaEdmComplexTypeView = null;
 
-
     @Override
     public void build() throws ODataJPAModelException, ODataJPARuntimeException {
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java
index b763ded..33b47ea 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/model/JPACustomProcessorNegativeMock.java
@@ -21,9 +21,9 @@ package org.apache.olingo.odata2.jpa.processor.core.mock.model;
 import java.util.List;
 
 import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImport;
-import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImportParameter;
 import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImport.ReturnType;
 import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImport.ReturnType.Type;
+import org.apache.olingo.odata2.api.annotation.edm.EdmFunctionImportParameter;
 
 public class JPACustomProcessorNegativeMock {
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
index 8086924..b43e448 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
@@ -430,7 +430,7 @@ public final class EntityProvider {
      * @return read error document
      * @throws EntityProviderException if reading of data (de-serialization) fails
      */
-    ODataErrorContext readErrorDocument(InputStream errorDocument, String contentType) throws  EntityProviderException;
+    ODataErrorContext readErrorDocument(InputStream errorDocument, String contentType) throws EntityProviderException;
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java
index bdc2156..c1a476d 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/exception/ODataMessageException.java
@@ -120,14 +120,14 @@ public abstract class ODataMessageException extends ODataException {
    */
   @Override
   public String getMessage() {
-    if(messageReference == null) {
+    if (messageReference == null) {
       return "No message reference given. Inherit message is = '" + super.getMessage() + "'";
     }
-    
+
     String message = RuntimeDelegate.extractExceptionMessage(this);
-    if(message == null) {
+    if (message == null) {
       return "Message Reference key = '" + messageReference.getKey() +
-              "' and inherit message = '" + super.getMessage() + "'";
+          "' and inherit message = '" + super.getMessage() + "'";
     }
     return message;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java
index 051270a..db500c6 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/rt/RuntimeDelegate.java
@@ -232,7 +232,7 @@ public abstract class RuntimeDelegate {
    * @param exception which contains the message references.
    * @return the message of the {@link ODataMessageException}
    */
-  public static String extractExceptionMessage(ODataMessageException exception) {
+  public static String extractExceptionMessage(final ODataMessageException exception) {
     return RuntimeDelegate.getInstance().extractExceptionMessage(exception);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
index 3efa87b..3433186 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
@@ -34,7 +34,7 @@ public class XmlHelper {
   public static XMLStreamReader createStreamReader(final Object content) throws EntityProviderException {
     if (content == null) {
       throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT
-              .addContent("Got not allowed NULL parameter for creation of XMLStreamReader."));
+          .addContent("Got not allowed NULL parameter for creation of XMLStreamReader."));
     }
     XMLStreamReader streamReader;
     try {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java
index b893e14..4954c75 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoBody.java
@@ -72,7 +72,7 @@ public class DebugInfoBody implements DebugInfo {
   }
 
   @Override
-  public void appendJson(JsonStreamWriter jsonStreamWriter) throws IOException {
+  public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException {
     if (isJson) {
       jsonStreamWriter.unquotedValue(getContentString());
     } else if (isText) {
@@ -100,7 +100,7 @@ public class DebugInfoBody implements DebugInfo {
   }
 
   @Override
-  public void appendHtml(Writer writer) throws IOException {
+  public void appendHtml(final Writer writer) throws IOException {
     final String body = getContentString();
     if (isImage) {
       writer.append("<img src=\"data:").append(response.getContentHeader()).append(";base64,")

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java
index 4201ba1..e8f6c5a 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoException.java
@@ -92,7 +92,7 @@ public class DebugInfoException implements DebugInfo {
   }
 
   @Override
-  public void appendHtml(Writer writer) throws IOException {
+  public void appendHtml(final Writer writer) throws IOException {
     appendException(exception, writer);
     writer.append("<h2>Stacktrace</h2>\n");
     int count = 0;
@@ -101,7 +101,7 @@ public class DebugInfoException implements DebugInfo {
     }
   }
 
-  private void appendException(final Throwable throwable, Writer writer) throws IOException {
+  private void appendException(final Throwable throwable, final Writer writer) throws IOException {
     if (throwable.getCause() != null) {
       appendException(throwable.getCause(), writer);
     }
@@ -114,7 +114,7 @@ public class DebugInfoException implements DebugInfo {
   }
 
   private void appendStackTraceElement(final StackTraceElement stackTraceElement,
-      final boolean isFirst, final boolean isLast, Writer writer) throws IOException {
+      final boolean isFirst, final boolean isLast, final Writer writer) throws IOException {
     if (isFirst) {
       writer.append("<table>\n<thead>\n")
           .append("<tr>\n<th class=\"name\">Class</th>\n")

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java
index 62af105..15e6b2f 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRequest.java
@@ -80,7 +80,7 @@ public class DebugInfoRequest implements DebugInfo {
   }
 
   @Override
-  public void appendHtml(Writer writer) throws IOException {
+  public void appendHtml(final Writer writer) throws IOException {
     writer.append("<h2>Request Method</h2>\n")
         .append("<p>").append(method).append("</p>\n")
         .append("<h2>Request URI</h2>\n")

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java
index a2e1d42..1260803 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoResponse.java
@@ -53,7 +53,7 @@ public class DebugInfoResponse implements DebugInfo {
   }
 
   @Override
-  public void appendJson(JsonStreamWriter jsonStreamWriter) throws IOException {
+  public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException {
     jsonStreamWriter.beginObject();
 
     if (status != null) {
@@ -84,7 +84,7 @@ public class DebugInfoResponse implements DebugInfo {
   }
 
   @Override
-  public void appendHtml(Writer writer) throws IOException {
+  public void appendHtml(final Writer writer) throws IOException {
     writer.append("<h2>Status Code</h2>\n")
         .append("<p>").append(Integer.toString(status.getStatusCode())).append(' ')
         .append(status.getInfo()).append("</p>\n")

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java
index 250a2b4..90fdd37 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoRuntime.java
@@ -159,11 +159,11 @@ public class DebugInfoRuntime implements DebugInfo {
   }
 
   @Override
-  public void appendHtml(Writer writer) throws IOException {
+  public void appendHtml(final Writer writer) throws IOException {
     appendRuntimeNode(rootNode, "", true, writer);
   }
 
-  private void appendRuntimeNode(final RuntimeNode node, final String draw, final boolean isLast, Writer writer)
+  private void appendRuntimeNode(final RuntimeNode node, final String draw, final boolean isLast, final Writer writer)
       throws IOException {
     if (node.className != null) {
       writer.append("<li>")

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
index 97d5646..ad1fd4a 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
@@ -63,7 +63,7 @@ public class DebugInfoServer implements DebugInfo {
   }
 
   @Override
-  public void appendHtml(Writer writer) throws IOException {
+  public void appendHtml(final Writer writer) throws IOException {
     writer.append("<h2>Server Environment</h2>\n");
     ODataDebugResponseWrapper.appendHtmlTable(writer, environment);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java
index daecc7a..eb6d8b6 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoUri.java
@@ -76,7 +76,7 @@ public class DebugInfoUri implements DebugInfo {
   }
 
   @Override
-  public void appendJson(JsonStreamWriter jsonStreamWriter) throws IOException {
+  public void appendJson(final JsonStreamWriter jsonStreamWriter) throws IOException {
     jsonStreamWriter.beginObject();
 
     if (exception != null && exception.getFilterTree() != null) {
@@ -127,7 +127,7 @@ public class DebugInfoUri implements DebugInfo {
   }
 
   @Override
-  public void appendHtml(Writer writer) throws IOException {
+  public void appendHtml(final Writer writer) throws IOException {
     if (exception != null && exception.getFilterTree() != null) {
       writer.append("<h2>Expression Information</h2>\n")
           .append("<pre class=\"code\">").append(exception.getFilterTree().getUriLiteral())
@@ -162,7 +162,7 @@ public class DebugInfoUri implements DebugInfo {
     }
   }
 
-  private void appendExpression(final CommonExpression expression, Writer writer) throws IOException {
+  private void appendExpression(final CommonExpression expression, final Writer writer) throws IOException {
     final ExpressionKind kind = expression.getKind();
     writer.append("<span class=\"kind\">")
         .append(kind.toString())
@@ -200,7 +200,7 @@ public class DebugInfoUri implements DebugInfo {
     }
   }
 
-  private void appendExpandSelect(final ExpandSelectTreeNode expandSelect, Writer writer) throws IOException {
+  private void appendExpandSelect(final ExpandSelectTreeNode expandSelect, final Writer writer) throws IOException {
     writer.append("<ul class=\"expand\">\n")
         .append("<li>");
     if (expandSelect.isAll()) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
index 5eae0e9..78fe62f 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
@@ -242,7 +242,7 @@ public class ODataDebugResponseWrapper {
     return value == null ? null : value.replace("&", "&amp;").replace("<", "&lt;").replace(">", "&gt;");
   }
 
-  protected static void appendJsonTable(JsonStreamWriter jsonStreamWriter, final Map<String, String> entries)
+  protected static void appendJsonTable(final JsonStreamWriter jsonStreamWriter, final Map<String, String> entries)
       throws IOException {
     jsonStreamWriter.beginObject();
     boolean first = true;
@@ -260,7 +260,7 @@ public class ODataDebugResponseWrapper {
     jsonStreamWriter.endObject();
   }
 
-  protected static void appendHtmlTable(Writer writer, final Map<String, String> entries) throws IOException {
+  protected static void appendHtmlTable(final Writer writer, final Map<String, String> entries) throws IOException {
     writer.append("<table>\n<thead>\n")
         .append("<tr><th class=\"name\">Name</th><th class=\"value\">Value</th></tr>\n")
         .append("</thead>\n<tbody>\n");

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java
index 0aaae45..a05e9c3 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/EdmDouble.java
@@ -38,18 +38,10 @@ public class EdmDouble extends AbstractSimpleType {
   private static final int MAX_PRECISION = 15;
   private static final int MAX_SCALE = 308;
 
-
   private static final Pattern PATTERN = Pattern.compile(
       "(?:\\+|-)?\\p{Digit}+(?:\\.\\p{Digit}+)?(?:(?:E|e)(?:\\+|-)?\\p{Digit}{1,3})?(D|d)?");
   private static final EdmDouble instance = new EdmDouble();
 
-  
-  
-  
-  
-  
-  
-  
   public static EdmDouble getInstance() {
     return instance;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
index d21cec4..9eb1a8f 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -23,6 +23,10 @@ import java.util.HashMap;
 import java.util.Locale;
 import java.util.Map;
 
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
 import org.apache.olingo.odata2.api.edm.Edm;
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
 import org.apache.olingo.odata2.api.processor.ODataErrorContext;
@@ -30,10 +34,6 @@ import org.apache.olingo.odata2.core.commons.ContentType;
 import org.apache.olingo.odata2.core.commons.XmlHelper;
 import org.apache.olingo.odata2.core.ep.util.FormatXml;
 
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
 /**
  * Consuming (read / deserialization) for OData error document in XML format.
  */
@@ -65,7 +65,7 @@ public class XmlErrorDocumentConsumer {
       return parserError(reader);
     } catch (XMLStreamException e) {
       cachedException = new EntityProviderException(EntityProviderException.INVALID_STATE.addContent(
-                      e.getMessage()), e);
+          e.getMessage()), e);
       throw cachedException;
     } catch (EntityProviderException e) {
       cachedException = e;
@@ -79,15 +79,15 @@ public class XmlErrorDocumentConsumer {
             throw cachedException;
           } else {
             throw new EntityProviderException(
-                    EntityProviderException.EXCEPTION_OCCURRED.addContent(
-                            e.getClass().getSimpleName()), e);
+                EntityProviderException.EXCEPTION_OCCURRED.addContent(
+                    e.getClass().getSimpleName()), e);
           }
         }
       }
     }
   }
 
-  private ODataErrorContext parserError(XMLStreamReader reader) throws XMLStreamException, EntityProviderException {
+  private ODataErrorContext parserError(final XMLStreamReader reader) throws XMLStreamException, EntityProviderException {
     // read xml tag
     reader.require(XMLStreamConstants.START_DOCUMENT, null, null);
     reader.nextTag();
@@ -99,21 +99,21 @@ public class XmlErrorDocumentConsumer {
     boolean codeFound = false;
     boolean messageFound = false;
     ODataErrorContext errorContext = new ODataErrorContext();
-    while(notFinished(reader)) {
+    while (notFinished(reader)) {
       reader.nextTag();
-      if(reader.isStartElement()) {
+      if (reader.isStartElement()) {
         String name = reader.getLocalName();
-        if(FormatXml.M_CODE.equals(name)) {
+        if (FormatXml.M_CODE.equals(name)) {
           codeFound = true;
           handleCode(reader, errorContext);
-        } else if(FormatXml.M_MESSAGE.equals(name)) {
+        } else if (FormatXml.M_MESSAGE.equals(name)) {
           messageFound = true;
           handleMessage(reader, errorContext);
-        } else if(FormatXml.M_INNER_ERROR.equals(name)) {
+        } else if (FormatXml.M_INNER_ERROR.equals(name)) {
           handleInnerError(reader, errorContext);
         } else {
           throw new EntityProviderException(
-                  EntityProviderException.INVALID_CONTENT.addContent(name, FormatXml.M_ERROR));
+              EntityProviderException.INVALID_CONTENT.addContent(name, FormatXml.M_ERROR));
         }
       }
     }
@@ -123,34 +123,34 @@ public class XmlErrorDocumentConsumer {
     return errorContext;
   }
 
-  private void validate(boolean codeFound, boolean messageFound) throws EntityProviderException {
+  private void validate(final boolean codeFound, final boolean messageFound) throws EntityProviderException {
     if (!codeFound) {
       throw new EntityProviderException(
-              EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'code' property not found.'"));
+          EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'code' property not found.'"));
     } else if (!messageFound) {
       throw new EntityProviderException(
-              EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'message' property not found.'"));
+          EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'message' property not found.'"));
     }
   }
 
-  private boolean notFinished(XMLStreamReader reader) throws XMLStreamException {
+  private boolean notFinished(final XMLStreamReader reader) throws XMLStreamException {
     boolean finished = reader.isEndElement() && FormatXml.M_ERROR.equals(reader.getLocalName());
     return !finished && reader.hasNext();
   }
 
-  private void handleInnerError(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+  private void handleInnerError(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
     String innerError = reader.getElementText();
     errorContext.setInnerError(innerError);
   }
 
-  private void handleMessage(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+  private void handleMessage(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
     String lang = reader.getAttributeValue(Edm.NAMESPACE_XML_1998, FormatXml.XML_LANG);
     errorContext.setLocale(getLocale(lang));
     String message = reader.getElementText();
     errorContext.setMessage(message);
   }
 
-  private void handleCode(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+  private void handleCode(final XMLStreamReader reader, final ODataErrorContext errorContext) throws XMLStreamException {
     String code = reader.getElementText();
     errorContext.setErrorCode(code);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java
index 96c3b93..2c207bb 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rest/ODataSubLocator.java
@@ -144,7 +144,7 @@ public final class ODataSubLocator {
 
     ODataContextImpl context = new ODataContextImpl(request, serviceFactory);
     context.setParameter(ODataContext.HTTP_SERVLET_REQUEST_OBJECT, httpRequest);
-    
+
     ODataService service = serviceFactory.createService(context);
 
     service.getProcessor().setContext(context);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java
index 8c1852e..dbe2935 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/servlet/ODataServlet.java
@@ -176,7 +176,7 @@ public class ODataServlet extends HttpServlet {
       ODataService service = serviceFactory.createService(context);
       context.setService(service);
       service.getProcessor().setContext(context);
-      
+
       ODataRequestHandler requestHandler = new ODataRequestHandler(serviceFactory, service, context);
       final ODataResponse odataResponse = requestHandler.handle(odataRequest);
       createResponse(resp, odataResponse);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
index 58577aa..e5236d4 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
@@ -252,13 +252,13 @@ public class ProviderFacadeImplTest extends AbstractConsumerTest {
   public void readErrorDocumentXml() throws EntityProviderException {
     ProviderFacadeImpl providerFacade = new ProviderFacadeImpl();
     String errorDoc =
-            "<?xml version='1.0' encoding='UTF-8'?>\n" +
+        "<?xml version='1.0' encoding='UTF-8'?>\n" +
             "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
             "\t<code>ErrorCode</code>\n" +
             "\t<message xml:lang=\"en-US\">Message</message>\n" +
             "</error>";
     ODataErrorContext errorContext = providerFacade.readErrorDocument(StringHelper.encapsulate(errorDoc),
-            ContentType.APPLICATION_XML.toContentTypeString());
+        ContentType.APPLICATION_XML.toContentTypeString());
     //
     assertEquals("Wrong content type", "application/xml", errorContext.getContentType());
     assertEquals("Wrong message", "Message", errorContext.getMessage());

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
index 4f4dc2b..a98044e 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
@@ -18,11 +18,31 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.core.exception;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Locale;
+
 import org.apache.olingo.odata2.api.edm.EdmException;
 import org.apache.olingo.odata2.api.edm.EdmLiteralException;
 import org.apache.olingo.odata2.api.edm.EdmSimpleTypeException;
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
-import org.apache.olingo.odata2.api.exception.*;
+import org.apache.olingo.odata2.api.exception.ODataBadRequestException;
+import org.apache.olingo.odata2.api.exception.ODataConflictException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.exception.ODataForbiddenException;
+import org.apache.olingo.odata2.api.exception.ODataHttpException;
+import org.apache.olingo.odata2.api.exception.ODataMessageException;
+import org.apache.olingo.odata2.api.exception.ODataMethodNotAllowedException;
+import org.apache.olingo.odata2.api.exception.ODataNotAcceptableException;
+import org.apache.olingo.odata2.api.exception.ODataNotFoundException;
+import org.apache.olingo.odata2.api.exception.ODataNotImplementedException;
+import org.apache.olingo.odata2.api.exception.ODataPreconditionFailedException;
+import org.apache.olingo.odata2.api.exception.ODataPreconditionRequiredException;
+import org.apache.olingo.odata2.api.exception.ODataServiceUnavailableException;
+import org.apache.olingo.odata2.api.exception.ODataUnsupportedMediaTypeException;
 import org.apache.olingo.odata2.api.uri.UriNotMatchingException;
 import org.apache.olingo.odata2.api.uri.UriSyntaxException;
 import org.apache.olingo.odata2.api.uri.expression.ExceptionVisitExpression;
@@ -35,10 +55,6 @@ import org.apache.olingo.odata2.testutil.fit.BaseTest;
 import org.apache.olingo.odata2.testutil.helper.ODataMessageTextVerifier;
 import org.junit.Test;
 
-import java.util.Locale;
-
-import static org.junit.Assert.*;
-
 /**
  *  
  */

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java
index 2beed3c..73b88aa 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/AbstractRefJsonTest.java
@@ -30,7 +30,7 @@ import com.google.gson.reflect.TypeToken;
  */
 @Ignore("no test methods")
 public class AbstractRefJsonTest extends AbstractRefTest {
-  
+
   public AbstractRefJsonTest(final ServletType servletType) {
     super(servletType);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
index c4677a1..8533e42 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/contentnegotiation/BasicContentNegotiationTest.java
@@ -197,7 +197,7 @@ public class BasicContentNegotiationTest extends AbstractContentNegotiationTest
     final HttpResponse response = new DefaultHttpClient().execute(get);
 
     final String contentType = response.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue();
-//    assertEquals(expectedResponseContentType, contentType);
+    //    assertEquals(expectedResponseContentType, contentType);
     try {
 
       assertEquals(ContentType.APPLICATION_XML, ContentType.create(contentType));

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
index 47fb03a..7345c84 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/AbstractFitTest.java
@@ -47,13 +47,10 @@ public abstract class AbstractFitTest extends BaseTest {
 
   private final HttpClient httpClient = new DefaultHttpClient();
 
-  private ServletType servletType;
-
-  public AbstractFitTest(ServletType servletType) {
-    this.servletType = servletType;
+  public AbstractFitTest(final ServletType servletType) {
     server = new TestServer(this.getClass().getSimpleName(), servletType);
   }
-  
+
   @Parameterized.Parameters
   public static List<Object[]> data() {
     // If desired this can be made dependent on runtime variables
@@ -65,8 +62,8 @@ public abstract class AbstractFitTest extends BaseTest {
     return Arrays.asList(a);
   }
 
-//  public AbstractFitTest() {
-//  }
+  //  public AbstractFitTest() {
+  //  }
 
   protected URI getEndpoint() {
     return server.getEndpoint();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java
index 4d1bd6f..8fcf979 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/fit/FitStaticServiceFactory.java
@@ -73,7 +73,7 @@ public class FitStaticServiceFactory extends ODataServiceFactory {
     assertNotNull(ctx);
     assertNotNull(ctx.getAcceptableLanguages());
     assertNotNull(ctx.getParameter(ODataContext.HTTP_SERVLET_REQUEST_OBJECT));
-    
+
     final Map<String, List<String>> requestHeaders = ctx.getRequestHeaders();
     final String host = requestHeaders.get("Host").get(0);
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/f57601c2/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
index 05b9f0f..87e57ca 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/server/TestServer.java
@@ -54,17 +54,17 @@ public class TestServer {
   private int pathSplit = 0;
   private ServletType servletType;
 
-  public TestServer(ServletType type) {
+  public TestServer(final ServletType type) {
     this(DEFAULT_PATH, type);
-  }  
-  
-  public TestServer(final String path, ServletType type) {
+  }
+
+  public TestServer(final String path, final ServletType type) {
     if (path.startsWith("/")) {
       this.path = path;
     } else {
       this.path = "/" + path;
     }
-    this.servletType = type;
+    servletType = type;
   }
 
   public int getPathSplit() {
@@ -154,22 +154,22 @@ public class TestServer {
     return contextHandler;
   }
 
-//  private ServletContextHandler createODataContextHandler(final Class<? extends ODataServiceFactory> factoryClass)
-//      throws InstantiationException, IllegalAccessException, ClassNotFoundException {
-//    String odataServlet = "org.apache.olingo.odata2.core.servlet.ODataServlet";
-//    final HttpServlet httpServlet = (HttpServlet) Class.forName(odataServlet).newInstance();
-//    final ServletHolder odataServletHolder = new ServletHolder(httpServlet);
-//    odataServletHolder.setInitParameter(ODataServiceFactory.FACTORY_LABEL, factoryClass.getCanonicalName());
-//
-//    if (pathSplit > 0) {
-//      odataServletHolder.setInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL, Integer.toString(pathSplit));
-//    }
-//
-//    final ServletContextHandler contextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
-//    contextHandler.setContextPath("/abc");
-//    contextHandler.addServlet(odataServletHolder, path + "/*");
-//    return contextHandler;
-//  }
+  //  private ServletContextHandler createODataContextHandler(final Class<? extends ODataServiceFactory> factoryClass)
+  //      throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+  //    String odataServlet = "org.apache.olingo.odata2.core.servlet.ODataServlet";
+  //    final HttpServlet httpServlet = (HttpServlet) Class.forName(odataServlet).newInstance();
+  //    final ServletHolder odataServletHolder = new ServletHolder(httpServlet);
+  //    odataServletHolder.setInitParameter(ODataServiceFactory.FACTORY_LABEL, factoryClass.getCanonicalName());
+  //
+  //    if (pathSplit > 0) {
+  //      odataServletHolder.setInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL, Integer.toString(pathSplit));
+  //    }
+  //
+  //    final ServletContextHandler contextHandler = new ServletContextHandler(ServletContextHandler.SESSIONS);
+  //    contextHandler.setContextPath("/abc");
+  //    contextHandler.addServlet(odataServletHolder, path + "/*");
+  //    return contextHandler;
+  //  }
 
   public void startServer(final ODataService service) {
     startServer(FitStaticServiceFactory.class);


[17/38] git commit: [OLINGO-185] Handling java.sql.Blob and java.sql.Clob in JPA processor

Posted by mi...@apache.org.
[OLINGO-185] Handling java.sql.Blob and java.sql.Clob in JPA processor

New callback interface
org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent is
introduced. Implement this interface when Blob and Clob data types are
used as JPA entity property. OData JPA processor call backs the
implementation to fetch the JPA provider specific implementation of Blob
and Clob Objects.

The callback implementation needs to be registered via the method
setOnJPAWriteCallBack provided as part of ODataJPAServiceFactory class.



Signed-off-by: Chandan V A <ch...@sap.com>

Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/ba0ff6be
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/ba0ff6be
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/ba0ff6be

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: ba0ff6beb9944f1a57115d5ed7367a3498f629fb
Parents: 1f37db3
Author: Chandan V A <ch...@sap.com>
Authored: Wed Apr 2 17:20:42 2014 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Wed Apr 2 17:20:42 2014 +0530

----------------------------------------------------------------------
 .../processor/api/ODataJPAServiceFactory.java   |  17 ++
 .../jpa/processor/api/OnJPAWriteContent.java    |  54 +++++
 .../api/exception/ODataJPARuntimeException.java |   5 +
 .../processor/core/access/data/JPAEntity.java   |  66 ++++--
 .../core/access/data/JPAEntityParser.java       | 105 +++++++++
 .../core/access/model/JPATypeConvertor.java     |  41 ++--
 .../main/resources/jpaprocessor_msg.properties  |   2 +
 .../JPAEntityParserTestForStaticMethods.java    |  79 +++++++
 .../core/access/data/JPAEntityTest.java         |  71 +++++-
 .../processor/core/mock/ODataContextMock.java   |  14 ++
 .../core/mock/ODataJPAContextMock.java          |   1 +
 .../core/mock/ODataJPAServiceFactoryMock.java   |  47 ++++
 .../core/mock/OnJPAWriteContentMock.java        |  58 +++++
 .../processor/core/mock/data/EdmMockUtilV2.java |  57 ++++-
 .../processor/core/mock/data/JPATypeMock.java   |  63 +++++
 .../core/mock/data/ODataEntryMockUtil.java      |  16 +-
 odata2-jpa-processor/jpa-ref/pom.xml            |  36 ++-
 .../ref/converter/BlobToByteConverter.java      |  64 +++++
 .../jpa/processor/ref/model/Material.java       |  21 ++
 .../odata2/jpa/processor/ref/model/Note.java    |  13 +-
 .../odata2/jpa/processor/ref/model/NoteKey.java |  65 +++++
 .../src/main/resources/META-INF/persistence.xml |   4 +
 odata2-jpa-processor/jpa-web/pom.xml            | 236 ++++++++++---------
 .../ref/extension/OnDBWriteContent.java         |  37 +++
 .../ref/web/JPAReferenceServiceFactory.java     |   4 +
 .../main/resources/SQL_Insert_Note.properties   |   2 +-
 26 files changed, 998 insertions(+), 180 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java
index 66d29f9..82aa68d 100644
--- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/ODataJPAServiceFactory.java
@@ -80,6 +80,7 @@ public abstract class ODataJPAServiceFactory extends ODataServiceFactory {
   private ODataJPAContext oDataJPAContext;
   private ODataContext oDataContext;
   private boolean setDetailErrors = false;
+  private OnJPAWriteContent onJPAWriteContent = null;
 
   /**
    * Creates an OData Service based on the values set in
@@ -176,6 +177,16 @@ public abstract class ODataJPAServiceFactory extends ODataServiceFactory {
     this.setDetailErrors = setDetailErrors;
   }
 
+  /**
+   * The methods sets the context with a callback implementation for JPA provider specific content.
+   * For details refer to {@link org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent}
+   * @param onJPAWriteContent is an instance of type
+   * {@link org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent}
+   */
+  protected void setOnWriteJPAContent(final OnJPAWriteContent onJPAWriteContent) {
+    this.onJPAWriteContent = onJPAWriteContent;
+  }
+
   @SuppressWarnings("unchecked")
   @Override
   public <T extends ODataCallback> T getCallback(final Class<? extends ODataCallback> callbackInterface) {
@@ -184,6 +195,12 @@ public abstract class ODataJPAServiceFactory extends ODataServiceFactory {
         return (T) new ODataJPAErrorCallback();
       }
     }
+
+    if (onJPAWriteContent != null) {
+      if (callbackInterface.isAssignableFrom(OnJPAWriteContent.class)) {
+        return (T) onJPAWriteContent;
+      }
+    }
     return null;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/OnJPAWriteContent.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/OnJPAWriteContent.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/OnJPAWriteContent.java
new file mode 100644
index 0000000..6be7492
--- /dev/null
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/OnJPAWriteContent.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * 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.olingo.odata2.jpa.processor.api;
+
+import java.sql.Blob;
+import java.sql.Clob;
+
+import org.apache.olingo.odata2.api.ODataCallback;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+
+/**
+ * <p> The interface is a call back interface that enables OData JPA Processor to get JPA provider specific
+ * implementation
+ * of <b>java.sql.Blob</b> and <b>java.sql.Clob</b> instances.</p>
+ * <p>
+ * Implement this interface if the JPA Model uses the data types java.sql.Blob and java.sql.Clob for its entity
+ * properties. </p>
+ * 
+ * 
+ */
+public interface OnJPAWriteContent extends ODataCallback {
+
+  /**
+   * Implement this method to instantiate JPA provider specific implementation of java.sql.Blob instance from an array
+   * of bytes.
+   * @param binaryData is an array of bytes
+   * @return an instance of type {@link java.sql.Blob}
+   */
+  public Blob getJPABlob(byte[] binaryData) throws ODataJPARuntimeException;
+
+  /**
+   * Implement this method to instantiate JPA provider specific implementation of java.sql.Clob instance from an array
+   * of characters.
+   * @param characterData is an array of characters
+   * @return an instance of type {@link java.sql.Clob}
+   */
+  public Clob getJPAClob(char[] characterData) throws ODataJPARuntimeException;
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java
index 46737bc..bac5ca3 100644
--- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java
@@ -66,6 +66,10 @@ public class ODataJPARuntimeException extends ODataJPAException {
       "RELATIONSHIP_INVALID");
   public static final MessageReference RESOURCE_X_NOT_FOUND = createMessageReference(ODataJPARuntimeException.class,
       "RESOURCE_X_NOT_FOUND");
+  public static final MessageReference ERROR_JPA_BLOB_NULL = createMessageReference(ODataJPARuntimeException.class,
+      "ERROR_JPA_BLOB_NULL");
+  public static final MessageReference ERROR_JPA_CLOB_NULL = createMessageReference(ODataJPARuntimeException.class,
+      "ERROR_JPA_CLOB_NULL");
 
   private ODataJPARuntimeException(final String localizedMessage, final Throwable e, final MessageReference msgRef) {
     super(localizedMessage, e, msgRef);
@@ -94,4 +98,5 @@ public class ODataJPARuntimeException extends ODataJPAException {
 
   private static final long serialVersionUID = -5230976355642443012L;
 
+
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
index c7852d2..b263644 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
@@ -20,6 +20,9 @@ package org.apache.olingo.odata2.jpa.processor.core.access.data;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -32,6 +35,7 @@ import org.apache.olingo.odata2.api.edm.EdmEntityType;
 import org.apache.olingo.odata2.api.edm.EdmException;
 import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
 import org.apache.olingo.odata2.api.edm.EdmProperty;
+import org.apache.olingo.odata2.api.edm.EdmSimpleType;
 import org.apache.olingo.odata2.api.edm.EdmStructuralType;
 import org.apache.olingo.odata2.api.edm.EdmTypeKind;
 import org.apache.olingo.odata2.api.edm.EdmTyped;
@@ -39,6 +43,7 @@ import org.apache.olingo.odata2.api.ep.entry.EntryMetadata;
 import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
 import org.apache.olingo.odata2.api.ep.feed.ODataFeed;
 import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
+import org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent;
 import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
 import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
 import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping;
@@ -53,6 +58,7 @@ public class JPAEntity {
   private HashMap<String, Method> accessModifiersWrite = null;
   private JPAEntityParser jpaEntityParser = null;
   private ODataJPAContext oDataJPAContext;
+  private OnJPAWriteContent onJPAWriteContent = null;
   public HashMap<String, List<Object>> relatedJPAEntityMap = null;
 
   public JPAEntity(final EdmEntityType oDataEntityType, final EdmEntitySet oDataEntitySet,
@@ -67,6 +73,7 @@ public class JPAEntity {
       return;
     }
     jpaEntityParser = new JPAEntityParser();
+    onJPAWriteContent = oDataJPAContext.getODataContext().getServiceFactory().getCallback(OnJPAWriteContent.class);
   }
 
   public void setAccessModifersWrite(final HashMap<String, Method> accessModifiersWrite) {
@@ -140,7 +147,9 @@ public class JPAEntity {
             }
           }
           accessModifier = accessModifiersWrite.get(propertyName);
-          setProperty(accessModifier, jpaEntity, oDataEntryProperties.get(propertyName));
+          setProperty(accessModifier, jpaEntity, oDataEntryProperties.get(propertyName), (EdmSimpleType) edmTyped
+              .getType());
+
           break;
         case COMPLEX:
           structuralType = (EdmStructuralType) edmTyped.getType();
@@ -174,6 +183,9 @@ public class JPAEntity {
         }
       }
     } catch (Exception e) {
+      if (e instanceof ODataJPARuntimeException) {
+        throw (ODataJPARuntimeException) e;
+      }
       throw ODataJPARuntimeException
           .throwException(ODataJPARuntimeException.GENERAL
               .addContent(e.getMessage()), e);
@@ -279,7 +291,7 @@ public class JPAEntity {
   protected void setComplexProperty(Method accessModifier, final Object jpaEntity,
       final EdmStructuralType edmComplexType, final HashMap<String, Object> propertyValue)
       throws EdmException, IllegalAccessException, IllegalArgumentException, InvocationTargetException,
-      InstantiationException, ODataJPARuntimeException {
+      InstantiationException, ODataJPARuntimeException, NoSuchMethodException, SecurityException, SQLException {
 
     JPAEdmMapping mapping = (JPAEdmMapping) edmComplexType.getMapping();
     Object embeddableObject = mapping.getJPAType().newInstance();
@@ -296,27 +308,47 @@ public class JPAEntity {
         setComplexProperty(accessModifier, embeddableObject, structualType, (HashMap<String, Object>) propertyValue
             .get(edmPropertyName));
       } else {
-        setProperty(accessModifier, embeddableObject, propertyValue.get(edmPropertyName));
+        setProperty(accessModifier, embeddableObject, propertyValue.get(edmPropertyName), (EdmSimpleType) edmTyped
+            .getType());
       }
     }
   }
 
-  protected void setProperty(final Method method, final Object entity, final Object entityPropertyValue) throws
-      IllegalAccessException, IllegalArgumentException, InvocationTargetException {
+  protected void setProperty(final Method method, final Object entity, final Object entityPropertyValue,
+      EdmSimpleType type) throws
+      IllegalAccessException, IllegalArgumentException, InvocationTargetException, ODataJPARuntimeException {
     if (entityPropertyValue != null) {
       Class<?> parameterType = method.getParameterTypes()[0];
-      if (parameterType.equals(char[].class)) {
-        char[] characters = ((String) entityPropertyValue).toCharArray();
-        method.invoke(entity, characters);
-      } else if (parameterType.equals(char.class)) {
-        char c = ((String) entityPropertyValue).charAt(0);
-        method.invoke(entity, c);
-      } else if (parameterType.equals(Character[].class)) {
-        Character[] characters = JPAEntityParser.toCharacterArray((String) entityPropertyValue);
-        method.invoke(entity, (Object) characters);
-      } else if (parameterType.equals(Character.class)) {
-        Character c = Character.valueOf(((String) entityPropertyValue).charAt(0));
-        method.invoke(entity, c);
+      if (type != null && type.getDefaultType().equals(String.class)) {
+        if (parameterType.equals(String.class)) {
+          method.invoke(entity, entityPropertyValue);
+        } else if (parameterType.equals(char[].class)) {
+          char[] characters = ((String) entityPropertyValue).toCharArray();
+          method.invoke(entity, characters);
+        } else if (parameterType.equals(char.class)) {
+          char c = ((String) entityPropertyValue).charAt(0);
+          method.invoke(entity, c);
+        } else if (parameterType.equals(Character[].class)) {
+          Character[] characters = JPAEntityParser.toCharacterArray((String) entityPropertyValue);
+          method.invoke(entity, (Object) characters);
+        } else if (parameterType.equals(Character.class)) {
+          Character c = Character.valueOf(((String) entityPropertyValue).charAt(0));
+          method.invoke(entity, c);
+        }
+      } else if (parameterType.equals(Blob.class)) {
+        if (onJPAWriteContent == null) {
+          throw ODataJPARuntimeException
+              .throwException(ODataJPARuntimeException.ERROR_JPA_BLOB_NULL, null);
+        } else {
+          method.invoke(entity, onJPAWriteContent.getJPABlob((byte[]) entityPropertyValue));
+        }
+      } else if (parameterType.equals(Clob.class)) {
+        if (onJPAWriteContent == null) {
+          throw ODataJPARuntimeException
+              .throwException(ODataJPARuntimeException.ERROR_JPA_CLOB_NULL, null);
+        } else {
+          method.invoke(entity, onJPAWriteContent.getJPAClob(((String) entityPropertyValue).toCharArray()));
+        }
       } else {
         method.invoke(entity, entityPropertyValue);
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
index 3930420..7fc9744 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
@@ -18,8 +18,16 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.core.access.data;
 
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.io.StringWriter;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
@@ -230,6 +238,10 @@ public final class JPAEntityParser {
         if (c != null) {
           propertyValue = toString(new Character[] { c });
         }
+      } else if (returnType.equals(Blob.class)) {
+        propertyValue = getBytes((Blob) method.invoke(entity));
+      } else if (returnType.equals(Clob.class)) {
+        propertyValue = getString((Clob) method.invoke(entity));
       } else {
         propertyValue = method.invoke(entity);
       }
@@ -246,6 +258,99 @@ public final class JPAEntityParser {
     return propertyValue;
   }
 
+  public static String getString(Clob clob) throws ODataJPARuntimeException {
+    try {
+      Reader stringReader = clob.getCharacterStream();
+      StringWriter buffer = null;
+      long clobSize = clob.length();
+      long remainingClobSize = clobSize;
+      int len = 0;
+      int off = 0;
+      boolean bufferNotEmpty = false;
+      if (clobSize > Integer.MAX_VALUE) {
+        buffer = new StringWriter(Integer.MAX_VALUE);
+        len = Integer.MAX_VALUE;
+        bufferNotEmpty = true;
+      } else {
+        buffer = new StringWriter((int) clobSize);
+        len = (int) clobSize;
+      }
+      stringReader = clob.getCharacterStream();
+      char c[] = new char[len];
+      while (remainingClobSize > len) {
+        stringReader.read(c, off, len);
+        buffer.write(c);
+        off = len + 1;
+        remainingClobSize = remainingClobSize - Integer.MAX_VALUE;
+        if (remainingClobSize > Integer.MAX_VALUE) {
+          len = Integer.MAX_VALUE;
+        } else {
+          len = (int) remainingClobSize;
+        }
+      }
+      if (remainingClobSize <= len) {
+        stringReader.read(c, off, len);
+      }
+      if (bufferNotEmpty) {
+        return buffer.toString();
+      } else {
+        return new String(c);
+      }
+
+    } catch (SQLException e) {
+      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    } catch (IOException e) {
+      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    }
+
+  }
+
+  public static byte[] getBytes(Blob blob) throws ODataJPARuntimeException {
+    try {
+      InputStream is = null;
+      ByteArrayOutputStream buffer = null;
+      long blobSize = blob.length();
+      long remainingBlobSize = blobSize;
+      int len = 0;
+      int off = 0;
+      boolean bufferNotEmpty = false;
+      if (blobSize > Integer.MAX_VALUE) { // Edge case when the Blob Size is more than 2GB
+        buffer = new ByteArrayOutputStream(Integer.MAX_VALUE);
+        len = Integer.MAX_VALUE;
+        bufferNotEmpty = true;
+      } else {
+        buffer = new ByteArrayOutputStream((int) blobSize);
+        len = (int) blobSize;
+      }
+
+      is = blob.getBinaryStream();
+      byte b[] = new byte[len];
+      while (remainingBlobSize > len) {
+        is.read(b, off, len);
+        buffer.write(b);
+        off = len + 1;
+        remainingBlobSize = remainingBlobSize - Integer.MAX_VALUE;
+        if (remainingBlobSize > Integer.MAX_VALUE) {
+          len = Integer.MAX_VALUE;
+        } else {
+          len = (int) remainingBlobSize;
+        }
+      }
+      if (remainingBlobSize <= len) {
+        is.read(b, off, len);
+      }
+      if (bufferNotEmpty) {
+        return buffer.toByteArray();
+      } else {
+        return b;
+      }
+    } catch (SQLException e) {
+      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    } catch (IOException e) {
+      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    }
+  }
+
   public Object getEmbeddablePropertyValue(final String methodName, final Object jpaEntity)
       throws ODataJPARuntimeException {
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java
index e35e4cf..c5c2722 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java
@@ -18,12 +18,15 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.core.access.model;
 
-import java.lang.reflect.Field;
+import java.lang.reflect.AnnotatedElement;
 import java.math.BigDecimal;
+import java.sql.Blob;
+import java.sql.Clob;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.UUID;
 
+import javax.persistence.Lob;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 import javax.persistence.metamodel.Attribute;
@@ -53,8 +56,6 @@ public class JPATypeConvertor {
    * @see EdmSimpleTypeKind
    */
 
-  private static final String OBJECT_TYPE = "java.lang.Object";
-
   public static EdmSimpleTypeKind
       convertToEdmSimpleType(final Class<?> jpaType, final Attribute<?, ?> currentAttribute)
           throws ODataJPAModelException {
@@ -78,14 +79,12 @@ public class JPATypeConvertor {
       return EdmSimpleTypeKind.Binary;
     } else if (jpaType.equals(Byte.class) || jpaType.equals(byte.class)) {
       return EdmSimpleTypeKind.Byte;
-    } else if (jpaType.equals(Byte[].class)) {
-      return EdmSimpleTypeKind.Binary;
     } else if (jpaType.equals(Boolean.class) || jpaType.equals(boolean.class)) {
       return EdmSimpleTypeKind.Boolean;
     } else if ((jpaType.equals(Date.class)) || (jpaType.equals(Calendar.class))) {
       try {
         if ((currentAttribute != null)
-            && (determineTemporalType(currentAttribute.getDeclaringType().getJavaType(), currentAttribute.getName())
+            && (determineTemporalType(currentAttribute)
               == TemporalType.TIME)) {
           return EdmSimpleTypeKind.Time;
         } else {
@@ -96,21 +95,33 @@ public class JPATypeConvertor {
       }
     } else if (jpaType.equals(UUID.class)) {
       return EdmSimpleTypeKind.Guid;
+    } else if (jpaType.equals(Byte[].class)) {
+      return EdmSimpleTypeKind.Binary;
+    } else if (jpaType.equals(Blob.class) && isBlob(currentAttribute)) {
+      return EdmSimpleTypeKind.Binary;
+    } else if (jpaType.equals(Clob.class) && isBlob(currentAttribute)) {
+      return EdmSimpleTypeKind.String;
     }
     throw ODataJPAModelException.throwException(ODataJPAModelException.TYPE_NOT_SUPPORTED
         .addContent(jpaType.toString()), null);
   }
 
-  private static TemporalType determineTemporalType(final Class<?> type, final String fieldName)
+  private static boolean isBlob(Attribute<?, ?> currentAttribute) {
+    if (currentAttribute != null) {
+      AnnotatedElement annotatedElement = (AnnotatedElement) currentAttribute.getJavaMember();
+      if (annotatedElement != null && annotatedElement.getAnnotation(Lob.class) != null) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  private static TemporalType determineTemporalType(Attribute<?, ?> currentAttribute)
       throws ODataJPAModelException {
-    if (type != null && !type.getName().equals(OBJECT_TYPE)) {
-      try {
-        Field field = type.getField(fieldName);
-        return field.getAnnotation(Temporal.class).value();
-      } catch (NoSuchFieldException e) {
-        determineTemporalType(type.getSuperclass(), fieldName);
-      } catch (SecurityException e) {
-        throw ODataJPAModelException.throwException(ODataJPAModelException.GENERAL.addContent(e.getMessage()), e);
+    if (currentAttribute != null) {
+      AnnotatedElement annotatedElement = (AnnotatedElement) currentAttribute.getJavaMember();
+      if (annotatedElement != null && annotatedElement.getAnnotation(Temporal.class) != null) {
+        return annotatedElement.getAnnotation(Temporal.class).value();
       }
     }
     return null;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/main/resources/jpaprocessor_msg.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/resources/jpaprocessor_msg.properties b/odata2-jpa-processor/jpa-core/src/main/resources/jpaprocessor_msg.properties
index db8d857..7788d49 100644
--- a/odata2-jpa-processor/jpa-core/src/main/resources/jpaprocessor_msg.properties
+++ b/odata2-jpa-processor/jpa-core/src/main/resources/jpaprocessor_msg.properties
@@ -55,6 +55,8 @@ org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException.ER
 org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException.ERROR_JPQL_INTEGRITY_CONSTRAINT="Integrity constraint violation"
 org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException.RELATIONSHIP_INVALID="OData - JPA Runtime: Invalid link"
 org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException.RESOURCE_X_NOT_FOUND="OData - JPA Runtime: Resource [%1$s] not found"
+org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException.ERROR_JPA_BLOB_NULL="OData - JPA Runtime: Blob data type is null. Initialize Blob type by implementing callback interface org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent.
+org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException.ERROR_JPA_CLOB_NULL="OData - JPA Runtime: Clob data type is null. Initialize Clob type by implementing callback interface org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent.
 
 #JPA Common Errors
 org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAException.ODATA_JPACTX_NULL="OData JPA: OData JPA Context cannot be null"

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java
index 22bac6c..44f1f4b 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java
@@ -23,7 +23,19 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
+import java.io.ByteArrayOutputStream;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
 import java.lang.reflect.Method;
+import java.net.URL;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.SQLException;
+
+import javax.sql.rowset.serial.SerialBlob;
+import javax.sql.rowset.serial.SerialClob;
+import javax.sql.rowset.serial.SerialException;
 
 import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
 import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
@@ -213,6 +225,73 @@ public class JPAEntityParserTestForStaticMethods {
     }
   }
 
+  @Test
+  public void testGetString() {
+    char[] expectedChar = new char[] { 'a', 'b', 'c' };
+    try {
+      Clob clob = new SerialClob(expectedChar);
+      String actualString = JPAEntityParser.getString(clob);
+
+      assertEquals(new String(expectedChar), actualString);
+
+    } catch (SerialException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (SQLException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataJPARuntimeException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    }
+  }
+
+  @Test
+  public void testGetBytes() {
+    final String fileName = "SalesOrderProcessingMappingModels.xml";
+
+    try {
+      FileInputStream fis = getFileStream(fileName);
+
+      ByteArrayOutputStream baos = new ByteArrayOutputStream();
+      int content = fis.read();
+      while (content != -1) {
+        baos.write(content);
+        content = fis.read();
+      }
+      Blob blob = new SerialBlob(baos.toByteArray());
+      byte[] actualBytes = (byte[]) JPAEntityParser.getBytes(blob);
+      byte[] expectedBytes = baos.toByteArray();
+
+      assertEquals(expectedBytes.length, actualBytes.length);
+      int size = actualBytes.length;
+      int index = 0;
+      while (index < size) {
+        assertEquals(expectedBytes[index], actualBytes[index]);
+        index++;
+      }
+
+    } catch (FileNotFoundException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (SerialException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (SQLException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (IOException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataJPARuntimeException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage() + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    }
+  }
+
+  private FileInputStream getFileStream(String name) throws SerialException, FileNotFoundException {
+    final String fileName = "SalesOrderProcessingMappingModels.xml";
+    FileInputStream fis;
+
+    URL fileURL = JPAEntityParserTestForStaticMethods.class.getClassLoader().getResource(fileName);
+    fis = new FileInputStream(fileURL.getPath());
+
+    return fis;
+
+  }
+
   public Character getCharacter() {
     return new Character('A');
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java
index 71e2204..3bfac96 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityTest.java
@@ -26,8 +26,12 @@ import static org.junit.Assert.fail;
 import org.apache.olingo.odata2.api.edm.EdmEntitySet;
 import org.apache.olingo.odata2.api.edm.EdmEntityType;
 import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
 import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
 import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
+import org.apache.olingo.odata2.jpa.processor.core.mock.ODataContextMock;
 import org.apache.olingo.odata2.jpa.processor.core.mock.ODataJPAContextMock;
 import org.apache.olingo.odata2.jpa.processor.core.mock.data.EdmMockUtilV2;
 import org.apache.olingo.odata2.jpa.processor.core.mock.data.JPATypeMock;
@@ -47,7 +51,7 @@ public class JPAEntityTest {
       EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, true);
       EdmEntityType edmEntityType = edmEntitySet.getEntityType();
 
-      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, null);
+      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
       jpaEntity.create(ODataEntryMockUtil.mockODataEntryWithComplexType(JPATypeMock.ENTITY_NAME));
     } catch (ODataJPARuntimeException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
@@ -55,6 +59,9 @@ public class JPAEntityTest {
     } catch (EdmException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
           + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
     }
     JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
     assertEquals(jpaTypeMock.getMInt(), ODataEntryMockUtil.VALUE_MINT);
@@ -76,7 +83,7 @@ public class JPAEntityTest {
       EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false);
       EdmEntityType edmEntityType = edmEntitySet.getEntityType();
 
-      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, null);
+      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
       jpaEntity.create(ODataEntryMockUtil.mockODataEntry(JPATypeMock.ENTITY_NAME));
     } catch (ODataJPARuntimeException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
@@ -84,10 +91,17 @@ public class JPAEntityTest {
     } catch (EdmException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
           + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
     }
     JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
     assertEquals(jpaTypeMock.getMInt(), ODataEntryMockUtil.VALUE_MINT);
     assertEquals(jpaTypeMock.getMString(), ODataEntryMockUtil.VALUE_MSTRING);
+    assertEquals(ODataEntryMockUtil.VALUE_C.charAt(0), jpaTypeMock.getMC());
+    assertEquals(ODataEntryMockUtil.VALUE_CARRAY, new String(jpaTypeMock.getMCArray()));
+    assertEquals(ODataEntryMockUtil.VALUE_CHAR, jpaTypeMock.getMChar().toString());
+    assertEquals(ODataEntryMockUtil.VALUE_CHARARRAY, JPAEntityParser.toString(jpaTypeMock.getMCharArray()));
     assertTrue(jpaTypeMock.getMDateTime().equals(ODataEntryMockUtil.VALUE_DATE_TIME));
   }
 
@@ -97,7 +111,7 @@ public class JPAEntityTest {
       EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false);
       EdmEntityType edmEntityType = edmEntitySet.getEntityType();
 
-      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, ODataJPAContextMock.mockODataJPAContext());
+      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
       jpaEntity.create(ODataEntryMockUtil.mockODataEntryWithInline(JPATypeMock.ENTITY_NAME));
     } catch (ODataJPARuntimeException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
@@ -105,6 +119,9 @@ public class JPAEntityTest {
     } catch (EdmException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
           + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
     }
     JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
     assertEquals(jpaTypeMock.getMInt(), ODataEntryMockUtil.VALUE_MINT);
@@ -124,7 +141,7 @@ public class JPAEntityTest {
       EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false);
       EdmEntityType edmEntityType = edmEntitySet.getEntityType();
 
-      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, null);
+      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
       jpaEntity.create(ODataEntryMockUtil.mockODataEntryProperties(JPATypeMock.ENTITY_NAME));
     } catch (ODataJPARuntimeException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
@@ -132,6 +149,9 @@ public class JPAEntityTest {
     } catch (EdmException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
           + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
     }
     JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
     assertEquals(jpaTypeMock.getMInt(), ODataEntryMockUtil.VALUE_MINT);
@@ -140,12 +160,33 @@ public class JPAEntityTest {
   }
 
   @Test
+  public void testCreateODataEntryPropertyWithOutCallBack() {
+    try {
+      EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false);
+      EdmEntityType edmEntityType = edmEntitySet.getEntityType();
+
+      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContextWithoutCallBack());
+      jpaEntity.create(ODataEntryMockUtil.mockODataEntryProperties(JPATypeMock.ENTITY_NAME));
+    } catch (ODataJPARuntimeException e) {
+      assertEquals(ODataJPARuntimeException.ERROR_JPA_BLOB_NULL.getKey(), e.getMessageReference().getKey());
+      return;
+    } catch (EdmException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    }
+    fail(ODataJPATestConstants.EXCEPTION_EXPECTED);
+  }
+
+  @Test
   public void testUpdateODataEntry() {
     try {
       EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false);
       EdmEntityType edmEntityType = edmEntitySet.getEntityType();
 
-      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, ODataJPAContextMock.mockODataJPAContext());
+      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
       JPATypeMock jpaTypeMock = new JPATypeMock();
       jpaEntity.setJPAEntity(jpaTypeMock);
       jpaEntity.update(ODataEntryMockUtil.mockODataEntry(JPATypeMock.ENTITY_NAME));
@@ -155,6 +196,9 @@ public class JPAEntityTest {
     } catch (EdmException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
           + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
     }
     JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
     assertEquals(jpaTypeMock.getMInt(), 0);// Key should not be changed
@@ -168,7 +212,7 @@ public class JPAEntityTest {
       EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false);
       EdmEntityType edmEntityType = edmEntitySet.getEntityType();
 
-      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, null);
+      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
       JPATypeMock jpaTypeMock = new JPATypeMock();
       jpaEntity.setJPAEntity(jpaTypeMock);
       jpaEntity.update(ODataEntryMockUtil.mockODataEntryProperties(JPATypeMock.ENTITY_NAME));
@@ -178,10 +222,25 @@ public class JPAEntityTest {
     } catch (EdmException e) {
       fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
           + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
+    } catch (ODataException e) {
+      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
+          + ODataJPATestConstants.EXCEPTION_MSG_PART_2);
     }
     JPATypeMock jpaTypeMock = (JPATypeMock) jpaEntity.getJPAEntity();
     assertEquals(jpaTypeMock.getMInt(), 0);// Key should not be changed
     assertEquals(jpaTypeMock.getMString(), ODataEntryMockUtil.VALUE_MSTRING);
     assertTrue(jpaTypeMock.getMDateTime().equals(ODataEntryMockUtil.VALUE_DATE_TIME));
   }
+
+  private ODataJPAContext mockODataJPAContext() throws ODataException {
+    ODataContext context = new ODataContextMock().mock();
+    ODataJPAContext jpaContext = ODataJPAContextMock.mockODataJPAContext(context);
+    return jpaContext;
+  }
+
+  private ODataJPAContext mockODataJPAContextWithoutCallBack() throws ODataException {
+    ODataContext context = new ODataContextMock().mockWithoutOnJPAWriteContent();
+    ODataJPAContext jpaContext = ODataJPAContextMock.mockODataJPAContext(context);
+    return jpaContext;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java
index d4a691e..3bc3f14 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java
@@ -41,6 +41,20 @@ public class ODataContextMock {
     ODataContext context = EasyMock.createMock(ODataContext.class);
     EasyMock.expect(context.getService()).andReturn(odataService).anyTimes();
     EasyMock.expect(context.getPathInfo()).andReturn(pathInfo).anyTimes();
+    ODataJPAServiceFactoryMock mockServiceFactory = new ODataJPAServiceFactoryMock(context);
+    mockServiceFactory.initializeODataJPAContext();
+    EasyMock.expect(context.getServiceFactory()).andReturn(mockServiceFactory).anyTimes();
+    EasyMock.replay(context);
+    return context;
+  }
+
+  public ODataContext mockWithoutOnJPAWriteContent() throws ODataException {
+    ODataContext context = EasyMock.createMock(ODataContext.class);
+    EasyMock.expect(context.getService()).andReturn(odataService).anyTimes();
+    EasyMock.expect(context.getPathInfo()).andReturn(pathInfo).anyTimes();
+    ODataJPAServiceFactoryMock mockServiceFactory = new ODataJPAServiceFactoryMock(context);
+    mockServiceFactory.initializeODataJPAContextX();
+    EasyMock.expect(context.getServiceFactory()).andReturn(mockServiceFactory).anyTimes();
     EasyMock.replay(context);
     return context;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
index 17464a4..433f784 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
@@ -49,6 +49,7 @@ public abstract class ODataJPAContextMock {
     ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
     EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn(NAMESPACE);
     EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andReturn(mockEntityManagerFactory());
+    EasyMock.expect(odataJPAContext.getEntityManager()).andReturn(mockEntityManager());
     EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
     EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
     EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java
new file mode 100644
index 0000000..8535fe4
--- /dev/null
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * 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.olingo.odata2.jpa.processor.core.mock;
+
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
+import org.apache.olingo.odata2.jpa.processor.api.ODataJPAServiceFactory;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+
+public class ODataJPAServiceFactoryMock extends ODataJPAServiceFactory {
+  private ODataContext context = null;
+
+  public ODataJPAServiceFactoryMock(ODataContext context) {
+    this.context = context;
+  }
+
+  @Override
+  public ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException {
+    ODataJPAContext oDataJPAContext = null;
+    oDataJPAContext = ODataJPAContextMock.mockODataJPAContext(this.context);
+    setOnWriteJPAContent(new OnJPAWriteContentMock());
+    return oDataJPAContext;
+  }
+
+  public ODataJPAContext initializeODataJPAContextX() throws ODataJPARuntimeException {
+    ODataJPAContext oDataJPAContext = null;
+    oDataJPAContext = ODataJPAContextMock.mockODataJPAContext(this.context);
+    setOnWriteJPAContent(null);
+    return oDataJPAContext;
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java
new file mode 100644
index 0000000..6a59361
--- /dev/null
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * 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.olingo.odata2.jpa.processor.core.mock;
+
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.SQLException;
+
+import javax.sql.rowset.serial.SerialBlob;
+import javax.sql.rowset.serial.SerialClob;
+import javax.sql.rowset.serial.SerialException;
+
+import org.apache.olingo.odata2.jpa.processor.api.OnJPAWriteContent;
+import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
+
+public class OnJPAWriteContentMock implements OnJPAWriteContent {
+
+  @Override
+  public Blob getJPABlob(byte[] binaryData) throws ODataJPARuntimeException {
+    try {
+      return new SerialBlob(binaryData);
+    } catch (SerialException e) {
+      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    } catch (SQLException e) {
+      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    }
+    return null;
+  }
+
+  @Override
+  public Clob getJPAClob(char[] characterData) throws ODataJPARuntimeException {
+    try {
+      return new SerialClob(characterData);
+    } catch (SerialException e) {
+      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    } catch (SQLException e) {
+      ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
+    }
+    return null;
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java
index a15fbc1..095d7e1 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java
@@ -18,6 +18,8 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.core.mock.data;
 
+import java.sql.Blob;
+import java.sql.Clob;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.List;
@@ -87,6 +89,18 @@ public class EdmMockUtilV2 {
           mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MSTRING)).anyTimes();
       EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_MDATETIME)).andReturn(
           mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MDATETIME)).anyTimes();
+      EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_MBLOB)).andReturn(
+          mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MBLOB)).anyTimes();
+      EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_CLOB)).andReturn(
+          mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_CLOB)).anyTimes();
+      EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_MC)).andReturn(
+          mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MC)).anyTimes();
+      EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_MCARRAY)).andReturn(
+          mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MCARRAY)).anyTimes();
+      EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_MCHAR)).andReturn(
+          mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MCHAR)).anyTimes();
+      EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_MCHARARRAY)).andReturn(
+          mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MCHARARRAY)).anyTimes();
       EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_MCOMPLEXTYPE)).andReturn(
           mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MCOMPLEXTYPE)).anyTimes();
       EasyMock.expect(entityType.getProperty(JPATypeMock.NAVIGATION_PROPERTY_X)).andReturn(
@@ -137,6 +151,12 @@ public class EdmMockUtilV2 {
       propertyNames.add(JPATypeMock.PROPERTY_NAME_MINT);
       propertyNames.add(JPATypeMock.PROPERTY_NAME_MDATETIME);
       propertyNames.add(JPATypeMock.PROPERTY_NAME_MSTRING);
+      propertyNames.add(JPATypeMock.PROPERTY_NAME_MBLOB);
+      propertyNames.add(JPATypeMock.PROPERTY_NAME_CLOB);
+      propertyNames.add(JPATypeMock.PROPERTY_NAME_MC);
+      propertyNames.add(JPATypeMock.PROPERTY_NAME_MCARRAY);
+      propertyNames.add(JPATypeMock.PROPERTY_NAME_MCHAR);
+      propertyNames.add(JPATypeMock.PROPERTY_NAME_MCHARARRAY);
     } else if (entityName.equals(JPARelatedTypeMock.ENTITY_NAME)) {
       propertyNames.add(JPARelatedTypeMock.PROPERTY_NAME_MLONG);
       propertyNames.add(JPARelatedTypeMock.PROPERTY_NAME_MBYTE);
@@ -226,6 +246,12 @@ public class EdmMockUtilV2 {
     if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MINT) ||
         propertyName.equals(JPATypeMock.PROPERTY_NAME_MSTRING) ||
         propertyName.equals(JPATypeMock.PROPERTY_NAME_MDATETIME) ||
+        propertyName.equals(JPATypeMock.PROPERTY_NAME_MBLOB) ||
+        propertyName.equals(JPATypeMock.PROPERTY_NAME_CLOB) ||
+        propertyName.equals(JPATypeMock.PROPERTY_NAME_MCARRAY) ||
+        propertyName.equals(JPATypeMock.PROPERTY_NAME_MC) ||
+        propertyName.equals(JPATypeMock.PROPERTY_NAME_MCHAR) ||
+        propertyName.equals(JPATypeMock.PROPERTY_NAME_MCHARARRAY) ||
         propertyName.equals(JPATypeMock.JPATypeEmbeddableMock.PROPERTY_NAME_MSHORT) ||
         propertyName.equals(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MFLOAT) ||
         propertyName.equals(JPATypeMock.JPATypeEmbeddableMock2.PROPERTY_NAME_MUUID) ||
@@ -237,6 +263,18 @@ public class EdmMockUtilV2 {
       EdmSimpleType edmType = EasyMock.createMock(EdmSimpleType.class);
       EasyMock.expect(edmProperty.getType()).andReturn(edmType).anyTimes();
       EasyMock.expect(edmType.getKind()).andReturn(EdmTypeKind.SIMPLE).anyTimes();
+      if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MSTRING) ||
+          propertyName.equals(JPATypeMock.PROPERTY_NAME_MCARRAY) ||
+          propertyName.equals(JPATypeMock.PROPERTY_NAME_MC) ||
+          propertyName.equals(JPATypeMock.PROPERTY_NAME_MCHAR) ||
+          propertyName.equals(JPATypeMock.PROPERTY_NAME_MCHARARRAY)) {
+        EasyMock.<Class<?>> expect(edmType.getDefaultType()).andReturn(String.class).anyTimes();
+      } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MBLOB)) {
+        EasyMock.<Class<?>> expect(edmType.getDefaultType()).andReturn(Blob.class).anyTimes();
+      } else {
+        EasyMock.<Class<?>> expect(edmType.getDefaultType()).andReturn(Integer.class).anyTimes();
+      }
+
       EasyMock.expect(edmType.isCompatible(EasyMock.isA(EdmSimpleType.class))).andReturn(true).anyTimes();
       EasyMock.replay(edmType);
       EasyMock.expect(edmProperty.getName()).andReturn(propertyName).anyTimes();
@@ -311,6 +349,24 @@ public class EdmMockUtilV2 {
     } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MSTRING)) {
       mapping.setJPAType(String.class);
       ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MSTRING);
+    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MBLOB)) {
+      mapping.setJPAType(Blob.class);
+      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MBLOB);
+    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_CLOB)) {
+      mapping.setJPAType(Clob.class);
+      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_CLOB);
+    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MC)) {
+      mapping.setJPAType(char.class);
+      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MC);
+    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MCARRAY)) {
+      mapping.setJPAType(char[].class);
+      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MCARRAY);
+    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MCHAR)) {
+      mapping.setJPAType(Character.class);
+      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MCHAR);
+    } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MCHARARRAY)) {
+      mapping.setJPAType(Character[].class);
+      ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MCHARARRAY);
     } else if (propertyName.equals(JPATypeMock.PROPERTY_NAME_MDATETIME)) {
       mapping.setJPAType(Calendar.class);
       ((Mapping) mapping).setInternalName(JPATypeMock.PROPERTY_NAME_MDATETIME);
@@ -344,5 +400,4 @@ public class EdmMockUtilV2 {
     }
     return mapping;
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
index 9242df9..be1475c 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
@@ -18,6 +18,8 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.core.mock.data;
 
+import java.sql.Blob;
+import java.sql.Clob;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.List;
@@ -30,6 +32,12 @@ public class JPATypeMock {
   public static final String PROPERTY_NAME_MINT = "mInt";
   public static final String PROPERTY_NAME_MSTRING = "mString";
   public static final String PROPERTY_NAME_MDATETIME = "mDateTime";
+  public static final String PROPERTY_NAME_MBLOB = "mBlob";
+  public static final String PROPERTY_NAME_CLOB = "mClob";
+  public static final String PROPERTY_NAME_MCHAR = "mChar";
+  public static final String PROPERTY_NAME_MCHARARRAY = "mCharArray";
+  public static final String PROPERTY_NAME_MC = "mC";
+  public static final String PROPERTY_NAME_MCARRAY = "mCArray";
   public static final String PROPERTY_NAME_MKEY = "key";
   public static final String PROPERTY_NAME_MCOMPLEXTYPE = "complexType";
 
@@ -41,6 +49,53 @@ public class JPATypeMock {
   private int mInt;
   private String mString;
   private Calendar mDateTime;
+  private Blob mBlob;
+  private Clob mClob;
+  private char mC;
+  private char[] mCArray;
+  private Character mChar;
+  private Character[] mCharArray;
+
+  public Clob getMClob() {
+    return mClob;
+  }
+
+  public void setMClob(Clob mClob) {
+    this.mClob = mClob;
+  }
+
+  public char getMC() {
+    return mC;
+  }
+
+  public void setMC(char mC) {
+    this.mC = mC;
+  }
+
+  public char[] getMCArray() {
+    return mCArray;
+  }
+
+  public void setMCArray(char[] mCArray) {
+    this.mCArray = mCArray;
+  }
+
+  public Character getMChar() {
+    return mChar;
+  }
+
+  public void setMChar(Character mChar) {
+    this.mChar = mChar;
+  }
+
+  public Character[] getMCharArray() {
+    return mCharArray;
+  }
+
+  public void setMCharArray(Character[] mCharArray) {
+    this.mCharArray = mCharArray;
+  }
+
   private JPARelatedTypeMock mRelatedEntity;
   private List<JPARelatedTypeMock> mRelatedEntities = new ArrayList<JPATypeMock.JPARelatedTypeMock>();
 
@@ -100,6 +155,14 @@ public class JPATypeMock {
     this.complexType = complexType;
   }
 
+  public Blob getMBlob() {
+    return mBlob;
+  }
+
+  public void setMBlob(Blob mBlob) {
+    this.mBlob = mBlob;
+  }
+
   /* ========================================================================= */
   public static class JPATypeEmbeddableMock {
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/ODataEntryMockUtil.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/ODataEntryMockUtil.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/ODataEntryMockUtil.java
index 27ac4ea..13e1f05 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/ODataEntryMockUtil.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/ODataEntryMockUtil.java
@@ -38,11 +38,17 @@ public class ODataEntryMockUtil {
 
   public static final int VALUE_MINT = 20;
   public static Calendar VALUE_DATE_TIME = null;
+  public static byte[] VALUE_BLOB = null;
+  public static final String VALUE_CLOB = "ABC";
+  public static final String VALUE_C = "D";
+  public static final String VALUE_CARRAY = "EFG";
+  public static final String VALUE_CHAR = "I";
+  public static final String VALUE_CHARARRAY = "LMN";
   public static final String VALUE_MSTRING = "Mock";
   public static final long VALUE_MLONG = 1234567890L;
   public static final double VALUE_MDOUBLE = 20.12;
   public static final byte VALUE_MBYTE = 0XA;
-  public static final byte[] VALUE_MBYTEARRAY = { 0XA, 0XB };
+  public static final byte[] VALUE_MBYTEARRAY = new byte[] { 0XA, 0XB };
   public static final float VALUE_MFLOAT = 2.00F;
   public static final UUID VALUE_UUID = UUID.fromString("38400000-8cf0-11bd-b23e-10b96e4ef00d");
   public static final short VALUE_SHORT = 2;
@@ -76,6 +82,14 @@ public class ODataEntryMockUtil {
       VALUE_DATE_TIME.set(2013, 1, 1, 1, 1, 1);
       propertyMap.put(JPATypeMock.PROPERTY_NAME_MDATETIME, VALUE_DATE_TIME);
 
+      VALUE_BLOB = VALUE_MBYTEARRAY;
+      propertyMap.put(JPATypeMock.PROPERTY_NAME_MBLOB, VALUE_BLOB);
+
+      propertyMap.put(JPATypeMock.PROPERTY_NAME_CLOB, VALUE_CLOB);
+      propertyMap.put(JPATypeMock.PROPERTY_NAME_MC, VALUE_C);
+      propertyMap.put(JPATypeMock.PROPERTY_NAME_MCARRAY, VALUE_CARRAY);
+      propertyMap.put(JPATypeMock.PROPERTY_NAME_MCHAR, VALUE_CHAR);
+      propertyMap.put(JPATypeMock.PROPERTY_NAME_MCHARARRAY, VALUE_CHARARRAY);
       propertyMap.put(JPATypeMock.PROPERTY_NAME_MSTRING, VALUE_MSTRING);
     } else if (entityName.equals(JPARelatedTypeMock.ENTITY_NAME)) {
       propertyMap.put(JPARelatedTypeMock.PROPERTY_NAME_MLONG, VALUE_MLONG);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index c981b62..26d3b41 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -1,22 +1,14 @@
 <?xml version="1.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.
--->
+<!-- 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. -->
 <project
 	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
 	xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
@@ -32,7 +24,7 @@
 	<artifactId>olingo-odata2-jpa-processor-ref</artifactId>
 	<packaging>jar</packaging>
 	<name>${project.artifactId}</name>
-	
+
 	<build>
 		<plugins>
 			<plugin>
@@ -72,7 +64,7 @@
 			</plugin>
 		</plugins>
 	</build>
-	
+
 	<dependencies>
 		<!-- JPA Support -->
 		<dependency>
@@ -88,7 +80,7 @@
 		<dependency>
 			<groupId>org.hsqldb</groupId>
 			<artifactId>hsqldb</artifactId>
-			<version>1.8.0.10</version>
+			<version>2.3.2</version>
 		</dependency>
 
 		<!-- OData Annotation Support -->
@@ -97,7 +89,7 @@
 			<artifactId>olingo-odata2-api-annotation</artifactId>
 			<version>${project.version}</version>
 		</dependency>
-		
+
 		<!-- JUnits -->
 		<dependency>
 			<groupId>junit</groupId>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
new file mode 100644
index 0000000..8e9c6c2
--- /dev/null
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * 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.olingo.odata2.jpa.processor.ref.converter;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.sql.Blob;
+import java.sql.SQLException;
+
+import javax.persistence.AttributeConverter;
+import javax.persistence.Converter;
+
+import org.hsqldb.jdbc.JDBCBlob;
+
+@Converter(autoApply = true)
+public class BlobToByteConverter implements AttributeConverter<Blob, byte[]> {
+
+  @Override
+  public byte[] convertToDatabaseColumn(Blob arg0) {
+    ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+    InputStream is;
+    try {
+      is = arg0.getBinaryStream();
+      int b;
+      b = is.read();
+      while (b != -1) {
+        buffer.write(b);
+        b = is.read();
+      }
+    } catch (SQLException e) {
+      e.printStackTrace();
+    } catch (IOException e) {
+      e.printStackTrace();
+    }
+    return buffer.toByteArray();
+  }
+
+  @Override
+  public Blob convertToEntityAttribute(byte[] arg0) {
+    try {
+      return new JDBCBlob(arg0);
+    } catch (SQLException e) {
+      e.printStackTrace();
+    }
+    return null;
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
index c4ca423..83483de 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
@@ -18,20 +18,28 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.ref.model;
 
+import java.sql.Blob;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 
 import javax.persistence.Column;
+import javax.persistence.Convert;
 import javax.persistence.Entity;
 import javax.persistence.Id;
 import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
 import javax.persistence.ManyToMany;
 import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 
+import org.eclipse.persistence.annotations.Converter;
+
 @Entity
 @Table(name = "T_MATERIAL")
+@Converter(
+    name = "BlobToByteConverter",
+    converterClass = org.apache.olingo.odata2.jpa.processor.ref.converter.BlobToByteConverter.class)
 public class Material {
 
   public Material() {}
@@ -57,6 +65,19 @@ public class Material {
   @Column(name = "MEASUREMENT_UNIT")
   private String measurementUnit;
 
+  @Lob
+  @Column(name = "MIMAGE")
+  @Convert(converter = org.apache.olingo.odata2.jpa.processor.ref.converter.BlobToByteConverter.class)
+  private Blob materialImage;
+
+  public Blob getMaterialImage() {
+    return materialImage;
+  }
+
+  public void setMaterialImage(Blob materialImage) {
+    this.materialImage = materialImage;
+  }
+
   @ManyToMany
   private List<Store> stores = new ArrayList<Store>();
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Note.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Note.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Note.java
index 4a93509..5691dca 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Note.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Note.java
@@ -18,25 +18,29 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.jpa.processor.ref.model;
 
+import java.sql.Clob;
 import java.util.Calendar;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
+import javax.persistence.IdClass;
 import javax.persistence.JoinColumn;
+import javax.persistence.Lob;
 import javax.persistence.ManyToOne;
 import javax.persistence.Table;
 import javax.persistence.Temporal;
 import javax.persistence.TemporalType;
 
 @Entity
+@IdClass(value = NoteKey.class)
 @Table(name = "T_NOTE")
 public class Note {
 
   public Note() {}
 
   public Note(final Calendar creationTime, final Calendar creationDate, final String createdBy,
-      final String text) {
+      final Clob text) {
     super();
     this.creationTime = creationTime;
     this.creationDate = creationDate;
@@ -56,7 +60,8 @@ public class Note {
   private String createdBy;
 
   @Column
-  private String text;
+  @Lob
+  private Clob text;
 
   @Column(name = "SO_ID")
   private long soId;
@@ -89,11 +94,11 @@ public class Note {
     this.createdBy = createdBy;
   }
 
-  public String getText() {
+  public Clob getText() {
     return text;
   }
 
-  public void setText(final String text) {
+  public void setText(final Clob text) {
     this.text = text;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
new file mode 100644
index 0000000..69309d6
--- /dev/null
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
@@ -0,0 +1,65 @@
+package org.apache.olingo.odata2.jpa.processor.ref.model;
+
+import java.io.Serializable;
+import java.util.Calendar;
+
+public class NoteKey implements Serializable {
+
+  /**
+   * 
+   */
+  private static final long serialVersionUID = 1L;
+
+  public Calendar getCreationTime() {
+    return creationTime;
+  }
+
+  public void setCreationTime(Calendar creationTime) {
+    this.creationTime = creationTime;
+  }
+
+  public Calendar getCreationDate() {
+    return creationDate;
+  }
+
+  public void setCreationDate(Calendar creationDate) {
+    this.creationDate = creationDate;
+  }
+
+  public String getCreatedBy() {
+    return createdBy;
+  }
+
+  public void setCreatedBy(String createdBy) {
+    this.createdBy = createdBy;
+  }
+
+  @Override
+  public int hashCode() {
+    return creationTime.hashCode() + creationDate.hashCode() + createdBy.hashCode();
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (obj instanceof Note) {
+      Note note = (Note) obj;
+
+      if (!note.getCreatedBy().equals(this.getCreatedBy())) {
+        return false;
+      }
+      if (!note.getCreationDate().equals(this.getCreationDate())) {
+        return false;
+      }
+      if (!note.getCreationTime().equals(this.getCreationTime())) {
+        return false;
+      }
+      return true;
+    }
+    return false;
+  }
+
+  private Calendar creationTime;
+  private Calendar creationDate;
+  private String createdBy;
+
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/ba0ff6be/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml b/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
index 29e5007..5bbfcf4 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
+++ b/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
@@ -22,6 +22,10 @@
 		<class>org.apache.olingo.odata2.jpa.processor.ref.model.Customer</class>
 		<class>org.apache.olingo.odata2.jpa.processor.ref.model.Category</class>
 		<class>org.apache.olingo.odata2.jpa.processor.ref.model.Material</class>
+		<class>org.apache.olingo.odata2.jpa.processor.ref.model.AppointmentActivity</class>
+				<class>org.apache.olingo.odata2.jpa.processor.ref.model.Activity</class>
+		<class>org.apache.olingo.odata2.jpa.processor.ref.model.ActivityParty</class>
+		<class>org.apache.olingo.odata2.jpa.processor.ref.converter.BlobToByteConverter</class>
 		<properties>
 			<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
 			<property name="javax.persistence.jdbc.url"


[06/38] git commit: [OLINGO-210] Set release version 1.2.0

Posted by mi...@apache.org.
[OLINGO-210] Set release version 1.2.0


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/73da5c45
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/73da5c45
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/73da5c45

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 73da5c45732ae4cc104b5f78ef9eb80de93c1b4b
Parents: 33980b9
Author: Christian Amend <ch...@apache.org>
Authored: Mon Mar 24 14:16:02 2014 +0100
Committer: Christian Amend <ch...@apache.org>
Committed: Mon Mar 24 14:16:02 2014 +0100

----------------------------------------------------------------------
 odata2-annotation-processor/annotation-processor-api/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-core/pom.xml    | 2 +-
 odata2-annotation-processor/annotation-processor-ref/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-web/pom.xml     | 2 +-
 odata2-annotation-processor/pom.xml                              | 2 +-
 odata2-dist/janos/pom.xml                                        | 2 +-
 odata2-dist/javadoc/pom.xml                                      | 2 +-
 odata2-dist/jpa/pom.xml                                          | 2 +-
 odata2-dist/lib/pom.xml                                          | 2 +-
 odata2-dist/pom.xml                                              | 2 +-
 odata2-dist/ref/pom.xml                                          | 2 +-
 odata2-jpa-processor/jpa-api/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-core/pom.xml                            | 2 +-
 odata2-jpa-processor/jpa-ref/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-web/pom.xml                             | 2 +-
 odata2-jpa-processor/pom.xml                                     | 2 +-
 odata2-lib/odata-annotation/pom.xml                              | 2 +-
 odata2-lib/odata-api/pom.xml                                     | 2 +-
 odata2-lib/odata-core/pom.xml                                    | 2 +-
 odata2-lib/odata-fit/pom.xml                                     | 2 +-
 odata2-lib/odata-ref/pom.xml                                     | 2 +-
 odata2-lib/odata-testutil/pom.xml                                | 2 +-
 odata2-lib/odata-web/pom.xml                                     | 2 +-
 odata2-lib/pom.xml                                               | 2 +-
 odata2-sample/cars-annotation-archetype/pom.xml                  | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-jpa-archetype/pom.xml                         | 2 +-
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-service-archetype/pom.xml                     | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/pom.xml                                            | 2 +-
 pom.xml                                                          | 2 +-
 32 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-annotation-processor/annotation-processor-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml
index b0c3bdb..a85b263 100644
--- a/odata2-annotation-processor/annotation-processor-api/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-api/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml
index c91fba4..09ea4cc 100644
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml
index c014d2e..f466317 100644
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-annotation-processor/annotation-processor-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-web/pom.xml b/odata2-annotation-processor/annotation-processor-web/pom.xml
index 64e5742..4eb901c 100644
--- a/odata2-annotation-processor/annotation-processor-web/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-web/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-annotation-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml
index 4df2244..7802fd7 100644
--- a/odata2-annotation-processor/pom.xml
+++ b/odata2-annotation-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-dist/janos/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/janos/pom.xml b/odata2-dist/janos/pom.xml
index 441358a..985f70b 100644
--- a/odata2-dist/janos/pom.xml
+++ b/odata2-dist/janos/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/javadoc/pom.xml b/odata2-dist/javadoc/pom.xml
index 081d3f2..a9f032f 100644
--- a/odata2-dist/javadoc/pom.xml
+++ b/odata2-dist/javadoc/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-dist/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/jpa/pom.xml b/odata2-dist/jpa/pom.xml
index ea4b142..67b16e5 100644
--- a/odata2-dist/jpa/pom.xml
+++ b/odata2-dist/jpa/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-dist/lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/lib/pom.xml b/odata2-dist/lib/pom.xml
index 937f1ed..fba7d2c 100644
--- a/odata2-dist/lib/pom.xml
+++ b/odata2-dist/lib/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-dist/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/pom.xml b/odata2-dist/pom.xml
index 4c69edf..d5d6a83 100644
--- a/odata2-dist/pom.xml
+++ b/odata2-dist/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-dist/ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/ref/pom.xml b/odata2-dist/ref/pom.xml
index 674c4b1..063fd21 100644
--- a/odata2-dist/ref/pom.xml
+++ b/odata2-dist/ref/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-jpa-processor/jpa-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml
index 69b80d6..ef32790 100644
--- a/odata2-jpa-processor/jpa-api/pom.xml
+++ b/odata2-jpa-processor/jpa-api/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-jpa-processor/jpa-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml
index 08f3be0..e510637 100644
--- a/odata2-jpa-processor/jpa-core/pom.xml
+++ b/odata2-jpa-processor/jpa-core/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index c981b62..2719e36 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index 3c6c978..715df01 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-jpa-processor</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-jpa-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/pom.xml b/odata2-jpa-processor/pom.xml
index e422512..980147f 100644
--- a/odata2-jpa-processor/pom.xml
+++ b/odata2-jpa-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent</artifactId>
-      <version>1.3.0-SNAPSHOT</version>
+      <version>1.2.0</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index 53795bd..845c420 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-lib/odata-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/pom.xml b/odata2-lib/odata-api/pom.xml
index 53e2d58..edad6ee 100644
--- a/odata2-lib/odata-api/pom.xml
+++ b/odata2-lib/odata-api/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-lib/odata-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/pom.xml b/odata2-lib/odata-core/pom.xml
index 44c9232..f65716d 100644
--- a/odata2-lib/odata-core/pom.xml
+++ b/odata2-lib/odata-core/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-lib/odata-fit/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/pom.xml b/odata2-lib/odata-fit/pom.xml
index 301d180..58f7061 100644
--- a/odata2-lib/odata-fit/pom.xml
+++ b/odata2-lib/odata-fit/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-lib/odata-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-ref/pom.xml b/odata2-lib/odata-ref/pom.xml
index 84a49d5..33f90d0 100644
--- a/odata2-lib/odata-ref/pom.xml
+++ b/odata2-lib/odata-ref/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-lib/odata-testutil/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/pom.xml b/odata2-lib/odata-testutil/pom.xml
index 49738a1..938c081 100644
--- a/odata2-lib/odata-testutil/pom.xml
+++ b/odata2-lib/odata-testutil/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-lib/odata-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-web/pom.xml b/odata2-lib/odata-web/pom.xml
index 0f6e5e7..6e84d8c 100644
--- a/odata2-lib/odata-web/pom.xml
+++ b/odata2-lib/odata-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-lib</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/pom.xml b/odata2-lib/pom.xml
index 933db60..ba4f3f1 100644
--- a/odata2-lib/pom.xml
+++ b/odata2-lib/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
index d565f61..be07b76 100644
--- a/odata2-sample/cars-annotation-archetype/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -16,13 +16,13 @@
   <groupId>org.apache.olingo</groupId>
   <artifactId>olingo-odata2-sample-cars-annotation-archetype</artifactId>
   <name>${project.artifactId}</name>
-  <version>1.3.0-SNAPSHOT</version>
+  <version>1.2.0</version>
   <packaging>maven-archetype</packaging>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
index 73e58d6..dfb3bd3 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -32,7 +32,7 @@
     <version.servlet-api>2.5</version.servlet-api>
     <version.jaxrs-api>2.0-m10</version.jaxrs-api>
     <version.slf4j>1.7.1</version.slf4j>
-    <version.olingo>1.3.0-SNAPSHOT</version.olingo>
+    <version.olingo>1.2.0</version.olingo>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-sample/cars-jpa-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/pom.xml b/odata2-sample/cars-jpa-archetype/pom.xml
index 6089703..0786edb 100644
--- a/odata2-sample/cars-jpa-archetype/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 	

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
index 39628c0..e7f8cde 100644
--- a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
-		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
+		<version.olingo>1.2.0</version.olingo>
 		<version.eclipselink>2.5.1</version.eclipselink>
 		<version.javax.persistence>2.0.5</version.javax.persistence>
 	</properties>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-sample/cars-service-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/pom.xml b/odata2-sample/cars-service-archetype/pom.xml
index e6f434e..f9fb407 100644
--- a/odata2-sample/cars-service-archetype/pom.xml
+++ b/odata2-sample/cars-service-archetype/pom.xml
@@ -24,14 +24,14 @@
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-cars-service-archetype</artifactId>
     <name>${project.artifactId}</name>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0</version>
 
     <packaging>maven-archetype</packaging>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
index 83e7237..9c09d10 100644
--- a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
 		<version.slf4j>1.7.1</version.slf4j>
-		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
+		<version.olingo>1.2.0</version.olingo>
 	</properties>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index ce867ab..f06c4f4 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -15,7 +15,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent</artifactId>
-      <version>1.3.0-SNAPSHOT</version>
+      <version>1.2.0</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/73da5c45/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 55700ca..a5b67e7 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
 
 	<groupId>org.apache.olingo</groupId>
 	<artifactId>olingo-odata2-parent</artifactId>
-	<version>1.3.0-SNAPSHOT</version>
+	<version>1.2.0</version>
 	<packaging>pom</packaging>
 
 	<name>${project.artifactId}</name>


[20/38] git commit: [OLINGO-232] Added according methods to EdmEntityContainer

Posted by mi...@apache.org.
[OLINGO-232] Added according methods to EdmEntityContainer


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/1035f924
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/1035f924
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/1035f924

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 1035f9249c68fc782e520a9ae649ef77b74f659c
Parents: bf7da39
Author: Michael Bolz <mi...@apache.org>
Authored: Wed Apr 2 14:44:10 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Thu Apr 3 13:13:34 2014 +0200

----------------------------------------------------------------------
 .../odata2/api/edm/EdmEntityContainer.java      |  22 ++++
 .../provider/EdmEntityContainerImplProv.java    | 111 ++++++++++++++++---
 .../EdmEntityContainerImplProvTest.java         | 105 +++++++++++++++---
 3 files changed, 208 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1035f924/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmEntityContainer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmEntityContainer.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmEntityContainer.java
index 899bccb..39e70e4 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmEntityContainer.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/edm/EdmEntityContainer.java
@@ -18,6 +18,8 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.api.edm;
 
+import java.util.List;
+
 /**
  * @org.apache.olingo.odata2.DoNotImplement
  * A CSDL EntityContainer element
@@ -42,6 +44,16 @@ public interface EdmEntityContainer extends EdmNamed, EdmAnnotatable {
   EdmEntitySet getEntitySet(String name) throws EdmException;
 
   /**
+   * <b>ATTENTION:</b> This method does not support <b>LAZY LOADING</b>.
+   * <br/>
+   * Get list of all contained EntitySets.
+   * 
+   * @return with all contained {@link EdmEntitySet}
+   * @throws EdmException
+   */
+  List<EdmEntitySet> getEntitySets() throws EdmException;
+
+  /**
    * Get contained FunctionImport by name
    * 
    * @param name
@@ -60,4 +72,14 @@ public interface EdmEntityContainer extends EdmNamed, EdmAnnotatable {
    */
   EdmAssociationSet getAssociationSet(EdmEntitySet sourceEntitySet, EdmNavigationProperty navigationProperty)
       throws EdmException;
+
+  /**
+   * <b>ATTENTION:</b> This method does not support <b>LAZY LOADING</b>.
+   * <br/>
+   * Get list of all contained AssociationSets
+   * 
+   * @return list with all contained {@link EdmAssociationSet}
+   * @throws EdmException
+   */
+  List<EdmAssociationSet> getAssociationSets() throws EdmException;
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1035f924/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProv.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProv.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProv.java
index be42b03..e4026e6 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProv.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProv.java
@@ -18,7 +18,9 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.core.edm.provider;
 
+import java.util.ArrayList;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
@@ -32,9 +34,11 @@ import org.apache.olingo.odata2.api.edm.EdmFunctionImport;
 import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
 import org.apache.olingo.odata2.api.edm.FullQualifiedName;
 import org.apache.olingo.odata2.api.edm.provider.AssociationSet;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainer;
 import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
 import org.apache.olingo.odata2.api.edm.provider.EntitySet;
 import org.apache.olingo.odata2.api.edm.provider.FunctionImport;
+import org.apache.olingo.odata2.api.edm.provider.Schema;
 import org.apache.olingo.odata2.api.exception.ODataException;
 
 /**
@@ -43,7 +47,8 @@ import org.apache.olingo.odata2.api.exception.ODataException;
 public class EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnotatable {
 
   private EdmImplProv edm;
-  private EntityContainerInfo entityContainer;
+  private List<EntityContainer> entityContainerHierachy;
+  private EntityContainerInfo entityContainerInfo;
   private Map<String, EdmEntitySet> edmEntitySets;
   private Map<String, EdmAssociationSet> edmAssociationSets;
   private Map<String, EdmFunctionImport> edmFunctionImports;
@@ -51,17 +56,17 @@ public class EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnota
   private boolean isDefaultContainer;
   private EdmAnnotations annotations;
 
-  public EdmEntityContainerImplProv(final EdmImplProv edm, final EntityContainerInfo entityContainer)
+  public EdmEntityContainerImplProv(final EdmImplProv edm, final EntityContainerInfo entityContainerInfo)
       throws EdmException {
     this.edm = edm;
-    this.entityContainer = entityContainer;
+    this.entityContainerInfo = entityContainerInfo;
     edmEntitySets = new HashMap<String, EdmEntitySet>();
     edmAssociationSets = new HashMap<String, EdmAssociationSet>();
     edmFunctionImports = new HashMap<String, EdmFunctionImport>();
-    isDefaultContainer = entityContainer.isDefaultEntityContainer();
+    isDefaultContainer = entityContainerInfo.isDefaultEntityContainer();
 
-    if (entityContainer.getExtendz() != null) {
-      edmExtendedEntityContainer = edm.getEntityContainer(entityContainer.getExtendz());
+    if (entityContainerInfo.getExtendz() != null) {
+      edmExtendedEntityContainer = edm.getEntityContainer(entityContainerInfo.getExtendz());
       if (edmExtendedEntityContainer == null) {
         throw new EdmException(EdmException.COMMON);
       }
@@ -70,7 +75,7 @@ public class EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnota
 
   @Override
   public String getName() throws EdmException {
-    return entityContainer.getName();
+    return entityContainerInfo.getName();
   }
 
   @Override
@@ -82,14 +87,13 @@ public class EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnota
 
     EntitySet entitySet;
     try {
-      entitySet = edm.edmProvider.getEntitySet(entityContainer.getName(), name);
+      entitySet = edm.edmProvider.getEntitySet(entityContainerInfo.getName(), name);
     } catch (ODataException e) {
       throw new EdmException(EdmException.PROVIDERPROBLEM, e);
     }
 
     if (entitySet != null) {
       edmEntitySet = createEntitySet(entitySet);
-      edmEntitySets.put(name, edmEntitySet);
     } else if (edmExtendedEntityContainer != null) {
       edmEntitySet = edmExtendedEntityContainer.getEntitySet(name);
       if (edmEntitySet != null) {
@@ -109,7 +113,7 @@ public class EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnota
 
     FunctionImport functionImport;
     try {
-      functionImport = edm.edmProvider.getFunctionImport(entityContainer.getName(), name);
+      functionImport = edm.edmProvider.getFunctionImport(entityContainerInfo.getName(), name);
     } catch (ODataException e) {
       throw new EdmException(EdmException.PROVIDERPROBLEM, e);
     }
@@ -147,7 +151,7 @@ public class EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnota
         new FullQualifiedName(edmAssociation.getNamespace(), edmAssociation.getName());
     try {
       associationSet =
-          edm.edmProvider.getAssociationSet(entityContainer.getName(), associationFQName, entitySetName,
+          edm.edmProvider.getAssociationSet(entityContainerInfo.getName(), associationFQName, entitySetName,
               entitySetFromRole);
     } catch (ODataException e) {
       throw new EdmException(EdmException.PROVIDERPROBLEM, e);
@@ -166,8 +170,18 @@ public class EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnota
     }
   }
 
+  /**
+   * Create an {@link EdmEntitySet} based on given {@link EntitySet} and put it into the cache (see
+   * {@link #edmEntitySets}).
+   * 
+   * @param entitySet based on which the {@link EdmEntitySet} is created
+   * @return the created and cached {@link EdmEntitySet}
+   * @throws EdmException
+   */
   private EdmEntitySet createEntitySet(final EntitySet entitySet) throws EdmException {
-    return new EdmEntitySetImplProv(edm, entitySet, this);
+    EdmEntitySet edmEntitySet = new EdmEntitySetImplProv(edm, entitySet, this);
+    edmEntitySets.put(entitySet.getName(), edmEntitySet);
+    return edmEntitySet;
   }
 
   private EdmFunctionImport createFunctionImport(final FunctionImport functionImport) throws EdmException {
@@ -186,9 +200,78 @@ public class EdmEntityContainerImplProv implements EdmEntityContainer, EdmAnnota
   @Override
   public EdmAnnotations getAnnotations() throws EdmException {
     if (annotations == null) {
-      annotations = new EdmAnnotationsImplProv(entityContainer.getAnnotationAttributes(),
-          entityContainer.getAnnotationElements());
+      annotations = new EdmAnnotationsImplProv(entityContainerInfo.getAnnotationAttributes(),
+          entityContainerInfo.getAnnotationElements());
     }
     return annotations;
   }
+
+  @Override
+  public List<EdmEntitySet> getEntitySets() throws EdmException {
+    try {
+      List<EdmEntitySet> edmEntitySets = new ArrayList<EdmEntitySet>();
+      List<EntityContainer> entityContainerHierachy = getEntityContainerHierachy();
+      for (EntityContainer entityContainer : entityContainerHierachy) {
+        List<EntitySet> entitySets = entityContainer.getEntitySets();
+        for (EntitySet entitySet : entitySets) {
+          EdmEntitySet ees = createEntitySet(entitySet);
+          edmEntitySets.add(ees);
+        }
+      }
+      return edmEntitySets;
+    } catch (ODataException e) {
+      throw new EdmException(EdmException.PROVIDERPROBLEM, e);
+    }
+  }
+
+  @Override
+  public List<EdmAssociationSet> getAssociationSets() throws EdmException {
+    try {
+      List<EntityContainer> containers = getEntityContainerHierachy();
+      List<EdmAssociationSet> edmAssociationSets = new ArrayList<EdmAssociationSet>();
+      for (EntityContainer entityContainer : containers) {
+        List<AssociationSet> associationSets = entityContainer.getAssociationSets();
+        for (AssociationSet associationSet : associationSets) {
+          EdmAssociationSet eas = createAssociationSet(associationSet);
+          edmAssociationSets.add(eas);
+        }
+      }
+
+      return edmAssociationSets;
+    } catch (ODataException e) {
+      throw new EdmException(EdmException.PROVIDERPROBLEM, e);
+    }
+  }
+
+  private Map<String, EntityContainer> getEntityContainerMap() throws ODataException {
+    Map<String, EntityContainer> name2Container = new HashMap<String, EntityContainer>();
+    List<Schema> schemas = edm.edmProvider.getSchemas();
+    for (Schema schema : schemas) {
+      List<EntityContainer> containers = schema.getEntityContainers();
+      for (EntityContainer container : containers) {
+        name2Container.put(container.getName(), container);
+      }
+    }
+    return name2Container;
+  }
+
+  private List<EntityContainer> getEntityContainerHierachy() throws ODataException {
+    if (entityContainerHierachy != null) {
+      return entityContainerHierachy;
+    }
+
+    List<EntityContainer> entityContainerHierachy = new ArrayList<EntityContainer>();
+    Map<String, EntityContainer> name2Container = getEntityContainerMap();
+    String currentName = getName();
+    while (currentName != null) {
+      EntityContainer currentContainer = name2Container.get(currentName);
+      entityContainerHierachy.add(currentContainer);
+      currentName = currentContainer.getExtendz();
+    }
+
+    if (entityContainerHierachy.isEmpty()) {
+      throw new EdmException(EdmException.PROVIDERPROBLEM, "No container at all found.");
+    }
+    return entityContainerHierachy;
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1035f924/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java
index 98ec966..1661308 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/edm/provider/EdmEntityContainerImplProvTest.java
@@ -26,20 +26,28 @@ import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
 import org.apache.olingo.odata2.api.edm.EdmAnnotatable;
 import org.apache.olingo.odata2.api.edm.EdmAnnotations;
 import org.apache.olingo.odata2.api.edm.EdmAssociation;
+import org.apache.olingo.odata2.api.edm.EdmAssociationSet;
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
 import org.apache.olingo.odata2.api.edm.EdmEntitySet;
 import org.apache.olingo.odata2.api.edm.EdmException;
 import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
 import org.apache.olingo.odata2.api.edm.FullQualifiedName;
 import org.apache.olingo.odata2.api.edm.provider.AssociationSet;
 import org.apache.olingo.odata2.api.edm.provider.EdmProvider;
+import org.apache.olingo.odata2.api.edm.provider.EntityContainer;
 import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
 import org.apache.olingo.odata2.api.edm.provider.EntitySet;
 import org.apache.olingo.odata2.api.edm.provider.FunctionImport;
+import org.apache.olingo.odata2.api.edm.provider.Schema;
 import org.apache.olingo.odata2.testutil.fit.BaseTest;
-import org.junit.BeforeClass;
+import org.junit.Before;
 import org.junit.Test;
 
 /**
@@ -47,41 +55,76 @@ import org.junit.Test;
  */
 public class EdmEntityContainerImplProvTest extends BaseTest {
 
-  private static EdmEntityContainerImplProv edmEntityContainer;
+  private EdmEntityContainer edmEntityContainer;
 
-  @BeforeClass
-  public static void getEdmEntityContainerImpl() throws Exception {
+  @Before
+  public void getEdmEntityContainerImpl() throws Exception {
     EdmProvider edmProvider = mock(EdmProvider.class);
     EdmImplProv edmImplProv = new EdmImplProv(edmProvider);
-    when(edmProvider.getEntityContainerInfo("Container")).thenReturn(new EntityContainerInfo().setName("Container"));
-
-    EntityContainerInfo entityContainer = new EntityContainerInfo().setName("Container1").setExtendz("Container");
+    String containerParentName = "ContainerParent";
+    String containerName = "Container";
+
+    List<Schema> schemas = new ArrayList<Schema>();
+    Schema mockedSchema = mock(Schema.class);
+    List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
+    List<EntitySet> entitySetsParent = new ArrayList<EntitySet>();
+    EntityContainer parentEntityContainer = new EntityContainer()
+        .setName(containerParentName)
+        .setEntitySets(entitySetsParent);
+    EntityContainer entityContainer = mock(EntityContainer.class);
+    when(entityContainer.getName()).thenReturn(containerName);
+    when(entityContainer.getExtendz()).thenReturn(containerParentName);
+    entityContainers.add(entityContainer);
+    entityContainers.add(parentEntityContainer);
+    when(mockedSchema.getEntityContainers()).thenReturn(entityContainers);
+    schemas.add(mockedSchema);
+    when(edmProvider.getSchemas()).thenReturn(schemas);
+
+    List<AssociationSet> associationSets = new ArrayList<AssociationSet>();
+    when(entityContainer.getAssociationSets()).thenReturn(associationSets);
+    List<EntitySet> entitySets = new ArrayList<EntitySet>();
+    when(entityContainer.getEntitySets()).thenReturn(entitySets);
+
+    when(edmProvider.getEntityContainerInfo(containerParentName))
+        .thenReturn(new EntityContainerInfo().setName(containerParentName));
+    EntityContainerInfo entityContainerInfo =
+        new EntityContainerInfo().setName(containerName).setExtendz(containerParentName);
 
     EntitySet entitySetFooFromParent = new EntitySet().setName("fooFromParent");
-    when(edmProvider.getEntitySet("Container", "fooFromParent")).thenReturn(entitySetFooFromParent);
+    entitySetsParent.add(entitySetFooFromParent);
+    when(edmProvider.getEntitySet(containerParentName, "fooFromParent")).thenReturn(entitySetFooFromParent);
 
     EntitySet entitySetFoo = new EntitySet().setName("foo");
-    when(edmProvider.getEntitySet("Container1", "foo")).thenReturn(entitySetFoo);
+    entitySets.add(entitySetFoo);
+    when(edmProvider.getEntitySet(containerName, "foo")).thenReturn(entitySetFoo);
 
-    EntitySet entitySetBar = new EntitySet().setName("foo");
-    when(edmProvider.getEntitySet("Container1", "foo")).thenReturn(entitySetBar);
+    EntitySet entitySetBar = new EntitySet().setName("bar");
+    entitySets.add(entitySetBar);
+    when(edmProvider.getEntitySet(containerName, "bar")).thenReturn(entitySetBar);
 
     AssociationSet associationSet = new AssociationSet().setName("4711");
     FullQualifiedName assocFQName = new FullQualifiedName("AssocNs", "AssocName");
-    when(edmProvider.getAssociationSet("Container1", assocFQName, "foo", "fromRole")).thenReturn(associationSet);
+    associationSets.add(associationSet);
+    when(edmProvider.getAssociationSet(containerName, assocFQName, "foo", "fromRole")).thenReturn(associationSet);
+
+    AssociationSet parentAssociationSet = new AssociationSet().setName("42");
+    FullQualifiedName parentAssocFQName = new FullQualifiedName("AssocNs", "AssocNameParent");
+    when(edmProvider.getAssociationSet(containerParentName,
+        parentAssocFQName, "fooFromParent", "fromParentRole")).thenReturn(parentAssociationSet);
+    parentEntityContainer.setAssociationSets(Arrays.asList(parentAssociationSet));
 
     FunctionImport functionImportFoo = new FunctionImport().setName("foo");
-    when(edmProvider.getFunctionImport("Container1", "foo")).thenReturn(functionImportFoo);
+    when(edmProvider.getFunctionImport(containerName, "foo")).thenReturn(functionImportFoo);
 
     FunctionImport functionImportBar = new FunctionImport().setName("foo");
-    when(edmProvider.getFunctionImport("Container1", "foo")).thenReturn(functionImportBar);
+    when(edmProvider.getFunctionImport(containerName, "foo")).thenReturn(functionImportBar);
 
-    edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, entityContainer);
+    edmEntityContainer = new EdmEntityContainerImplProv(edmImplProv, entityContainerInfo);
   }
 
   @Test
   public void testEntityContainerName() throws EdmException {
-    assertEquals("Container1", edmEntityContainer.getName());
+    assertEquals("Container", edmEntityContainer.getName());
   }
 
   @Test
@@ -146,4 +189,34 @@ public class EdmEntityContainerImplProvTest extends BaseTest {
     assertNull(annotations.getAnnotationAttributes());
     assertNull(annotations.getAnnotationElements());
   }
+
+  @Test
+  public void testGetEntitySets() throws EdmException {
+
+    List<EdmEntitySet> entitySets = edmEntityContainer.getEntitySets();
+    assertNotNull(entitySets);
+    assertEquals(3, entitySets.size());
+
+    for (EdmEntitySet entitySet : entitySets) {
+      String name = entitySet.getName();
+      boolean expectedName = "fooFromParent".equals(name)
+          || "foo".equals(name)
+          || "bar".equals(name);
+      assertTrue("Found not expected name: " + name, expectedName);
+    }
+  }
+
+  @Test
+  public void testGetAssociationSets() throws EdmException {
+    List<EdmAssociationSet> associationSets = edmEntityContainer.getAssociationSets();
+    assertNotNull(associationSets);
+    assertEquals(2, associationSets.size());
+
+    for (EdmAssociationSet assoSet : associationSets) {
+      String name = assoSet.getName();
+      boolean expectedName = "4711".equals(name)
+          || "42".equals(name);
+      assertTrue("Found not expected name: " + name, expectedName);
+    }
+  }
 }


[05/38] git commit: [OLINGO-210] Set 1.3.0-SNAPSHOT version again

Posted by mi...@apache.org.
[OLINGO-210] Set 1.3.0-SNAPSHOT version again


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/33980b9e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/33980b9e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/33980b9e

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 33980b9e6a5baeb2db0be652ad71db21722cc8be
Parents: 96f3826
Author: Christian Amend <ch...@apache.org>
Authored: Fri Mar 21 10:16:45 2014 +0100
Committer: Christian Amend <ch...@apache.org>
Committed: Fri Mar 21 10:16:45 2014 +0100

----------------------------------------------------------------------
 odata2-annotation-processor/annotation-processor-api/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-core/pom.xml    | 2 +-
 odata2-annotation-processor/annotation-processor-ref/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-web/pom.xml     | 2 +-
 odata2-annotation-processor/pom.xml                              | 2 +-
 odata2-dist/janos/pom.xml                                        | 2 +-
 odata2-dist/javadoc/pom.xml                                      | 2 +-
 odata2-dist/jpa/pom.xml                                          | 2 +-
 odata2-dist/lib/pom.xml                                          | 2 +-
 odata2-dist/pom.xml                                              | 2 +-
 odata2-dist/ref/pom.xml                                          | 2 +-
 odata2-jpa-processor/jpa-api/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-core/pom.xml                            | 2 +-
 odata2-jpa-processor/jpa-ref/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-web/pom.xml                             | 2 +-
 odata2-jpa-processor/pom.xml                                     | 2 +-
 odata2-lib/odata-annotation/pom.xml                              | 2 +-
 odata2-lib/odata-api/pom.xml                                     | 2 +-
 odata2-lib/odata-core/pom.xml                                    | 2 +-
 odata2-lib/odata-fit/pom.xml                                     | 2 +-
 odata2-lib/odata-ref/pom.xml                                     | 2 +-
 odata2-lib/odata-testutil/pom.xml                                | 2 +-
 odata2-lib/odata-web/pom.xml                                     | 2 +-
 odata2-lib/pom.xml                                               | 2 +-
 odata2-sample/cars-annotation-archetype/pom.xml                  | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-jpa-archetype/pom.xml                         | 2 +-
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-service-archetype/pom.xml                     | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/pom.xml                                            | 2 +-
 pom.xml                                                          | 2 +-
 32 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-annotation-processor/annotation-processor-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml
index a6ad772..b0c3bdb 100644
--- a/odata2-annotation-processor/annotation-processor-api/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-api/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml
index 57fef32..c91fba4 100644
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml
index 12cbfda..c014d2e 100644
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-annotation-processor/annotation-processor-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-web/pom.xml b/odata2-annotation-processor/annotation-processor-web/pom.xml
index 54dec5a..64e5742 100644
--- a/odata2-annotation-processor/annotation-processor-web/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-web/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor</artifactId>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-annotation-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml
index 2d3f6d8..4df2244 100644
--- a/odata2-annotation-processor/pom.xml
+++ b/odata2-annotation-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-dist/janos/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/janos/pom.xml b/odata2-dist/janos/pom.xml
index 7093bae..441358a 100644
--- a/odata2-dist/janos/pom.xml
+++ b/odata2-dist/janos/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/javadoc/pom.xml b/odata2-dist/javadoc/pom.xml
index 067961d..081d3f2 100644
--- a/odata2-dist/javadoc/pom.xml
+++ b/odata2-dist/javadoc/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-dist/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/jpa/pom.xml b/odata2-dist/jpa/pom.xml
index bbe0002..ea4b142 100644
--- a/odata2-dist/jpa/pom.xml
+++ b/odata2-dist/jpa/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-dist/lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/lib/pom.xml b/odata2-dist/lib/pom.xml
index 43d68dd..937f1ed 100644
--- a/odata2-dist/lib/pom.xml
+++ b/odata2-dist/lib/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-dist/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/pom.xml b/odata2-dist/pom.xml
index 64b8811..4c69edf 100644
--- a/odata2-dist/pom.xml
+++ b/odata2-dist/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-dist/ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/ref/pom.xml b/odata2-dist/ref/pom.xml
index 2cb869d..674c4b1 100644
--- a/odata2-dist/ref/pom.xml
+++ b/odata2-dist/ref/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-jpa-processor/jpa-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml
index bbac006..69b80d6 100644
--- a/odata2-jpa-processor/jpa-api/pom.xml
+++ b/odata2-jpa-processor/jpa-api/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.2.0-RC02</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-jpa-processor/jpa-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml
index d0525f9..08f3be0 100644
--- a/odata2-jpa-processor/jpa-core/pom.xml
+++ b/odata2-jpa-processor/jpa-core/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.2.0-RC02</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index c806fcf..c981b62 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor</artifactId>
-		<version>1.2.0-RC02</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index 9801d0d..3c6c978 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-jpa-processor</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-jpa-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/pom.xml b/odata2-jpa-processor/pom.xml
index df6e66f..e422512 100644
--- a/odata2-jpa-processor/pom.xml
+++ b/odata2-jpa-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent</artifactId>
-      <version>1.2.0-RC02</version>
+      <version>1.3.0-SNAPSHOT</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index 484b72a..53795bd 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib</artifactId>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-lib/odata-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/pom.xml b/odata2-lib/odata-api/pom.xml
index 5c9b6c4..53e2d58 100644
--- a/odata2-lib/odata-api/pom.xml
+++ b/odata2-lib/odata-api/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-lib/odata-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/pom.xml b/odata2-lib/odata-core/pom.xml
index 9933231..44c9232 100644
--- a/odata2-lib/odata-core/pom.xml
+++ b/odata2-lib/odata-core/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.2.0-RC02</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-lib/odata-fit/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/pom.xml b/odata2-lib/odata-fit/pom.xml
index ad91faa..301d180 100644
--- a/odata2-lib/odata-fit/pom.xml
+++ b/odata2-lib/odata-fit/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.2.0-RC02</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-lib/odata-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-ref/pom.xml b/odata2-lib/odata-ref/pom.xml
index 82d683f..84a49d5 100644
--- a/odata2-lib/odata-ref/pom.xml
+++ b/odata2-lib/odata-ref/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib</artifactId>
-		<version>1.2.0-RC02</version>
+		<version>1.3.0-SNAPSHOT</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-lib/odata-testutil/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/pom.xml b/odata2-lib/odata-testutil/pom.xml
index 63bacfb..49738a1 100644
--- a/odata2-lib/odata-testutil/pom.xml
+++ b/odata2-lib/odata-testutil/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib</artifactId>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-lib/odata-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-web/pom.xml b/odata2-lib/odata-web/pom.xml
index 3b1ce26..0f6e5e7 100644
--- a/odata2-lib/odata-web/pom.xml
+++ b/odata2-lib/odata-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-lib</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/pom.xml b/odata2-lib/pom.xml
index e574903..933db60 100644
--- a/odata2-lib/pom.xml
+++ b/odata2-lib/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
index c5ad861..d565f61 100644
--- a/odata2-sample/cars-annotation-archetype/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -16,13 +16,13 @@
   <groupId>org.apache.olingo</groupId>
   <artifactId>olingo-odata2-sample-cars-annotation-archetype</artifactId>
   <name>${project.artifactId}</name>
-  <version>1.2.0-RC02</version>
+  <version>1.3.0-SNAPSHOT</version>
   <packaging>maven-archetype</packaging>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample</artifactId>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
index c152975..73e58d6 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -32,7 +32,7 @@
     <version.servlet-api>2.5</version.servlet-api>
     <version.jaxrs-api>2.0-m10</version.jaxrs-api>
     <version.slf4j>1.7.1</version.slf4j>
-    <version.olingo>1.2.0-RC02</version.olingo>
+    <version.olingo>1.3.0-SNAPSHOT</version.olingo>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-sample/cars-jpa-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/pom.xml b/odata2-sample/cars-jpa-archetype/pom.xml
index 4a96b26..6089703 100644
--- a/odata2-sample/cars-jpa-archetype/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 	

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
index 6369839..39628c0 100644
--- a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
-		<version.olingo>1.2.0-RC02</version.olingo>
+		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
 		<version.eclipselink>2.5.1</version.eclipselink>
 		<version.javax.persistence>2.0.5</version.javax.persistence>
 	</properties>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-sample/cars-service-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/pom.xml b/odata2-sample/cars-service-archetype/pom.xml
index a548807..e6f434e 100644
--- a/odata2-sample/cars-service-archetype/pom.xml
+++ b/odata2-sample/cars-service-archetype/pom.xml
@@ -24,14 +24,14 @@
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-cars-service-archetype</artifactId>
     <name>${project.artifactId}</name>
-    <version>1.2.0-RC02</version>
+    <version>1.3.0-SNAPSHOT</version>
 
     <packaging>maven-archetype</packaging>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample</artifactId>
-        <version>1.2.0-RC02</version>
+        <version>1.3.0-SNAPSHOT</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
index 161df3f..83e7237 100644
--- a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
 		<version.slf4j>1.7.1</version.slf4j>
-		<version.olingo>1.2.0-RC02</version.olingo>
+		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
 	</properties>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index ec5db93..ce867ab 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -15,7 +15,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent</artifactId>
-      <version>1.2.0-RC02</version>
+      <version>1.3.0-SNAPSHOT</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/33980b9e/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9d68eb1..55700ca 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
 
 	<groupId>org.apache.olingo</groupId>
 	<artifactId>olingo-odata2-parent</artifactId>
-	<version>1.2.0-RC02</version>
+	<version>1.3.0-SNAPSHOT</version>
 	<packaging>pom</packaging>
 
 	<name>${project.artifactId}</name>


[30/38] git commit: [OLINGO-256] Added missing import

Posted by mi...@apache.org.
[OLINGO-256] Added missing import


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/55b1c846
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/55b1c846
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/55b1c846

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 55b1c8464e0c84f48210fb0d986975c954bc93ee
Parents: d75041c
Author: Michael Bolz <mi...@apache.org>
Authored: Fri Apr 25 15:24:32 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Fri Apr 25 15:24:32 2014 +0200

----------------------------------------------------------------------
 .../apache/olingo/odata2/testutil/helper/StringHelper.java    | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/55b1c846/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
index 1d46767..d5191f0 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
@@ -18,12 +18,7 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.testutil.helper;
 
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
+import java.io.*;
 import java.nio.charset.Charset;
 import java.util.Random;
 


[31/38] git commit: [OLINGO-243] Fixed wrong content type handling

Posted by mi...@apache.org.
[OLINGO-243] Fixed wrong content type handling


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/e8512509
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/e8512509
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/e8512509

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: e85125093cb782103a112fe0f8368a0ab2aae8a1
Parents: 55b1c84
Author: Michael Bolz <mi...@apache.org>
Authored: Mon Apr 28 10:58:24 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Mon Apr 28 10:58:24 2014 +0200

----------------------------------------------------------------------
 .../olingo/odata2/core/ODataRequestHandler.java |  9 ++-
 .../odata2/core/ContentNegotiatorTest.java      |  8 +++
 .../odata2/fit/ref/FunctionImportXmlTest.java   | 68 +++++++++++++++++++-
 3 files changed, 80 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/e8512509/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestHandler.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestHandler.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestHandler.java
index f244bf7..0b1da19 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestHandler.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ODataRequestHandler.java
@@ -481,8 +481,13 @@ public class ODataRequestHandler {
   private List<String> getSupportedContentTypes(final UriInfoImpl uriInfo, final ODataHttpMethod method)
       throws ODataException {
     Class<? extends ODataProcessor> processorFeature = Dispatcher.mapUriTypeToProcessorFeature(uriInfo);
-    if (ODataHttpMethod.POST.equals(method)) {
-      UriType uriType = uriInfo.getUriType();
+    UriType uriType = uriInfo.getUriType();
+    //
+    if (uriType == UriType.URI11) {
+      processorFeature = EntitySetProcessor.class;
+    } else if ((uriType == UriType.URI10)) {
+      processorFeature = EntityProcessor.class;
+    } else if (ODataHttpMethod.POST.equals(method)) {
       if (uriType == UriType.URI1 || uriType == UriType.URI6B) {
         processorFeature = EntityProcessor.class;
       }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/e8512509/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ContentNegotiatorTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ContentNegotiatorTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ContentNegotiatorTest.java
index a45da48..ff12314 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ContentNegotiatorTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ContentNegotiatorTest.java
@@ -47,6 +47,14 @@ public class ContentNegotiatorTest {
     assertEquals(expected, contentType.toContentTypeString());
   }
 
+  @Test
+  public void defaultContentTypeForEmptyList() throws ODataException {
+    List<ContentType> contentTypes = Arrays.asList();
+    List<ContentType> supportedTypes = Arrays.asList(ContentType.APPLICATION_ATOM_XML, ContentType.APPLICATION_XML);
+
+    negotiateContentType(contentTypes, supportedTypes, "application/atom+xml");
+  }
+
   @Test(expected = IllegalArgumentException.class)
   public void invalidContentNegotiatorCreation() throws ODataException {
     final ContentType contentType = new ContentNegotiator().doContentNegotiation(null, null, null);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/e8512509/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java
index 6a45963..bdf62e5 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java
@@ -25,10 +25,12 @@ import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
+import junit.framework.Assert;
 
 import org.apache.http.HttpResponse;
 import org.apache.olingo.odata2.api.commons.HttpContentType;
 import org.apache.olingo.odata2.api.commons.HttpHeaders;
+import org.apache.olingo.odata2.core.commons.ContentType;
 import org.apache.olingo.odata2.testutil.server.ServletType;
 import org.junit.Test;
 
@@ -51,10 +53,59 @@ public class FunctionImportXmlTest extends AbstractRefXmlTest {
 
     assertFalse(getBody(callUri("EmployeeSearch?q='-'")).contains("entry"));
 
-    response = callUri("AllLocations");
+    response = callUri("AllLocations", HttpHeaders.ACCEPT, HttpContentType.APPLICATION_XML);
     checkMediaType(response, HttpContentType.APPLICATION_XML_UTF8);
     assertXpathExists("/d:AllLocations/d:element/d:City[d:CityName=\"" + CITY_2_NAME + "\"]", getBody(response));
 
+    response = callUri("AllUsedRoomIds", HttpHeaders.ACCEPT, HttpContentType.APPLICATION_XML);
+    checkMediaType(response, HttpContentType.APPLICATION_XML_UTF8);
+    assertXpathExists("/d:AllUsedRoomIds[d:element=\"3\"]", getBody(response));
+
+    response = callUri("MaximalAge", HttpHeaders.ACCEPT, HttpContentType.APPLICATION_XML);
+    checkMediaType(response, HttpContentType.APPLICATION_XML_UTF8);
+    assertXpathEvaluatesTo(EMPLOYEE_3_AGE, "/d:MaximalAge", getBody(response));
+
+    response = callUri("MostCommonLocation", HttpHeaders.ACCEPT, HttpContentType.APPLICATION_XML);
+    checkMediaType(response, HttpContentType.APPLICATION_XML_UTF8);
+    assertXpathEvaluatesTo(CITY_2_NAME, "/d:MostCommonLocation/d:City/d:CityName", getBody(response));
+
+    checkUri("ManagerPhoto?Id='1'");
+
+    response = callUri("ManagerPhoto/$value?Id='1'");
+    checkMediaType(response, IMAGE_JPEG);
+    assertNull(response.getFirstHeader(HttpHeaders.ETAG));
+    assertNotNull(getBody(response));
+
+    response = callUri("OldestEmployee", HttpHeaders.ACCEPT, HttpContentType.APPLICATION_XML);
+    checkMediaType(response, HttpContentType.APPLICATION_XML_UTF8);
+    assertXpathEvaluatesTo(EMPLOYEE_3_NAME, "/atom:entry/m:properties/d:EmployeeName", getBody(response));
+
+    response = callUri("OldestEmployee?$format=xml");
+    checkMediaType(response, HttpContentType.APPLICATION_XML_UTF8);
+    assertXpathEvaluatesTo(EMPLOYEE_3_NAME, "/atom:entry/m:properties/d:EmployeeName", getBody(response));
+
+    badRequest("AllLocations/$count");
+    badRequest("AllUsedRoomIds/$value");
+    badRequest("MaximalAge()");
+    badRequest("MostCommonLocation/City/CityName");
+    badRequest("ManagerPhoto");
+    badRequest("OldestEmployee()");
+    notFound("ManagerPhoto?Id='2'");
+  }
+
+  @Test
+  public void functionImportsDefaultAccept() throws Exception {
+    HttpResponse response = callUri("EmployeeSearch('1')/ne_Room/Id/$value?q='alter'");
+    checkMediaType(response, HttpContentType.TEXT_PLAIN_UTF8);
+    checkEtag(response, "W/\"1\"");
+    assertEquals("1", getBody(response));
+
+    assertFalse(getBody(callUri("EmployeeSearch?q='-'")).contains("entry"));
+
+    response = callUri("AllLocations");
+    checkMediaType(response, ContentType.APPLICATION_ATOM_XML_FEED_CS_UTF_8);
+    assertXpathExists("/d:AllLocations/d:element/d:City[d:CityName=\"" + CITY_2_NAME + "\"]", getBody(response));
+
     response = callUri("AllUsedRoomIds");
     checkMediaType(response, HttpContentType.APPLICATION_XML_UTF8);
     assertXpathExists("/d:AllUsedRoomIds[d:element=\"3\"]", getBody(response));
@@ -74,8 +125,8 @@ public class FunctionImportXmlTest extends AbstractRefXmlTest {
     assertNull(response.getFirstHeader(HttpHeaders.ETAG));
     assertNotNull(getBody(response));
 
-    response = callUri("OldestEmployee", HttpHeaders.ACCEPT, HttpContentType.APPLICATION_XML);
-    checkMediaType(response, HttpContentType.APPLICATION_XML_UTF8);
+    response = callUri("OldestEmployee");
+    checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_ENTRY_UTF8);
     assertXpathEvaluatesTo(EMPLOYEE_3_NAME, "/atom:entry/m:properties/d:EmployeeName", getBody(response));
 
     response = callUri("OldestEmployee?$format=xml");
@@ -91,6 +142,17 @@ public class FunctionImportXmlTest extends AbstractRefXmlTest {
     notFound("ManagerPhoto?Id='2'");
   }
 
+  @Override
+  public void checkMediaType(final HttpResponse response, final String expectedContentType) {
+    checkMediaType(response, ContentType.parse(expectedContentType));
+  }
+
+  private void checkMediaType(final HttpResponse response, final ContentType expectedContentType) {
+    ContentType responseContentType =
+        ContentType.parse(response.getFirstHeader(HttpHeaders.CONTENT_TYPE).getValue());
+    Assert.assertEquals(expectedContentType, responseContentType);
+  }
+
   @Test
   public void select() throws Exception {
     HttpResponse response = callUri("EmployeeSearch?q='ede'&$select=Age");


[10/38] git commit: [OLINGO-196] Added XML implementation

Posted by mi...@apache.org.
[OLINGO-196] Added XML implementation


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/9b1ba14b
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/9b1ba14b
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/9b1ba14b

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 9b1ba14ba5a12a9237904729b884836f77527128
Parents: 69e73b5
Author: Michael Bolz <mi...@apache.org>
Authored: Tue Mar 25 16:12:53 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Wed Mar 26 06:34:49 2014 +0100

----------------------------------------------------------------------
 .../olingo/odata2/core/commons/XmlHelper.java   |   4 +
 .../ep/consumer/XmlErrorDocumentConsumer.java   | 122 +++++++++-
 .../odata2/core/ep/ProviderFacadeImplTest.java  |  18 ++
 .../consumer/XmlErrorDocumentConsumerTest.java  | 228 +++++++++++++++++++
 4 files changed, 371 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9b1ba14b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
index f4bf49b..3efa87b 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/commons/XmlHelper.java
@@ -32,6 +32,10 @@ public class XmlHelper {
   private static final String DEFAULT_CHARSET = "UTF-8";
 
   public static XMLStreamReader createStreamReader(final Object content) throws EntityProviderException {
+    if (content == null) {
+      throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT
+              .addContent("Got not allowed NULL parameter for creation of XMLStreamReader."));
+    }
     XMLStreamReader streamReader;
     try {
       XMLInputFactory factory = XMLInputFactory.newInstance();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9b1ba14b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
index 21f3f8c..d21cec4 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -19,14 +19,35 @@
 package org.apache.olingo.odata2.core.ep.consumer;
 
 import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
 
+import org.apache.olingo.odata2.api.edm.Edm;
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
 import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.core.commons.ContentType;
+import org.apache.olingo.odata2.core.commons.XmlHelper;
+import org.apache.olingo.odata2.core.ep.util.FormatXml;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 
 /**
  * Consuming (read / deserialization) for OData error document in XML format.
  */
 public class XmlErrorDocumentConsumer {
+  /** Map containing language code (language - country) to Locale mapping
+   * based on Locale.getAvailableLocales()
+   * */
+  private final static Map<String, Locale> AVAILABLE_LOCALES = new HashMap<String, Locale>();
+  static {
+    Locale[] locales = Locale.getAvailableLocales();
+    for (Locale l : locales) {
+      AVAILABLE_LOCALES.put(l.getLanguage() + "-" + l.getCountry(), l);
+    }
+  }
 
   /**
    * Deserialize / read OData error document in ODataErrorContext.
@@ -36,6 +57,105 @@ public class XmlErrorDocumentConsumer {
    * @throws EntityProviderException if an exception during read / deserialization occurs.
    */
   public ODataErrorContext readError(final InputStream errorDocument) throws EntityProviderException {
-    throw new RuntimeException("Not yet implementedØ");
+    XMLStreamReader reader = null;
+    EntityProviderException cachedException = null;
+
+    try {
+      reader = XmlHelper.createStreamReader(errorDocument);
+      return parserError(reader);
+    } catch (XMLStreamException e) {
+      cachedException = new EntityProviderException(EntityProviderException.INVALID_STATE.addContent(
+                      e.getMessage()), e);
+      throw cachedException;
+    } catch (EntityProviderException e) {
+      cachedException = e;
+      throw cachedException;
+    } finally {// NOPMD (suppress DoNotThrowExceptionInFinally)
+      if (reader != null) {
+        try {
+          reader.close();
+        } catch (XMLStreamException e) {
+          if (cachedException != null) {
+            throw cachedException;
+          } else {
+            throw new EntityProviderException(
+                    EntityProviderException.EXCEPTION_OCCURRED.addContent(
+                            e.getClass().getSimpleName()), e);
+          }
+        }
+      }
+    }
+  }
+
+  private ODataErrorContext parserError(XMLStreamReader reader) throws XMLStreamException, EntityProviderException {
+    // read xml tag
+    reader.require(XMLStreamConstants.START_DOCUMENT, null, null);
+    reader.nextTag();
+
+    // read error tag
+    reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_M_2007_08, FormatXml.M_ERROR);
+
+    // read error data
+    boolean codeFound = false;
+    boolean messageFound = false;
+    ODataErrorContext errorContext = new ODataErrorContext();
+    while(notFinished(reader)) {
+      reader.nextTag();
+      if(reader.isStartElement()) {
+        String name = reader.getLocalName();
+        if(FormatXml.M_CODE.equals(name)) {
+          codeFound = true;
+          handleCode(reader, errorContext);
+        } else if(FormatXml.M_MESSAGE.equals(name)) {
+          messageFound = true;
+          handleMessage(reader, errorContext);
+        } else if(FormatXml.M_INNER_ERROR.equals(name)) {
+          handleInnerError(reader, errorContext);
+        } else {
+          throw new EntityProviderException(
+                  EntityProviderException.INVALID_CONTENT.addContent(name, FormatXml.M_ERROR));
+        }
+      }
+    }
+    validate(codeFound, messageFound);
+
+    errorContext.setContentType(ContentType.APPLICATION_XML.toContentTypeString());
+    return errorContext;
+  }
+
+  private void validate(boolean codeFound, boolean messageFound) throws EntityProviderException {
+    if (!codeFound) {
+      throw new EntityProviderException(
+              EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'code' property not found.'"));
+    } else if (!messageFound) {
+      throw new EntityProviderException(
+              EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'message' property not found.'"));
+    }
+  }
+
+  private boolean notFinished(XMLStreamReader reader) throws XMLStreamException {
+    boolean finished = reader.isEndElement() && FormatXml.M_ERROR.equals(reader.getLocalName());
+    return !finished && reader.hasNext();
+  }
+
+  private void handleInnerError(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+    String innerError = reader.getElementText();
+    errorContext.setInnerError(innerError);
+  }
+
+  private void handleMessage(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+    String lang = reader.getAttributeValue(Edm.NAMESPACE_XML_1998, FormatXml.XML_LANG);
+    errorContext.setLocale(getLocale(lang));
+    String message = reader.getElementText();
+    errorContext.setMessage(message);
+  }
+
+  private void handleCode(XMLStreamReader reader, ODataErrorContext errorContext) throws XMLStreamException {
+    String code = reader.getElementText();
+    errorContext.setErrorCode(code);
+  }
+
+  private Locale getLocale(final String langValue) {
+    return AVAILABLE_LOCALES.get(langValue);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9b1ba14b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
index fdc8525..58577aa 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
@@ -249,6 +249,24 @@ public class ProviderFacadeImplTest extends AbstractConsumerTest {
   }
 
   @Test
+  public void readErrorDocumentXml() throws EntityProviderException {
+    ProviderFacadeImpl providerFacade = new ProviderFacadeImpl();
+    String errorDoc =
+            "<?xml version='1.0' encoding='UTF-8'?>\n" +
+            "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+            "\t<code>ErrorCode</code>\n" +
+            "\t<message xml:lang=\"en-US\">Message</message>\n" +
+            "</error>";
+    ODataErrorContext errorContext = providerFacade.readErrorDocument(StringHelper.encapsulate(errorDoc),
+            ContentType.APPLICATION_XML.toContentTypeString());
+    //
+    assertEquals("Wrong content type", "application/xml", errorContext.getContentType());
+    assertEquals("Wrong message", "Message", errorContext.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", errorContext.getErrorCode());
+    assertEquals("Wrong locale for lang", Locale.US, errorContext.getLocale());
+  }
+
+  @Test
   public void writeFeed() throws Exception {
     final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
     List<Map<String, Object>> propertiesList = new ArrayList<Map<String, Object>>();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/9b1ba14b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
new file mode 100644
index 0000000..4106bcd
--- /dev/null
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumerTest.java
@@ -0,0 +1,228 @@
+/*******************************************************************************
+ * 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.olingo.odata2.core.ep.consumer;
+
+import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
+
+import java.io.InputStream;
+import java.util.Locale;
+
+import static org.junit.Assert.*;
+
+/**
+ *  
+ */
+public class XmlErrorDocumentConsumerTest extends AbstractConsumerTest {
+
+  private static final String XML_ERROR_DOCUMENT_SIMPLE =
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:lang=\"en-US\">Message</message>\n" +
+                  "</error>";
+  private static final String XML_ERROR_DOCUMENT_NULL_LOCALE =
+          "<?xml version='1.0' encoding='UTF-8'?>\n" +
+                  "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+                  "\t<code>ErrorCode</code>\n" +
+                  "\t<message xml:lang=\"\">Message</message>\n" +
+                  "</error>";
+  private static final String XML_ERROR_DOCUMENT_INNER_ERROR =
+  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "<innererror>Some InnerError</innererror>\n" +
+          "</error>";
+  private static final String XML_ERROR_DOCUMENT_INVALID_XML =
+  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</CODE>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "</error>";
+  /* error document with name 'locale' instead of 'lang' for message object */
+  private static final String XML_ERROR_DOCUMENT_UNKNOWN_CONTENT =
+  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:locale=\"en-US\">Message</message>\n" +
+          "\t<privateMessage>Secret</privateMessage>\n" +
+          "</error>";
+  /* error document without value for message object */
+  private static final String XML_ERROR_DOCUMENT_EMPTY_MESSAGE =
+  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\" />\n" +
+          "</error>";
+  private static final String XML_ERROR_DOCUMENT_MISSING_MESSAGE =
+  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "</error>";
+  private static final String XML_ERROR_DOCUMENT_MISSING_CODE =
+  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "</error>";
+  private static final String XML_ERROR_DOCUMENT_MISSING_ERROR =
+  "<?xml version='1.0' encoding='UTF-8'?>\n" +
+          "<errorForMe xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\n" +
+          "\t<code>ErrorCode</code>\n" +
+          "\t<message xml:lang=\"en-US\">Message</message>\n" +
+          "</errorForMe>";
+  private XmlErrorDocumentConsumer xedc = new XmlErrorDocumentConsumer();
+
+  @Test
+  public void simpleErrorDocument() throws Exception {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_SIMPLE);
+    ODataErrorContext error = xedc.readError(in);
+
+    assertEquals("Wrong content type", "application/xml", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong locale for lang", Locale.US, error.getLocale());
+  }
+
+  @Test
+  public void emptyMessage() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_EMPTY_MESSAGE);
+
+    ODataErrorContext error = xedc.readError(in);
+
+    assertEquals("Wrong content type", "application/xml", error.getContentType());
+    assertEquals("Wrong message", "", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong locale for lang", Locale.US, error.getLocale());
+  }
+
+  @Test
+  public void localeNull() throws Exception {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_NULL_LOCALE);
+    ODataErrorContext error = xedc.readError(in);
+
+    assertEquals("Wrong content type", "application/xml", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertNull("Expected NULL for locale", error.getLocale());
+  }
+
+
+  @Test
+  public void innerError() throws Exception {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_INNER_ERROR);
+    ODataErrorContext error = xedc.readError(in);
+
+    assertEquals("Wrong content type", "application/xml", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong inner error", "Some InnerError", error.getInnerError());
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidJson() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_INVALID_XML);
+    try {
+      xedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.INVALID_STATE, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidEmptyDocument() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate("");
+    try {
+      xedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
+              EntityProviderException.INVALID_STATE, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void nullParameter() throws EntityProviderException {
+    try {
+      xedc.readError(null);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.ILLEGAL_ARGUMENT, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocumentUnknown() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_UNKNOWN_CONTENT);
+    try {
+      xedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.INVALID_CONTENT, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocumentMissingError() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_MISSING_ERROR);
+    try {
+      xedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
+              EntityProviderException.INVALID_STATE, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocumentMissingCode() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_MISSING_CODE);
+    try {
+      xedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
+              EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+      assertTrue(e.getMessage().contains("code"));
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocumentMissingMessage() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(XML_ERROR_DOCUMENT_MISSING_MESSAGE);
+    try {
+      xedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals("Got wrong exception: " + e.getMessageReference().getKey(),
+              EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+      assertTrue(e.getMessage().contains("message"));
+      throw e;
+    }
+  }
+}


[21/38] git commit: [OLINGO-237] Added library info to debug output

Posted by mi...@apache.org.
[OLINGO-237] Added library info to debug output


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/df769309
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/df769309
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/df769309

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: df769309acae25ce1f525152c3ffdbda8094a516
Parents: 1035f92
Author: Michael Bolz <mi...@apache.org>
Authored: Fri Apr 4 13:43:42 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Fri Apr 4 13:43:42 2014 +0200

----------------------------------------------------------------------
 .../odata2/core/debug/DebugInfoServer.java      |  6 +++-
 .../core/debug/ODataDebugResponseWrapper.java   | 31 ++++++++------------
 .../debug/ODataDebugResponseWrapperTest.java    | 30 ++++++++++---------
 3 files changed, 33 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/df769309/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
index ad1fd4a..8af0876 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/DebugInfoServer.java
@@ -64,7 +64,11 @@ public class DebugInfoServer implements DebugInfo {
 
   @Override
   public void appendHtml(final Writer writer) throws IOException {
-    writer.append("<h2>Server Environment</h2>\n");
+    final Package pack = ODataDebugResponseWrapper.class.getPackage();
+    writer.append("<h2>Library Version</h2>\n")
+        .append("<p>").append(pack.getImplementationTitle())
+        .append(" Version ").append(pack.getImplementationVersion()).append("</p>\n")
+        .append("<h2>Server Environment</h2>\n");
     ODataDebugResponseWrapper.appendHtmlTable(writer, environment);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/df769309/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
index 78fe62f..52fbac4 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapper.java
@@ -140,30 +140,23 @@ public class ODataDebugResponseWrapper {
     CircleStreamBuffer csb = new CircleStreamBuffer();
     BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(csb.getOutputStream(), "UTF-8"));
     JsonStreamWriter jsonStreamWriter = new JsonStreamWriter(writer);
-    jsonStreamWriter.beginObject();
-    jsonStreamWriter.name(parts.get(0).getName().toLowerCase(Locale.ROOT));
+    jsonStreamWriter.beginObject()
+        .name(parts.get(0).getName().toLowerCase(Locale.ROOT));
     parts.get(0).appendJson(jsonStreamWriter);
-    jsonStreamWriter.separator();
-    jsonStreamWriter.name(parts.get(1).getName().toLowerCase(Locale.ROOT));
+    jsonStreamWriter.separator()
+        .name(parts.get(1).getName().toLowerCase(Locale.ROOT));
     parts.get(1).appendJson(jsonStreamWriter);
-    if (parts.size() > 2) {
-      jsonStreamWriter.separator();
-      jsonStreamWriter.name("server")
-          .beginObject();
-    }
-    boolean first = true;
+    jsonStreamWriter.separator()
+        .name("server")
+        .beginObject()
+        .namedStringValueRaw("version", ODataDebugResponseWrapper.class.getPackage().getImplementationVersion());
     for (final DebugInfo part : parts.subList(2, parts.size())) {
-      if (!first) {
-        jsonStreamWriter.separator();
-      }
-      first = false;
-      jsonStreamWriter.name(part.getName().toLowerCase(Locale.ROOT));
+      jsonStreamWriter.separator()
+          .name(part.getName().toLowerCase(Locale.ROOT));
       part.appendJson(jsonStreamWriter);
     }
-    if (parts.size() > 2) {
-      jsonStreamWriter.endObject();
-    }
-    jsonStreamWriter.endObject();
+    jsonStreamWriter.endObject()
+        .endObject();
     writer.flush();
     csb.closeWrite();
     return csb.getInputStream();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/df769309/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapperTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapperTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapperTest.java
index 1442b5f..659a54c 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapperTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/debug/ODataDebugResponseWrapperTest.java
@@ -66,7 +66,8 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
 
   private static final String EXPECTED = "{"
       + "\"request\":{\"method\":\"GET\",\"uri\":\"http://test/entity\",\"protocol\":null},"
-      + "\"response\":{\"status\":{\"code\":200,\"info\":\"OK\"}}}";
+      + "\"response\":{\"status\":{\"code\":200,\"info\":\"OK\"}},"
+      + "\"server\":{\"version\":null}}";
 
   private ODataContext mockContext(final ODataHttpMethod method) throws ODataException {
     ODataContext context = mock(ODataContext.class);
@@ -128,18 +129,18 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
     ODataResponse response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), null,
         ODataDebugResponseWrapper.ODATA_DEBUG_JSON).wrapResponse();
     String entity = StringHelper.inputStreamToString((InputStream) response.getEntity());
-    assertEquals(EXPECTED.replace("}}}",
+    assertEquals(EXPECTED.replace("}},\"server",
         "},\"headers\":{\"" + HttpHeaders.CONTENT_TYPE + "\":\"" + HttpContentType.APPLICATION_JSON + "\"},"
-            + "\"body\":\"test\"}}"),
+            + "\"body\":\"test\"},\"server"),
         entity);
 
     wrappedResponse = mockResponse(HttpStatusCodes.OK, "test", HttpContentType.TEXT_PLAIN);
     response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), null,
         ODataDebugResponseWrapper.ODATA_DEBUG_JSON).wrapResponse();
     entity = StringHelper.inputStreamToString((InputStream) response.getEntity());
-    assertEquals(EXPECTED.replace("}}}",
+    assertEquals(EXPECTED.replace("}},\"server",
         "},\"headers\":{\"" + HttpHeaders.CONTENT_TYPE + "\":\"" + HttpContentType.TEXT_PLAIN + "\"},"
-            + "\"body\":\"test\"}}"),
+            + "\"body\":\"test\"},\"server"),
         entity);
 
     wrappedResponse = mockResponse(HttpStatusCodes.OK, null, "image/png");
@@ -147,9 +148,9 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
     response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), null,
         ODataDebugResponseWrapper.ODATA_DEBUG_JSON).wrapResponse();
     entity = StringHelper.inputStreamToString((InputStream) response.getEntity());
-    assertEquals(EXPECTED.replace("}}}",
+    assertEquals(EXPECTED.replace("}},\"server",
         "},\"headers\":{\"" + HttpHeaders.CONTENT_TYPE + "\":\"image/png\"},"
-            + "\"body\":\"dGVzdA==\"}}"),
+            + "\"body\":\"dGVzdA==\"},\"server"),
         entity);
 
     when(wrappedResponse.getEntity()).thenReturn(new ByteArrayInputStream("test".getBytes()));
@@ -173,8 +174,9 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
     String entity = StringHelper.inputStreamToString((InputStream) response.getEntity());
     assertEquals(EXPECTED.replace("},\"response",
         ",\"headers\":{\"" + HttpHeaders.CONTENT_TYPE + "\":\"" + HttpContentType.APPLICATION_JSON + "\"}},\"response")
-        .replace("}}}",
-            "},\"headers\":{\"" + HttpHeaders.CONTENT_TYPE + "\":\"" + HttpContentType.APPLICATION_JSON + "\"}}}"),
+        .replace("}},\"server",
+            "},\"headers\":{\"" + HttpHeaders.CONTENT_TYPE + "\":\"" + HttpContentType.APPLICATION_JSON
+                + "\"}},\"server"),
         entity);
 
     response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), null,
@@ -194,7 +196,7 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
     ODataResponse response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), null,
         ODataDebugResponseWrapper.ODATA_DEBUG_JSON).wrapResponse();
     String entity = StringHelper.inputStreamToString((InputStream) response.getEntity());
-    assertEquals(EXPECTED.replace("}}}", "}},\"server\":{\"environment\":{\"serverPort\":\"12345\"}}}"),
+    assertEquals(EXPECTED.replace("null}}", "null,\"environment\":{\"serverPort\":\"12345\"}}}"),
         entity);
 
     response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), null,
@@ -234,7 +236,7 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
     ODataResponse response = new ODataDebugResponseWrapper(context, wrappedResponse, uriInfo, null,
         ODataDebugResponseWrapper.ODATA_DEBUG_JSON).wrapResponse();
     String entity = StringHelper.inputStreamToString((InputStream) response.getEntity());
-    assertEquals(EXPECTED.replace("}}}", "}},\"server\":{"
+    assertEquals(EXPECTED.replace("null}}", "null,"
         + "\"uri\":{\"filter\":{\"nodeType\":\"LITERAL\",\"type\":\"Edm.Boolean\",\"value\":\"true\"},"
         + "\"orderby\":{\"nodeType\":\"order collection\","
         + "\"orders\":[{\"nodeType\":\"ORDER\",\"sortorder\":\"asc\","
@@ -266,7 +268,7 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
     ODataResponse response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), exception,
         ODataDebugResponseWrapper.ODATA_DEBUG_JSON).wrapResponse();
     String entity = StringHelper.inputStreamToString((InputStream) response.getEntity());
-    assertEquals(EXPECTED.replace("}}}", "}},\"server\":{"
+    assertEquals(EXPECTED.replace("null}}", "null,"
         + "\"uri\":{\"error\":{\"expression\":\"wrong\"}},"
         + "\"stacktrace\":{\"exceptions\":[{\"class\":\"" + exception.getClass().getName() + "\","
         + "\"message\":\"Error while parsing a ODATA expression.\","
@@ -300,7 +302,7 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
     ODataResponse response = new ODataDebugResponseWrapper(context, wrappedResponse, mock(UriInfo.class), null,
         ODataDebugResponseWrapper.ODATA_DEBUG_JSON).wrapResponse();
     String entity = StringHelper.inputStreamToString((InputStream) response.getEntity());
-    assertEquals(EXPECTED.replace("}}}", "}},\"server\":{"
+    assertEquals(EXPECTED.replace("null}}", "null,"
         + "\"runtime\":[{\"class\":\"class\",\"method\":\"method\",\"duration\":{\"value\":41,\"unit\":\"µs\"},"
         + "\"children\":[{\"class\":\"class\",\"method\":\"inner\",\"duration\":{\"value\":8,\"unit\":\"µs\"}},"
         + "{\"class\":\"class\",\"method\":\"inner\",\"duration\":{\"value\":3,\"unit\":\"µs\"},\"children\":["
@@ -339,7 +341,7 @@ public class ODataDebugResponseWrapperTest extends BaseTest {
         .replace(Integer.toString(HttpStatusCodes.OK.getStatusCode()),
             Integer.toString(HttpStatusCodes.BAD_REQUEST.getStatusCode()))
         .replace(HttpStatusCodes.OK.getInfo(), HttpStatusCodes.BAD_REQUEST.getInfo())
-        .replace("}}}", "}},\"server\":{"
+        .replace("null}}", "null,"
             + "\"stacktrace\":{\"exceptions\":[{\"class\":\"" + exception.getClass().getName() + "\","
             + "\"message\":\"Common exception\","
             + "\"invocation\":{\"class\":\"class\",\"method\":\"method\",\"line\":42}},"


[27/38] git commit: [OLINGO-251] clean up code

Posted by mi...@apache.org.
[OLINGO-251] clean up code


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/2541c88f
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/2541c88f
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/2541c88f

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 2541c88f1ec4e0a5f38f693f708b2527fd891910
Parents: b9bcff1
Author: Stephan Klevenz <sk...@apache.org>
Authored: Wed Apr 23 10:41:02 2014 +0200
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Wed Apr 23 10:41:02 2014 +0200

----------------------------------------------------------------------
 .../olingo/odata2/api/ep/EntityProviderWriteProperties.java  | 8 ++++----
 .../odata2/core/ep/ODataEntityProviderPropertiesTest.java    | 4 ++--
 .../odata2/core/ep/producer/AtomEntryProducerTest.java       | 4 ++--
 .../apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java    | 2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2541c88f/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
index 93c1082..822fc84 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderWriteProperties.java
@@ -122,8 +122,8 @@ public class EntityProviderWriteProperties {
   /**
    * Gets the additional links that should be in the payload.
    * @return the additional links as Map where the navigation-property name is the key and
-     *       a key predicate is the value -
-     *       a key predicate is a Map from key-property names to their values
+   * a key predicate is the value -
+   * a key predicate is a Map from key-property names to their values
    */
   public final Map<String, Map<String, Object>> getAdditionalLinks() {
     return additionalLinks;
@@ -220,8 +220,8 @@ public class EntityProviderWriteProperties {
     /**
      * Sets additional links from this entity to other entities.
      * @param links a Map where the navigation-property name is the key and
-     *              a key predicate is the value -
-     *              a key predicate is a Map from key-property names to their values
+     * a key predicate is the value -
+     * a key predicate is a Map from key-property names to their values
      * @return properties builder
      */
     public ODataEntityProviderPropertiesBuilder additionalLinks(final Map<String, Map<String, Object>> links) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2541c88f/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java
index b5d178e..3b0d5ab 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ODataEntityProviderPropertiesTest.java
@@ -62,7 +62,7 @@ public class ODataEntityProviderPropertiesTest extends BaseTest {
     callbacks.put("aCallback", new MyCallback(null, null));
     ExpandSelectTreeNode expandSelectTree = new ExpandSelectTreeNodeImpl();
     URI selfLink = new URI("http://some.uri");
-    Map<String, Map<String, Object>> links = new HashMap<String, Map<String,Object>>();
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
     links.put("aNavigationProperty", Collections.<String, Object> emptyMap());
     final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
         .callbacks(callbacks)
@@ -106,7 +106,7 @@ public class ODataEntityProviderPropertiesTest extends BaseTest {
     callbacks.put("aCallback", new MyCallback(null, null));
     ExpandSelectTreeNode expandSelectTree = new ExpandSelectTreeNodeImpl();
     URI selfLink = new URI("http://some.uri");
-    Map<String, Map<String, Object>> links = new HashMap<String, Map<String,Object>>();
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
     links.put("aNavigationProperty", Collections.<String, Object> emptyMap());
     final EntityProviderWriteProperties properties = EntityProviderWriteProperties.serviceRoot(serviceRoot)
         .callbacks(callbacks)

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2541c88f/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
index c4bcb22..a87698d 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/AtomEntryProducerTest.java
@@ -725,7 +725,7 @@ public class AtomEntryProducerTest extends AbstractProviderTest {
     links.put("nr_Building", buildingData);
     final ODataResponse response = createAtomEntityProvider().writeEntry(
         MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms"), roomData,
-         EntityProviderWriteProperties.serviceRoot(BASE_URI).additionalLinks(links).build());
+        EntityProviderWriteProperties.serviceRoot(BASE_URI).additionalLinks(links).build());
     final String xmlString = verifyResponse(response);
 
     assertXpathExists("/a:entry/a:link[@title='nr_Building']", xmlString);
@@ -740,7 +740,7 @@ public class AtomEntryProducerTest extends AbstractProviderTest {
     links.put("nr_Employees", employeeData);
     final ODataResponse response = createAtomEntityProvider().writeEntry(
         MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms"), roomData,
-         EntityProviderWriteProperties.serviceRoot(BASE_URI).additionalLinks(links).build());
+        EntityProviderWriteProperties.serviceRoot(BASE_URI).additionalLinks(links).build());
     final String xmlString = verifyResponse(response);
 
     assertXpathExists("/a:entry/a:link[@title='nr_Employees']", xmlString);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2541c88f/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java
index 9c1df43..7be20f2 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryJsonChangeTest.java
@@ -93,7 +93,7 @@ public class EntryJsonChangeTest extends AbstractRefTest {
     data.put("Version", 42);
     Map<String, Object> key = new HashMap<String, Object>();
     key.put("Id", "1");
-    Map<String, Map<String, Object>> links = new HashMap<String, Map<String,Object>>();
+    Map<String, Map<String, Object>> links = new HashMap<String, Map<String, Object>>();
     links.put("nr_Building", key);
     final String requestBody = StringHelper.inputStreamToString(
         (InputStream) EntityProvider.writeEntry(HttpContentType.APPLICATION_JSON, linkedEntitySet, data,


[03/38] git commit: [OLINGO-210] Set candiadate version RC02

Posted by mi...@apache.org.
[OLINGO-210] Set candiadate version RC02


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/cfe20cb6
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/cfe20cb6
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/cfe20cb6

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: cfe20cb6adbf4f42381f791ff806e87ebe04138e
Parents: 8b54e48
Author: Christian Amend <ch...@apache.org>
Authored: Thu Mar 20 16:39:05 2014 +0100
Committer: Christian Amend <ch...@apache.org>
Committed: Thu Mar 20 16:39:05 2014 +0100

----------------------------------------------------------------------
 odata2-annotation-processor/annotation-processor-api/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-core/pom.xml    | 2 +-
 odata2-annotation-processor/annotation-processor-ref/pom.xml     | 2 +-
 odata2-annotation-processor/annotation-processor-web/pom.xml     | 2 +-
 odata2-annotation-processor/pom.xml                              | 2 +-
 odata2-dist/janos/pom.xml                                        | 2 +-
 odata2-dist/javadoc/pom.xml                                      | 2 +-
 odata2-dist/jpa/pom.xml                                          | 2 +-
 odata2-dist/lib/pom.xml                                          | 2 +-
 odata2-dist/pom.xml                                              | 2 +-
 odata2-dist/ref/pom.xml                                          | 2 +-
 odata2-jpa-processor/jpa-api/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-core/pom.xml                            | 2 +-
 odata2-jpa-processor/jpa-ref/pom.xml                             | 2 +-
 odata2-jpa-processor/jpa-web/pom.xml                             | 2 +-
 odata2-jpa-processor/pom.xml                                     | 2 +-
 odata2-lib/odata-annotation/pom.xml                              | 2 +-
 odata2-lib/odata-api/pom.xml                                     | 2 +-
 odata2-lib/odata-core/pom.xml                                    | 2 +-
 odata2-lib/odata-fit/pom.xml                                     | 2 +-
 odata2-lib/odata-ref/pom.xml                                     | 2 +-
 odata2-lib/odata-testutil/pom.xml                                | 2 +-
 odata2-lib/odata-web/pom.xml                                     | 2 +-
 odata2-lib/pom.xml                                               | 2 +-
 odata2-sample/cars-annotation-archetype/pom.xml                  | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-jpa-archetype/pom.xml                         | 2 +-
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/cars-service-archetype/pom.xml                     | 4 ++--
 .../src/main/resources/archetype-resources/pom.xml               | 2 +-
 odata2-sample/pom.xml                                            | 2 +-
 pom.xml                                                          | 2 +-
 32 files changed, 34 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-annotation-processor/annotation-processor-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-api/pom.xml b/odata2-annotation-processor/annotation-processor-api/pom.xml
index 9ef97c3..033166d 100644
--- a/odata2-annotation-processor/annotation-processor-api/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-api/pom.xml
@@ -25,7 +25,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-annotation-processor/annotation-processor-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/pom.xml b/odata2-annotation-processor/annotation-processor-core/pom.xml
index 47944a1..c0871b2 100644
--- a/odata2-annotation-processor/annotation-processor-core/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-core/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-annotation-processor/annotation-processor-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-ref/pom.xml b/odata2-annotation-processor/annotation-processor-ref/pom.xml
index 9381d9f..5a1f2a4 100644
--- a/odata2-annotation-processor/annotation-processor-ref/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-ref/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-annotation-processor/annotation-processor-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-web/pom.xml b/odata2-annotation-processor/annotation-processor-web/pom.xml
index b0f7dda..2075925 100644
--- a/odata2-annotation-processor/annotation-processor-web/pom.xml
+++ b/odata2-annotation-processor/annotation-processor-web/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-annotation-processor-incubating</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-annotation-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/pom.xml b/odata2-annotation-processor/pom.xml
index a570c8c..2b9b17a 100644
--- a/odata2-annotation-processor/pom.xml
+++ b/odata2-annotation-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-dist/janos/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/janos/pom.xml b/odata2-dist/janos/pom.xml
index f5125e8..23a66d3 100644
--- a/odata2-dist/janos/pom.xml
+++ b/odata2-dist/janos/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-dist/javadoc/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/javadoc/pom.xml b/odata2-dist/javadoc/pom.xml
index bc13bf4..2f82b64 100644
--- a/odata2-dist/javadoc/pom.xml
+++ b/odata2-dist/javadoc/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-dist/jpa/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/jpa/pom.xml b/odata2-dist/jpa/pom.xml
index 06b1ce1..788fdc3 100644
--- a/odata2-dist/jpa/pom.xml
+++ b/odata2-dist/jpa/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-dist/lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/lib/pom.xml b/odata2-dist/lib/pom.xml
index cd2e29a..bc4e02f 100644
--- a/odata2-dist/lib/pom.xml
+++ b/odata2-dist/lib/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-dist/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/pom.xml b/odata2-dist/pom.xml
index 1933db7..f31d9c3 100644
--- a/odata2-dist/pom.xml
+++ b/odata2-dist/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-dist/ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-dist/ref/pom.xml b/odata2-dist/ref/pom.xml
index c56bff3..62fb5ff 100644
--- a/odata2-dist/ref/pom.xml
+++ b/odata2-dist/ref/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-dist-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-jpa-processor/jpa-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/pom.xml b/odata2-jpa-processor/jpa-api/pom.xml
index 662b60d..d8ca788 100644
--- a/odata2-jpa-processor/jpa-api/pom.xml
+++ b/odata2-jpa-processor/jpa-api/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0-RC02</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-jpa-processor/jpa-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/pom.xml b/odata2-jpa-processor/jpa-core/pom.xml
index 158eeb8..c351821 100644
--- a/odata2-jpa-processor/jpa-core/pom.xml
+++ b/odata2-jpa-processor/jpa-core/pom.xml
@@ -24,7 +24,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0-RC02</version>
 		<relativePath>../</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-jpa-processor/jpa-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/pom.xml b/odata2-jpa-processor/jpa-ref/pom.xml
index 5d5bbc9..4d384cf 100644
--- a/odata2-jpa-processor/jpa-ref/pom.xml
+++ b/odata2-jpa-processor/jpa-ref/pom.xml
@@ -25,7 +25,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-jpa-processor/jpa-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/pom.xml b/odata2-jpa-processor/jpa-web/pom.xml
index 36b3b8e..e92010a 100644
--- a/odata2-jpa-processor/jpa-web/pom.xml
+++ b/odata2-jpa-processor/jpa-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-jpa-processor-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-jpa-processor/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/pom.xml b/odata2-jpa-processor/pom.xml
index 917b21c..42522e5 100644
--- a/odata2-jpa-processor/pom.xml
+++ b/odata2-jpa-processor/pom.xml
@@ -18,7 +18,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent-incubating</artifactId>
-      <version>1.3.0-SNAPSHOT</version>
+      <version>1.2.0-RC02</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-lib/odata-annotation/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-annotation/pom.xml b/odata2-lib/odata-annotation/pom.xml
index 8e7e13c..aaa23e8 100644
--- a/odata2-lib/odata-annotation/pom.xml
+++ b/odata2-lib/odata-annotation/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-lib/odata-api/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/pom.xml b/odata2-lib/odata-api/pom.xml
index be642e3..42908a8 100644
--- a/odata2-lib/odata-api/pom.xml
+++ b/odata2-lib/odata-api/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-lib/odata-core/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/pom.xml b/odata2-lib/odata-core/pom.xml
index eb068ac..6128d98 100644
--- a/odata2-lib/odata-core/pom.xml
+++ b/odata2-lib/odata-core/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-lib/odata-fit/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/pom.xml b/odata2-lib/odata-fit/pom.xml
index c3fa9c4..af54825 100644
--- a/odata2-lib/odata-fit/pom.xml
+++ b/odata2-lib/odata-fit/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-lib/odata-ref/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-ref/pom.xml b/odata2-lib/odata-ref/pom.xml
index 127c749..7f641ec 100644
--- a/odata2-lib/odata-ref/pom.xml
+++ b/odata2-lib/odata-ref/pom.xml
@@ -28,7 +28,7 @@
 	<parent>
 		<groupId>org.apache.olingo</groupId>
 		<artifactId>olingo-odata2-lib-incubating</artifactId>
-		<version>1.3.0-SNAPSHOT</version>
+		<version>1.2.0-RC02</version>
 		<relativePath>..</relativePath>
 	</parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-lib/odata-testutil/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/pom.xml b/odata2-lib/odata-testutil/pom.xml
index 8bc27f5..c84b781 100644
--- a/odata2-lib/odata-testutil/pom.xml
+++ b/odata2-lib/odata-testutil/pom.xml
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-lib-incubating</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-lib/odata-web/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-web/pom.xml b/odata2-lib/odata-web/pom.xml
index 71515ab..b37811a 100644
--- a/odata2-lib/odata-web/pom.xml
+++ b/odata2-lib/odata-web/pom.xml
@@ -17,7 +17,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-lib-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-lib/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/pom.xml b/odata2-lib/pom.xml
index 6e39b40..a449ac5 100644
--- a/odata2-lib/pom.xml
+++ b/odata2-lib/pom.xml
@@ -18,7 +18,7 @@
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-parent-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
index 293351b..f35c2b2 100644
--- a/odata2-sample/cars-annotation-archetype/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -16,13 +16,13 @@
   <groupId>org.apache.olingo</groupId>
   <artifactId>olingo-odata2-sample-cars-annotation-archetype-incubating</artifactId>
   <name>${project.artifactId}</name>
-  <version>1.3.0-SNAPSHOT</version>
+  <version>1.2.0-RC02</version>
   <packaging>maven-archetype</packaging>
 
   <parent>
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-incubating</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
     <relativePath>..</relativePath>
   </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
index 3e76b56..b1e5460 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -32,7 +32,7 @@
     <version.servlet-api>2.5</version.servlet-api>
     <version.jaxrs-api>2.0-m10</version.jaxrs-api>
     <version.slf4j>1.7.1</version.slf4j>
-    <version.olingo>1.3.0-SNAPSHOT</version.olingo>
+    <version.olingo>1.2.0-RC02</version.olingo>
   </properties>
 
   <build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-sample/cars-jpa-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/pom.xml b/odata2-sample/cars-jpa-archetype/pom.xml
index ce73ed8..f8d69f2 100644
--- a/odata2-sample/cars-jpa-archetype/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/pom.xml
@@ -23,7 +23,7 @@
 	<parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 	

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
index 6cce640..3af001e 100644
--- a/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-jpa-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 	<properties>
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
-		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
+		<version.olingo>1.2.0-RC02</version.olingo>
 		<version.eclipselink>2.5.1</version.eclipselink>
 		<version.javax.persistence>2.0.5</version.javax.persistence>
 	</properties>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-sample/cars-service-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/pom.xml b/odata2-sample/cars-service-archetype/pom.xml
index 6c8ce97..877ec04 100644
--- a/odata2-sample/cars-service-archetype/pom.xml
+++ b/odata2-sample/cars-service-archetype/pom.xml
@@ -24,14 +24,14 @@
     <groupId>org.apache.olingo</groupId>
     <artifactId>olingo-odata2-sample-cars-service-archetype-incubating</artifactId>
     <name>${project.artifactId}</name>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.0-RC02</version>
 
     <packaging>maven-archetype</packaging>
 
     <parent>
         <groupId>org.apache.olingo</groupId>
         <artifactId>olingo-odata2-sample-incubating</artifactId>
-        <version>1.3.0-SNAPSHOT</version>
+        <version>1.2.0-RC02</version>
         <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
index b2d6e83..ddaa73d 100644
--- a/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
+++ b/odata2-sample/cars-service-archetype/src/main/resources/archetype-resources/pom.xml
@@ -20,7 +20,7 @@
 		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 		<version.cxf>2.7.6</version.cxf>
 		<version.slf4j>1.7.1</version.slf4j>
-		<version.olingo>1.3.0-SNAPSHOT</version.olingo>
+		<version.olingo>1.2.0-RC02</version.olingo>
 	</properties>
 
 	<build>

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index 0410dbd..4279e14 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -15,7 +15,7 @@
     <parent>
       <groupId>org.apache.olingo</groupId>
       <artifactId>olingo-odata2-parent-incubating</artifactId>
-      <version>1.3.0-SNAPSHOT</version>
+      <version>1.2.0-RC02</version>
       <relativePath>..</relativePath>
     </parent>
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/cfe20cb6/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d956e14..6c235bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
 
 	<groupId>org.apache.olingo</groupId>
 	<artifactId>olingo-odata2-parent-incubating</artifactId>
-	<version>1.3.0-SNAPSHOT</version>
+	<version>1.2.0-RC02</version>
 	<packaging>pom</packaging>
 
 	<name>${project.artifactId}</name>


[18/38] git commit: [OLINGO-185] Add licence header

Posted by mi...@apache.org.
[OLINGO-185] Add licence header


Signed-off-by: Chandan V A <ch...@sap.com>

Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/6a9335f3
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/6a9335f3
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/6a9335f3

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 6a9335f31938599cbe7ebe8f082b286cba67fd88
Parents: ba0ff6b
Author: Chandan V A <ch...@sap.com>
Authored: Wed Apr 2 17:28:54 2014 +0530
Committer: Chandan V A <ch...@sap.com>
Committed: Wed Apr 2 17:28:54 2014 +0530

----------------------------------------------------------------------
 .../processor/ref/extension/OnDBWriteContent.java | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/6a9335f3/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
index bcd85a2..220b904 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
@@ -1,3 +1,21 @@
+/*******************************************************************************
+ * 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.olingo.odata2.jpa.processor.ref.extension;
 
 import java.sql.Blob;


[08/38] git commit: [OLINGO-196] Added JSON implementation

Posted by mi...@apache.org.
[OLINGO-196] Added JSON implementation


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/69e73b56
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/69e73b56
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/69e73b56

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 69e73b56c4d39492ea6f1832e5bd3f6d2f827522
Parents: 1c2bcda
Author: Michael Bolz <mi...@apache.org>
Authored: Mon Mar 24 13:55:41 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Tue Mar 25 10:52:55 2014 +0100

----------------------------------------------------------------------
 .../odata2/core/ep/AtomEntityProvider.java      |   2 +-
 .../odata2/core/ep/JsonEntityProvider.java      |   2 +-
 .../odata2/core/ep/ProviderFacadeImpl.java      |   4 +-
 .../ep/consumer/JsonErrorDocumentConsumer.java  | 170 ++++++++++++++++-
 .../ep/consumer/XmlErrorDocumentConsumer.java   |   7 +-
 .../odata2/core/rt/RuntimeDelegateImpl.java     |   2 +-
 .../odata2/core/ep/ProviderFacadeImplTest.java  |  17 +-
 .../consumer/JsonErrorDocumentConsumerTest.java | 189 +++++++++++++++++++
 .../core/ep/consumer/XmlEntityConsumerTest.java |   4 +-
 9 files changed, 382 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java
index 3b6f121..441dace 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java
@@ -405,7 +405,7 @@ public class AtomEntityProvider implements ContentTypeBasedEntityProvider {
   }
 
   @Override
-  public ODataErrorContext readErrorDocument(InputStream errorDocument) throws EntityProviderException {
+  public ODataErrorContext readErrorDocument(final InputStream errorDocument) throws EntityProviderException {
     XmlErrorDocumentConsumer xmlErrorDocumentConsumer = new XmlErrorDocumentConsumer();
     return xmlErrorDocumentConsumer.readError(errorDocument);
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java
index 32c68a2..def8c6a 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java
@@ -344,7 +344,7 @@ public class JsonEntityProvider implements ContentTypeBasedEntityProvider {
   }
 
   @Override
-  public ODataErrorContext readErrorDocument(InputStream errorDocument) throws EntityProviderException {
+  public ODataErrorContext readErrorDocument(final InputStream errorDocument) throws EntityProviderException {
     return new JsonErrorDocumentConsumer().readError(errorDocument);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java
index 16c5693..803c97c 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java
@@ -155,8 +155,8 @@ public class ProviderFacadeImpl implements EntityProviderInterface {
   }
 
   @Override
-  public ODataErrorContext readErrorDocument(InputStream errorDocument, String contentType)
-          throws EntityProviderException {
+  public ODataErrorContext readErrorDocument(final InputStream errorDocument, final String contentType)
+      throws EntityProviderException {
     return create(contentType).readErrorDocument(errorDocument);
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
index fad6dd9..3b065d0 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
@@ -18,15 +18,38 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.core.ep.consumer;
 
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
 import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.core.commons.ContentType;
+import org.apache.olingo.odata2.core.ep.util.FormatJson;
 
-import java.io.InputStream;
+import com.google.gson.stream.JsonReader;
+import com.google.gson.stream.JsonToken;
 
 /**
  * Consuming (read / deserialization) for OData error document in JSON format.
  */
 public class JsonErrorDocumentConsumer {
+  /** Default used charset for reader */
+  private static final String DEFAULT_CHARSET = "UTF-8";
+  /** Map containing language code (language - country) to Locale mapping
+   * based on Locale.getAvailableLocales()
+   * */
+  private final static Map<String, Locale> AVAILABLE_LOCALES = new HashMap<String, Locale>();
+  static {
+    Locale[] locales = Locale.getAvailableLocales();
+    for (Locale l : locales) {
+      AVAILABLE_LOCALES.put(l.getLanguage() + "-" + l.getCountry(), l);
+    }
+  }
 
   /**
    * Deserialize / read OData error document in ODataErrorContext.
@@ -35,7 +58,148 @@ public class JsonErrorDocumentConsumer {
    * @return created ODataErrorContext based on input stream content.
    * @throws EntityProviderException if an exception during read / deserialization occurs.
    */
-  public ODataErrorContext readError(InputStream errorDocument) throws EntityProviderException {
-    throw new RuntimeException("Not yet implemented");
+  public ODataErrorContext readError(final InputStream errorDocument) throws EntityProviderException {
+    JsonReader reader = createJsonReader(errorDocument);
+    try {
+      return parseJson(reader);
+    } catch (IOException e) {
+      throw new EntityProviderException(
+          EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getMessage()), e);
+    }
+  }
+
+  private ODataErrorContext parseJson(final JsonReader reader) throws IOException, EntityProviderException {
+    ODataErrorContext errorContext;
+
+    if (reader.hasNext()) {
+      reader.beginObject();
+      String currentName = reader.nextName();
+      if (FormatJson.ERROR.equals(currentName)) {
+        errorContext = parseError(reader);
+      } else {
+        throw new EntityProviderException(EntityProviderException.INVALID_STATE.addContent(
+            "Invalid object with name '" + currentName + "' found."));
+      }
+    } else {
+      throw new EntityProviderException(EntityProviderException.INVALID_STATE.addContent(
+          "No content to parse found."));
+    }
+
+    errorContext.setContentType(ContentType.APPLICATION_JSON.toContentTypeString());
+    return errorContext;
+  }
+
+  private ODataErrorContext parseError(final JsonReader reader) throws IOException, EntityProviderException {
+    ODataErrorContext errorContext = new ODataErrorContext();
+    String currentName;
+    reader.beginObject();
+    boolean messageFound = false;
+    boolean codeFound = false;
+
+    while (reader.hasNext()) {
+      currentName = reader.nextName();
+      if (FormatJson.CODE.equals(currentName)) {
+        codeFound = true;
+        errorContext.setErrorCode(getValue(reader));
+      } else if (FormatJson.MESSAGE.equals(currentName)) {
+        messageFound = true;
+        parseMessage(reader, errorContext);
+      } else if (FormatJson.INNER_ERROR.equals(currentName)) {
+        parseInnerError(reader, errorContext);
+      } else {
+        throw new EntityProviderException(EntityProviderException.INVALID_STATE.addContent(
+            "Invalid name '" + currentName + "' found."));
+      }
+    }
+
+    if (!codeFound) {
+      throw new EntityProviderException(
+          EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'code' property not found.'"));
+    }
+    if (!messageFound) {
+      throw new EntityProviderException(
+          EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'message' property not found.'"));
+    }
+
+    reader.endObject();
+    return errorContext;
+  }
+
+  private void parseInnerError(final JsonReader reader, final ODataErrorContext errorContext) throws IOException {
+    // implementation for parse content as provided by JsonErrorDocumentProducer
+    String innerError = reader.nextString();
+    errorContext.setInnerError(innerError);
+    // implementation for OData v2 Section 2.2.8.1.2 JSON Error Response
+    //    (RFC4627 Section 2.2 -> https://www.ietf.org/rfc/rfc4627.txt))
+    // currently not provided
+  }
+
+  private void parseMessage(final JsonReader reader, final ODataErrorContext errorContext)
+      throws IOException, EntityProviderException {
+
+    reader.beginObject();
+    boolean valueFound = false;
+    boolean langFound = false;
+    String currentName;
+
+    while (reader.hasNext()) {
+      currentName = reader.nextName();
+      if (FormatJson.LANG.equals(currentName)) {
+        langFound = true;
+        String langValue = getValue(reader);
+        if (langValue != null) {
+          errorContext.setLocale(getLocale(langValue));
+        }
+      } else if (FormatJson.VALUE.equals(currentName)) {
+        valueFound = true;
+        errorContext.setMessage(getValue(reader));
+      } else {
+        throw new EntityProviderException(EntityProviderException.INVALID_STATE.addContent("Invalid name '" +
+            currentName + "' found."));
+      }
+    }
+
+    if (!langFound) {
+      throw new EntityProviderException(
+          EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'lang' property not found.'"));
+    }
+    if (!valueFound) {
+      throw new EntityProviderException(
+          EntityProviderException.MISSING_PROPERTY.addContent("Mandatory 'value' property not found.'"));
+    }
+    reader.endObject();
+  }
+
+  private Locale getLocale(final String langValue) {
+    return AVAILABLE_LOCALES.get(langValue);
+  }
+
+  /**
+   * Read the string value from the JsonReader or 'null' if no value is available.
+   *
+   * @param reader to read from
+   * @return the string value or 'null'
+   * @throws IOException if an exception occurs
+   */
+  private String getValue(final JsonReader reader) throws IOException {
+    JsonToken token = reader.peek();
+    if (JsonToken.NULL == token) {
+      reader.skipValue();
+      return null;
+    }
+    return reader.nextString();
+  }
+
+  private JsonReader createJsonReader(final InputStream in) throws EntityProviderException {
+    if (in == null) {
+      throw new EntityProviderException(EntityProviderException.INVALID_STATE
+          .addContent(("Got not supported NULL object as content to de-serialize.")));
+    }
+    try {
+      return new JsonReader(new InputStreamReader(in, DEFAULT_CHARSET));
+    } catch (final UnsupportedEncodingException e) {
+      throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
+          .getSimpleName()), e);
+    }
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
index c7f0a51..21f3f8c 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -18,17 +18,16 @@
  ******************************************************************************/
 package org.apache.olingo.odata2.core.ep.consumer;
 
+import java.io.InputStream;
+
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
 import org.apache.olingo.odata2.api.processor.ODataErrorContext;
 
-import java.io.InputStream;
-
 /**
  * Consuming (read / deserialization) for OData error document in XML format.
  */
 public class XmlErrorDocumentConsumer {
 
-
   /**
    * Deserialize / read OData error document in ODataErrorContext.
    *
@@ -36,7 +35,7 @@ public class XmlErrorDocumentConsumer {
    * @return created ODataErrorContext based on input stream content.
    * @throws EntityProviderException if an exception during read / deserialization occurs.
    */
-  public ODataErrorContext readError(InputStream errorDocument) throws EntityProviderException {
+  public ODataErrorContext readError(final InputStream errorDocument) throws EntityProviderException {
     throw new RuntimeException("Not yet implementedØ");
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rt/RuntimeDelegateImpl.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rt/RuntimeDelegateImpl.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rt/RuntimeDelegateImpl.java
index d3a974c..b081d62 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rt/RuntimeDelegateImpl.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/rt/RuntimeDelegateImpl.java
@@ -142,7 +142,7 @@ public class RuntimeDelegateImpl extends RuntimeDelegateInstance {
   }
 
   @Override
-  public String extractExceptionMessage(ODataMessageException exception) {
+  public String extractExceptionMessage(final ODataMessageException exception) {
     Message msg = MessageService.getMessage(Locale.ENGLISH, exception.getMessageReference());
     return msg.getText();
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
index 434d43d..fdc8525 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImplTest.java
@@ -32,6 +32,7 @@ import java.util.Arrays;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import junit.framework.Assert;
@@ -43,12 +44,14 @@ import org.apache.olingo.odata2.api.edm.EdmEntitySet;
 import org.apache.olingo.odata2.api.edm.EdmFunctionImport;
 import org.apache.olingo.odata2.api.edm.EdmLiteralKind;
 import org.apache.olingo.odata2.api.edm.EdmProperty;
+import org.apache.olingo.odata2.api.ep.EntityProviderException;
 import org.apache.olingo.odata2.api.ep.EntityProviderReadProperties;
 import org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties;
 import org.apache.olingo.odata2.api.ep.entry.DeletedEntryMetadata;
 import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
 import org.apache.olingo.odata2.api.ep.feed.ODataDeltaFeed;
 import org.apache.olingo.odata2.api.ep.feed.ODataFeed;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
 import org.apache.olingo.odata2.api.processor.ODataResponse;
 import org.apache.olingo.odata2.core.commons.ContentType;
 import org.apache.olingo.odata2.core.edm.EdmDateTimeOffset;
@@ -233,6 +236,19 @@ public class ProviderFacadeImplTest extends AbstractConsumerTest {
   }
 
   @Test
+  public void readErrorDocumentJson() throws EntityProviderException {
+    ProviderFacadeImpl providerFacade = new ProviderFacadeImpl();
+    String errorDoc = "{\"error\":{\"code\":\"ErrorCode\",\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}}}";
+    ODataErrorContext errorContext = providerFacade.readErrorDocument(StringHelper.encapsulate(errorDoc),
+        ContentType.APPLICATION_JSON.toContentTypeString());
+    //
+    assertEquals("Wrong content type", "application/json", errorContext.getContentType());
+    assertEquals("Wrong message", "Message", errorContext.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", errorContext.getErrorCode());
+    assertEquals("Wrong locale for lang", Locale.US, errorContext.getLocale());
+  }
+
+  @Test
   public void writeFeed() throws Exception {
     final EdmEntitySet entitySet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
     List<Map<String, Object>> propertiesList = new ArrayList<Map<String, Object>>();
@@ -346,5 +362,4 @@ public class ProviderFacadeImplTest extends AbstractConsumerTest {
         new ProviderFacadeImpl().writeFunctionImport(HttpContentType.APPLICATION_JSON, function, properties, null);
     assertEquals("{\"d\":{\"MaximalAge\":99}}", StringHelper.inputStreamToString((InputStream) result.getEntity()));
   }
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
new file mode 100644
index 0000000..204498d
--- /dev/null
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumerTest.java
@@ -0,0 +1,189 @@
+/*******************************************************************************
+ * 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.olingo.odata2.core.ep.consumer;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.InputStream;
+import java.util.Locale;
+
+import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.testutil.helper.StringHelper;
+import org.junit.Test;
+
+/**
+ *  
+ */
+public class JsonErrorDocumentConsumerTest extends AbstractConsumerTest {
+
+  private static final String JSON_ERROR_DOCUMENT_SIMPLE = "{\"error\":{\"code\":\"ErrorCode\"," +
+      "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}}}";
+  private static final String JSON_ERROR_DOCUMENT_NULL_LOCALE = "{\"error\":{\"code\":\"ErrorCode\"," +
+      "\"message\":{\"lang\":null,\"value\":\"Message\"}}}";
+  private static final String JSON_ERROR_DOCUMENT_INNER_ERROR = "{\"error\":{\"code\":\"ErrorCode\"," +
+      "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}, \"innererror\":\"Some InnerError\"}}";
+  private static final String JSON_ERROR_DOCUMENT_INVALID_JSON = "\"error\":{\"code\":\"ErrorCode\"," +
+      "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}}}";
+  /* error document with name 'locale' instead of 'lang' for message object */
+  private static final String JSON_ERROR_DOCUMENT_UNKNOWN_CONTENT = "{\"error\":{\"code\":\"ErrorCode\"," +
+      "\"message\":{\"locale\":\"en-US\",\"value\":\"Message\"}}}";
+  /* error document without value for message object */
+  private static final String JSON_ERROR_DOCUMENT_INVALID_CONTENT = "{\"error\":{\"code\":\"ErrorCode\"," +
+      "\"message\":{\"lang\":\"en-US\"}}}";
+  private static final String JSON_ERROR_DOCUMENT_MISSING_MESSAGE = "{\"error\":{\"code\":\"ErrorCode\"}}";
+  private static final String JSON_ERROR_DOCUMENT_MISSING_CODE = "{\"error\":{" +
+      "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}}}";
+  private static final String JSON_ERROR_DOCUMENT_MISSING_ERROR = "{\"code\":\"ErrorCode\"," +
+      "\"message\":{\"lang\":\"en-US\",\"value\":\"Message\"}}";
+  private JsonErrorDocumentConsumer jedc = new JsonErrorDocumentConsumer();
+
+  @Test
+  public void simpleErrorDocument() throws Exception {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_SIMPLE);
+    ODataErrorContext error = jedc.readError(in);
+
+    assertEquals("Wrong content type", "application/json", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong locale for lang", Locale.US, error.getLocale());
+  }
+
+  @Test
+  public void localeNull() throws Exception {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_NULL_LOCALE);
+    ODataErrorContext error = jedc.readError(in);
+
+    assertEquals("Wrong content type", "application/json", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertNull("Expected NULL for locale", error.getLocale());
+  }
+
+  @Test
+  public void innerError() throws Exception {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_INNER_ERROR);
+    ODataErrorContext error = jedc.readError(in);
+
+    assertEquals("Wrong content type", "application/json", error.getContentType());
+    assertEquals("Wrong message", "Message", error.getMessage());
+    assertEquals("Wrong error code", "ErrorCode", error.getErrorCode());
+    assertEquals("Wrong inner error", "Some InnerError", error.getInnerError());
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidJson() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_INVALID_JSON);
+    try {
+      jedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.EXCEPTION_OCCURRED, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidEmptyDocument() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate("");
+    try {
+      jedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.EXCEPTION_OCCURRED, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void nullParameter() throws EntityProviderException {
+    try {
+      jedc.readError(null);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.INVALID_STATE, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocumentUnknown() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_UNKNOWN_CONTENT);
+    try {
+      jedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.INVALID_STATE, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocument() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_INVALID_CONTENT);
+    try {
+      jedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocumentMissingError() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_MISSING_ERROR);
+    try {
+      jedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.INVALID_STATE, e.getMessageReference());
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocumentMissingCode() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_MISSING_CODE);
+    try {
+      jedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+      assertTrue(e.getMessage().contains("code"));
+      throw e;
+    }
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void invalidErrorDocumentMissingMessage() throws EntityProviderException {
+    InputStream in = StringHelper.encapsulate(JSON_ERROR_DOCUMENT_MISSING_MESSAGE);
+    try {
+      jedc.readError(in);
+      fail("Expected exception was not thrown");
+    } catch (EntityProviderException e) {
+      assertEquals(EntityProviderException.MISSING_PROPERTY, e.getMessageReference());
+      assertTrue(e.getMessage().contains("message"));
+      throw e;
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/69e73b56/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
index b357c71..59df942 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumerTest.java
@@ -577,7 +577,7 @@ public class XmlEntityConsumerTest extends AbstractXmlConsumerTest {
     assertEquals("Building 1", inlineBuildingProps.get("Name"));
     assertNull(inlineBuildingProps.get("Image"));
     assertNull(inlineBuildingProps.get("nb_Rooms"));
-    
+
     assertEquals("Rooms('1')/nr_Employees", entry.getMetadata().getAssociationUris("nr_Employees").get(0));
     assertEquals("Rooms('1')/nr_Building", entry.getMetadata().getAssociationUris("nr_Building").get(0));
   }
@@ -2325,7 +2325,7 @@ public class XmlEntityConsumerTest extends AbstractXmlConsumerTest {
     Map<String, Object> properties = result.getProperties();
     assertEquals(1, properties.size());
     assertEquals("1", properties.get("Id"));
-    
+
     assertEquals("Rooms('1')/nr_Building", result.getMetadata().getAssociationUris("nr_Building").get(0));
     assertEquals("Rooms('1')/nr_Employees", result.getMetadata().getAssociationUris("nr_Employees").get(0));
   }


[36/38] git commit: [OLINGO-275] Fix RAT issue

Posted by mi...@apache.org.
[OLINGO-275] Fix RAT issue


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/aa7bf829
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/aa7bf829
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/aa7bf829

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: aa7bf8293ee8522754845c6fea4c3a88b8e31dc9
Parents: 340d7c0
Author: Christian Amend <ch...@apache.org>
Authored: Thu May 8 16:00:34 2014 +0200
Committer: Christian Amend <ch...@apache.org>
Committed: Thu May 8 16:00:34 2014 +0200

----------------------------------------------------------------------
 odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/aa7bf829/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml b/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml
index 6b8c09b..b7b5057 100644
--- a/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml
+++ b/odata2-lib/odata-core/src/test/resources/feed_rooms_small.xml
@@ -1,4 +1,11 @@
 <?xml version='1.0' encoding='utf-8'?>
+<!-- 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. -->
 <feed xmlns="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xml:base="http://localhost:8080/ReferenceScenario.svc/">
 	<id>http://localhost:8080/ReferenceScenario.svc/Rooms</id>
 	<title type="text">Rooms</title>


[22/38] git commit: [OLINGO-239] Changed folder path handling

Posted by mi...@apache.org.
[OLINGO-239] Changed folder path handling


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/e1b6ead9
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/e1b6ead9
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/e1b6ead9

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: e1b6ead92c2bb71055e99cc9f762e4bccbd96974
Parents: df76930
Author: Michael Bolz <mi...@apache.org>
Authored: Fri Apr 11 06:00:04 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Fri Apr 11 08:27:13 2014 +0200

----------------------------------------------------------------------
 .../processor/core/util/ClassHelper.java        | 56 ++++++++++++--------
 .../processor/core/util/ClassHelperTest.java    | 20 +++++++
 2 files changed, 53 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/e1b6ead9/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
index 22ba73c..d81d9cf 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
@@ -23,6 +23,8 @@ import java.io.FileFilter;
 import java.io.FilenameFilter;
 import java.io.IOException;
 import java.lang.reflect.Field;
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -58,25 +60,22 @@ public class ClassHelper {
     }
   };
 
-  public static final List<Class<?>> loadClasses(final String packageToScan, final ClassValidator cv) {
+  public static List<Class<?>> loadClasses(final String packageToScan, final ClassValidator cv) {
     return loadClasses(packageToScan, CLASSFILE_FILTER, cv);
   }
 
-  public static final List<Class<?>> loadClasses(final String packageToScan, final FilenameFilter ff,
+  public static List<Class<?>> loadClasses(final String packageToScan, final FilenameFilter ff,
       final ClassValidator cv) {
     final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
-    String folderToScan = packageToScan.replace(PACKAGE_SEPARATOR, RESOURCE_SEPARATOR);
-    URL url = classLoader.getResource(folderToScan);
-    if (url == null) {
-      throw new IllegalArgumentException("No folder to scan found for package '" + packageToScan + "'.");
-    }
+
+    URI uri = getResourceUri(packageToScan, classLoader);
 
     final Collection<String> fqnForClasses;
-    File folder = new File(url.getFile());
+    File folder = new File(uri.getSchemeSpecificPart());
     if (folder.isDirectory()) {
       fqnForClasses = getClassFqnFromDir(ff, folder, packageToScan);
-    } else if (isJarFile(url)) {
-      fqnForClasses = getClassFqnFromJar(url.getFile().substring(5), packageToScan);
+    } else if (isJarFile(uri)) {
+      fqnForClasses = getClassFqnFromJar(uri, packageToScan);
     } else {
       fqnForClasses = null;
     }
@@ -94,7 +93,7 @@ public class ClassHelper {
         }
       } catch (ClassNotFoundException ex) {
         throw new IllegalArgumentException("Exception during class loading of class '" + fqn +
-            " from resource '" + url.getFile() + "'" +
+            " from resource '" + uri + "'" +
             "' with message '" + ex.getMessage() + "'.");
       }
     }
@@ -102,18 +101,29 @@ public class ClassHelper {
     return annotatedClasses;
   }
 
-  private static boolean isJarFile(final URL url) {
-    String filename = url.getFile();
-    int index = filename.indexOf(JAR_RESOURCE_SEPARATOR);
-    if (index > JAR_FILE_ENDING.length()) {
-      String fileEnding = filename.substring(index - JAR_FILE_ENDING.length(), index);
-      return JAR_FILE_ENDING.equalsIgnoreCase(fileEnding);
+  private static URI getResourceUri(String packageToScan, ClassLoader classLoader) {
+    String folderToScan = packageToScan.replace(PACKAGE_SEPARATOR, RESOURCE_SEPARATOR);
+    URL url = classLoader.getResource(folderToScan);
+    if (url == null) {
+      throw new IllegalArgumentException("No folder to scan found for package '" + packageToScan + "'.");
+    }
+    try {
+      URI uri = url.toURI();
+      if (uri == null) {
+        throw new IllegalArgumentException("No folder to scan found for package '" + packageToScan + "'.");
+      }
+      return uri;
+    } catch (URISyntaxException e) {
+      throw new IllegalArgumentException("Invalid folder path for path URL '" + url +
+              "' from thread context class loader.");
     }
-    return false;
   }
 
-  private static Collection<String> getClassFqnFromDir(final FilenameFilter ff, final File folder,
-      final String packageToScan) {
+  private static boolean isJarFile(URI uri) {
+    return JAR_FILE_ENDING.equals(uri.getScheme());
+  }
+
+  private static Collection<String> getClassFqnFromDir(final FilenameFilter ff, File folder, String packageToScan) {
     List<String> classFiles = new ArrayList<String>();
     String[] classFilesForFolder = folder.list(ff);
     for (String name : classFilesForFolder) {
@@ -129,10 +139,9 @@ public class ClassHelper {
     return classFiles;
   }
 
-  private static Collection<String> getClassFqnFromJar(final String filepath, final String packageToScan) {
-    JarFile jarFile = null;
-
+  private static Collection<String> getClassFqnFromJar(URI uri, String packageToScan) {
     final String jarFilePath;
+    String filepath = uri.getSchemeSpecificPart().substring(5);
     String[] split = filepath.split(JAR_RESOURCE_SEPARATOR);
     if (split.length == 2) {
       jarFilePath = split[0];
@@ -140,6 +149,7 @@ public class ClassHelper {
       throw new IllegalArgumentException("Illegal jar file path '" + filepath + "'.");
     }
 
+    JarFile jarFile = null;
     try {
       jarFile = new JarFile(jarFilePath);
       List<String> classFileNames = new ArrayList<String>();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/e1b6ead9/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
index 393b651..42dd259 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
@@ -15,6 +15,8 @@
  */
 package org.apache.olingo.odata2.annotation.processor.core.util;
 
+import java.io.File;
+import java.net.URL;
 import java.util.List;
 
 import junit.framework.Assert;
@@ -59,6 +61,24 @@ public class ClassHelperTest {
     Assert.assertEquals(SimpleEntity.class.getName(), loadedClasses.get(0).getName());
   }
 
+  @Test(expected = ClassFormatError.class)
+  public void loadFromSpaceDir() throws Exception {
+    URL currentPath = Thread.currentThread().getContextClassLoader().getResource(".");
+    File folder = new File(currentPath.getFile(), "space space/package");
+    folder.mkdirs();
+    File classFile = new File(folder, "Invalid.class");
+    classFile.createNewFile();
+    String packageToScan = "space space.package";
+
+    //
+    List<Class<?>> loadedClasses = ClassHelper.loadClasses(packageToScan, annotatedTestEntityInnerClasses);
+
+    //
+    Assert.assertEquals(1, loadedClasses.size());
+    Assert.assertEquals(SimpleEntity.class.getName(), loadedClasses.get(0).getName());
+  }
+
+
   @Test
   public void loadSingleEntityFromJar() throws ODataException {
     String packageToScan = AnnotatedEntity.class.getPackage().getName();


[32/38] git commit: [OLINGO-256] Changed batch write/read to be RFC1341 compliant

Posted by mi...@apache.org.
[OLINGO-256] Changed batch write/read to be RFC1341 compliant


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/a9380800
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/a9380800
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/a9380800

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: a9380800aac9571c38059173a0fd90fd98229214
Parents: e851250
Author: Michael Bolz <mi...@apache.org>
Authored: Tue Apr 29 09:15:51 2014 +0200
Committer: Michael Bolz <mi...@apache.org>
Committed: Tue Apr 29 09:41:49 2014 +0200

----------------------------------------------------------------------
 .../odata2/core/batch/BatchRequestParser.java   | 24 ++++++++++----------
 .../odata2/core/batch/BatchRequestWriter.java   | 11 ++++-----
 .../odata2/core/batch/BatchResponseParser.java  | 11 +++++++--
 .../core/batch/BatchRequestParserTest.java      |  2 ++
 .../odata2/core/batch/BatchRequestTest.java     |  2 ++
 .../core/batch/BatchRequestWriterTest.java      |  2 +-
 .../odata2/core/batch/BatchResponseTest.java    |  2 +-
 .../odata2/testutil/helper/StringHelper.java    | 18 +++++++++++----
 8 files changed, 45 insertions(+), 27 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/a9380800/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
index 2404ad8..1211cf8 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestParser.java
@@ -155,13 +155,12 @@ public class BatchRequestParser {
 
   private BatchRequestPart parseMultipart(final Scanner scanner, final String boundary, final boolean isChangeSet)
       throws BatchException {
-    Map<String, String> mimeHeaders = new HashMap<String, String>();
-    BatchRequestPart multipart = null;
     List<ODataRequest> requests = new ArrayList<ODataRequest>();
+    BatchRequestPart multipart;
     if (scanner.hasNext("--" + boundary + REG_EX_ZERO_OR_MORE_WHITESPACES)) {
       scanner.next();
       currentLineNumber++;
-      mimeHeaders = parseHeaders(scanner);
+      Map<String, String> mimeHeaders = parseHeaders(scanner);
       currentMimeHeaderContentId = mimeHeaders.get(BatchHelper.HTTP_CONTENT_ID.toLowerCase(Locale.ENGLISH));
 
       String contentType = mimeHeaders.get(HttpHeaders.CONTENT_TYPE.toLowerCase(Locale.ENGLISH));
@@ -173,7 +172,7 @@ public class BatchRequestParser {
           validateEncoding(mimeHeaders.get(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING.toLowerCase(Locale.ENGLISH)));
           parseNewLine(scanner);// mandatory
 
-          requests.add(parseRequest(scanner, isChangeSet));
+          requests.add(parseRequest(scanner, true, boundary));
           multipart = new BatchRequestPartImpl(false, requests);
         } else {
           throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent(HttpContentType.APPLICATION_HTTP));
@@ -182,7 +181,7 @@ public class BatchRequestParser {
         if (HttpContentType.APPLICATION_HTTP.equalsIgnoreCase(contentType)) {
           validateEncoding(mimeHeaders.get(BatchHelper.HTTP_CONTENT_TRANSFER_ENCODING.toLowerCase(Locale.ENGLISH)));
           parseNewLine(scanner);// mandatory
-          requests.add(parseRequest(scanner, isChangeSet));
+          requests.add(parseRequest(scanner, false, boundary));
           multipart = new BatchRequestPartImpl(false, requests);
         } else if (contentType.matches(REG_EX_OPTIONAL_WHITESPACE + HttpContentType.MULTIPART_MIXED + ANY_CHARACTERS)) {
           String changeSetBoundary = getBoundary(contentType);
@@ -220,7 +219,8 @@ public class BatchRequestParser {
 
   }
 
-  private ODataRequest parseRequest(final Scanner scanner, final boolean isChangeSet) throws BatchException {
+  private ODataRequest parseRequest(final Scanner scanner, final boolean isChangeSet, final String boundary)
+          throws BatchException {
     if (scanner.hasNext(REG_EX_REQUEST_LINE)) {
       scanner.next(REG_EX_REQUEST_LINE);
       currentLineNumber++;
@@ -245,7 +245,7 @@ public class BatchRequestParser {
         throw new BatchException(BatchException.INVALID_QUERY_OPERATION_METHOD.addContent(currentLineNumber));
       }
       ODataHttpMethod httpMethod = ODataHttpMethod.valueOf(method);
-      Map<String, List<String>> headers = parseRequestHeaders(scanner);
+      Map<String, List<String>> headers = parseRequestHeaders(scanner, boundary);
       if (currentMimeHeaderContentId != null) {
         List<String> headerList = new ArrayList<String>();
         headerList.add(currentMimeHeaderContentId);
@@ -255,12 +255,9 @@ public class BatchRequestParser {
       String contentType = getContentTypeHeader(headers);
       List<String> acceptHeaders = getAcceptHeader(headers);
       List<Locale> acceptLanguages = getAcceptLanguageHeader(headers);
-      parseNewLine(scanner);
       InputStream body = new ByteArrayInputStream(new byte[0]);
       if (isChangeSet) {
         body = parseBody(scanner);
-      } else {
-        parseNewLine(scanner);
       }
 
       ODataRequestBuilder requestBuilder = ODataRequest.method(httpMethod)
@@ -283,9 +280,12 @@ public class BatchRequestParser {
 
   }
 
-  private Map<String, List<String>> parseRequestHeaders(final Scanner scanner) throws BatchException {
+  private Map<String, List<String>> parseRequestHeaders(final Scanner scanner, final String boundary)
+          throws BatchException {
     Map<String, List<String>> headers = new HashMap<String, List<String>>();
-    while (scanner.hasNext() && !scanner.hasNext(REG_EX_BLANK_LINE)) {
+    while (scanner.hasNext()
+            && !scanner.hasNext(REG_EX_BLANK_LINE)
+            && !scanner.hasNext("--" + boundary + REG_EX_ZERO_OR_MORE_WHITESPACES)) {
       if (scanner.hasNext(REG_EX_HEADER)) {
         scanner.next(REG_EX_HEADER);
         currentLineNumber++;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/a9380800/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
index 4622d37..40cf0e0 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchRequestWriter.java
@@ -57,7 +57,7 @@ public class BatchRequestWriter {
             request.getContentId());
       }
     }
-    writer.append("--").append(boundary).append("--").append(LF).append(LF);
+    writer.append(LF).append("--").append(boundary).append("--");
     InputStream batchRequestBody;
     batchRequestBody = new ByteArrayInputStream(BatchHelper.getBytes(writer.toString()));
     return batchRequestBody;
@@ -69,13 +69,13 @@ public class BatchRequestWriter {
       boundary = BatchHelper.generateBoundary("changeset");
     }
     writer.append(HttpHeaders.CONTENT_TYPE).append(COLON).append(SP).append(
-        HttpContentType.MULTIPART_MIXED + "; boundary=" + boundary).append(LF).append(LF);
+        HttpContentType.MULTIPART_MIXED + "; boundary=" + boundary).append(LF);
     for (BatchChangeSetPart request : batchChangeSet.getChangeSetParts()) {
-      writer.append("--").append(boundary).append(LF);
+      writer.append(LF).append("--").append(boundary).append(LF);
       appendRequestBodyPart(request.getMethod(), request.getUri(), request.getBody(), request.getHeaders(), request
           .getContentId());
     }
-    writer.append("--").append(boundary).append("--").append(LF).append(LF);
+    writer.append(LF).append("--").append(boundary).append("--").append(LF);
   }
 
   private void appendRequestBodyPart(final String method, final String uri, final String body,
@@ -98,7 +98,6 @@ public class BatchRequestWriter {
     if (!isContentLengthPresent && body != null && !body.isEmpty()) {
       writer.append(HttpHeaders.CONTENT_LENGTH).append(COLON).append(SP).append(BatchHelper.getBytes(body).length)
           .append(LF);
-
     }
     appendHeader(headers);
 
@@ -106,14 +105,12 @@ public class BatchRequestWriter {
       writer.append(LF);
       writer.append(body);
     }
-    writer.append(LF).append(LF);
   }
 
   private void appendHeader(final Map<String, String> headers) {
     for (Map.Entry<String, String> headerMap : headers.entrySet()) {
       String name = headerMap.getKey();
       writer.append(name).append(COLON).append(SP).append(headerMap.getValue()).append(LF);
-
     }
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/a9380800/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java
index 84b90b0..0dfe77b 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/batch/BatchResponseParser.java
@@ -157,7 +157,7 @@ public class BatchResponseParser {
           }
           scanner.next(changeSetCloseDelimiter);
           currentLineNumber++;
-          parseNewLine(scanner);
+          parseOptionalEmptyLine(scanner);
         } else {
           throw new BatchException(BatchException.INVALID_CONTENT_TYPE.addContent(HttpContentType.MULTIPART_MIXED
               + " or " + HttpContentType.APPLICATION_HTTP));
@@ -358,7 +358,14 @@ public class BatchResponseParser {
     }
   }
 
-  private String trimQuota(String boundary) {
+  private void parseOptionalEmptyLine(final Scanner scanner) {
+      if (scanner.hasNext() && scanner.hasNext(REG_EX_BLANK_LINE)) {
+        scanner.next();
+        currentLineNumber++;
+      }
+    }
+
+      private String trimQuota(String boundary) {
     if (boundary.matches("\".*\"")) {
       boundary = boundary.replace("\"", "");
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/a9380800/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestParserTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestParserTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestParserTest.java
index f66a864..e1315fb 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestParserTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestParserTest.java
@@ -40,6 +40,7 @@ import org.apache.olingo.odata2.core.ODataPathSegmentImpl;
 import org.apache.olingo.odata2.core.PathInfoImpl;
 import org.apache.olingo.odata2.testutil.helper.StringHelper;
 import org.junit.BeforeClass;
+import org.junit.Ignore;
 import org.junit.Test;
 
 /**
@@ -347,6 +348,7 @@ public class BatchRequestParserTest {
   }
 
   @Test(expected = BatchException.class)
+  @Ignore("What should here throw an exception")
   public void testMimeHeaderContentId() throws BatchException {
     String batch = "--batch_8194-cf13-1f56" + LF
         + MIME_HEADERS

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/a9380800/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java
index 40c3218..b3f41a0 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestTest.java
@@ -121,6 +121,7 @@ public class BatchRequestTest {
     assertTrue(requestBody.contains("--changeset_"));
     assertTrue(requestBody.contains("PUT Employees('2') HTTP/1.1"));
     assertTrue(requestBody.contains("{\"Возраст\":40}"));
+    assertEquals(16, batchRequestStream.linesCount());
 
     String contentType = "multipart/mixed; boundary=" + BOUNDARY;
     BatchRequestParser parser = new BatchRequestParser(contentType, parseProperties);
@@ -161,6 +162,7 @@ public class BatchRequestTest {
     assertTrue(requestBody.contains("GET Employees HTTP/1.1"));
     assertTrue(requestBody.contains("POST Employees HTTP/1.1"));
     assertTrue(requestBody.contains(body));
+    assertEquals(23, batchRequestStream.linesCount());
 
     String contentType = "multipart/mixed; boundary=" + BOUNDARY;
     BatchRequestParser parser = new BatchRequestParser(contentType, parseProperties);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/a9380800/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java
index 496686d..89bdea3 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchRequestWriterTest.java
@@ -67,7 +67,7 @@ public class BatchRequestWriterTest {
     assertTrue(requestBody.contains("--batch_"));
     assertTrue(requestBody.contains("GET Employees HTTP/1.1"));
     checkHeaders(headers, requestBody);
-    assertEquals(10, StringHelper.countLines(requestBody));
+    assertEquals(8, StringHelper.countLines(requestBody));
   }
 
   @Test

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/a9380800/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java
index 29dd774..c438a0f 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/batch/BatchResponseTest.java
@@ -136,6 +136,6 @@ public class BatchResponseTest {
     StringHelper.Stream content = StringHelper.toStream(body);
     List<BatchSingleResponse> result = parser.parse(content.asStream());
     assertEquals(2, result.size());
-    assertEquals("Failing content:\n" + content.asString(), 19, content.countCrLf());
+    assertEquals("Failing content:\n" + content.asString(), 20, content.linesCount());
   }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/a9380800/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
index d5191f0..feb4ddd 100644
--- a/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
+++ b/odata2-lib/odata-testutil/src/main/java/org/apache/olingo/odata2/testutil/helper/StringHelper.java
@@ -67,7 +67,14 @@ public class StringHelper {
       return print(System.out);
     }
 
-    public int countCrLf() {
+    /**
+     * Number of lines separated by line breaks (<code>CRLF</code>).
+     * A content string like <code>text\r\nmoreText</code> will result in
+     * a line count of <code>2</code>.
+     *
+     * @return lines count
+     */
+    public int linesCount() {
       return StringHelper.countLines(asString(), "\r\n");
     }
   }
@@ -120,14 +127,17 @@ public class StringHelper {
   }
 
   public static int countLines(String content, String lineBreak) {
-    int lastPos = 0;
-    int count = -1;
+    if(content == null) {
+      return -1;
+    }
+
+    int lastPos = content.indexOf(lineBreak);
+    int count = 1;
 
     while (lastPos >= 0) {
       lastPos = content.indexOf(lineBreak, lastPos+1);
       count++;
     }
-
     return count;
   }
 


[23/38] git commit: [OLINGO-235] reader option to switch off validation of facets

Posted by mi...@apache.org.
[OLINGO-235] reader option to switch off validation of facets

Change-Id: Ie35a7b5ce4e72f0d21a546e35768a36718635f06

Signed-off-by: Stephan Klevenz <sk...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/2211ce41
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/2211ce41
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/2211ce41

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 2211ce410c4bd2c45181037b931244ad6504efd9
Parents: e1b6ead
Author: Klaus Straubinger <kl...@sap.com>
Authored: Fri Apr 11 14:03:03 2014 +0200
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Wed Apr 16 16:28:30 2014 +0200

----------------------------------------------------------------------
 .../api/ep/EntityProviderReadProperties.java    |  19 +++-
 .../core/ep/consumer/JsonEntryConsumer.java     |  14 ++-
 .../core/ep/consumer/JsonPropertyConsumer.java  |  33 +++---
 .../core/ep/consumer/XmlEntityConsumer.java     |   5 +-
 .../core/ep/consumer/XmlEntryConsumer.java      |  22 ++--
 .../core/ep/consumer/XmlPropertyConsumer.java   |  32 +++---
 .../ep/consumer/JsonPropertyConsumerTest.java   |  53 ++++++++--
 .../ep/consumer/XmlPropertyConsumerTest.java    | 103 ++++++++++++++-----
 .../odata2/fit/basic/ServiceResolutionTest.java |  18 ++++
 9 files changed, 220 insertions(+), 79 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java
index a012487..3df4758 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java
@@ -31,10 +31,10 @@ import org.apache.olingo.odata2.api.ep.callback.OnReadInlineContent;
  * <ul>
  * <li>the <code>mergeSemantic</code></li>
  * <li>the <code>callback for inlined navigation properties</code></li>
- * <li>and the <code>type mappings</code></li>
+ * <li>the <code>type mappings</code></li>
+ * <li>and <code>validatingFacets</code></li>
  * </ul>
  * </p>
- * 
  */
 public class EntityProviderReadProperties {
   /** Callback which is necessary if entity contains inlined navigation properties. */
@@ -51,6 +51,9 @@ public class EntityProviderReadProperties {
    * Supported mappings are documented in {@link org.apache.olingo.odata2.api.edm.EdmSimpleType}.
    */
   final private Map<String, Object> typeMappings;
+  /** whether the constraints expressed in properties' facets are validated */
+  private boolean validatingFacets = true;
+
   final private Map<String, String> validatedPrefix2NamespaceUri;
 
   private EntityProviderReadProperties() {
@@ -90,8 +93,12 @@ public class EntityProviderReadProperties {
     return merge;
   }
 
+  public boolean isValidatingFacets() {
+    return validatingFacets;
+  }
+
   /**
-   *  
+   * Builder for {@link EntityProviderReadProperties}.  
    */
   public static class EntityProviderReadPropertiesBuilder {
     private final EntityProviderReadProperties properties = new EntityProviderReadProperties();
@@ -103,6 +110,7 @@ public class EntityProviderReadProperties {
       properties.callback = propertiesFrom.callback;
       addValidatedPrefixes(propertiesFrom.validatedPrefix2NamespaceUri);
       addTypeMappings(propertiesFrom.typeMappings);
+      properties.validatingFacets = propertiesFrom.validatingFacets;
     }
 
     /**
@@ -134,6 +142,11 @@ public class EntityProviderReadProperties {
       return this;
     }
 
+    public EntityProviderReadPropertiesBuilder isValidatingFacets(final boolean validatingFacets) {
+      properties.validatingFacets = validatingFacets;
+      return this;
+    }
+
     public EntityProviderReadProperties build() {
       return properties;
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
index 11350b1..5bae8e7 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
@@ -168,8 +168,8 @@ public class JsonEntryConsumer {
       ensureODataEntryExists();
       EntityPropertyInfo propertyInfo = eia.getPropertyInfo(name);
       if (propertyInfo != null) {
-        JsonPropertyConsumer jpc = new JsonPropertyConsumer();
-        Object propertyValue = jpc.readPropertyValue(reader, propertyInfo, typeMappings.get(name));
+        Object propertyValue = new JsonPropertyConsumer()
+            .readPropertyValue(reader, propertyInfo, typeMappings.get(name), readProperties);
         if (properties.containsKey(name)) {
           throw new EntityProviderException(EntityProviderException.DOUBLE_PROPERTY.addContent(name));
         }
@@ -303,7 +303,10 @@ public class JsonEntryConsumer {
         try {
           if (callback == null) {
             inlineReadProperties =
-                EntityProviderReadProperties.init().mergeSemantic(readProperties.getMergeSemantic()).build();
+                EntityProviderReadProperties.init()
+                    .mergeSemantic(readProperties.getMergeSemantic())
+                    .isValidatingFacets(readProperties.isValidatingFacets())
+                    .build();
 
           } else {
             inlineReadProperties = callback.receiveReadProperties(readProperties, navigationProperty);
@@ -348,7 +351,10 @@ public class JsonEntryConsumer {
       EntityProviderReadProperties inlineReadProperties;
       if (callback == null) {
         inlineReadProperties =
-            EntityProviderReadProperties.init().mergeSemantic(readProperties.getMergeSemantic()).build();
+            EntityProviderReadProperties.init()
+                .mergeSemantic(readProperties.getMergeSemantic())
+                .isValidatingFacets(readProperties.isValidatingFacets())
+                .build();
       } else {
         try {
           inlineReadProperties = callback.receiveReadProperties(readProperties, navigationProperty);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java
index af1262d..1c3ef59 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumer.java
@@ -24,6 +24,7 @@ import java.util.Map;
 
 import org.apache.olingo.odata2.api.edm.Edm;
 import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.edm.EdmFacets;
 import org.apache.olingo.odata2.api.edm.EdmLiteralKind;
 import org.apache.olingo.odata2.api.edm.EdmProperty;
 import org.apache.olingo.odata2.api.edm.EdmSimpleType;
@@ -39,7 +40,7 @@ import com.google.gson.stream.JsonReader;
 import com.google.gson.stream.JsonToken;
 
 /**
- *  
+ * JSON property consumer.
  */
 public class JsonPropertyConsumer {
 
@@ -55,10 +56,10 @@ public class JsonPropertyConsumer {
       if (FormatJson.D.equals(nextName)) {
         reader.beginObject();
         nextName = reader.nextName();
-        handleName(reader, typeMappings, entityPropertyInfo, result, nextName);
+        handleName(reader, typeMappings, entityPropertyInfo, readProperties, result, nextName);
         reader.endObject();
       } else {
-        handleName(reader, typeMappings, entityPropertyInfo, result, nextName);
+        handleName(reader, typeMappings, entityPropertyInfo, readProperties, result, nextName);
       }
       reader.endObject();
 
@@ -78,8 +79,8 @@ public class JsonPropertyConsumer {
   }
 
   private void handleName(final JsonReader reader, final Map<String, Object> typeMappings,
-      final EntityPropertyInfo entityPropertyInfo, final Map<String, Object> result, final String nextName)
-      throws EntityProviderException {
+      final EntityPropertyInfo entityPropertyInfo, final EntityProviderReadProperties readProperties,
+      final Map<String, Object> result, final String nextName) throws EntityProviderException {
     if (!entityPropertyInfo.getName().equals(nextName)) {
       throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT.addContent(nextName));
     }
@@ -87,16 +88,16 @@ public class JsonPropertyConsumer {
     if (typeMappings != null) {
       mapping = typeMappings.get(nextName);
     }
-    Object propertyValue = readPropertyValue(reader, entityPropertyInfo, mapping);
+    Object propertyValue = readPropertyValue(reader, entityPropertyInfo, mapping, readProperties);
     result.put(nextName, propertyValue);
   }
 
   protected Object readPropertyValue(final JsonReader reader, final EntityPropertyInfo entityPropertyInfo,
-      final Object typeMapping) throws EntityProviderException {
+      final Object typeMapping, final EntityProviderReadProperties readProperties) throws EntityProviderException {
     try {
       return entityPropertyInfo.isComplex() ?
-          readComplexProperty(reader, (EntityComplexPropertyInfo) entityPropertyInfo, typeMapping) :
-          readSimpleProperty(reader, entityPropertyInfo, typeMapping);
+          readComplexProperty(reader, (EntityComplexPropertyInfo) entityPropertyInfo, typeMapping, readProperties) :
+          readSimpleProperty(reader, entityPropertyInfo, typeMapping, readProperties);
     } catch (final EdmException e) {
       throw new EntityProviderException(EntityProviderException.EXCEPTION_OCCURRED.addContent(e.getClass()
           .getSimpleName()), e);
@@ -107,7 +108,8 @@ public class JsonPropertyConsumer {
   }
 
   private Object readSimpleProperty(final JsonReader reader, final EntityPropertyInfo entityPropertyInfo,
-      final Object typeMapping) throws EdmException, EntityProviderException, IOException {
+      final Object typeMapping, final EntityProviderReadProperties readProperties)
+      throws EdmException, EntityProviderException, IOException {
     final EdmSimpleType type = (EdmSimpleType) entityPropertyInfo.getType();
     Object value = null;
     final JsonToken tokenType = reader.peek();
@@ -148,15 +150,18 @@ public class JsonPropertyConsumer {
     }
 
     final Class<?> typeMappingClass = typeMapping == null ? type.getDefaultType() : (Class<?>) typeMapping;
-    return type.valueOfString((String) value, EdmLiteralKind.JSON, entityPropertyInfo.getFacets(), typeMappingClass);
+    final EdmFacets facets = readProperties == null || readProperties.isValidatingFacets() ?
+        entityPropertyInfo.getFacets() : null;
+    return type.valueOfString((String) value, EdmLiteralKind.JSON, facets, typeMappingClass);
   }
 
   @SuppressWarnings("unchecked")
   private Object readComplexProperty(final JsonReader reader, final EntityComplexPropertyInfo complexPropertyInfo,
-      final Object typeMapping) throws EdmException, EntityProviderException, IOException {
+      final Object typeMapping, final EntityProviderReadProperties readProperties)
+      throws EdmException, EntityProviderException, IOException {
     if (reader.peek().equals(JsonToken.NULL)) {
       reader.nextNull();
-      if (complexPropertyInfo.isMandatory()) {
+      if ((readProperties == null || readProperties.isValidatingFacets()) && complexPropertyInfo.isMandatory()) {
         throw new EntityProviderException(EntityProviderException.INVALID_PROPERTY_VALUE.addContent(complexPropertyInfo
             .getName()));
       }
@@ -200,7 +205,7 @@ public class JsonPropertyConsumer {
         if (childPropertyInfo == null) {
           throw new EntityProviderException(EntityProviderException.INVALID_PROPERTY.addContent(childName));
         }
-        Object childData = readPropertyValue(reader, childPropertyInfo, mapping.get(childName));
+        Object childData = readPropertyValue(reader, childPropertyInfo, mapping.get(childName), readProperties);
         if (data.containsKey(childName)) {
           throw new EntityProviderException(EntityProviderException.DOUBLE_PROPERTY.addContent(childName));
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
index c7fca98..5d73862 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntityConsumer.java
@@ -115,9 +115,8 @@ public class XmlEntityConsumer {
 
     try {
       reader = XmlHelper.createStreamReader(content);
-      Map<String, Object> result =
-          xec.readProperty(reader, edmProperty, properties.getMergeSemantic(), properties.getTypeMappings());
-      return result;
+      return xec.readProperty(reader, edmProperty, properties.getMergeSemantic(), properties.getTypeMappings(),
+          properties);
     } catch (EntityProviderException e) {
       cachedException = e;
       throw cachedException;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
index 6b9cd5f..a6111d1 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlEntryConsumer.java
@@ -130,17 +130,18 @@ public class XmlEntryConsumer {
     } else if (FormatXml.ATOM_LINK.equals(currentHandledStartTagName)) {
       readLink(reader, eia, readProperties);
     } else if (FormatXml.ATOM_CONTENT.equals(currentHandledStartTagName)) {
-      readContent(reader, eia);
+      readContent(reader, eia, readProperties);
     } else if (FormatXml.M_PROPERTIES.equals(currentHandledStartTagName)) {
-      readProperties(reader, eia);
+      readProperties(reader, eia, readProperties);
     } else if (!readProperties.getMergeSemantic()) {
-      readCustomElement(reader, currentHandledStartTagName, eia);
+      readCustomElement(reader, currentHandledStartTagName, eia, readProperties);
     } else {
       skipStartedTag(reader);
     }
   }
 
-  private void readCustomElement(final XMLStreamReader reader, final String tagName, final EntityInfoAggregator eia)
+  private void readCustomElement(final XMLStreamReader reader, final String tagName, final EntityInfoAggregator eia,
+      final EntityProviderReadProperties readProperties)
       throws EdmException, EntityProviderException, XMLStreamException {
     EntityPropertyInfo targetPathInfo = eia.getTargetPathInfo(tagName);
     NamespaceContext nsctx = reader.getNamespaceContext();
@@ -165,7 +166,8 @@ public class XmlEntryConsumer {
             final EntityPropertyInfo propertyInfo = getValidatedPropertyInfo(eia, tagName);
             final Class<?> typeMapping = typeMappings.getMappingClass(propertyInfo.getName());
             final EdmSimpleType type = (EdmSimpleType) propertyInfo.getType();
-            final Object value = type.valueOfString(text, EdmLiteralKind.DEFAULT, propertyInfo.getFacets(),
+            final Object value = type.valueOfString(text, EdmLiteralKind.DEFAULT,
+                readProperties == null || readProperties.isValidatingFacets() ? propertyInfo.getFacets() : null,
                 typeMapping == null ? type.getDefaultType() : typeMapping);
             properties.put(tagName, value);
           }
@@ -524,7 +526,8 @@ public class XmlEntryConsumer {
     }
   }
 
-  private void readContent(final XMLStreamReader reader, final EntityInfoAggregator eia)
+  private void readContent(final XMLStreamReader reader, final EntityInfoAggregator eia,
+      final EntityProviderReadProperties readProperties)
       throws EntityProviderException, XMLStreamException, EdmException {
     reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_CONTENT);
 
@@ -534,7 +537,7 @@ public class XmlEntryConsumer {
     reader.nextTag();
 
     if (reader.isStartElement() && reader.getLocalName().equals(FormatXml.M_PROPERTIES)) {
-      readProperties(reader, eia);
+      readProperties(reader, eia, readProperties);
     } else if (reader.isEndElement()) {
       reader.require(XMLStreamConstants.END_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_CONTENT);
     } else {
@@ -553,7 +556,8 @@ public class XmlEntryConsumer {
     reader.require(XMLStreamConstants.END_ELEMENT, Edm.NAMESPACE_ATOM_2005, FormatXml.ATOM_ID);
   }
 
-  private void readProperties(final XMLStreamReader reader, final EntityInfoAggregator entitySet)
+  private void readProperties(final XMLStreamReader reader, final EntityInfoAggregator entitySet,
+      final EntityProviderReadProperties readProperties)
       throws XMLStreamException, EdmException, EntityProviderException {
     // validate namespace
     reader.require(XMLStreamConstants.START_ELEMENT, Edm.NAMESPACE_M_2007_08, FormatXml.M_PROPERTIES);
@@ -580,7 +584,7 @@ public class XmlEntryConsumer {
             throw new EntityProviderException(EntityProviderException.DOUBLE_PROPERTY.addContent(closeTag));
           }
           property = getValidatedPropertyInfo(entitySet, closeTag);
-          final Object value = xpc.readStartedElement(reader, property, typeMappings);
+          final Object value = xpc.readStartedElement(reader, property, typeMappings, readProperties);
           properties.put(closeTag, value);
           closeTag = null;
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
index 28cacef..3887333 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumer.java
@@ -33,6 +33,7 @@ import org.apache.olingo.odata2.api.edm.EdmProperty;
 import org.apache.olingo.odata2.api.edm.EdmSimpleType;
 import org.apache.olingo.odata2.api.edm.EdmSimpleTypeException;
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.ep.EntityProviderReadProperties;
 import org.apache.olingo.odata2.core.ep.aggregator.EntityComplexPropertyInfo;
 import org.apache.olingo.odata2.core.ep.aggregator.EntityInfoAggregator;
 import org.apache.olingo.odata2.core.ep.aggregator.EntityPropertyInfo;
@@ -40,27 +41,27 @@ import org.apache.olingo.odata2.core.ep.aggregator.EntityTypeMapping;
 import org.apache.olingo.odata2.core.ep.util.FormatXml;
 
 /**
- *  
+ * XML property consumer.
  */
 public class XmlPropertyConsumer {
 
   protected static final String TRUE = "true";
   protected static final String FALSE = "false";
 
-  public Map<String, Object>
-      readProperty(final XMLStreamReader reader, final EdmProperty property, final boolean merge)
-          throws EntityProviderException {
-    return readProperty(reader, property, merge, null);
+  public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property,
+      final boolean merge, final EntityProviderReadProperties readProperties) throws EntityProviderException {
+    return readProperty(reader, property, merge, null, readProperties);
   }
 
   public Map<String, Object> readProperty(final XMLStreamReader reader, final EdmProperty property,
-      final boolean merge, final Map<String, Object> typeMappings) throws EntityProviderException {
+      final boolean merge, final Map<String, Object> typeMappings, final EntityProviderReadProperties readProperties)
+      throws EntityProviderException {
     EntityPropertyInfo eia = EntityInfoAggregator.create(property);
 
     try {
       reader.next();
 
-      Object value = readStartedElement(reader, eia, EntityTypeMapping.create(typeMappings));
+      Object value = readStartedElement(reader, eia, EntityTypeMapping.create(typeMappings), readProperties);
 
       if (eia.isComplex() && merge) {
         mergeWithDefaultValues(value, eia);
@@ -110,7 +111,8 @@ public class XmlPropertyConsumer {
   }
 
   protected Object readStartedElement(final XMLStreamReader reader, final EntityPropertyInfo propertyInfo,
-      final EntityTypeMapping typeMappings) throws EntityProviderException, EdmException {
+      final EntityTypeMapping typeMappings, final EntityProviderReadProperties readProperties)
+      throws EntityProviderException, EdmException {
     final String name = propertyInfo.getName();
     Object result = null;
 
@@ -123,7 +125,7 @@ public class XmlPropertyConsumer {
       }
 
       if (TRUE.equals(nullAttribute)) {
-        if (propertyInfo.isMandatory()) {
+        if ((readProperties == null || readProperties.isValidatingFacets()) && propertyInfo.isMandatory()) {
           throw new EntityProviderException(EntityProviderException.INVALID_PROPERTY_VALUE.addContent(name));
         }
         reader.nextTag();
@@ -147,13 +149,14 @@ public class XmlPropertyConsumer {
           if (childProperty == null) {
             throw new EntityProviderException(EntityProviderException.INVALID_PROPERTY.addContent(childName));
           }
-          final Object value = readStartedElement(reader, childProperty, typeMappings.getEntityTypeMapping(name));
+          final Object value = readStartedElement(reader, childProperty, typeMappings.getEntityTypeMapping(name),
+              readProperties);
           name2Value.put(childName, value);
           reader.nextTag();
         }
         result = name2Value;
       } else {
-        result = convert(propertyInfo, reader.getElementText(), typeMappings.getMappingClass(name));
+        result = convert(propertyInfo, reader.getElementText(), typeMappings.getMappingClass(name), readProperties);
       }
       reader.require(XMLStreamConstants.END_ELEMENT, Edm.NAMESPACE_D_2007_08, name);
 
@@ -164,10 +167,11 @@ public class XmlPropertyConsumer {
     }
   }
 
-  private Object convert(final EntityPropertyInfo property, final String value, final Class<?> typeMapping)
-      throws EdmSimpleTypeException {
+  private Object convert(final EntityPropertyInfo property, final String value, final Class<?> typeMapping,
+      final EntityProviderReadProperties readProperties) throws EdmSimpleTypeException {
     final EdmSimpleType type = (EdmSimpleType) property.getType();
-    return type.valueOfString(value, EdmLiteralKind.DEFAULT, property.getFacets(),
+    return type.valueOfString(value, EdmLiteralKind.DEFAULT,
+        readProperties == null || readProperties.isValidatingFacets() ? property.getFacets() : null,
         typeMapping == null ? type.getDefaultType() : typeMapping);
   }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumerTest.java
index b52df8b..7d51314 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonPropertyConsumerTest.java
@@ -186,7 +186,7 @@ public class JsonPropertyConsumerTest extends BaseTest {
     reader.nextName();
 
     JsonPropertyConsumer jpc = new JsonPropertyConsumer();
-    Object value = jpc.readPropertyValue(reader, entityPropertyInfo, null);
+    Object value = jpc.readPropertyValue(reader, entityPropertyInfo, null, null);
     assertEquals("Team 1", value);
   }
 
@@ -208,6 +208,30 @@ public class JsonPropertyConsumerTest extends BaseTest {
     assertEquals(propertyValue, resultMap.get("Name"));
   }
 
+  @Test(expected = EntityProviderException.class)
+  public void simplePropertyViolatingValidation() throws Exception {
+    EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Room")
+        .getProperty("Name");
+    EdmFacets facets = mock(EdmFacets.class);
+    when(facets.getMaxLength()).thenReturn(10);
+    when(property.getFacets()).thenReturn(facets);
+    new JsonPropertyConsumer().readPropertyStandalone(prepareReader("{\"Name\":\"TooLongName\"}"), property, null);
+  }
+
+  @Test
+  public void simplePropertyIgnoringValidation() throws Exception {
+    EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Room")
+        .getProperty("Name");
+    EdmFacets facets = mock(EdmFacets.class);
+    when(facets.getMaxLength()).thenReturn(10);
+    when(property.getFacets()).thenReturn(facets);
+    final EntityProviderReadProperties readProperties = mock(EntityProviderReadProperties.class);
+    final Map<String, Object> resultMap = new JsonPropertyConsumer()
+        .readPropertyStandalone(prepareReader("{\"Name\":\"TooLongName\"}"), property, readProperties);
+    assertTrue(resultMap.containsKey("Name"));
+    assertEquals("TooLongName", resultMap.get("Name"));
+  }
+
   @Test
   public void simplePropertyNull() throws Exception {
     JsonReader reader = prepareReader("{\"Name\":null}");
@@ -405,7 +429,7 @@ public class JsonPropertyConsumerTest extends BaseTest {
 
     JsonPropertyConsumer jpc = new JsonPropertyConsumer();
     @SuppressWarnings("unchecked")
-    Map<String, Object> result = (Map<String, Object>) jpc.readPropertyValue(reader, entityPropertyInfo, null);
+    Map<String, Object> result = (Map<String, Object>) jpc.readPropertyValue(reader, entityPropertyInfo, null, null);
 
     assertEquals(2, result.size());
     assertEquals("Heidelberg", result.get("CityName"));
@@ -422,7 +446,7 @@ public class JsonPropertyConsumerTest extends BaseTest {
 
     JsonPropertyConsumer jpc = new JsonPropertyConsumer();
     @SuppressWarnings("unchecked")
-    Map<String, Object> result = (Map<String, Object>) jpc.readPropertyValue(reader, entityPropertyInfo, null);
+    Map<String, Object> result = (Map<String, Object>) jpc.readPropertyValue(reader, entityPropertyInfo, null, null);
 
     assertEquals(2, result.size());
     assertEquals("Heidelberg", result.get("CityName"));
@@ -443,7 +467,7 @@ public class JsonPropertyConsumerTest extends BaseTest {
 
     JsonPropertyConsumer jpc = new JsonPropertyConsumer();
     @SuppressWarnings("unchecked")
-    Map<String, Object> result = (Map<String, Object>) jpc.readPropertyValue(reader, entityPropertyInfo, null);
+    Map<String, Object> result = (Map<String, Object>) jpc.readPropertyValue(reader, entityPropertyInfo, null, null);
 
     assertEquals(2, result.size());
     assertEquals("Germany", result.get("Country"));
@@ -560,6 +584,23 @@ public class JsonPropertyConsumerTest extends BaseTest {
   }
 
   @Test
+  public void complexPropertyNullValueNotAllowedButNotValidated() throws Exception {
+    final EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getDefaultEntityContainer()
+        .getEntitySet("Employees").getEntityType().getProperty("Location");
+    EdmFacets facets = mock(EdmFacets.class);
+    when(facets.isNullable()).thenReturn(false);
+    when(property.getFacets()).thenReturn(facets);
+    final EntityProviderReadProperties readProperties = mock(EntityProviderReadProperties.class);
+
+    final Map<String, Object> propertyData = new JsonPropertyConsumer()
+        .readPropertyStandalone(prepareReader("{\"Location\":null}"), property, readProperties);
+    assertNotNull(propertyData);
+    assertEquals(1, propertyData.size());
+    assertTrue(propertyData.containsKey("Location"));
+    assertNull(propertyData.get("Location"));
+  }
+
+  @Test
   public void complexPropertyEmpty() throws Exception {
     final String cityProperty = "{\"d\":{\"City\":{}}}";
     JsonReader reader = prepareReader(cityProperty);
@@ -584,7 +625,7 @@ public class JsonPropertyConsumerTest extends BaseTest {
         (EdmProperty) MockFacade.getMockEdm().getComplexType("RefScenario", "c_Location").getProperty("City");
     EntityComplexPropertyInfo entityPropertyInfo = (EntityComplexPropertyInfo) EntityInfoAggregator.create(property);
 
-    new JsonPropertyConsumer().readPropertyValue(reader, entityPropertyInfo, null);
+    new JsonPropertyConsumer().readPropertyValue(reader, entityPropertyInfo, null, null);
   }
 
   @Test(expected = EntityProviderException.class)
@@ -596,7 +637,7 @@ public class JsonPropertyConsumerTest extends BaseTest {
         (EdmProperty) MockFacade.getMockEdm().getComplexType("RefScenario", "c_Location").getProperty("City");
     EntityComplexPropertyInfo entityPropertyInfo = (EntityComplexPropertyInfo) EntityInfoAggregator.create(property);
 
-    new JsonPropertyConsumer().readPropertyValue(reader, entityPropertyInfo, null);
+    new JsonPropertyConsumer().readPropertyValue(reader, entityPropertyInfo, null, null);
   }
 
   private JsonReader prepareReader(final String json) throws UnsupportedEncodingException {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumerTest.java
index e1e1f9d..c33b4ea 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/XmlPropertyConsumerTest.java
@@ -19,6 +19,7 @@
 package org.apache.olingo.odata2.core.ep.consumer;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
@@ -38,11 +39,12 @@ import org.apache.olingo.odata2.api.edm.EdmProperty;
 import org.apache.olingo.odata2.api.edm.EdmSimpleTypeException;
 import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.ep.EntityProviderReadProperties;
 import org.apache.olingo.odata2.testutil.mock.MockFacade;
 import org.junit.Test;
 
 /**
- *  
+ * Tests consuming XML properties.
  */
 public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
 
@@ -57,7 +59,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age");
 
-    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     assertEquals(Integer.valueOf(67), resultMap.get("Age"));
   }
@@ -70,7 +72,8 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age");
 
     Map<String, Object> typeMappings = createTypeMappings("Age", Long.class);
-    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, typeMappings);
+    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, typeMappings,
+        null);
 
     assertEquals(Long.valueOf(67), resultMap.get("Age"));
   }
@@ -83,7 +86,8 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age");
 
     Map<String, Object> typeMappings = null;
-    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, typeMappings);
+    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, typeMappings,
+        null);
 
     assertEquals(Integer.valueOf(67), resultMap.get("Age"));
   }
@@ -96,7 +100,8 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age");
 
     Map<String, Object> typeMappings = new HashMap<String, Object>();
-    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, typeMappings);
+    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, typeMappings,
+        null);
 
     assertEquals(Integer.valueOf(67), resultMap.get("Age"));
   }
@@ -108,7 +113,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("EmployeeName");
 
-    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     assertEquals("Max Mustermann", resultMap.get("EmployeeName"));
   }
@@ -120,7 +125,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("EmployeeName");
 
-    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     assertTrue(resultMap.containsKey("EmployeeName"));
     assertEquals("", resultMap.get("EmployeeName"));
@@ -134,7 +139,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("EntryDate");
 
-    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     assertTrue(resultMap.containsKey("EntryDate"));
     assertNull(resultMap.get("EntryDate"));
@@ -148,7 +153,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("EntryDate");
 
-    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     assertEquals(86400000L, ((Calendar) resultMap.get("EntryDate")).getTimeInMillis());
   }
@@ -160,7 +165,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age");
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
   }
 
   @Test(expected = EntityProviderException.class)
@@ -171,7 +176,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Age");
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
   }
 
   @Test(expected = EntityProviderException.class)
@@ -185,7 +190,35 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     when(facets.isNullable()).thenReturn(false);
     when(property.getFacets()).thenReturn(facets);
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
+  }
+
+  @Test(expected = EntityProviderException.class)
+  public void violatedValidation() throws Exception {
+    final String xml = "<Name xmlns=\"" + Edm.NAMESPACE_D_2007_08 + "\">TooLongName</Name>";
+    EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Team")
+        .getProperty("Name");
+    EdmFacets facets = mock(EdmFacets.class);
+    when(facets.getMaxLength()).thenReturn(10);
+    when(property.getFacets()).thenReturn(facets);
+
+    new XmlPropertyConsumer().readProperty(createReaderForTest(xml, true), property, false, null);
+  }
+
+  @Test
+  public void ignoringValidation() throws Exception {
+    final String xml = "<Name xmlns=\"" + Edm.NAMESPACE_D_2007_08 + "\">TooLongName</Name>";
+    EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Team")
+        .getProperty("Name");
+    EdmFacets facets = mock(EdmFacets.class);
+    when(facets.getMaxLength()).thenReturn(10);
+    when(property.getFacets()).thenReturn(facets);
+    final EntityProviderReadProperties readProperties = mock(EntityProviderReadProperties.class);
+
+    final Map<String, Object> resultMap = new XmlPropertyConsumer()
+        .readProperty(createReaderForTest(xml, true), property, false, readProperties);
+    assertTrue(resultMap.containsKey("Name"));
+    assertEquals("TooLongName", resultMap.get("Name"));
   }
 
   @Test
@@ -204,7 +237,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     Map<String, Object> locationMap = (Map<String, Object>) resultMap.get("Location");
     assertEquals("Germany", locationMap.get("Country"));
@@ -232,7 +265,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     Map<String, Object> locationMap = (Map<String, Object>) resultMap.get("Location");
     assertEquals("Germany", locationMap.get("Country"));
@@ -258,7 +291,8 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
 
     try {
       Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false,
-          createTypeMappings("Location", createTypeMappings("City", createTypeMappings("PostalCode", Integer.class))));
+          createTypeMappings("Location", createTypeMappings("City", createTypeMappings("PostalCode", Integer.class))),
+          null);
       assertNotNull(resultMap);
     } catch (EntityProviderException e) {
       assertTrue(e.getCause() instanceof EdmSimpleTypeException);
@@ -293,7 +327,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
             createTypeMappings("City",
                 createTypeMappings("CityName", String.class, "PostalCode", Long.class)));
     Map<String, Object> resultMap =
-        new XmlPropertyConsumer().readProperty(reader, locationComplexProperty, false, typeMappings);
+        new XmlPropertyConsumer().readProperty(reader, locationComplexProperty, false, typeMappings, null);
 
     // verify
     Map<String, Object> locationMap = (Map<String, Object>) resultMap.get("Location");
@@ -320,7 +354,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    Object prop = new XmlPropertyConsumer().readProperty(reader, property, false);
+    Object prop = new XmlPropertyConsumer().readProperty(reader, property, false, null);
     Map<String, Object> resultMap = (Map<String, Object>) prop;
 
     Map<String, Object> locationMap = (Map<String, Object>) resultMap.get("Location");
@@ -345,7 +379,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
   }
 
   @Test(expected = EntityProviderException.class)
@@ -363,7 +397,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
   }
 
   @Test(expected = EntityProviderException.class)
@@ -381,7 +415,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
   }
 
   @Test(expected = EntityProviderException.class)
@@ -399,7 +433,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
   }
 
   @Test
@@ -418,7 +452,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     Map<String, Object> locationMap = (Map<String, Object>) resultMap.get("Location");
     assertEquals("Germany", locationMap.get("Country"));
@@ -435,7 +469,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     assertTrue(resultMap.containsKey("Location"));
     assertNull(resultMap.get("Location"));
@@ -452,7 +486,24 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     when(facets.isNullable()).thenReturn(false);
     when(property.getFacets()).thenReturn(facets);
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
+  }
+
+  @Test
+  public void complexPropertyNullValueNotAllowedButNotValidated() throws Exception {
+    final String xml = "<Location xmlns=\"" + Edm.NAMESPACE_D_2007_08
+        + "\" m:null=\"true\" xmlns:m=\"" + Edm.NAMESPACE_M_2007_08 + "\" />";
+    EdmProperty property = (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee")
+        .getProperty("Location");
+    EdmFacets facets = mock(EdmFacets.class);
+    when(facets.isNullable()).thenReturn(false);
+    when(property.getFacets()).thenReturn(facets);
+    final EntityProviderReadProperties readProperties = mock(EntityProviderReadProperties.class);
+
+    final Map<String, Object> resultMap = new XmlPropertyConsumer()
+        .readProperty(createReaderForTest(xml, true), property, false, readProperties);
+    assertFalse(resultMap.isEmpty());
+    assertNull(resultMap.get("Location"));
   }
 
   @Test(expected = EntityProviderException.class)
@@ -465,7 +516,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    new XmlPropertyConsumer().readProperty(reader, property, false);
+    new XmlPropertyConsumer().readProperty(reader, property, false, null);
   }
 
   @Test
@@ -475,7 +526,7 @@ public class XmlPropertyConsumerTest extends AbstractXmlConsumerTest {
     final EdmProperty property =
         (EdmProperty) MockFacade.getMockEdm().getEntityType("RefScenario", "Employee").getProperty("Location");
 
-    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false);
+    final Map<String, Object> resultMap = new XmlPropertyConsumer().readProperty(reader, property, false, null);
 
     assertNotNull(resultMap.get("Location"));
     @SuppressWarnings("unchecked")

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/2211ce41/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java
index 621701e..8ee0883 100644
--- a/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java
+++ b/odata2-lib/odata-fit/src/test/java/org/apache/olingo/odata2/fit/basic/ServiceResolutionTest.java
@@ -255,6 +255,24 @@ public class ServiceResolutionTest extends BaseTest {
   }
 
   @Test
+  public void testMetadataUriWithMatrixParameter() throws ClientProtocolException, IOException, ODataException,
+      URISyntaxException {
+    server.setPathSplit(3);
+    startServer();
+
+    final String endpoint = server.getEndpoint().toString();
+    final HttpGet get = new HttpGet(URI.create(endpoint + "aaa/bbb;n=2,3;m=1/ccc/$metadata"));
+    final HttpResponse response = httpClient.execute(get);
+
+    assertEquals(HttpStatusCodes.OK.getStatusCode(), response.getStatusLine().getStatusCode());
+
+    final ODataContext ctx = service.getProcessor().getContext();
+    assertNotNull(ctx);
+    assertEquals(endpoint + "aaa/bbb;n=2,3;m=1/ccc/", ctx.getPathInfo().getServiceRoot().toASCIIString());
+    assertEquals("$metadata", ctx.getPathInfo().getODataSegments().get(0).getPath());
+  }
+
+  @Test
   public void testBaseUriWithEncoding() throws ClientProtocolException, IOException, ODataException,
       URISyntaxException {
     server.setPathSplit(3);


[24/38] git commit: [OLINGO-235] code cleanup

Posted by mi...@apache.org.
[OLINGO-235] code cleanup


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/74dff0f3
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/74dff0f3
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/74dff0f3

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 74dff0f3acbe7c693fa026995f9efe70e7cc4c81
Parents: 2211ce4
Author: Stephan Klevenz <sk...@apache.org>
Authored: Wed Apr 16 16:35:57 2014 +0200
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Wed Apr 16 16:35:57 2014 +0200

----------------------------------------------------------------------
 .../annotation/processor/core/util/ClassHelper.java   | 11 ++++++-----
 .../processor/core/util/ClassHelperTest.java          |  1 -
 .../api/exception/ODataJPARuntimeException.java       |  1 -
 .../jpa/processor/core/access/data/JPAEntity.java     |  2 +-
 .../processor/core/access/data/JPAEntityParser.java   |  4 ++--
 .../processor/core/access/model/JPATypeConvertor.java |  4 ++--
 .../data/JPAEntityParserTestForStaticMethods.java     |  2 +-
 .../core/mock/ODataJPAServiceFactoryMock.java         |  6 +++---
 .../processor/core/mock/OnJPAWriteContentMock.java    |  4 ++--
 .../jpa/processor/core/mock/data/JPATypeMock.java     | 12 ++++++------
 .../processor/ref/converter/BlobToByteConverter.java  |  4 ++--
 .../odata2/jpa/processor/ref/model/Material.java      |  2 +-
 .../odata2/jpa/processor/ref/model/NoteKey.java       | 14 +++++++-------
 .../jpa/processor/ref/extension/OnDBWriteContent.java |  4 ++--
 .../odata2/api/ep/EntityProviderReadProperties.java   |  2 +-
 15 files changed, 36 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
index d81d9cf..24082ff 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
@@ -101,7 +101,7 @@ public class ClassHelper {
     return annotatedClasses;
   }
 
-  private static URI getResourceUri(String packageToScan, ClassLoader classLoader) {
+  private static URI getResourceUri(final String packageToScan, final ClassLoader classLoader) {
     String folderToScan = packageToScan.replace(PACKAGE_SEPARATOR, RESOURCE_SEPARATOR);
     URL url = classLoader.getResource(folderToScan);
     if (url == null) {
@@ -115,15 +115,16 @@ public class ClassHelper {
       return uri;
     } catch (URISyntaxException e) {
       throw new IllegalArgumentException("Invalid folder path for path URL '" + url +
-              "' from thread context class loader.");
+          "' from thread context class loader.");
     }
   }
 
-  private static boolean isJarFile(URI uri) {
+  private static boolean isJarFile(final URI uri) {
     return JAR_FILE_ENDING.equals(uri.getScheme());
   }
 
-  private static Collection<String> getClassFqnFromDir(final FilenameFilter ff, File folder, String packageToScan) {
+  private static Collection<String> getClassFqnFromDir(final FilenameFilter ff, final File folder,
+      final String packageToScan) {
     List<String> classFiles = new ArrayList<String>();
     String[] classFilesForFolder = folder.list(ff);
     for (String name : classFilesForFolder) {
@@ -139,7 +140,7 @@ public class ClassHelper {
     return classFiles;
   }
 
-  private static Collection<String> getClassFqnFromJar(URI uri, String packageToScan) {
+  private static Collection<String> getClassFqnFromJar(final URI uri, final String packageToScan) {
     final String jarFilePath;
     String filepath = uri.getSchemeSpecificPart().substring(5);
     String[] split = filepath.split(JAR_RESOURCE_SEPARATOR);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
index 42dd259..3a1aba0 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
@@ -78,7 +78,6 @@ public class ClassHelperTest {
     Assert.assertEquals(SimpleEntity.class.getName(), loadedClasses.get(0).getName());
   }
 
-
   @Test
   public void loadSingleEntityFromJar() throws ODataException {
     String packageToScan = AnnotatedEntity.class.getPackage().getName();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java
index bac5ca3..9863544 100644
--- a/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java
+++ b/odata2-jpa-processor/jpa-api/src/main/java/org/apache/olingo/odata2/jpa/processor/api/exception/ODataJPARuntimeException.java
@@ -98,5 +98,4 @@ public class ODataJPARuntimeException extends ODataJPAException {
 
   private static final long serialVersionUID = -5230976355642443012L;
 
-
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
index b263644..ec05d6b 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntity.java
@@ -315,7 +315,7 @@ public class JPAEntity {
   }
 
   protected void setProperty(final Method method, final Object entity, final Object entityPropertyValue,
-      EdmSimpleType type) throws
+      final EdmSimpleType type) throws
       IllegalAccessException, IllegalArgumentException, InvocationTargetException, ODataJPARuntimeException {
     if (entityPropertyValue != null) {
       Class<?> parameterType = method.getParameterTypes()[0];

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
index 7fc9744..1314ed2 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParser.java
@@ -258,7 +258,7 @@ public final class JPAEntityParser {
     return propertyValue;
   }
 
-  public static String getString(Clob clob) throws ODataJPARuntimeException {
+  public static String getString(final Clob clob) throws ODataJPARuntimeException {
     try {
       Reader stringReader = clob.getCharacterStream();
       StringWriter buffer = null;
@@ -305,7 +305,7 @@ public final class JPAEntityParser {
 
   }
 
-  public static byte[] getBytes(Blob blob) throws ODataJPARuntimeException {
+  public static byte[] getBytes(final Blob blob) throws ODataJPARuntimeException {
     try {
       InputStream is = null;
       ByteArrayOutputStream buffer = null;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java
index c5c2722..685ee83 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/access/model/JPATypeConvertor.java
@@ -106,7 +106,7 @@ public class JPATypeConvertor {
         .addContent(jpaType.toString()), null);
   }
 
-  private static boolean isBlob(Attribute<?, ?> currentAttribute) {
+  private static boolean isBlob(final Attribute<?, ?> currentAttribute) {
     if (currentAttribute != null) {
       AnnotatedElement annotatedElement = (AnnotatedElement) currentAttribute.getJavaMember();
       if (annotatedElement != null && annotatedElement.getAnnotation(Lob.class) != null) {
@@ -116,7 +116,7 @@ public class JPATypeConvertor {
     return false;
   }
 
-  private static TemporalType determineTemporalType(Attribute<?, ?> currentAttribute)
+  private static TemporalType determineTemporalType(final Attribute<?, ?> currentAttribute)
       throws ODataJPAModelException {
     if (currentAttribute != null) {
       AnnotatedElement annotatedElement = (AnnotatedElement) currentAttribute.getJavaMember();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java
index 44f1f4b..efb388d 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPAEntityParserTestForStaticMethods.java
@@ -281,7 +281,7 @@ public class JPAEntityParserTestForStaticMethods {
     }
   }
 
-  private FileInputStream getFileStream(String name) throws SerialException, FileNotFoundException {
+  private FileInputStream getFileStream(final String name) throws SerialException, FileNotFoundException {
     final String fileName = "SalesOrderProcessingMappingModels.xml";
     FileInputStream fis;
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java
index 8535fe4..5fdeece 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAServiceFactoryMock.java
@@ -26,21 +26,21 @@ import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeExcep
 public class ODataJPAServiceFactoryMock extends ODataJPAServiceFactory {
   private ODataContext context = null;
 
-  public ODataJPAServiceFactoryMock(ODataContext context) {
+  public ODataJPAServiceFactoryMock(final ODataContext context) {
     this.context = context;
   }
 
   @Override
   public ODataJPAContext initializeODataJPAContext() throws ODataJPARuntimeException {
     ODataJPAContext oDataJPAContext = null;
-    oDataJPAContext = ODataJPAContextMock.mockODataJPAContext(this.context);
+    oDataJPAContext = ODataJPAContextMock.mockODataJPAContext(context);
     setOnWriteJPAContent(new OnJPAWriteContentMock());
     return oDataJPAContext;
   }
 
   public ODataJPAContext initializeODataJPAContextX() throws ODataJPARuntimeException {
     ODataJPAContext oDataJPAContext = null;
-    oDataJPAContext = ODataJPAContextMock.mockODataJPAContext(this.context);
+    oDataJPAContext = ODataJPAContextMock.mockODataJPAContext(context);
     setOnWriteJPAContent(null);
     return oDataJPAContext;
   }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java
index 6a59361..e0069ce 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/OnJPAWriteContentMock.java
@@ -32,7 +32,7 @@ import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeExcep
 public class OnJPAWriteContentMock implements OnJPAWriteContent {
 
   @Override
-  public Blob getJPABlob(byte[] binaryData) throws ODataJPARuntimeException {
+  public Blob getJPABlob(final byte[] binaryData) throws ODataJPARuntimeException {
     try {
       return new SerialBlob(binaryData);
     } catch (SerialException e) {
@@ -44,7 +44,7 @@ public class OnJPAWriteContentMock implements OnJPAWriteContent {
   }
 
   @Override
-  public Clob getJPAClob(char[] characterData) throws ODataJPARuntimeException {
+  public Clob getJPAClob(final char[] characterData) throws ODataJPARuntimeException {
     try {
       return new SerialClob(characterData);
     } catch (SerialException e) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
index be1475c..dd8207b 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/JPATypeMock.java
@@ -60,7 +60,7 @@ public class JPATypeMock {
     return mClob;
   }
 
-  public void setMClob(Clob mClob) {
+  public void setMClob(final Clob mClob) {
     this.mClob = mClob;
   }
 
@@ -68,7 +68,7 @@ public class JPATypeMock {
     return mC;
   }
 
-  public void setMC(char mC) {
+  public void setMC(final char mC) {
     this.mC = mC;
   }
 
@@ -76,7 +76,7 @@ public class JPATypeMock {
     return mCArray;
   }
 
-  public void setMCArray(char[] mCArray) {
+  public void setMCArray(final char[] mCArray) {
     this.mCArray = mCArray;
   }
 
@@ -84,7 +84,7 @@ public class JPATypeMock {
     return mChar;
   }
 
-  public void setMChar(Character mChar) {
+  public void setMChar(final Character mChar) {
     this.mChar = mChar;
   }
 
@@ -92,7 +92,7 @@ public class JPATypeMock {
     return mCharArray;
   }
 
-  public void setMCharArray(Character[] mCharArray) {
+  public void setMCharArray(final Character[] mCharArray) {
     this.mCharArray = mCharArray;
   }
 
@@ -159,7 +159,7 @@ public class JPATypeMock {
     return mBlob;
   }
 
-  public void setMBlob(Blob mBlob) {
+  public void setMBlob(final Blob mBlob) {
     this.mBlob = mBlob;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
index 8e9c6c2..b6b01cf 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/converter/BlobToByteConverter.java
@@ -33,7 +33,7 @@ import org.hsqldb.jdbc.JDBCBlob;
 public class BlobToByteConverter implements AttributeConverter<Blob, byte[]> {
 
   @Override
-  public byte[] convertToDatabaseColumn(Blob arg0) {
+  public byte[] convertToDatabaseColumn(final Blob arg0) {
     ByteArrayOutputStream buffer = new ByteArrayOutputStream();
     InputStream is;
     try {
@@ -53,7 +53,7 @@ public class BlobToByteConverter implements AttributeConverter<Blob, byte[]> {
   }
 
   @Override
-  public Blob convertToEntityAttribute(byte[] arg0) {
+  public Blob convertToEntityAttribute(final byte[] arg0) {
     try {
       return new JDBCBlob(arg0);
     } catch (SQLException e) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
index 83483de..356909f 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
@@ -74,7 +74,7 @@ public class Material {
     return materialImage;
   }
 
-  public void setMaterialImage(Blob materialImage) {
+  public void setMaterialImage(final Blob materialImage) {
     this.materialImage = materialImage;
   }
 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
index 6ca1067..2585f97 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/NoteKey.java
@@ -32,7 +32,7 @@ public class NoteKey implements Serializable {
     return creationTime;
   }
 
-  public void setCreationTime(Calendar creationTime) {
+  public void setCreationTime(final Calendar creationTime) {
     this.creationTime = creationTime;
   }
 
@@ -40,7 +40,7 @@ public class NoteKey implements Serializable {
     return creationDate;
   }
 
-  public void setCreationDate(Calendar creationDate) {
+  public void setCreationDate(final Calendar creationDate) {
     this.creationDate = creationDate;
   }
 
@@ -48,7 +48,7 @@ public class NoteKey implements Serializable {
     return createdBy;
   }
 
-  public void setCreatedBy(String createdBy) {
+  public void setCreatedBy(final String createdBy) {
     this.createdBy = createdBy;
   }
 
@@ -58,17 +58,17 @@ public class NoteKey implements Serializable {
   }
 
   @Override
-  public boolean equals(Object obj) {
+  public boolean equals(final Object obj) {
     if (obj instanceof Note) {
       Note note = (Note) obj;
 
-      if (!note.getCreatedBy().equals(this.getCreatedBy())) {
+      if (!note.getCreatedBy().equals(getCreatedBy())) {
         return false;
       }
-      if (!note.getCreationDate().equals(this.getCreationDate())) {
+      if (!note.getCreationDate().equals(getCreationDate())) {
         return false;
       }
-      if (!note.getCreationTime().equals(this.getCreationTime())) {
+      if (!note.getCreationTime().equals(getCreationTime())) {
         return false;
       }
       return true;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
index 220b904..678b62a 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OnDBWriteContent.java
@@ -32,7 +32,7 @@ import org.hsqldb.jdbc.JDBCClob;
 public class OnDBWriteContent implements OnJPAWriteContent {
 
   @Override
-  public Blob getJPABlob(byte[] binaryData) throws ODataJPARuntimeException {
+  public Blob getJPABlob(final byte[] binaryData) throws ODataJPARuntimeException {
     try {
       return new JDBCBlob(binaryData);
     } catch (SerialException e) {
@@ -44,7 +44,7 @@ public class OnDBWriteContent implements OnJPAWriteContent {
   }
 
   @Override
-  public Clob getJPAClob(char[] characterData) throws ODataJPARuntimeException {
+  public Clob getJPAClob(final char[] characterData) throws ODataJPARuntimeException {
     try {
       return new JDBCClob(new String(characterData));
     } catch (SQLException e) {

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/74dff0f3/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java
index 3df4758..6012d96 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProviderReadProperties.java
@@ -98,7 +98,7 @@ public class EntityProviderReadProperties {
   }
 
   /**
-   * Builder for {@link EntityProviderReadProperties}.  
+   * Builder for {@link EntityProviderReadProperties}.
    */
   public static class EntityProviderReadPropertiesBuilder {
     private final EntityProviderReadProperties properties = new EntityProviderReadProperties();


[09/38] git commit: [OLINGO-196] Added API methods for de-serialize of ODataErrorContext

Posted by mi...@apache.org.
[OLINGO-196] Added API methods for de-serialize of ODataErrorContext


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/1c2bcda5
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/1c2bcda5
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/1c2bcda5

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 1c2bcda5ad0b76af95cd886cc768bf823ccaca99
Parents: 5f87f64
Author: Michael Bolz <mi...@apache.org>
Authored: Thu Mar 20 13:53:50 2014 +0100
Committer: Michael Bolz <mi...@apache.org>
Committed: Tue Mar 25 10:52:55 2014 +0100

----------------------------------------------------------------------
 .../olingo/odata2/api/ep/EntityProvider.java    | 24 +++++++++++
 .../odata2/core/ep/AtomEntityProvider.java      |  8 ++++
 .../core/ep/ContentTypeBasedEntityProvider.java |  3 ++
 .../odata2/core/ep/JsonEntityProvider.java      |  6 +++
 .../odata2/core/ep/ProviderFacadeImpl.java      |  6 +++
 .../ep/consumer/JsonErrorDocumentConsumer.java  | 41 +++++++++++++++++++
 .../ep/consumer/XmlErrorDocumentConsumer.java   | 42 ++++++++++++++++++++
 .../core/exception/ODataExceptionTest.java      | 15 +------
 8 files changed, 131 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1c2bcda5/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
index 4ce2dac..8086924 100644
--- a/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
+++ b/odata2-lib/odata-api/src/main/java/org/apache/olingo/odata2/api/ep/EntityProvider.java
@@ -421,6 +421,16 @@ public final class EntityProvider {
      */
     List<BatchSingleResponse> parseBatchResponse(String contentType, InputStream content) throws BatchException;
 
+    /**
+     * Read (de-serialize) data from error document as {@link InputStream} and provide according
+     * {@link ODataErrorContext}.
+     *
+     * @param errorDocument error document which is read
+     * @param contentType format of content in the given input stream
+     * @return read error document
+     * @throws EntityProviderException if reading of data (de-serialization) fails
+     */
+    ODataErrorContext readErrorDocument(InputStream errorDocument, String contentType) throws  EntityProviderException;
   }
 
   /**
@@ -801,6 +811,20 @@ public final class EntityProvider {
   }
 
   /**
+   * Read (de-serialize) data from error document as {@link InputStream} and provide according
+   * {@link ODataErrorContext}.
+   *
+   * @param errorDocument error document which is read
+   * @param contentType format of content in the given input stream
+   * @return read error document
+   * @throws EntityProviderException if reading of data (de-serialization) fails
+   */
+  public static ODataErrorContext readErrorDocument(final InputStream errorDocument, final String contentType)
+      throws EntityProviderException {
+    return createEntityProvider().readErrorDocument(errorDocument, contentType);
+  }
+
+  /**
    * Read (de-serialize) data from service document <code>inputStream</code> (as {@link InputStream}) and provide
    * ServiceDocument as {@link ServiceDocument}
    * 

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1c2bcda5/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java
index 7024d02..3b6f121 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/AtomEntityProvider.java
@@ -46,6 +46,7 @@ import org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties;
 import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
 import org.apache.olingo.odata2.api.ep.feed.ODataDeltaFeed;
 import org.apache.olingo.odata2.api.ep.feed.ODataFeed;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
 import org.apache.olingo.odata2.api.processor.ODataResponse;
 import org.apache.olingo.odata2.api.processor.ODataResponse.ODataResponseBuilder;
 import org.apache.olingo.odata2.api.servicedocument.ServiceDocument;
@@ -55,6 +56,7 @@ import org.apache.olingo.odata2.core.ep.aggregator.EntityInfoAggregator;
 import org.apache.olingo.odata2.core.ep.aggregator.EntityPropertyInfo;
 import org.apache.olingo.odata2.core.ep.consumer.AtomServiceDocumentConsumer;
 import org.apache.olingo.odata2.core.ep.consumer.XmlEntityConsumer;
+import org.apache.olingo.odata2.core.ep.consumer.XmlErrorDocumentConsumer;
 import org.apache.olingo.odata2.core.ep.producer.AtomEntryEntityProducer;
 import org.apache.olingo.odata2.core.ep.producer.AtomFeedProducer;
 import org.apache.olingo.odata2.core.ep.producer.AtomServiceDocumentProducer;
@@ -401,4 +403,10 @@ public class AtomEntityProvider implements ContentTypeBasedEntityProvider {
     AtomServiceDocumentConsumer serviceDocConsumer = new AtomServiceDocumentConsumer();
     return serviceDocConsumer.parseXml(serviceDocument);
   }
+
+  @Override
+  public ODataErrorContext readErrorDocument(InputStream errorDocument) throws EntityProviderException {
+    XmlErrorDocumentConsumer xmlErrorDocumentConsumer = new XmlErrorDocumentConsumer();
+    return xmlErrorDocumentConsumer.readError(errorDocument);
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1c2bcda5/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ContentTypeBasedEntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ContentTypeBasedEntityProvider.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ContentTypeBasedEntityProvider.java
index 75adf9e..b988039 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ContentTypeBasedEntityProvider.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ContentTypeBasedEntityProvider.java
@@ -34,6 +34,7 @@ import org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties;
 import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
 import org.apache.olingo.odata2.api.ep.feed.ODataDeltaFeed;
 import org.apache.olingo.odata2.api.ep.feed.ODataFeed;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
 import org.apache.olingo.odata2.api.processor.ODataResponse;
 import org.apache.olingo.odata2.api.servicedocument.ServiceDocument;
 
@@ -84,4 +85,6 @@ public interface ContentTypeBasedEntityProvider {
 
   ODataDeltaFeed readDeltaFeed(EdmEntitySet entitySet, InputStream content, EntityProviderReadProperties properties)
       throws EntityProviderException;
+
+  ODataErrorContext readErrorDocument(InputStream errorDocument) throws EntityProviderException;
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1c2bcda5/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java
index d8efe36..32c68a2 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/JsonEntityProvider.java
@@ -43,12 +43,14 @@ import org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties;
 import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
 import org.apache.olingo.odata2.api.ep.feed.ODataDeltaFeed;
 import org.apache.olingo.odata2.api.ep.feed.ODataFeed;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
 import org.apache.olingo.odata2.api.processor.ODataResponse;
 import org.apache.olingo.odata2.api.processor.ODataResponse.ODataResponseBuilder;
 import org.apache.olingo.odata2.api.servicedocument.ServiceDocument;
 import org.apache.olingo.odata2.core.ep.aggregator.EntityInfoAggregator;
 import org.apache.olingo.odata2.core.ep.aggregator.EntityPropertyInfo;
 import org.apache.olingo.odata2.core.ep.consumer.JsonEntityConsumer;
+import org.apache.olingo.odata2.core.ep.consumer.JsonErrorDocumentConsumer;
 import org.apache.olingo.odata2.core.ep.consumer.JsonServiceDocumentConsumer;
 import org.apache.olingo.odata2.core.ep.producer.JsonCollectionEntityProducer;
 import org.apache.olingo.odata2.core.ep.producer.JsonEntryEntityProducer;
@@ -341,4 +343,8 @@ public class JsonEntityProvider implements ContentTypeBasedEntityProvider {
     return new JsonEntityConsumer().readDeltaFeed(entitySet, content, properties);
   }
 
+  @Override
+  public ODataErrorContext readErrorDocument(InputStream errorDocument) throws EntityProviderException {
+    return new JsonErrorDocumentConsumer().readError(errorDocument);
+  }
 }

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1c2bcda5/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java
index 128f730..16c5693 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/ProviderFacadeImpl.java
@@ -155,6 +155,12 @@ public class ProviderFacadeImpl implements EntityProviderInterface {
   }
 
   @Override
+  public ODataErrorContext readErrorDocument(InputStream errorDocument, String contentType)
+          throws EntityProviderException {
+    return create(contentType).readErrorDocument(errorDocument);
+  }
+
+  @Override
   public ODataFeed readFeed(final String contentType, final EdmEntitySet entitySet, final InputStream content,
       final EntityProviderReadProperties properties) throws EntityProviderException {
     return create(contentType).readFeed(entitySet, content, properties);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1c2bcda5/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
new file mode 100644
index 0000000..fad6dd9
--- /dev/null
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonErrorDocumentConsumer.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * 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.olingo.odata2.core.ep.consumer;
+
+import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+
+import java.io.InputStream;
+
+/**
+ * Consuming (read / deserialization) for OData error document in JSON format.
+ */
+public class JsonErrorDocumentConsumer {
+
+  /**
+   * Deserialize / read OData error document in ODataErrorContext.
+   *
+   * @param errorDocument OData error document in JSON format
+   * @return created ODataErrorContext based on input stream content.
+   * @throws EntityProviderException if an exception during read / deserialization occurs.
+   */
+  public ODataErrorContext readError(InputStream errorDocument) throws EntityProviderException {
+    throw new RuntimeException("Not yet implemented");
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1c2bcda5/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
new file mode 100644
index 0000000..c7f0a51
--- /dev/null
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/XmlErrorDocumentConsumer.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * 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.olingo.odata2.core.ep.consumer;
+
+import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+
+import java.io.InputStream;
+
+/**
+ * Consuming (read / deserialization) for OData error document in XML format.
+ */
+public class XmlErrorDocumentConsumer {
+
+
+  /**
+   * Deserialize / read OData error document in ODataErrorContext.
+   *
+   * @param errorDocument OData error document in XML format
+   * @return created ODataErrorContext based on input stream content.
+   * @throws EntityProviderException if an exception during read / deserialization occurs.
+   */
+  public ODataErrorContext readError(InputStream errorDocument) throws EntityProviderException {
+    throw new RuntimeException("Not yet implementedØ");
+  }
+}

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/1c2bcda5/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
index 6d97d15..4f4dc2b 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/exception/ODataExceptionTest.java
@@ -22,20 +22,7 @@ import org.apache.olingo.odata2.api.edm.EdmException;
 import org.apache.olingo.odata2.api.edm.EdmLiteralException;
 import org.apache.olingo.odata2.api.edm.EdmSimpleTypeException;
 import org.apache.olingo.odata2.api.ep.EntityProviderException;
-import org.apache.olingo.odata2.api.exception.ODataBadRequestException;
-import org.apache.olingo.odata2.api.exception.ODataConflictException;
-import org.apache.olingo.odata2.api.exception.ODataException;
-import org.apache.olingo.odata2.api.exception.ODataForbiddenException;
-import org.apache.olingo.odata2.api.exception.ODataHttpException;
-import org.apache.olingo.odata2.api.exception.ODataMessageException;
-import org.apache.olingo.odata2.api.exception.ODataMethodNotAllowedException;
-import org.apache.olingo.odata2.api.exception.ODataNotAcceptableException;
-import org.apache.olingo.odata2.api.exception.ODataNotFoundException;
-import org.apache.olingo.odata2.api.exception.ODataNotImplementedException;
-import org.apache.olingo.odata2.api.exception.ODataPreconditionFailedException;
-import org.apache.olingo.odata2.api.exception.ODataPreconditionRequiredException;
-import org.apache.olingo.odata2.api.exception.ODataServiceUnavailableException;
-import org.apache.olingo.odata2.api.exception.ODataUnsupportedMediaTypeException;
+import org.apache.olingo.odata2.api.exception.*;
 import org.apache.olingo.odata2.api.uri.UriNotMatchingException;
 import org.apache.olingo.odata2.api.uri.UriSyntaxException;
 import org.apache.olingo.odata2.api.uri.expression.ExceptionVisitExpression;


[28/38] git commit: [OLINGO-255] fixed

Posted by mi...@apache.org.
[OLINGO-255] fixed


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata2/commit/15abea36
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata2/tree/15abea36
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata2/diff/15abea36

Branch: refs/heads/Olingo-129_PocJpaDataStore
Commit: 15abea36ed0b9f74d5d6b3c0c7a68b9717566642
Parents: 2541c88
Author: Stephan Klevenz <sk...@apache.org>
Authored: Fri Apr 25 10:21:48 2014 +0200
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Fri Apr 25 10:21:48 2014 +0200

----------------------------------------------------------------------
 .../processor/core/util/ClassHelperTest.java    |  2 +-
 .../core/ep/consumer/JsonEntryConsumer.java     |  5 ++-
 .../core/ep/consumer/JsonFeedConsumer.java      |  3 +-
 .../consumer/JsonEntryDeepInsertEntryTest.java  | 16 +++++++
 .../resources/JsonInlineRoomWithInlineNull.json | 44 ++++++++++++++++++++
 5 files changed, 67 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/15abea36/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
index 3a1aba0..4da0960 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelperTest.java
@@ -96,7 +96,7 @@ public class ClassHelperTest {
   //
 
   @EdmEntityType
-  @SuppressWarnings("unused")
+//  @SuppressWarnings("unused")
   private class SimpleEntity {
     @EdmKey
     @EdmProperty

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/15abea36/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
index 5bae8e7..1a6bca2 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryConsumer.java
@@ -280,7 +280,8 @@ public class JsonEntryConsumer {
       throw new EntityProviderException(EntityProviderException.ILLEGAL_ARGUMENT.addContent(navigationPropertyName));
     }
 
-    if (reader.peek() == JsonToken.BEGIN_OBJECT) {
+    JsonToken peek = reader.peek();
+    if (peek == JsonToken.BEGIN_OBJECT) {
       reader.beginObject();
       String name = reader.nextName();
       if (FormatJson.DEFERRED.equals(name)) {
@@ -342,6 +343,8 @@ public class JsonEntryConsumer {
         }
       }
       reader.endObject();
+    } else if (peek == JsonToken.NULL) {
+      reader.nextNull();
     } else {
       final EdmNavigationProperty navigationProperty =
           (EdmNavigationProperty) eia.getEntityType().getProperty(navigationPropertyName);

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/15abea36/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumer.java
index f607286..04edbdc 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/consumer/JsonFeedConsumer.java
@@ -82,7 +82,8 @@ public class JsonFeedConsumer {
   }
 
   private void readFeed() throws IOException, EdmException, EntityProviderException {
-    if (reader.peek() == JsonToken.BEGIN_ARRAY) {
+    JsonToken peek = reader.peek();
+    if (peek == JsonToken.BEGIN_ARRAY) {
       readArrayContent();
     } else {
       reader.beginObject();

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/15abea36/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java
index 4919d99..1a057af 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/consumer/JsonEntryDeepInsertEntryTest.java
@@ -51,6 +51,7 @@ public class JsonEntryDeepInsertEntryTest extends AbstractConsumerTest {
 
   private static final String EMPLOYEE_WITH_INLINE_TEAM = "JsonEmployeeWithInlineTeam.json";
   private static final String INLINE_ROOM_WITH_INLINE_BUILDING = "JsonInlineRoomWithInlineBuilding.json";
+  private static final String INLINE_ROOM_WITH_INLINE_NULL = "JsonInlineRoomWithInlineNull.json";
 
   @Test
   public void innerEntryNoMediaResourceWithoutCallback() throws Exception {
@@ -266,6 +267,21 @@ public class JsonEntryDeepInsertEntryTest extends AbstractConsumerTest {
     assertEquals("http://localhost:8080/ReferenceScenario.svc/Buildings('1')/nb_Rooms", associationUris.get(0));
   }
 
+  @Test
+  public void inlineRoomWithInlineNullWithCallbacks() throws Exception {
+    EntryCallback buildingCallback = new EntryCallback();
+    EntryCallback roomCallback = new EntryCallback(buildingCallback);
+    EntityProviderReadProperties readProperties =
+        EntityProviderReadProperties.init().mergeSemantic(false).callback(roomCallback).build();
+    ODataEntry outerEntry = prepareAndExecuteEntry(INLINE_ROOM_WITH_INLINE_NULL, "Employees", readProperties);
+
+    ODataEntry innerRoom = (ODataEntry) outerEntry.getProperties().get("ne_Room");
+    assertNull(innerRoom);
+
+    innerRoom = roomCallback.getEntry();
+    assertNull(innerRoom);
+  }
+
   private class EntryCallback implements OnReadInlineContent {
     private ODataEntry entry;
     private EntryCallback innerCallback;

http://git-wip-us.apache.org/repos/asf/olingo-odata2/blob/15abea36/odata2-lib/odata-core/src/test/resources/JsonInlineRoomWithInlineNull.json
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/resources/JsonInlineRoomWithInlineNull.json b/odata2-lib/odata-core/src/test/resources/JsonInlineRoomWithInlineNull.json
new file mode 100644
index 0000000..a4b8c5e
--- /dev/null
+++ b/odata2-lib/odata-core/src/test/resources/JsonInlineRoomWithInlineNull.json
@@ -0,0 +1,44 @@
+{
+	"d" : {
+		"__metadata" : {
+			"id" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')",
+			"uri" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')",
+			"type" : "RefScenario.Employee",
+			"content_type" : "image/jpeg",
+			"media_src" : "Employees('1')/$value",
+			"edit_media" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')/$value"
+		},
+		"EmployeeId" : "1",
+		"EmployeeName" : "Walter Winter",
+		"ManagerId" : "1",
+		"RoomId" : "1",
+		"TeamId" : "1",
+		"Location" : {
+			"__metadata" : {
+				"type" : "RefScenario.c_Location"
+			},
+			"City" : {
+				"__metadata" : {
+					"type" : "RefScenario.c_City"
+				},
+				"PostalCode" : "69124",
+				"CityName" : "Heidelberg"
+			},
+			"Country" : "Germany"
+		},
+		"Age" : 52,
+		"EntryDate" : "\/Date(915148800000)\/",
+		"ImageUrl" : "Employees('1')/$value",
+		"ne_Manager" : {
+			"__deferred" : {
+				"uri" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')/ne_Manager"
+			}
+		},
+		"ne_Team" : {
+			"__deferred" : {
+				"uri" : "http://localhost:8080/ReferenceScenario.svc/Employees('1')/ne_Team"
+			}
+		},
+		"ne_Room" : null
+	}
+}