You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/05/13 13:47:45 UTC
[01/31] git commit: [OLINGO-274] fix V4 json error response's
deserializing ("details" & "innererror")
Repository: olingo-odata4
Updated Branches:
refs/heads/olingo-266-ref 0d62d15d2 -> a98d3b4ab
[OLINGO-274] fix V4 json error response's deserializing ("details" & "innererror")
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/6f1f4d05
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/6f1f4d05
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/6f1f4d05
Branch: refs/heads/olingo-266-ref
Commit: 6f1f4d05bda2f3ee75bf2f6fa6a8668f8ab0b18f
Parents: f02d9a0
Author: challenh <ch...@apache.org>
Authored: Wed May 7 12:42:01 2014 +0800
Committer: challenh <ch...@apache.org>
Committed: Wed May 7 12:42:01 2014 +0800
----------------------------------------------------------------------
fit/src/main/resources/V40/badRequest.json | 50 ++++++++-----
fit/src/main/resources/V40/notFound.json | 44 +++++++++---
.../olingo/fit/v4/ErrorResponseTestITCase.java | 76 ++++++++++++++++++++
.../apache/olingo/commons/api/Constants.java | 4 ++
.../olingo/commons/api/domain/ODataError.java | 17 +++++
.../commons/api/domain/ODataErrorDetail.java | 48 +++++++++++++
.../commons/core/data/AbstractODataError.java | 32 +++++++--
.../core/data/JSONODataErrorDeserializer.java | 34 ++++++++-
.../data/JSONODataErrorDetailDeserializer.java | 66 +++++++++++++++++
.../core/data/JSONODataErrorDetailImpl.java | 62 ++++++++++++++++
10 files changed, 402 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/fit/src/main/resources/V40/badRequest.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/badRequest.json b/fit/src/main/resources/V40/badRequest.json
index b6bc3ac..fbc0c63 100644
--- a/fit/src/main/resources/V40/badRequest.json
+++ b/fit/src/main/resources/V40/badRequest.json
@@ -1,17 +1,35 @@
{
- "odata.error":
- {
- "code": "",
- "message":
- {
- "lang": "en-US",
- "value": "Bad request."
- },
- "innererror":
- {
- "message": "Bad request.",
- "type": "Microsoft.Data.OData.BadRequest",
- "stacktrace": " at Microsoft.Data.OData.MediaTypeUtils.GetContentTypeFromSettings...."
- }
- }
-}
\ No newline at end of file
+
+ "error": {
+
+ "code": "400",
+
+ "message": "Bad request.",
+
+ "target": "query",
+
+ "details": [
+
+ {
+
+ "code": "400",
+
+ "target": "$search" ,
+
+ "message": "Microsoft.Data.OData.BadRequest"
+
+ }
+
+ ],
+
+ "innererror": {
+
+ "trace": ["at Microsoft.Data.OData.MediaTypeUtils.GetContentTypeFromSettings....","callmethod2 etc"],
+
+ "context": {"key1":"for debug deployment only"}
+
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/fit/src/main/resources/V40/notFound.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/notFound.json b/fit/src/main/resources/V40/notFound.json
index fba2ac4..2af4618 100644
--- a/fit/src/main/resources/V40/notFound.json
+++ b/fit/src/main/resources/V40/notFound.json
@@ -1,11 +1,35 @@
{
- "odata.error":
- {
- "code": "",
- "message":
- {
- "lang": "en-US",
- "value": "Resource not found for the segment 'Customer'."
- }
- }
-}
\ No newline at end of file
+
+ "error": {
+
+ "code": "501",
+
+ "message": "Unsupported functionality",
+
+ "target": "query",
+
+ "details": [
+
+ {
+
+ "code": "301",
+
+ "target": "$search",
+
+ "message": "$search query option not supported"
+
+ }
+
+ ],
+
+ "innererror": {
+
+ "trace": ["callmethod1 etc","callmethod2 etc"],
+
+ "context": {"key1":"for debug deployment only"}
+
+ }
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
new file mode 100644
index 0000000..7e576f0
--- /dev/null
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
@@ -0,0 +1,76 @@
+/*
+ * 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.fit.v4;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.net.URI;
+import java.util.Dictionary;
+
+import org.apache.olingo.client.api.communication.ODataClientErrorException;
+import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
+import org.apache.olingo.commons.api.domain.ODataError;
+import org.apache.olingo.commons.api.domain.ODataErrorDetail;
+import org.apache.olingo.commons.api.domain.v4.ODataEntity;
+import org.apache.olingo.commons.api.format.ODataPubFormat;
+import org.junit.Test;
+
+public class ErrorResponseTestITCase extends AbstractTestITCase {
+
+ @Test
+ public void jsonError() {
+
+ ODataPubFormat format = ODataPubFormat.JSON;
+ final URI readURI = getClient().getURIBuilder(testStaticServiceRootURL)
+ .appendEntitySetSegment("Customers").appendKeySegment(32)
+ .build();
+
+ final ODataEntityRequest<ODataEntity> req = getClient()
+ .getRetrieveRequestFactory().getEntityRequest(readURI);
+ try {
+ final ODataEntity read = read(format, readURI);
+ } catch (Exception ex) {
+ ODataError err = ((ODataClientErrorException) ex).getODataError();
+
+ // verify details
+ ODataErrorDetail detail = (ODataErrorDetail) err.getDetails()
+ .get(0);
+ assertEquals("Code should be correct", "301", detail.getCode());
+ assertEquals("Target should be correct", "$search",
+ detail.getTarget());
+ assertEquals("Message should be correct",
+ "$search query option not supported", detail.getMessage());
+
+ // verify inner error dictionary
+ Dictionary<String, Object> innerErr = err.getInnerError();
+ assertEquals("innerError dictionary size should be correct", 2,
+ innerErr.size());
+ assertEquals("innerError['context'] should be correct",
+ "{\"key1\":\"for debug deployment only\"}",
+ innerErr.get("context"));
+ assertEquals("innerError['trace'] should be correct",
+ "[\"callmethod1 etc\",\"callmethod2 etc\"]",
+ innerErr.get("trace"));
+ return;
+ }
+
+ assertNotNull("should have got exception", null);
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
index 17a65eb..cc6907c 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
@@ -243,6 +243,10 @@ public interface Constants {
public static final String ERROR_TARGET = "target";
+ public static final String ERROR_DETAILS = "details";
+
+ public static final String ERROR_INNERERROR= "innererror";
+
// canonical functions to be applied via dynamic annotation <tt>Apply</tt>
public static final String CANONICAL_FUNCTION_CONCAT = "odata.concat";
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java
index fc309d3..f899d9a 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java
@@ -18,6 +18,9 @@
*/
package org.apache.olingo.commons.api.domain;
+import java.util.Dictionary;
+import java.util.List;
+
/**
* OData error.
*/
@@ -43,5 +46,19 @@ public interface ODataError {
* @return error message.
*/
String getTarget();
+
+
+ /**
+ * Gets error details.
+ *
+ * @return ODataErrorDetail list.
+ */
+ List<ODataErrorDetail> getDetails();
+ /**
+ * Gets server defined key-value pairs for debug environment only.
+ *
+ * @return a Dictionary representing server defined object.
+ */
+ Dictionary<String, Object> getInnerError();
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java
new file mode 100644
index 0000000..462e91e
--- /dev/null
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java
@@ -0,0 +1,48 @@
+/*
+ * 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.commons.api.domain;
+
+/**
+ * OData details, for example - { "error": {..., "details":[
+ * {"code": "301","target": "$search" ,"message": "$search query option not supported"}
+ * ],...}}
+ */
+public interface ODataErrorDetail {
+
+ /**
+ * Gets error code.
+ *
+ * @return error code.
+ */
+ String getCode();
+
+ /**
+ * Gets error message.
+ *
+ * @return error message.
+ */
+ String getMessage();
+
+ /**
+ * Gets error target.
+ *
+ * @return error message.
+ */
+ String getTarget();
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java
index 931a38b..62cbebf 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java
@@ -18,9 +18,12 @@
*/
package org.apache.olingo.commons.core.data;
+import java.util.Dictionary;
+import java.util.List;
+
import org.apache.olingo.commons.api.domain.ODataError;
+import org.apache.olingo.commons.api.domain.ODataErrorDetail;
-// TODO p2 supports V4:
// {
// "error": {
// "code": "501",
@@ -29,10 +32,10 @@ import org.apache.olingo.commons.api.domain.ODataError;
// "details": [
// {
// "code": "301",
-// "target": "$search"
-// "message": "$search query option not supported",
+// "target": "$search",
+// "message": "$search query option not supported"
// }
-// ]
+// ],
// "innererror": {
// "trace": [...],
// "context": {...}
@@ -47,6 +50,10 @@ public abstract class AbstractODataError implements ODataError {
private String target;
+ private List<ODataErrorDetail> details;
+
+ private Dictionary<String,Object> innerError;
+
@Override
public String getCode() {
return code;
@@ -74,4 +81,21 @@ public abstract class AbstractODataError implements ODataError {
this.target = target;
}
+ @Override
+ public List<ODataErrorDetail> getDetails() {
+ return details;
+ }
+
+ public void setDetails(final List<ODataErrorDetail> detail) {
+ this.details = detail;
+ }
+
+ @Override
+ public Dictionary<String,Object> getInnerError() {
+ return innerError;
+ }
+
+ public void setInnerError(final Dictionary<String,Object> innerError) {
+ this.innerError = innerError;
+ }
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java
index 43ee06c..50fa1f9 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java
@@ -20,13 +20,23 @@ package org.apache.olingo.commons.core.data;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
+
import java.io.IOException;
import java.net.URI;
+import java.util.ArrayList;
+import java.util.Dictionary;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
import org.apache.olingo.commons.api.Constants;
+import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.domain.ODataErrorDetail;
public class JSONODataErrorDeserializer extends AbstractJsonDeserializer<JSONODataErrorImpl> {
@@ -54,8 +64,30 @@ public class JSONODataErrorDeserializer extends AbstractJsonDeserializer<JSONODa
if (errorNode.has(Constants.ERROR_TARGET)) {
error.setTarget(errorNode.get(Constants.ERROR_TARGET).textValue());
}
+ if (errorNode.hasNonNull(Constants.ERROR_DETAILS)) {
+ List<ODataErrorDetail> details = new ArrayList<ODataErrorDetail>();
+ for (final Iterator<JsonNode> itor = errorNode.get(Constants.ERROR_DETAILS).iterator(); itor.hasNext();) {
+ details.add(
+ itor.next().traverse(parser.getCodec()).<ResWrap<JSONODataErrorDetailImpl>>readValueAs(
+ new TypeReference<JSONODataErrorDetailImpl>() {
+ }).getPayload());
+ }
+
+ error.setDetails(details);
+ }
+ if (errorNode.hasNonNull(Constants.ERROR_INNERERROR)) {
+ JsonNode innerError = errorNode.get(Constants.ERROR_INNERERROR);
+ Dictionary<String, Object> innerErr = new Hashtable<String, Object>();
+ for (final Iterator<String> itor = innerError.fieldNames(); itor.hasNext();) {
+ String keyTmp = itor.next();
+ String val = innerError.get(keyTmp).toString();
+ innerErr.put(keyTmp,val);
+ }
+
+ error.setInnerError(innerErr);
+ }
}
-
+
return new ResWrap<JSONODataErrorImpl>((URI) null, null, error);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java
new file mode 100644
index 0000000..9c2ce7b
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java
@@ -0,0 +1,66 @@
+/*
+ * 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.commons.core.data;
+
+import com.fasterxml.jackson.core.JsonParser;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.DeserializationContext;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.olingo.commons.api.Constants;
+import org.apache.olingo.commons.api.data.Entity;
+import org.apache.olingo.commons.api.data.ResWrap;
+import org.apache.olingo.commons.api.domain.ODataErrorDetail;
+
+public class JSONODataErrorDetailDeserializer extends
+ AbstractJsonDeserializer<JSONODataErrorDetailImpl> {
+
+ @Override
+ protected ResWrap<JSONODataErrorDetailImpl> doDeserialize(
+ final JsonParser parser, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
+
+ final JSONODataErrorDetailImpl error = new JSONODataErrorDetailImpl();
+ final JsonNode errorNode = parser.getCodec().readTree(parser);
+ if (errorNode.has(Constants.ERROR_CODE)) {
+ error.setCode(errorNode.get(Constants.ERROR_CODE).textValue());
+ }
+ if (errorNode.has(Constants.ERROR_MESSAGE)) {
+ final JsonNode message = errorNode.get(Constants.ERROR_MESSAGE);
+ if (message.isValueNode()) {
+ error.setMessage(message.textValue());
+ } else if (message.isObject()) {
+ error.setMessage(message.get(Constants.VALUE).asText());
+ }
+ }
+ if (errorNode.has(Constants.ERROR_TARGET)) {
+ error.setTarget(errorNode.get(Constants.ERROR_TARGET).textValue());
+ }
+
+ return new ResWrap<JSONODataErrorDetailImpl>((URI) null, null, error);
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/6f1f4d05/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java
new file mode 100644
index 0000000..2f4585a
--- /dev/null
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java
@@ -0,0 +1,62 @@
+/*
+ * 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.commons.core.data;
+
+import org.apache.olingo.commons.api.domain.ODataErrorDetail;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+
+/*
+ * JSONODataErrorDetailImpl, using the JSONODataErrorDetailDeserializer similar to JSONODataErrorImpl's.
+ */
+@JsonDeserialize(using = JSONODataErrorDetailDeserializer.class)
+public class JSONODataErrorDetailImpl implements ODataErrorDetail {
+
+ private String code;
+
+ private String message;
+
+ private String target;
+
+ @Override
+ public String getCode() {
+ return code;
+ }
+
+ public void setCode(final String code) {
+ this.code = code;
+ }
+
+ @Override
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(final String message) {
+ this.message = message;
+ }
+
+ @Override
+ public String getTarget() {
+ return target;
+ }
+
+ public void setTarget(final String target) {
+ this.target = target;
+ }
+}
\ No newline at end of file
[30/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/FunctionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/FunctionProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/FunctionProvider.java
deleted file mode 100644
index 606d751..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/FunctionProvider.java
+++ /dev/null
@@ -1,852 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.Function;
-import org.apache.olingo.server.api.edm.provider.Parameter;
-import org.apache.olingo.server.api.edm.provider.ReturnType;
-
-public class FunctionProvider {
-
- // Bound Functions
- public static final FullQualifiedName nameBFCCollCTPrimCompRTESAllPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCCollCTPrimCompRTESAllPrim");
-
- public static final FullQualifiedName nameBFCCollStringRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCCollStringRTESTwoKeyNav");
-
- public static final FullQualifiedName nameBFCCTPrimCompRTESBaseTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCCTPrimCompRTESBaseTwoKeyNav");
-
- public static final FullQualifiedName nameBFCCTPrimCompRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCCTPrimCompRTESTwoKeyNav");
-
- public static final FullQualifiedName nameBFCCTPrimCompRTESTwoKeyNavParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCCTPrimCompRTESTwoKeyNavParam");
-
- public static final FullQualifiedName nameBFCCTPrimCompRTETTwoKeyNavParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCCTPrimCompRTETTwoKeyNavParam");
-
- public static final FullQualifiedName nameBFCESAllPrimRTCTAllPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESAllPrimRTCTAllPrim");
-
- public static final FullQualifiedName nameBFCESBaseTwoKeyNavRTESBaseTwoKey =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESBaseTwoKeyNavRTESBaseTwoKey");
-
- public static final FullQualifiedName nameBFCESKeyNavRTETKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESKeyNavRTETKeyNav");
-
- public static final FullQualifiedName nameBFCESKeyNavRTETKeyNavParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESKeyNavRTETKeyNavParam");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTTwoPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCollCTTwoPrim");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTCollString =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCollString");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTCTTwoPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCTTwoPrim");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTESTwoKeyNav");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTString =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTString");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTStringParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTStringParam");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTTwoKeyNav");
-
- public static final FullQualifiedName nameBFCETBaseTwoKeyNavRTESBaseTwoKey =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCETBaseTwoKeyNavRTESBaseTwoKey");
-
- public static final FullQualifiedName nameBFCETBaseTwoKeyNavRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCETBaseTwoKeyNavRTESTwoKeyNav");
-
- public static final FullQualifiedName nameBFCETBaseTwoKeyNavRTETTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCETBaseTwoKeyNavRTETTwoKeyNav");
-
- public static final FullQualifiedName nameBFCETKeyNavRTETKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCETKeyNavRTETKeyNav");
-
- public static final FullQualifiedName nameBFCETTwoKeyNavRTCTTwoPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCETTwoKeyNavRTCTTwoPrim");
-
- public static final FullQualifiedName nameBFCETTwoKeyNavRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCETTwoKeyNavRTESTwoKeyNav");
-
- public static final FullQualifiedName nameBFCETTwoKeyNavRTETTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCETTwoKeyNavRTETTwoKeyNav");
-
- public static final FullQualifiedName nameBFCSINavRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCSINavRTESTwoKeyNav");
-
- public static final FullQualifiedName nameBFCStringRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFCStringRTESTwoKeyNav");
-
- public static final FullQualifiedName nameBFESTwoKeyNavRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BFESTwoKeyNavRTESTwoKeyNav");
-
- // Unbound Functions
- public static final FullQualifiedName nameUFCRTCollCTTwoPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCollCTTwoPrim");
- public static final FullQualifiedName nameUFCRTCollCTTwoPrimParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCollCTTwoPrimParam");
- public static final FullQualifiedName nameUFCRTCollString = new FullQualifiedName(SchemaProvider.nameSpace,
- "UFCRTCollString");
- public static final FullQualifiedName nameUFCRTCollStringTwoParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCollStringTwoParam");
- public static final FullQualifiedName nameUFCRTCTAllPrimTwoParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCTAllPrimTwoParam");
- public static final FullQualifiedName nameUFCRTCTTwoPrim = new FullQualifiedName(SchemaProvider.nameSpace,
- "UFCRTCTTwoPrim");
- public static final FullQualifiedName nameUFCRTCTTwoPrimParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCTTwoPrimParam");
- public static final FullQualifiedName nameUFCRTESMixPrimCollCompTwoParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTESMixPrimCollCompTwoParam");
- public static final FullQualifiedName nameUFCRTESTwoKeyNavParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTESTwoKeyNavParam");
- public static final FullQualifiedName nameUFCRTETAllPrimTwoParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTETAllPrimTwoParam");
- public static final FullQualifiedName nameUFCRTETKeyNav = new FullQualifiedName(SchemaProvider.nameSpace,
- "UFCRTETKeyNav");
- public static final FullQualifiedName nameUFCRTETMedia = new FullQualifiedName(SchemaProvider.nameSpace,
- "UFCRTETMedia");
-
- public static final FullQualifiedName nameUFCRTETTwoKeyNavParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTETTwoKeyNavParam");
-
- public static final FullQualifiedName nameUFCRTETTwoKeyNavParamCTTwoPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTETTwoKeyNavParamCTTwoPrim");
-
- public static final FullQualifiedName nameUFCRTString =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTString");
-
- public static final FullQualifiedName nameUFCRTStringTwoParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTStringTwoParam");
-
- public static final FullQualifiedName nameUFNRTESMixPrimCollCompTwoParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFNRTESMixPrimCollCompTwoParam");
- public static final FullQualifiedName nameUFNRTInt16 =
- new FullQualifiedName(SchemaProvider.nameSpace, "UFNRTInt16");
-
- public static final FullQualifiedName nameUFNRTCollCTNavFiveProp = new FullQualifiedName(SchemaProvider.nameSpace,
- "UFNRTCollCTNavFiveProp");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTCTNavFiveProp = new FullQualifiedName(
- SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCTNavFiveProp");
-
- public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTNavFiveProp = new FullQualifiedName(
- SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCollCTNavFiveProp");
-
- public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
-
- if (functionName.equals(nameUFNRTInt16)) {
- return Arrays.asList(
- new Function()
- .setName("UFNRTInt16")
- .setParameters(new ArrayList<Parameter>())
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameInt16))
- );
-
- } else if (functionName.equals(nameUFCRTETKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTETKeyNav")
- .setParameters(new ArrayList<Parameter>())
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTETTwoKeyNavParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTETTwoKeyNavParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)
- )
- );
-
- } else if (functionName.equals(nameUFCRTETTwoKeyNavParamCTTwoPrim)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTETTwoKeyNavParamCTTwoPrim")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterCTTwoPrim").setType(ComplexTypeProvider.nameCTTwoPrim)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)
- )
- );
-
- } else if (functionName.equals(nameUFCRTStringTwoParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTStringTwoParam")
- .setParameters(Arrays.asList(
- new Parameter()
- .setName("ParameterInt16")
- .setType(PropertyProvider.nameInt16)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameString).setNullable(false)),
- new Function()
- .setName("UFCRTStringTwoParam")
- .setParameters(Arrays.asList(
- new Parameter()
- .setName("ParameterString")
- .setType(PropertyProvider.nameString)
- .setNullable(false),
- new Parameter()
- .setName("ParameterInt16")
- .setType(PropertyProvider.nameInt16)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(new ReturnType().setType(PropertyProvider.nameString).setNullable(false))
-
- );
-
- } else if (functionName.equals(nameUFCRTESTwoKeyNavParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTESTwoKeyNavParam")
- .setParameters(Arrays.asList(
- new Parameter()
- .setName("ParameterInt16")
- .setType(PropertyProvider.nameInt16)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTString)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTString")
-
- .setComposable(true)
- .setParameters(new ArrayList<Parameter>())
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameString).setNullable(false)
- )
- );
-
- } else if (functionName.equals(nameUFCRTCollStringTwoParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTCollStringTwoParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTCollString)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTCollString")
- .setParameters(new ArrayList<Parameter>())
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTCTAllPrimTwoParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTCTAllPrimTwoParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTCTTwoPrimParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTCTTwoPrimParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false),
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(true)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
- );
- } else if (functionName.equals(nameUFCRTCollCTTwoPrimParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTCollCTTwoPrimParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false),
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(true)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTCTTwoPrim)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTCTTwoPrim")
- .setParameters(new ArrayList<Parameter>())
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTCollCTTwoPrim)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTCollCTTwoPrim")
- .setComposable(true)
- .setParameters(new ArrayList<Parameter>())
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTETMedia)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTETMedia")
- .setParameters(new ArrayList<Parameter>())
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETMedia).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFNRTESMixPrimCollCompTwoParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFNRTESMixPrimCollCompTwoParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
- .setComposable(false)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETMixPrimCollComp).setCollection(true)
- .setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTETAllPrimTwoParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTETAllPrimTwoParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setNullable(false))
- );
-
- } else if (functionName.equals(nameUFCRTESMixPrimCollCompTwoParam)) {
- return Arrays.asList(
- new Function()
- .setName("UFCRTESMixPrimCollCompTwoParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)
- ))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETMixPrimCollComp).setCollection(true)
- .setNullable(false))
- );
-
- } else if (functionName.equals(nameUFNRTCollCTNavFiveProp)) {
- return Arrays.asList(
- new Function()
- .setName("UFNRTCollCTNavFiveProp")
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setCollection(true))
- );
- } else if (functionName.equals(nameBFCESTwoKeyNavRTESTwoKeyNav)) {
- return Arrays
- .asList(
- new Function()
- .setName("BFCESTwoKeyNavRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)
- .setNullable(false)),
-
- new Function()
- .setName("BFCESTwoKeyNavRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false),
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
- .setCollection(false).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)
- .setNullable(false)),
- new Function()
- .setName("BFCESTwoKeyNavRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)
- .setNullable(false)),
- new Function()
- .setName("BFCESTwoKeyNavRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav)
- .setCollection(true).setNullable(false),
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
- .setCollection(false).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)
- .setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCStringRTESTwoKeyNav)) {
- return Arrays.asList(
- new Function().setName("BFCStringRTESTwoKeyNav")
- .setBound(true)
- .setParameters(Arrays.asList(
- new Parameter().setName("BindingParam").setType(PropertyProvider.nameString).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTETTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCETBaseTwoKeyNavRTETTwoKeyNav")
- .setBound(true)
- .setParameters(Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)
- )
- );
-
- } else if (functionName.equals(nameBFCESBaseTwoKeyNavRTESBaseTwoKey)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESBaseTwoKeyNavRTESBaseTwoKey")
- .setBound(true)
- .setParameters(Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true)
- .setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCESAllPrimRTCTAllPrim)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESAllPrimRTCTAllPrim")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETAllPrim)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCESTwoKeyNavRTCTTwoPrim)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESTwoKeyNavRTCTTwoPrim")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCESTwoKeyNavRTCollCTTwoPrim)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESTwoKeyNavRTCollCTTwoPrim")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCESTwoKeyNavRTString)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESTwoKeyNavRTString")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameString).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCESTwoKeyNavRTCollString)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESTwoKeyNavRTCollString")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCETTwoKeyNavRTESTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCETTwoKeyNavRTESTwoKeyNav")
- .setBound(true)
- .setParameters(Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTESTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCETBaseTwoKeyNavRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCSINavRTESTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCSINavRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(
- false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTESBaseTwoKey)) {
- return Arrays.asList(
- new Function()
- .setName("BFCETBaseTwoKeyNavRTESBaseTwoKey")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true).setNullable(
- false))
- );
-
- } else if (functionName.equals(nameBFCCollStringRTESTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCCollStringRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(PropertyProvider.nameString).setCollection(true)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCCTPrimCompRTESTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCCTPrimCompRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable(
- false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCCTPrimCompRTESBaseTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCCTPrimCompRTESBaseTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable(
- false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true).setNullable(
- false))
- );
-
- } else if (functionName.equals(nameBFCCollCTPrimCompRTESAllPrim)) {
- return Arrays.asList(
- new Function()
- .setName("BFCCollCTPrimCompRTESAllPrim")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setCollection(true).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCESTwoKeyNavRTTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESTwoKeyNavRTTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCESKeyNavRTETKeyNav)) {
- return Arrays
- .asList(
- new Function()
- .setName("BFCESKeyNavRTETKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setCollection(
- true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCETKeyNavRTETKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCETKeyNavRTETKeyNav")
- .setBound(true)
- .setParameters(Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
- );
- } else if (functionName.equals(nameBFESTwoKeyNavRTESTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFESTwoKeyNavRTESTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
-
- );
-
- } else if (functionName.equals(nameBFCETTwoKeyNavRTETTwoKeyNav)) {
- return Arrays.asList(
- new Function()
- .setName("BFCETTwoKeyNavRTETTwoKeyNav")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(
- false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCETTwoKeyNavRTCTTwoPrim)) {
- return Arrays.asList(
- new Function()
- .setName("BFCETTwoKeyNavRTCTTwoPrim")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(
- false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
- );
- } else if (functionName.equals(nameBFCESTwoKeyNavRTCTNavFiveProp)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESTwoKeyNavRTCTNavFiveProp")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setNullable(false))
- );
- } else if (functionName.equals(nameBFCESTwoKeyNavRTCollCTNavFiveProp)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESTwoKeyNavRTCollCTNavFiveProp")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setCollection(true)
- .setNullable(false))
- );
- } else if (functionName.equals(nameBFCESTwoKeyNavRTStringParam)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESTwoKeyNavRTStringParam")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false),
- new Parameter().setName("ParameterComplex").setType(ComplexTypeProvider.nameCTTwoPrim)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameString).setNullable(false))
- );
-
- } else if (functionName.equals(nameBFCESKeyNavRTETKeyNavParam)) {
- return Arrays.asList(
- new Function()
- .setName("BFCESKeyNavRTETKeyNavParam")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setCollection(
- true).setNullable(false),
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
- );
- } else if (functionName.equals(nameBFCCTPrimCompRTETTwoKeyNavParam)) {
- return Arrays.asList(
- new Function()
- .setName("BFCCTPrimCompRTETTwoKeyNavParam")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable(
- false),
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(new ReturnType()
- .setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)
- )
- );
- } else if (functionName.equals(nameBFCCTPrimCompRTESTwoKeyNavParam)) {
- return Arrays.asList(
- new Function()
- .setName("BFCCTPrimCompRTESTwoKeyNavParam")
- .setBound(true)
- .setParameters(
- Arrays.asList(
- new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable(
- false),
- new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
- .setNullable(false)))
- .setComposable(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
- );
- }
-
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/PropertyProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/PropertyProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/PropertyProvider.java
deleted file mode 100644
index 92b8d6e..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/PropertyProvider.java
+++ /dev/null
@@ -1,590 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.NavigationProperty;
-import org.apache.olingo.server.api.edm.provider.Property;
-
-public class PropertyProvider {
-
- // Primitive Type Names
- public static final FullQualifiedName nameBinary = EdmPrimitiveTypeKind.Binary.getFullQualifiedName();
- public static final FullQualifiedName nameBoolean = EdmPrimitiveTypeKind.Boolean.getFullQualifiedName();
- public static final FullQualifiedName nameByte = EdmPrimitiveTypeKind.Byte.getFullQualifiedName();
-
- public static final FullQualifiedName nameDate = EdmPrimitiveTypeKind.Date.getFullQualifiedName();
- public static final FullQualifiedName nameDateTimeOffset =
- EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName();
-
- public static final FullQualifiedName nameDecimal = EdmPrimitiveTypeKind.Decimal.getFullQualifiedName();
- public static final FullQualifiedName nameDouble = EdmPrimitiveTypeKind.Double.getFullQualifiedName();
- public static final FullQualifiedName nameDuration = EdmPrimitiveTypeKind.Duration.getFullQualifiedName();
-
- public static final FullQualifiedName nameGuid = EdmPrimitiveTypeKind.Guid.getFullQualifiedName();
- public static final FullQualifiedName nameInt16 = EdmPrimitiveTypeKind.Int16.getFullQualifiedName();
- public static final FullQualifiedName nameInt32 = EdmPrimitiveTypeKind.Int32.getFullQualifiedName();
- public static final FullQualifiedName nameInt64 = EdmPrimitiveTypeKind.Int64.getFullQualifiedName();
-
- public static final FullQualifiedName nameSByte = EdmPrimitiveTypeKind.SByte.getFullQualifiedName();
- public static final FullQualifiedName nameSingle = EdmPrimitiveTypeKind.Single.getFullQualifiedName();
-
- public static final FullQualifiedName nameString = EdmPrimitiveTypeKind.String.getFullQualifiedName();
- public static final FullQualifiedName nameTimeOfDay = EdmPrimitiveTypeKind.TimeOfDay.getFullQualifiedName();
-
- // Primitive Properties --------------------------------------------------------------------------------------------
- public static final Property collPropertyBinary = new Property()
- .setName("CollPropertyBinary")
- .setType(nameBinary)
- .setCollection(true);
-
- public static final Property collPropertyBinary_ExplicitNullable = new Property()
- .setName("CollPropertyBinary")
- .setType(nameBinary)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyBoolean = new Property()
- .setName("CollPropertyBoolean")
- .setType(nameBoolean)
- .setCollection(true);
-
- public static final Property collPropertyBoolean_ExplicitNullable = new Property()
- .setName("CollPropertyBoolean")
- .setType(nameBoolean)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyByte = new Property()
- .setName("CollPropertyByte")
- .setType(nameByte)
- .setCollection(true);
-
- public static final Property collPropertyByte_ExplicitNullable = new Property()
- .setName("CollPropertyByte")
- .setType(nameByte)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyDate = new Property()
- .setName("CollPropertyDate")
- .setType(nameDate)
- .setCollection(true);
-
- public static final Property collPropertyDate_ExplicitNullable = new Property()
- .setName("CollPropertyDate")
- .setType(nameDate)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyDateTimeOffset = new Property()
- .setName("CollPropertyDateTimeOffset")
- .setType(nameDateTimeOffset)
- .setCollection(true);
-
- public static final Property collPropertyDateTimeOffset_ExplicitNullable = new Property()
- .setName("CollPropertyDateTimeOffset")
- .setType(nameDateTimeOffset)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyDecimal = new Property()
- .setName("CollPropertyDecimal")
- .setType(nameDecimal)
- .setCollection(true);
-
- public static final Property collPropertyDecimal_ExplicitNullable = new Property()
- .setName("CollPropertyDecimal")
- .setType(nameDecimal)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyDouble = new Property()
- .setName("CollPropertyDouble")
- .setType(nameDouble)
- .setCollection(true);
-
- public static final Property collPropertyDouble_ExplicitNullable = new Property()
- .setName("CollPropertyDouble")
- .setType(nameDouble)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyDuration = new Property()
- .setName("CollPropertyDuration")
- .setType(nameDuration)
- .setCollection(true);
-
- public static final Property collPropertyDuration_ExplicitNullable = new Property()
- .setName("CollPropertyDuration")
- .setType(nameDuration)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyGuid = new Property()
- .setName("CollPropertyGuid")
- .setType(nameGuid)
- .setCollection(true);
-
- public static final Property collPropertyGuid_ExplicitNullable = new Property()
- .setName("CollPropertyGuid")
- .setType(nameGuid)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyInt16 = new Property()
- .setName("CollPropertyInt16")
- .setType(nameInt16)
- .setCollection(true);
-
- public static final Property collPropertyInt16_ExplicitNullable = new Property()
- .setName("CollPropertyInt16")
- .setType(nameInt16)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyInt32 = new Property()
- .setName("CollPropertyInt32")
- .setType(nameInt32)
- .setCollection(true);
-
- public static final Property collPropertyInt32_ExplicitNullable = new Property()
- .setName("CollPropertyInt32")
- .setType(nameInt32)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyInt64 = new Property()
- .setName("CollPropertyInt64")
- .setType(nameInt64)
- .setCollection(true);
-
- public static final Property collPropertyInt64_ExplicitNullable = new Property()
- .setName("CollPropertyInt64")
- .setType(nameInt64)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertySByte = new Property()
- .setName("CollPropertySByte")
- .setType(nameSByte)
- .setCollection(true);
-
- public static final Property collPropertySByte_ExplicitNullable = new Property()
- .setName("CollPropertySByte")
- .setType(nameSByte)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertySingle = new Property()
- .setName("CollPropertySingle")
- .setType(nameSingle)
- .setCollection(true);
-
- public static final Property collPropertySingle_ExplicitNullable = new Property()
- .setName("CollPropertySingle")
- .setType(nameSingle)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyString = new Property()
- .setName("CollPropertyString")
- .setType(nameString)
- .setCollection(true);
-
- public static final Property collPropertyString_ExplicitNullable = new Property()
- .setName("CollPropertyString")
- .setType(nameString)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property collPropertyTimeOfDay = new Property()
- .setName("CollPropertyTimeOfDay")
- .setType(nameTimeOfDay)
- .setCollection(true);
-
- public static final Property collPropertyTimeOfDay_ExplicitNullable = new Property()
- .setName("CollPropertyTimeOfDay")
- .setType(nameTimeOfDay)
- .setNullable(true)
- .setCollection(true);
-
- public static final Property propertyBinary = new Property()
- .setName("PropertyBinary")
- .setType(nameBinary);
-
- public static final Property propertyBinary_NotNullable = new Property()
- .setName("PropertyBinary")
- .setType(nameBinary)
- .setNullable(false);
-
- public static final Property propertyBinary_ExplicitNullable = new Property()
- .setName("PropertyBinary")
- .setType(nameBinary)
- .setNullable(true);
-
- public static final Property propertyBoolean = new Property()
- .setName("PropertyBoolean")
- .setType(nameBoolean);
-
- public static final Property propertyBoolean_NotNullable = new Property()
- .setName("PropertyBoolean")
- .setType(nameBoolean)
- .setNullable(false);
-
- public static final Property propertyBoolean_ExplicitNullable = new Property()
- .setName("PropertyBoolean")
- .setType(nameBoolean)
- .setNullable(true);
-
- public static final Property propertyByte = new Property()
- .setName("PropertyByte")
- .setType(nameByte);
-
- public static final Property propertyByte_NotNullable = new Property()
- .setName("PropertyByte")
- .setType(nameByte)
- .setNullable(false);
-
- public static final Property propertyByte_ExplicitNullable = new Property()
- .setName("PropertyByte")
- .setType(nameByte)
- .setNullable(true);
-
- public static final Property propertyDate = new Property()
- .setName("PropertyDate")
- .setType(nameDate);
-
- public static final Property propertyDate_NotNullable = new Property()
- .setName("PropertyDate")
- .setType(nameDate)
- .setNullable(false);
-
- public static final Property propertyDate_ExplicitNullable = new Property()
- .setName("PropertyDate")
- .setType(nameDate)
- .setNullable(true);
-
- public static final Property propertyDateTimeOffset = new Property()
- .setName("PropertyDateTimeOffset")
- .setType(nameDateTimeOffset);
-
- public static final Property propertyDateTimeOffset_NotNullable = new Property()
- .setName("PropertyDateTimeOffset")
- .setType(nameDateTimeOffset)
- .setNullable(false);
-
- public static final Property propertyDateTimeOffset_ExplicitNullable = new Property()
- .setName("PropertyDateTimeOffset")
- .setType(nameDateTimeOffset)
- .setNullable(true);
-
- public static final Property propertyDecimal = new Property()
- .setName("PropertyDecimal")
- .setType(nameDecimal);
-
- public static final Property propertyDecimal_NotNullable = new Property()
- .setName("PropertyDecimal")
- .setType(nameDecimal)
- .setNullable(false);
-
- public static final Property propertyDecimal_ExplicitNullable = new Property()
- .setName("PropertyDecimal")
- .setType(nameDecimal)
- .setNullable(true);
-
- public static final Property propertyDouble = new Property()
- .setName("PropertyDouble")
- .setType(nameDouble);
-
- public static final Property propertyDouble_NotNullable = new Property()
- .setName("PropertyDouble")
- .setType(nameDouble)
- .setNullable(false);
-
- public static final Property propertyDouble_ExplicitNullable = new Property()
- .setName("PropertyDouble")
- .setType(nameDouble)
- .setNullable(true);
-
- public static final Property propertyDuration = new Property()
- .setName("PropertyDuration")
- .setType(nameDuration);
-
- public static final Property propertyDuration_NotNullable = new Property()
- .setName("PropertyDuration")
- .setType(nameDuration)
- .setNullable(false);
-
- public static final Property propertyDuration_ExplicitNullable = new Property()
- .setName("PropertyDuration")
- .setType(nameDuration)
- .setNullable(true);
-
- public static final Property propertyGuid = new Property()
- .setName("PropertyGuid")
- .setType(nameGuid);
-
- public static final Property propertyGuid_NotNullable = new Property()
- .setName("PropertyGuid")
- .setType(nameGuid)
- .setNullable(false);
-
- public static final Property propertyGuid_ExplicitNullable = new Property()
- .setName("PropertyGuid")
- .setType(nameGuid)
- .setNullable(true);
-
- public static final Property propertyInt16 = new Property()
- .setName("PropertyInt16")
- .setType(nameInt16);
-
- public static final Property propertyInt16_NotNullable = new Property()
- .setName("PropertyInt16")
- .setType(nameInt16)
- .setNullable(false);
-
- public static final Property propertyInt16_ExplicitNullable = new Property()
- .setName("PropertyInt16")
- .setType(nameInt16)
- .setNullable(true);
-
- public static final Property propertyInt32 = new Property()
- .setName("PropertyInt32")
- .setType(nameInt32);
-
- public static final Property propertyInt32_NotNullable = new Property()
- .setName("PropertyInt32")
- .setType(nameInt32)
- .setNullable(false);
-
- public static final Property propertyInt32_ExplicitNullable = new Property()
- .setName("PropertyInt32")
- .setType(nameInt32)
- .setNullable(true);
-
- public static final Property propertyInt64 = new Property()
- .setName("PropertyInt64")
- .setType(nameInt64);
-
- public static final Property propertyInt64_NotNullable = new Property()
- .setName("PropertyInt64")
- .setType(nameInt64)
- .setNullable(false);
-
- public static final Property propertyInt64_ExplicitNullable = new Property()
- .setName("PropertyInt64")
- .setType(nameInt64)
- .setNullable(true);
-
- public static final Property propertySByte = new Property()
- .setName("PropertySByte")
- .setType(nameSByte);
-
- public static final Property propertySByte_NotNullable = new Property()
- .setName("PropertySByte")
- .setType(nameSByte)
- .setNullable(false);
-
- public static final Property propertySByte_ExplicitNullable = new Property()
- .setName("PropertySByte")
- .setType(nameSByte)
- .setNullable(true);
-
- public static final Property propertySingle = new Property()
- .setName("PropertySingle")
- .setType(nameSingle);
-
- public static final Property propertySingle_NotNullable = new Property()
- .setName("PropertySingle")
- .setType(nameSingle)
- .setNullable(false);
-
- public static final Property propertySingle_ExplicitNullable = new Property()
- .setName("PropertySingle")
- .setType(nameSingle)
- .setNullable(true);
-
- public static final Property propertyString = new Property()
- .setName("PropertyString")
- .setType(nameString);
-
- public static final Property propertyString_NotNullable = new Property()
- .setName("PropertyString")
- .setType(nameString)
- .setNullable(false);
-
- public static final Property propertyString_ExplicitNullable = new Property()
- .setName("PropertyString")
- .setType(nameString)
- .setNullable(true);
-
- public static final Property propertyTimeOfDay = new Property()
- .setName("PropertyTimeOfDay")
- .setType(nameTimeOfDay);
-
- public static final Property propertyTimeOfDay_NotNullable = new Property()
- .setName("PropertyTimeOfDay")
- .setType(nameTimeOfDay)
- .setNullable(false);
-
- public static final Property propertyTimeOfDay_ExplicitNullable = new Property()
- .setName("PropertyTimeOfDay")
- .setType(nameTimeOfDay)
- .setNullable(true);
-
- /*
- * TODO add propertyStream
- * Property propertyStream = new Property()
- * .setName("PropertyStream")
- * .setType(EdmStream.getFullQualifiedName());
- */
-
- // Complex Properties ----------------------------------------------------------------------------------------------
- public static final Property collPropertyComplex_CTPrimComp = new Property()
- .setName("CollPropertyComplex")
- .setType(ComplexTypeProvider.nameCTPrimComp)
- .setCollection(true);
-
- public static final Property collPropertyComplex_CTTwoPrim = new Property()
- .setName("CollPropertyComplex")
- .setType(ComplexTypeProvider.nameCTTwoPrim)
- .setCollection(true);
-
- public static final Property propertyComplex_CTAllPrim = new Property()
- .setName("PropertyComplex")
- .setType(ComplexTypeProvider.nameCTAllPrim);
-
- public static final Property propertyComplex_CTCollAllPrim = new Property()
- .setName("PropertyComplex")
- .setType(ComplexTypeProvider.nameCTCollAllPrim);
-
- public static final Property propertyComplex_CTCompCollComp = new Property()
- .setName("PropertyComplex")
- .setType(ComplexTypeProvider.nameCTCompCollComp);
-
- public static final Property propertyComplex_CTCompComp = new Property()
- .setName("PropertyComplex")
- .setType(ComplexTypeProvider.nameCTCompComp);
-
- public static final Property propertyComplex_CTNavFiveProp = new Property()
- .setName("PropertyComplex")
- .setType(ComplexTypeProvider.nameCTNavFiveProp);
-
- public static final Property propertyComplex_CTPrimComp_NotNullable = new Property()
- .setName("PropertyComplex")
- .setType(ComplexTypeProvider.nameCTPrimComp)
- .setNullable(false);
-
- public static final Property propertyComplex_CTTwoPrim = new Property()
- .setName("PropertyComplex")
- .setType(ComplexTypeProvider.nameCTTwoPrim);
-
- public static final Property propertyComplexAllPrim_CTAllPrim = new Property()
- .setName("PropertyComplexAllPrim")
- .setType(ComplexTypeProvider.nameCTAllPrim);
-
- public static final Property propertyComplexComplex_CTCompComp = new Property()
- .setName("PropertyComplexComplex")
- .setType(ComplexTypeProvider.nameCTCompComp);
-
- public static final Property propertyComplexEnum_CTPrimEnum_NotNullable = new Property()
- .setName("PropertyComplexEnum")
- .setType(ComplexTypeProvider.nameCTPrimEnum)
- .setNullable(false);
-
- public static final Property propertyComplexTwoPrim_CTTwoPrim = new Property()
- .setName("PropertyComplexTwoPrim")
- .setType(ComplexTypeProvider.nameCTTwoPrim);
-
- public static final Property propertyMixedPrimCollComp_CTMixPrimCollComp = new Property()
- .setName("PropertyMixedPrimCollComp")
- .setType(ComplexTypeProvider.nameCTMixPrimCollComp);
-
- // Navigation Properties -------------------------------------------------------------------------------------------
- public static final NavigationProperty collectionNavPropertyETKeyNavMany_ETKeyNav = new NavigationProperty()
- .setName("NavPropertyETKeyNavMany")
- .setType(EntityTypeProvider.nameETKeyNav)
- .setCollection(true);
-
- public static final NavigationProperty collectionNavPropertyETMediaMany_ETMedia = new NavigationProperty()
- .setName("NavPropertyETMediaMany")
- .setType(EntityTypeProvider.nameETMedia)
- .setCollection(true);
-
- public static final NavigationProperty collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav = new NavigationProperty()
- .setName("NavPropertyETTwoKeyNavMany")
- .setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true)
- .setPartner("NavPropertyETKeyNavOne");
-
- public static final NavigationProperty collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav = new NavigationProperty()
- .setName("NavPropertyETTwoKeyNavOne")
- .setType(EntityTypeProvider.nameETTwoKeyNav);
-
- public static final NavigationProperty collectionNavPropertyETTwoPrimMany_ETTwoPrim = new NavigationProperty()
- .setName("NavPropertyETTwoPrimMany")
- .setType(EntityTypeProvider.nameETTwoPrim)
- .setCollection(true)
- .setNullable(false);
-
- public static final NavigationProperty collectionNavPropertyETAllPrimMany_ETAllPrim = new NavigationProperty()
- .setName("NavPropertyETAllPrimMany")
- .setType(EntityTypeProvider.nameETAllPrim)
- .setCollection(true);
-
- public static final NavigationProperty navPropertyETKeyNavOne_ETKeyNav = new NavigationProperty()
- .setName("NavPropertyETKeyNavOne")
- .setType(EntityTypeProvider.nameETKeyNav);
-
- public static final NavigationProperty navPropertyETMediaOne_ETMedia = new NavigationProperty()
- .setName("NavPropertyETMediaOne")
- .setType(EntityTypeProvider.nameETMedia);
-
- public static final NavigationProperty navPropertyETKeyPrimNavOne_ETKeyPrimNav = new NavigationProperty()
- .setName("NavPropertyETKeyPrimNavOne")
- .setType(EntityTypeProvider.nameETKeyPrimNav);
-
- public static final NavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav_NotNullable = new NavigationProperty()
- .setName("NavPropertyETTwoKeyNavOne")
- .setType(EntityTypeProvider.nameETTwoKeyNav)
- .setNullable(false);
-
- public static final NavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav = new NavigationProperty()
- .setName("NavPropertyETTwoKeyNavOne")
- .setType(EntityTypeProvider.nameETTwoKeyNav);
-
- public static final NavigationProperty navPropertyETTwoPrimOne_ETTwoPrim = new NavigationProperty()
- .setName("NavPropertyETTwoPrimOne")
- .setType(EntityTypeProvider.nameETTwoPrim)
- .setNullable(false);
-
- public static final NavigationProperty navPropertyETAllPrimOne_ETAllPrim = new NavigationProperty()
- .setName("NavPropertyETAllPrimOne")
- .setType(EntityTypeProvider.nameETAllPrim);
-
- // EnumProperties --------------------------------------------------------------------------------------------------
- public static final Property propertyEnumString_ENString = new Property()
- .setName("PropertyEnumString")
- .setType(EnumTypeProvider.nameENString);
-
- // TypeDefinition Properties ---------------------------------------------------------------------------------------
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/SchemaProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/SchemaProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/SchemaProvider.java
deleted file mode 100644
index c4fa3ae..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/SchemaProvider.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.server.api.edm.provider.Action;
-import org.apache.olingo.server.api.edm.provider.ActionImport;
-import org.apache.olingo.server.api.edm.provider.ComplexType;
-import org.apache.olingo.server.api.edm.provider.EntityContainer;
-import org.apache.olingo.server.api.edm.provider.EntitySet;
-import org.apache.olingo.server.api.edm.provider.EntityType;
-import org.apache.olingo.server.api.edm.provider.EnumType;
-import org.apache.olingo.server.api.edm.provider.Function;
-import org.apache.olingo.server.api.edm.provider.FunctionImport;
-import org.apache.olingo.server.api.edm.provider.Schema;
-import org.apache.olingo.server.api.edm.provider.Singleton;
-
-public class SchemaProvider {
-
- private EdmTechProvider prov;
-
- public static final String nameSpace = "com.sap.odata.test1";
-
- public SchemaProvider(final EdmTechProvider prov) {
- this.prov = prov;
- }
-
- public List<Schema> getSchemas() throws ODataException {
- List<Schema> schemas = new ArrayList<Schema>();
- Schema schema = new Schema();
- schema.setNamespace("com.sap.odata.test1");
- schema.setAlias("Namespace1_Alias");
- schemas.add(schema);
- // EnumTypes
- List<EnumType> enumTypes = new ArrayList<EnumType>();
- schema.setEnumTypes(enumTypes);
- enumTypes.add(prov.getEnumType(EnumTypeProvider.nameENString));
- // EntityTypes
- List<EntityType> entityTypes = new ArrayList<EntityType>();
- schema.setEntityTypes(entityTypes);
-
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllPrim));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCollAllPrim));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoPrim));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMixPrimCollComp));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoKeyTwoPrim));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETBase));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoBase));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllKey));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompAllPrim));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompCollAllPrim));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompComp));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompCollComp));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMedia));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETFourKeyAlias));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETServerSidePaging));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllNullable));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyNav));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoKeyNav));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompMixPrimCollComp));
- entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyPrimNav));
-
- // ComplexTypes
- List<ComplexType> complexType = new ArrayList<ComplexType>();
- schema.setComplexTypes(complexType);
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrim));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTAllPrim));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCollAllPrim));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoPrim));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTMixPrimCollComp));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTBase));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBase));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompComp));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompCollComp));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrimComp));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTNavFiveProp));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrimEnum));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTBasePrimCompNav));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBasePrimCompNav));
- complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompNav));
-
- // TypeDefinitions
-
- // Actions
- List<Action> actions = new ArrayList<Action>();
- schema.setActions(actions);
- actions.addAll(prov.getActions(ActionProvider.nameBAETTwoKeyNavRTETTwoKeyNav));
- actions.addAll(prov.getActions(ActionProvider.nameBAESAllPrimRTETAllPrim));
- actions.addAll(prov.getActions(ActionProvider.nameBAESTwoKeyNavRTESTwoKeyNav));
- actions.addAll(prov.getActions(ActionProvider.nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav));
- actions.addAll(prov.getActions(ActionProvider.nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav));
- actions.addAll(prov.getActions(ActionProvider.nameUARTPrimParam));
- actions.addAll(prov.getActions(ActionProvider.nameUARTPrimCollParam));
- actions.addAll(prov.getActions(ActionProvider.nameUARTCompParam));
- actions.addAll(prov.getActions(ActionProvider.nameUARTCompCollParam));
- actions.addAll(prov.getActions(ActionProvider.nameUARTETParam));
- actions.addAll(prov.getActions(ActionProvider.nameUARTESParam));
-
- // Functions
- List<Function> functions = new ArrayList<Function>();
- schema.setFunctions(functions);
-
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTInt16));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParamCTTwoPrim));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTStringTwoParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESTwoKeyNavParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTString));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollStringTwoParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollString));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTAllPrimTwoParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTTwoPrimParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollCTTwoPrimParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTTwoPrim));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollCTTwoPrim));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETMedia));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTESMixPrimCollCompTwoParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETAllPrimTwoParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTCollCTNavFiveProp));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTESTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCStringRTESTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTETTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESBaseTwoKeyNavRTESBaseTwoKey));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESAllPrimRTCTAllPrim));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCTTwoPrim));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollCTTwoPrim));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTString));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollString));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTESTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTESTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCSINavRTESTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTESBaseTwoKey));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCollStringRTESTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESBaseTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCollCTPrimCompRTESAllPrim));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETKeyNavRTETKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFESTwoKeyNavRTESTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTETTwoKeyNav));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTCTTwoPrim));
-
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCTNavFiveProp));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollCTNavFiveProp));
-
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTStringParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNavParam));
- functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTETTwoKeyNavParam));
- // functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNavParam));
-
- // EntityContainer
- EntityContainer container = new EntityContainer();
- schema.setEntityContainer(container);
- container.setName(ContainerProvider.nameContainer.getName());
-
- // EntitySets
- List<EntitySet> entitySets = new ArrayList<EntitySet>();
- container.setEntitySets(entitySets);
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllPrim"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCollAllPrim"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoPrim"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixPrimCollComp"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBase"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBase"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoKeyTwoPrim"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBaseTwoKeyTwoPrim"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBaseTwoKeyTwoPrim"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllKey"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompAllPrim"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompCollAllPrim"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompComp"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompCollComp"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMedia"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyTwoKeyComp"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESInvisible"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESServerSidePaging"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllNullable"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyNav"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoKeyNav"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBaseTwoKeyNav"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompMixPrimCollComp"));
- entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESFourKeyAlias"));
-
- // Singletons
- List<Singleton> singletons = new ArrayList<Singleton>();
- container.setSingletons(singletons);
- singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SI"));
- singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SINav"));
- singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SIMedia"));
-
- // ActionImports
- List<ActionImport> actionImports = new ArrayList<ActionImport>();
- container.setActionImports(actionImports);
- actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTPrimParam"));
- actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTPrimCollParam"));
- actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTCompParam"));
- actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTCompCollParam"));
- actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTETParam"));
- actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTETCollAllPrimParam"));
-
- // FunctionImports
- List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
- container.setFunctionImports(functionImports);
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTInt16"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisibleRTInt16"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisible2RTInt16"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETKeyNav"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETTwoKeyNavParam"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTStringTwoParam"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollStringTwoParam"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTAllPrimTwoParam"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESMixPrimCollCompTwoParam"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTESMixPrimCollCompTwoParam"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrim"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETMedia"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrimParam"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrim"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollString"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTString"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESTwoKeyNavParam"));
- functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrimParam"));
-
- return schemas;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/TypeDefinitionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/TypeDefinitionProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/TypeDefinitionProvider.java
deleted file mode 100644
index 0cc566a..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/TypeDefinitionProvider.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.TypeDefinition;
-
-public class TypeDefinitionProvider {
-
- public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) {
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/resources/simplelogger.properties
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/resources/simplelogger.properties b/lib/server-ref/src/main/resources/simplelogger.properties
deleted file mode 100644
index 2a3350c..0000000
--- a/lib/server-ref/src/main/resources/simplelogger.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-org.slf4j.simpleLogger.defaultLogLevel=debug
-org.slf4j.simpleLogger.logFile=System.out
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/webapp/WEB-INF/web.xml b/lib/server-ref/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index b828a8e..0000000
--- a/lib/server-ref/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?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.
--->
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
- id="WebApp_ID" version="2.5">
-
- <display-name>Apache Olingo OData 4.0 Reference Scenario Service</display-name>
-
- <welcome-file-list>
- <welcome-file>index.html</welcome-file>
- </welcome-file-list>
-
- <servlet>
- <servlet-name>ODataServlet</servlet-name>
- <servlet-class>org.apache.olingo.server.ref.ReferenceServlet</servlet-class>
- <load-on-startup>1</load-on-startup>
- </servlet>
-
- <servlet-mapping>
- <servlet-name>ODataServlet</servlet-name>
- <url-pattern>/odata.svc/*</url-pattern>
- </servlet-mapping>
-
-</web-app>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/webapp/index.html b/lib/server-ref/src/main/webapp/index.html
deleted file mode 100644
index e25f4fb..0000000
--- a/lib/server-ref/src/main/webapp/index.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<html>
-<!--
- 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.
--->
-
-<body>
- <h1>Olingo OData 4.0 Reference Scenario Service</h1>
- <hr>
- <h2>Reference Scenario Service</h2>
- <lu>
- <li><a href="odata.svc/">Service Document</a></li>
- <li><a href="odata.svc/$metadata">Metadata</a></li>
- </lu>
-
-</body>
-
-</html>
\ No newline at end of file
[26/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
deleted file mode 100644
index fde13c8..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import org.apache.olingo.commons.api.ODataApplicationException;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.queryoption.ExpandItem;
-import org.apache.olingo.server.api.uri.queryoption.SelectItem;
-import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.QueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
-
-public class ExpandValidator implements TestValidator {
- private Edm edm;
- private TestValidator invokedByValidator;
-
- private int expandItemIndex;
- private ExpandOptionImpl expandOption;
- private ExpandItem expandItem;
-
- // --- Setup ---
-
- public ExpandValidator setUpValidator(final TestValidator validator) {
- invokedByValidator = validator;
- return this;
- }
-
- public ExpandValidator setExpand(final ExpandOptionImpl expand) {
- expandOption = expand;
- first();
- return this;
- }
-
- public ExpandValidator setEdm(final Edm edm) {
- this.edm = edm;
- return this;
- }
-
- // --- Navigation ---
-
- public ExpandValidator goUpToExpandValidator() {
- return (ExpandValidator) invokedByValidator;
- }
-
- public ResourceValidator goUpToUriResourceValidator() {
- return (ResourceValidator) invokedByValidator;
- }
-
- public ResourceValidator goPath() {
- UriInfoImpl uriInfo = (UriInfoImpl) expandItem.getResourcePath();
-
- if (uriInfo.getKind() != UriInfoKind.resource) {
- fail("goPath() can only be used on UriInfoKind.resource");
- }
-
- return new ResourceValidator()
- .setUpValidator(this)
- .setEdm(edm)
- .setUriInfoImplPath(uriInfo);
-
- }
-
- public FilterValidator goOrder(final int index) {
- OrderByOptionImpl orderBy = (OrderByOptionImpl) expandItem.getOrderByOption();
-
- return new FilterValidator()
- .setValidator(this)
- .setEdm(edm)
- .setExpression(orderBy.getOrders().get(index).getExpression());
- }
-
- public ResourceValidator goSelectItem(final int index) {
- SelectOptionImpl select = (SelectOptionImpl) expandItem.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- UriInfoImpl uriInfo = (UriInfoImpl) item.getResourcePath();
-
- return new ResourceValidator()
- .setUpValidator(this)
- .setEdm(edm)
- .setUriInfoImplPath(uriInfo);
-
- }
-
- public ExpandValidator goExpand() {
- ExpandValidator val = new ExpandValidator()
- .setExpand((ExpandOptionImpl) expandItem.getExpandOption())
- .setUpValidator(this);
- return val;
- }
-
- public ExpandValidator first() {
- expandItemIndex = 0;
- expandItem = expandOption.getExpandItems().get(expandItemIndex);
- return this;
- }
-
- public ExpandValidator next() {
- expandItemIndex++;
-
- try {
- expandItem = expandOption.getExpandItems().get(expandItemIndex);
- } catch (IndexOutOfBoundsException ex) {
- fail("not enought segments");
- }
- return this;
-
- }
-
- public ExpandValidator isSegmentStar(final int index) {
- assertEquals(true, expandItem.isStar());
- return this;
- }
-
- public ExpandValidator isSegmentRef(final int index) {
- assertEquals(true, expandItem.isRef());
- return this;
- }
-
- public ExpandValidator isLevelText(final String text) {
- QueryOptionImpl option = (QueryOptionImpl) expandItem.getLevelsOption();
- assertEquals(text, option.getText());
- return this;
- }
-
- public ExpandValidator isSkipText(final String text) {
- QueryOptionImpl option = (QueryOptionImpl) expandItem.getSkipOption();
- assertEquals(text, option.getText());
- return this;
- }
-
- public ExpandValidator isTopText(final String text) {
- QueryOptionImpl option = (QueryOptionImpl) expandItem.getTopOption();
- assertEquals(text, option.getText());
- return this;
- }
-
- public ExpandValidator isInlineCountText(final String text) {
- QueryOptionImpl option = (QueryOptionImpl) expandItem.getCountOption();
- assertEquals(text, option.getText());
- return this;
- }
-
- public ExpandValidator isSelectText(final String text) {
- QueryOptionImpl option = (QueryOptionImpl) expandItem.getSelectOption();
- assertEquals(text, option.getText());
- return this;
- }
-
- public ExpandValidator isSelectItemStar(final int index) {
- SelectOptionImpl select = (SelectOptionImpl) expandItem.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- assertEquals(true, item.isStar());
- return this;
- }
-
- public ExpandValidator isSelectItemAllOperations(final int index, final FullQualifiedName fqn) {
- SelectOptionImpl select = (SelectOptionImpl) expandItem.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- assertEquals(fqn.toString(), item.getAllOperationsInSchemaNameSpace().toString());
- return this;
- }
-
- public ExpandValidator isFilterOptionText(final String text) {
- QueryOptionImpl option = (QueryOptionImpl) expandItem.getFilterOption();
- assertEquals(text, option.getText());
- return this;
- }
-
- public ExpandValidator isFilterSerialized(final String serialized) {
- FilterOptionImpl filter = (FilterOptionImpl) expandItem.getFilterOption();
-
- try {
- String tmp = FilterTreeToText.Serialize(filter);
- assertEquals(serialized, tmp);
- } catch (ExpressionVisitException e) {
- fail("Exception occured while converting the filterTree into text" + "\n"
- + " Exception: " + e.getMessage());
- } catch (ODataApplicationException e) {
- fail("Exception occured while converting the filterTree into text" + "\n"
- + " Exception: " + e.getMessage());
- }
-
- return this;
- }
-
- public ExpandValidator isSortOrder(final int index, final boolean descending) {
- OrderByOptionImpl orderBy = (OrderByOptionImpl) expandItem.getOrderByOption();
- assertEquals(descending, orderBy.getOrders().get(index).isDescending());
- return this;
- }
-
- public ExpandValidator isExpandStartType(final FullQualifiedName fullName) {
- EdmType actualType = expandItem.getStartTypeFilter();
-
- FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
- assertEquals(fullName, actualName);
- return this;
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java
deleted file mode 100644
index 06056e0..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import java.util.List;
-
-import org.apache.olingo.commons.api.ODataApplicationException;
-import org.apache.olingo.commons.api.edm.EdmEnumType;
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.server.api.uri.UriInfoResource;
-import org.apache.olingo.server.api.uri.UriResource;
-import org.apache.olingo.server.api.uri.UriResourceLambdaAll;
-import org.apache.olingo.server.api.uri.UriResourceLambdaAny;
-import org.apache.olingo.server.api.uri.UriResourcePartTyped;
-import org.apache.olingo.server.api.uri.queryoption.FilterOption;
-import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
-import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
-import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitor;
-import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.UnaryOperatorKind;
-
-public class FilterTreeToText implements ExpressionVisitor<String> {
-
- public static String Serialize(final FilterOption filter)
- throws ExpressionVisitException, ODataApplicationException {
-
- Expression expression = filter.getExpression();
- return expression.accept(new FilterTreeToText());
- }
-
- public static String Serialize(final Expression expression)
- throws ExpressionVisitException, ODataApplicationException {
-
- return expression.accept(new FilterTreeToText());
- }
-
- @Override
- public String visitBinaryOperator(final BinaryOperatorKind operator, final String left, final String right)
- throws ExpressionVisitException {
-
- return "<" + left + " " + operator.toString() + " " + right + ">";
- }
-
- @Override
- public String visitUnaryOperator(final UnaryOperatorKind operator, final String operand)
- throws ExpressionVisitException {
-
- return "<" + operator + " " + operand.toString() + ">";
- }
-
- @Override
- public String visitMethodCall(final MethodKind methodCall, final List<String> parameters)
- throws ExpressionVisitException {
-
- String text = "<" + methodCall + "(";
- int i = 0;
- while (i < parameters.size()) {
- if (i > 0) {
- text += ",";
- }
- text += parameters.get(i);
- i++;
- }
- return text + ")>";
- }
-
- @Override
- public String visitLiteral(final String literal) throws ExpressionVisitException {
- return "<" + literal + ">";
- }
-
- @Override
- public String visitMember(final UriInfoResource resource) throws ExpressionVisitException, ODataApplicationException {
- String ret = "";
-
- UriInfoResource path = resource;
-
- for (UriResource item : path.getUriResourceParts()) {
- String tmp = "";
- if (item instanceof UriResourceLambdaAll) {
- UriResourceLambdaAll all = (UriResourceLambdaAll) item;
- tmp = visitLambdaExpression("ALL", all.getLambdaVariable(), all.getExpression());
- } else if (item instanceof UriResourceLambdaAny) {
- UriResourceLambdaAny any = (UriResourceLambdaAny) item;
- tmp = visitLambdaExpression("ANY", any.getLamdaVariable(), any.getExpression());
- } else if (item instanceof UriResourcePartTyped) {
- UriResourcePartTyped typed = (UriResourcePartTyped) item;
- tmp = typed.toString(true);
- }
-
- if (ret.length() != 0) {
- ret += "/";
- }
- ret += tmp;
-
- }
- return "<" + ret + ">";
- }
-
- @Override
- public String visitAlias(final String referenceName) throws ExpressionVisitException {
- return "<" + referenceName + ">";
- }
-
- @Override
- public String visitLambdaExpression(final String functionText, final String string, final Expression expression)
- throws ExpressionVisitException, ODataApplicationException {
-
- return "<" + functionText + ";" + ((expression == null) ? "" : expression.accept(this)) + ">";
- }
-
- @Override
- public String visitTypeLiteral(final EdmType type) {
- return "<" + type.getNamespace() + "." + type.getName() + ">";
- }
-
- @Override
- public String visitLambdaReference(final String variableText) {
- return "<" + variableText + ">";
- }
-
- @Override
- public String visitEnum(final EdmEnumType type, final List<String> enumValues)
- throws ExpressionVisitException, ODataApplicationException {
- String tmp = "";
-
- for (String item : enumValues) {
- if (tmp.length() > 0) {
- tmp += ",";
- }
- tmp += item;
- }
-
- return "<" + type.getNamespace() + "." + type.getName() + "<" + tmp + ">>";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
deleted file mode 100644
index 58e429f..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-
-import org.apache.olingo.commons.api.ODataApplicationException;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.uri.UriInfo;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
-import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
-import org.apache.olingo.server.api.uri.queryoption.expression.Member;
-import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.parser.Parser;
-import org.apache.olingo.server.core.uri.parser.UriParserException;
-import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
-import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
-import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.BinaryImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.EnumerationImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.MemberImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.MethodImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.TypeLiteralImpl;
-
-public class FilterValidator implements TestValidator {
- private Edm edm;
-
- private TestValidator invokedByValidator;
- private FilterOptionImpl filter;
-
- private Expression curExpression;
- private Expression rootExpression;
-
- private OrderByOptionImpl orderBy;
-
- private UriParserException exception;
-
- // --- Setup ---
- public FilterValidator setUriResourcePathValidator(final ResourceValidator uriResourcePathValidator) {
- invokedByValidator = uriResourcePathValidator;
- return this;
- }
-
- public FilterValidator setUriValidator(final TestUriValidator uriValidator) {
- invokedByValidator = uriValidator;
- return this;
- }
-
- public FilterValidator setValidator(final TestValidator uriValidator) {
- invokedByValidator = uriValidator;
- return this;
- }
-
- public FilterValidator setEdm(final Edm edm) {
- this.edm = edm;
- return this;
- }
-
- public FilterValidator setFilter(final FilterOptionImpl filter) {
- this.filter = filter;
-
- if (filter.getExpression() == null) {
- fail("FilterValidator: no filter found");
- }
- setExpression(filter.getExpression());
- return this;
- }
-
- public FilterValidator setOrderBy(final OrderByOptionImpl orderBy) {
- this.orderBy = orderBy;
-
- return this;
- }
-
- public FilterValidator setExpression(final Expression expression) {
- rootExpression = curExpression = expression;
- return this;
- }
-
- // --- Execution ---
-
- public FilterValidator runOrderByOnETAllPrim(final String orderBy) throws UriParserException {
- String uri = "ESAllPrim?$orderby=" + orderBy.trim();
- return runUriOrderBy(uri);
- }
-
- public FilterValidator runOrderByOnETTwoKeyNav(final String orderBy) throws UriParserException {
- String uri = "ESTwoKeyNav?$orderby=" + orderBy.trim();
- return runUriOrderBy(uri);
- }
-
- public FilterValidator runOrderByOnETTwoKeyNavEx(final String orderBy) throws UriParserException {
- String uri = "ESTwoKeyNav?$orderby=" + orderBy.trim();
- return runUriOrderByEx(uri);
- }
-
- public FilterValidator runOnETTwoKeyNav(final String filter) throws UriParserException {
- String uri = "ESTwoKeyNav?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnETTwoKeyNavSingle(final String filter) throws UriParserException {
- String uri = "SINav?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnETTwoKeyNavEx(final String filter) throws UriParserException {
- String uri = "ESTwoKeyNav?$filter=" + filter.trim();
- return runUriEx(uri);
- }
-
- public FilterValidator runOnETAllPrim(final String filter) throws UriParserException {
- String uri = "ESAllPrim(1)?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnETKeyNav(final String filter) throws UriParserException {
- String uri = "ESKeyNav(1)?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnETKeyNavEx(final String filter) throws UriParserException {
- String uri = "ESKeyNav(1)?$filter=" + filter.trim();
- return runUriEx(uri);
- }
-
- public FilterValidator runOnCTTwoPrim(final String filter) throws UriParserException {
- String uri = "SINav/PropertyComplexTwoPrim?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnString(final String filter) throws UriParserException {
- String uri = "SINav/PropertyString?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnInt32(final String filter) throws UriParserException {
- String uri = "ESCollAllPrim(1)/CollPropertyInt32?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnDateTimeOffset(final String filter) throws UriParserException {
- String uri = "ESCollAllPrim(1)/CollPropertyDateTimeOffset?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnDuration(final String filter) throws UriParserException {
- String uri = "ESCollAllPrim(1)/CollPropertyDuration?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runOnTimeOfDay(final String filter) throws UriParserException {
- String uri = "ESCollAllPrim(1)/CollPropertyTimeOfDay?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runESabc(final String filter) throws UriParserException {
- String uri = "ESabc?$filter=" + filter.trim();
- return runUri(uri);
- }
-
- public FilterValidator runUri(final String uri) throws UriParserException {
- Parser parser = new Parser();
- UriInfo uriInfo = null;
-
- uriInfo = parser.parseUri(uri, edm);
-
- if (uriInfo.getKind() != UriInfoKind.resource) {
- fail("Filtervalidator can only be used on resourcePaths");
- }
-
- setFilter((FilterOptionImpl) uriInfo.getFilterOption());
- curExpression = filter.getExpression();
- return this;
- }
-
- public FilterValidator runUriEx(final String uri) {
- Parser parser = new Parser();
- UriInfo uriInfo = null;
-
- try {
- uriInfo = parser.parseUri(uri, edm);
- } catch (UriParserException e) {
- exception = e;
- return this;
- }
-
- if (uriInfo.getKind() != UriInfoKind.resource) {
- fail("Filtervalidator can only be used on resourcePaths");
- }
-
- setFilter((FilterOptionImpl) uriInfo.getFilterOption());
- curExpression = filter.getExpression();
- return this;
- }
-
- public FilterValidator runUriOrderBy(final String uri) throws UriParserException {
- Parser parser = new Parser();
- UriInfo uriInfo = null;
-
- uriInfo = parser.parseUri(uri, edm);
-
- if (uriInfo.getKind() != UriInfoKind.resource) {
- fail("Filtervalidator can only be used on resourcePaths");
- }
-
- setOrderBy((OrderByOptionImpl) uriInfo.getOrderByOption());
- return this;
- }
-
- public FilterValidator runUriOrderByEx(final String uri) {
- Parser parser = new Parser();
- UriInfo uriInfo = null;
-
- try {
- uriInfo = parser.parseUri(uri, edm);
- } catch (UriParserException e) {
- exception = e;
- return this;
- }
-
- if (uriInfo.getKind() != UriInfoKind.resource) {
- fail("Filtervalidator can only be used on resourcePaths");
- }
-
- setOrderBy((OrderByOptionImpl) uriInfo.getOrderByOption());
- return this;
- }
-
- // --- Navigation ---
-
- public ExpandValidator goUpToExpandValidator() {
- return (ExpandValidator) invokedByValidator;
- }
-
- public ResourceValidator goUpToResourceValidator() {
- return (ResourceValidator) invokedByValidator;
- }
-
- public ResourceValidator goPath() {
- if (!(curExpression instanceof MemberImpl)) {
- fail("Current expression not a member");
- }
-
- MemberImpl member = (MemberImpl) curExpression;
-
- return new ResourceValidator()
- .setEdm(edm)
- .setUriInfoImplPath((UriInfoImpl) member.getResourcePath())
- .setUpValidator(this);
-
- }
-
- public FilterValidator goParameter(final int parameterIndex) {
- if (curExpression instanceof MethodImpl) {
- MethodImpl methodCall = (MethodImpl) curExpression;
- curExpression = methodCall.getParameters().get(parameterIndex);
- } else {
- fail("Current expression not a methodCall");
- }
- return this;
- }
-
- // --- Validation ---
-
- /**
- * Validates the serialized filterTree against a given filterString
- * The given expected filterString is compressed before to allow better readable code in the unit tests
- * @param toBeCompr
- * @return
- */
- public FilterValidator isCompr(final String toBeCompr) {
- return is(compress(toBeCompr));
- }
-
- public FilterValidator is(final String expectedFilterAsString) {
- try {
- String actualFilterAsText = FilterTreeToText.Serialize((FilterOptionImpl) filter);
- assertEquals(expectedFilterAsString, actualFilterAsText);
- } catch (ExpressionVisitException e) {
- fail("Exception occured while converting the filterTree into text" + "\n"
- + " Exception: " + e.getMessage());
- } catch (ODataApplicationException e) {
- fail("Exception occured while converting the filterTree into text" + "\n"
- + " Exception: " + e.getMessage());
- }
-
- return this;
- }
-
- // --- Helper ---
-
- private String compress(final String expected) {
- String ret = expected.replaceAll("\\s+", " ");
- ret = ret.replaceAll("< ", "<");
- ret = ret.replaceAll(" >", ">");
- return ret;
- }
-
- public FilterValidator isType(final FullQualifiedName fullName) {
- EdmType actualType = null;
-
- if (curExpression instanceof MemberImpl) {
- Member member = (Member) curExpression;
- actualType = member.getType();
- } else if (curExpression instanceof TypeLiteralImpl) {
- TypeLiteralImpl typeLiteral = (TypeLiteralImpl) curExpression;
- actualType = typeLiteral.getType();
- } else if (curExpression instanceof LiteralImpl) {
- LiteralImpl typeLiteral = (LiteralImpl) curExpression;
- actualType = typeLiteral.getType();
- }
-
- if (actualType == null) {
- fail("Current expression not typed");
- }
-
- FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
- assertEquals(fullName, actualName);
- return this;
- }
-
- public FilterValidator left() {
- if (!(curExpression instanceof BinaryImpl)) {
- fail("Current expression not a binary operator");
- }
-
- curExpression = ((BinaryImpl) curExpression).getLeftOperand();
-
- return this;
- }
-
- public FilterValidator root() {
- if (filter != null) {
- curExpression = filter.getExpression();
- } else {
- curExpression = rootExpression;
- }
-
- return this;
- }
-
- public FilterValidator right() {
- if (!(curExpression instanceof BinaryImpl)) {
- fail("Current expression is not a binary operator");
- }
-
- curExpression = ((BinaryImpl) curExpression).getRightOperand();
-
- return this;
-
- }
-
- public FilterValidator isLiteral(final String literalText) {
- if (!(curExpression instanceof LiteralImpl)) {
- fail("Current expression is not a literal");
- }
-
- String actualLiteralText = ((LiteralImpl) curExpression).getText();
- assertEquals(literalText, actualLiteralText);
-
- return this;
- }
-
- public FilterValidator isMethod(final MethodKind methodKind, final int parameterCount) {
- if (!(curExpression instanceof MethodImpl)) {
- fail("Current expression is not a methodCall");
- }
-
- MethodImpl methodCall = (MethodImpl) curExpression;
- assertEquals(methodKind, methodCall.getMethod());
- assertEquals(parameterCount, methodCall.getParameters().size());
-
- return this;
- }
-
- public FilterValidator isParameterText(final int parameterIndex, final String parameterText)
- throws ExpressionVisitException, ODataApplicationException {
-
- if (!(curExpression instanceof MethodImpl)) {
- fail("Current expression is not a method");
- }
-
- MethodImpl methodCall = (MethodImpl) curExpression;
-
- Expression parameter = methodCall.getParameters().get(parameterIndex);
- String actualParameterText = FilterTreeToText.Serialize(parameter);
- assertEquals(parameterText, actualParameterText);
-
- return this;
- }
-
- public FilterValidator isBinary(final BinaryOperatorKind binaryOperator) {
- if (!(curExpression instanceof BinaryImpl)) {
- fail("Current expression is not a binary operator");
- }
-
- BinaryImpl binary = (BinaryImpl) curExpression;
- assertEquals(binaryOperator, binary.getOperator());
-
- return this;
- }
-
- public FilterValidator isTypedLiteral(final FullQualifiedName fullName) {
- if (!(curExpression instanceof TypeLiteralImpl)) {
- fail("Current expression not a typeLiteral");
- }
-
- isType(fullName);
-
- return this;
- }
-
- public FilterValidator isMember() {
- if (!(curExpression instanceof MemberImpl)) {
- fail("Current expression not a member");
- }
-
- return this;
- }
-
- public FilterValidator isMemberStartType(final FullQualifiedName fullName) {
- if (!(curExpression instanceof MemberImpl)) {
- fail("Current expression not a member");
- }
-
- MemberImpl member = (MemberImpl) curExpression;
- EdmType actualType = member.getStartTypeFilter();
-
- FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
- assertEquals(fullName, actualName);
- return this;
- }
-
- public FilterValidator isEnum(final FullQualifiedName nameenstring, final List<String> enumValues) {
- if (!(curExpression instanceof EnumerationImpl)) {
- fail("Current expression not a enumeration");
- }
-
- EnumerationImpl enumeration = (EnumerationImpl) curExpression;
-
- FullQualifiedName actualName =
- new FullQualifiedName(enumeration.getType().getNamespace(), enumeration.getType().getName());
-
- // check name
- assertEquals(nameenstring.toString(), actualName.toString());
-
- // check values
- int i = 0;
- for (String item : enumValues) {
- assertEquals(item, enumeration.getValues().get(i));
- i++;
- }
-
- return this;
- }
-
- public FilterValidator isSortOrder(final int index, final boolean descending) {
- assertEquals(descending, orderBy.getOrders().get(index).isDescending());
- return this;
- }
-
- public FilterValidator goOrder(final int index) {
- curExpression = orderBy.getOrders().get(index).getExpression();
- return this;
- }
-
- public FilterValidator isExSyntax(final long errorID) {
- assertEquals(UriParserSyntaxException.class, exception.getClass());
- return this;
- }
-
- public FilterValidator isExSemantic(final long errorID) {
- assertEquals(UriParserSemanticException.class, exception.getClass());
- return this;
- }
-
- public FilterValidator isNull() {
- if (!(curExpression instanceof LiteralImpl)) {
- fail("Current expression is not a literal");
- }
-
- String actualLiteralText = ((LiteralImpl) curExpression).getText();
- assertEquals("null", actualLiteralText);
- return this;
- }
-
- public FilterValidator isTrue() {
- if (!(curExpression instanceof LiteralImpl)) {
- fail("Current expression is not a literal");
- }
-
- String actualLiteralText = ((LiteralImpl) curExpression).getText();
- assertEquals("true", actualLiteralText);
- return this;
- }
-
- public FilterValidator isFalse() {
- if (!(curExpression instanceof LiteralImpl)) {
- fail("Current expression is not a literal");
- }
-
- String actualLiteralText = ((LiteralImpl) curExpression).getText();
- assertEquals("false", actualLiteralText);
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParseTreeToText.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParseTreeToText.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParseTreeToText.java
deleted file mode 100644
index f6a3086..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParseTreeToText.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.antlr.v4.runtime.Token;
-import org.antlr.v4.runtime.misc.NotNull;
-import org.antlr.v4.runtime.misc.Nullable;
-import org.antlr.v4.runtime.misc.Utils;
-import org.antlr.v4.runtime.tree.ErrorNode;
-import org.antlr.v4.runtime.tree.RuleNode;
-import org.antlr.v4.runtime.tree.TerminalNode;
-import org.antlr.v4.runtime.tree.Tree;
-
-public class ParseTreeToText {
-
- public static String getTreeAsText(final Tree contextTree, final String[] ruleNames) {
- return toStringTree(contextTree, Arrays.asList(ruleNames));
- }
-
- private static String toStringTree(final Tree t, @Nullable final List<String> ruleNames) {
-
- if (t.getChildCount() == 0) {
- return Utils.escapeWhitespace(getNodeText(t, ruleNames), false);
- }
-
- StringBuilder buf = new StringBuilder();
- String s = Utils.escapeWhitespace(getNodeText(t, ruleNames), false);
- buf.append(s);
- buf.append("(");
-
- for (int i = 0; i < t.getChildCount(); i++) {
- if (i > 0) {
- buf.append(' ');
- }
- buf.append(toStringTree(t.getChild(i), ruleNames));
- }
- buf.append(")");
- return buf.toString();
- }
-
- private static String getNodeText(@NotNull final Tree t, @Nullable final List<String> ruleNames) {
- if (ruleNames != null) {
- if (t instanceof RuleNode) {
- int ruleIndex = ((RuleNode) t).getRuleContext().getRuleIndex();
- return ruleNames.get(ruleIndex);
- } else if (t instanceof ErrorNode) {
- return t.toString();
- } else if (t instanceof TerminalNode) {
- Token symbol = ((TerminalNode) t).getSymbol();
- if (symbol != null) {
- String s = symbol.getText();
- return s;
- }
- }
- }
- // no recog for rule names
- Object payload = t.getPayload();
- if (payload instanceof Token) {
- return ((Token) payload).getText();
- }
- return t.getPayload().toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserValidator.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserValidator.java
deleted file mode 100644
index 3f73b97..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserValidator.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.antlr.v4.runtime.ParserRuleContext;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser;
-
-public class ParserValidator {
-
- private String input = null;
- private ParserRuleContext root;
-
- int logLevel = 0;
- private int lexerLogLevel = 0;
-
- boolean allowFullContext;
- boolean allowContextSensitifity;
- boolean allowAmbiguity;
-
- List<Exception> exceptions = new ArrayList<Exception>();
- private Exception curException = null;
-
- // --- Setup ---
-
- public ParserValidator log(final int logLevel) {
- this.logLevel = logLevel;
- return this;
- }
-
- public ParserValidator lexerLog(final int logLevel) {
- lexerLogLevel = logLevel;
- return this;
- }
-
- /**
- * Used in fast LL Parsing:
- * Don't stop the parsing process when the slower full context parsing (with prediction mode SLL) is
- * required
- * @return
- */
- public ParserValidator aFC() {
- allowFullContext = true;
- return this;
- }
-
- /**
- * Used in fast LL Parsing:
- * Allows ContextSensitifity Errors which occur often when using the slower full context parsing
- * and indicate that there is a context sensitivity ( which may not be an error).
- * @return
- */
- public ParserValidator aCS() {
- allowContextSensitifity = true;
- return this;
- }
-
- /**
- * Used in fast LL Parsing:
- * Allows ambiguities
- * @return
- */
- public ParserValidator aAM() {
- allowAmbiguity = true;
- return this;
- }
-
- // --- Execution ---
-
- public ParserValidator run(final String uri) {
- input = uri;
-
- // just run a short lexer step. E.g. to print the tokens
- if (lexerLogLevel > 0) {
- (new TokenValidator()).log(lexerLogLevel).run(input);
- }
-
- /**/// root = parseInput(uri);
-
- // if LOG > 0 - Write serialized tree
- if (logLevel > 0) {
- if (root != null) {
- System.out.println(ParseTreeToText.getTreeAsText(root, new UriParserParser(null).getRuleNames()));
- } else {
- System.out.println("root == null");
- }
- }
-
- // reset for next test
- allowFullContext = false;
- allowContextSensitifity = false;
- allowAmbiguity = false;
- logLevel = 0;
-
- return this;
- }
-
- // --- Navigation ---
-
- public ParserValidator exFirst() {
- try {
- // curWeakException = exceptions.get(0);
- } catch (IndexOutOfBoundsException ex) {
- // curWeakException = null;
- }
- return this;
-
- }
-
- public ParserValidator exLast() {
- // curWeakException = exceptions.get(exceptions.size() - 1);
- return this;
- }
-
- public ParserValidator exAt(final int index) {
- try {
- // curWeakException = exceptions.get(index);
- } catch (IndexOutOfBoundsException ex) {
- // curWeakException = null;
- }
- return this;
- }
-
- // --- Validation ---
-
- public ParserValidator isText(final String expected) {
-
- assertEquals(null, curException);
- assertEquals(0, exceptions.size());
-
- String actualTreeAsText = ParseTreeToText.getTreeAsText(root, new UriParserParser(null).getRuleNames());
-
- assertEquals(expected, actualTreeAsText);
- return this;
- }
-
- public ParserValidator isExeptionType(final Class<?> exClass) {
- assertEquals(exClass, curException.getClass());
- return this;
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserWithLogging.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserWithLogging.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserWithLogging.java
deleted file mode 100644
index 524a38a..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserWithLogging.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import org.antlr.v4.runtime.DefaultErrorStrategy;
-import org.antlr.v4.runtime.DiagnosticErrorListener;
-import org.apache.olingo.server.core.uri.antlr.UriParserParser;
-import org.apache.olingo.server.core.uri.parser.Parser;
-
-public class ParserWithLogging extends Parser {
- TestErrorLogger errorCollector1;
- TestErrorLogger errorCollector2;
-
- public ParserWithLogging() {
- errorCollector1 = new TestErrorLogger("Stage 1", 1);
- errorCollector2 = new TestErrorLogger("Stage 2", 1);
- }
-
- @Override
- protected void addStage2ErrorStategy(final UriParserParser parser) {
- // Don't throw an at first syntax error, so the error listener will be called
- parser.setErrorHandler(new DefaultErrorStrategy());
- }
-
- @Override
- protected void addStage1ErrorListener(final UriParserParser parser) {
- // Log error to console
- parser.removeErrorListeners();
- parser.addErrorListener(errorCollector1);
- parser.addErrorListener(new DiagnosticErrorListener());
- }
-
- @Override
- protected void addStage2ErrorListener(final UriParserParser parser) {
- // Log error to console
- parser.removeErrorListeners();
- parser.addErrorListener(errorCollector2);
- parser.addErrorListener(new DiagnosticErrorListener());
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ResourceValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ResourceValidator.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ResourceValidator.java
deleted file mode 100644
index 143871a..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/ResourceValidator.java
+++ /dev/null
@@ -1,599 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-
-import org.apache.olingo.commons.api.ODataApplicationException;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmElement;
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.uri.UriInfo;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.UriParameter;
-import org.apache.olingo.server.api.uri.UriResourceKind;
-import org.apache.olingo.server.api.uri.UriResourcePartTyped;
-import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
-import org.apache.olingo.server.api.uri.queryoption.SelectItem;
-import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.UriResourceActionImpl;
-import org.apache.olingo.server.core.uri.UriResourceComplexPropertyImpl;
-import org.apache.olingo.server.core.uri.UriResourceEntitySetImpl;
-import org.apache.olingo.server.core.uri.UriResourceFunctionImpl;
-import org.apache.olingo.server.core.uri.UriResourceImpl;
-import org.apache.olingo.server.core.uri.UriResourceLambdaAllImpl;
-import org.apache.olingo.server.core.uri.UriResourceLambdaAnyImpl;
-import org.apache.olingo.server.core.uri.UriResourceNavigationPropertyImpl;
-import org.apache.olingo.server.core.uri.UriResourcePrimitivePropertyImpl;
-import org.apache.olingo.server.core.uri.UriResourceSingletonImpl;
-import org.apache.olingo.server.core.uri.UriResourceWithKeysImpl;
-import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.ExpressionImpl;
-import org.apache.olingo.server.core.uri.validator.UriValidator;
-
-public class ResourceValidator implements TestValidator {
- private Edm edm;
- private TestValidator invokedBy;
- private UriInfo uriInfo = null;
-
- private UriResourceImpl uriPathInfo = null;
- private int uriResourceIndex;
-
- // --- Setup ---
-
- public ResourceValidator setUpValidator(final TestValidator uriValidator) {
- invokedBy = uriValidator;
- return this;
- }
-
- public ResourceValidator setEdm(final Edm edm) {
- this.edm = edm;
- return this;
- }
-
- public ResourceValidator setUriInfoImplPath(final UriInfoImpl uriInfoPath) {
- uriInfo = uriInfoPath;
- last();
- return this;
- }
-
- // --- Execution ---
-
- public ResourceValidator run(final String uri) {
- ParserWithLogging testParser = new ParserWithLogging();
-
- UriInfoImpl uriInfoTmp = null;
- uriPathInfo = null;
- try {
- uriInfoTmp = (UriInfoImpl) testParser.parseUri(uri, edm);
-
- UriValidator uriValidator = new UriValidator();
- uriValidator.validate(uriInfoTmp, "GET");
- } catch (Exception e) {
- fail("Exception occured while parsing the URI: " + uri + "\n"
- + " Message: " + e.getMessage());
- }
-
- if (uriInfoTmp.getKind() != UriInfoKind.resource) {
- fail("Invalid UriInfoKind: " + uriInfoTmp.getKind().toString());
- }
- uriInfo = uriInfoTmp;
-
- first();
- return this;
- }
-
- // --- Navigation ---
-
- public TestUriValidator goUpUriValidator() {
- return (TestUriValidator) invokedBy;
- }
-
- public ExpandValidator goUpExpandValidator() {
- return (ExpandValidator) invokedBy;
- }
-
- public FilterValidator goUpFilterValidator() {
- return (FilterValidator) invokedBy;
- }
-
- public FilterValidator goParameter(final int index) {
- assertEquals(UriResourceKind.function, uriPathInfo.getKind());
- UriResourceFunctionImpl function = (UriResourceFunctionImpl) uriPathInfo;
-
- return new FilterValidator()
- .setEdm(edm)
- .setExpression(function.getParameters().get(index).getExression())
- .setValidator(this);
- }
-
- public FilterValidator goLambdaExpression() {
- if (uriPathInfo.getKind() == UriResourceKind.lambdaAll) {
- return new FilterValidator()
- .setEdm(edm)
- .setExpression(((UriResourceLambdaAllImpl) uriPathInfo).getExpression());
-
- } else if (uriPathInfo.getKind() == UriResourceKind.lambdaAny) {
- return new FilterValidator()
- .setEdm(edm)
- .setExpression(((UriResourceLambdaAnyImpl) uriPathInfo).getExpression());
- } else {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
- return null;
- }
-
- public ResourceValidator goSelectItem(final int index) {
- SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- UriInfoImpl uriInfo1 = (UriInfoImpl) item.getResourcePath();
-
- return new ResourceValidator()
- .setUpValidator(this)
- .setEdm(edm)
- .setUriInfoImplPath(uriInfo1);
-
- }
-
- public ExpandValidator goExpand() {
- ExpandOptionImpl expand = (ExpandOptionImpl) uriInfo.getExpandOption();
- if (expand == null) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- return new ExpandValidator().setUpValidator(this).setExpand(expand);
- }
-
- public ResourceValidator first() {
- uriResourceIndex = 0;
- uriPathInfo = (UriResourceImpl) uriInfo.getUriResourceParts().get(0);
- return this;
- }
-
- public ResourceValidator last() {
- uriResourceIndex = 0;
-
- try {
- uriPathInfo = (UriResourceImpl) uriInfo.getUriResourceParts().get(uriInfo.getUriResourceParts().size() - 1);
- uriResourceIndex = uriInfo.getUriResourceParts().size() - 1;
- } catch (IndexOutOfBoundsException ex) {
- fail("not enough segments");
- }
-
- return this;
- }
-
- public ResourceValidator n() {
- uriResourceIndex++;
-
- try {
- uriPathInfo = (UriResourceImpl) uriInfo.getUriResourceParts().get(uriResourceIndex);
- } catch (IndexOutOfBoundsException ex) {
- fail("not enough segments");
- }
-
- return this;
- }
-
- public ResourceValidator at(final int index) {
- uriResourceIndex = index;
- try {
- uriPathInfo = (UriResourceImpl) uriInfo.getUriResourceParts().get(index);
- } catch (IndexOutOfBoundsException ex) {
- fail("not enough segments");
- }
- return this;
- }
-
- // --- Validation ---
-
- public ResourceValidator isLambdaVar(final String var) {
- String actualVar = null;
- if (uriPathInfo.getKind() == UriResourceKind.lambdaAll) {
- actualVar = ((UriResourceLambdaAllImpl) uriPathInfo).getLambdaVariable();
- } else if (uriPathInfo.getKind() == UriResourceKind.lambdaAny) {
- actualVar = ((UriResourceLambdaAnyImpl) uriPathInfo).getLamdaVariable();
- } else {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- assertEquals(var, actualVar);
- return this;
- }
-
- public ResourceValidator isTypeFilter(final FullQualifiedName expectedType) {
-
- if (uriPathInfo.getKind() != UriResourceKind.complexProperty &&
- uriPathInfo.getKind() != UriResourceKind.singleton) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- EdmType actualType = null;
- if (uriPathInfo instanceof UriResourceComplexPropertyImpl) {
- actualType = ((UriResourceComplexPropertyImpl) uriPathInfo).getComplexTypeFilter();
- } else if (uriPathInfo instanceof UriResourceSingletonImpl) {
- actualType = ((UriResourceSingletonImpl) uriPathInfo).getEntityTypeFilter();
- }
-
- if (actualType == null) {
- fail("type information not set");
- }
-
- FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
-
- assertEquals(expectedType.toString(), actualName.toString());
- return this;
- }
-
- public ResourceValidator isType(final FullQualifiedName type) {
- if (!(uriPathInfo instanceof UriResourcePartTyped)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
- UriResourcePartTyped uriPathInfoTyped = (UriResourcePartTyped) uriPathInfo;
-
- EdmType actualType = uriPathInfoTyped.getType();
- if (actualType == null) {
- fail("type information not set");
- }
-
- FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
-
- assertEquals(type.toString(), actualName.toString());
-
- return this;
- }
-
- public ResourceValidator isType(final FullQualifiedName type, final boolean isFinallyACollection) {
- isType(type);
- assertEquals(isFinallyACollection, ((UriResourcePartTyped) uriPathInfo).isCollection());
- return this;
- }
-
- public ResourceValidator isTypeFilterOnEntry(final FullQualifiedName type) {
- if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourceWithKeysImpl uriPathInfoKeyPred = (UriResourceWithKeysImpl) uriPathInfo;
-
- // input parameter type may be null in order to assert that the singleTypeFilter is not set
- EdmType actualType = uriPathInfoKeyPred.getTypeFilterOnEntry();
- if (type == null) {
- assertEquals(type, actualType);
- } else {
- assertEquals(type.toString(), new FullQualifiedName(actualType.getNamespace(), actualType.getName()).toString());
- }
-
- return this;
- }
-
- public ResourceValidator isTypeFilterOnCollection(final FullQualifiedName expectedType) {
- if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
- UriResourceWithKeysImpl uriPathInfoKeyPred = (UriResourceWithKeysImpl) uriPathInfo;
-
- // input parameter type may be null in order to assert that the collectionTypeFilter is not set
- EdmType actualType = uriPathInfoKeyPred.getTypeFilterOnCollection();
- if (expectedType == null) {
- assertEquals(expectedType, actualType);
- } else {
- FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
- assertEquals(expectedType.toString(), actualName.toString());
- }
-
- return this;
- }
-
- // other functions
- public ResourceValidator checkCustomParameter(final int index, final String name, final String value) {
- if (uriInfo == null) {
- fail("hasQueryParameter: uriInfo == null");
- }
-
- List<CustomQueryOption> list = uriInfo.getCustomQueryOptions();
- if (list.size() <= index) {
- fail("not enough queryParameters");
- }
-
- CustomQueryOptionImpl option = (CustomQueryOptionImpl) list.get(index);
- assertEquals(name, option.getName());
- assertEquals(value, option.getText());
- return this;
- }
-
- // TODO remove
- /*
- * public ResourceValidator isCollection(final boolean isCollection) {
- * if (!(uriPathInfo instanceof UriResourcePartTyped)) {
- * fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- * }
- * UriResourcePartTyped uriPathInfoTyped = (UriResourcePartTyped) uriPathInfo;
- *
- * EdmType type = uriPathInfoTyped.getType();
- * if (type == null) {
- * fail("isCollection: type == null");
- * }
- * assertEquals(isCollection, uriPathInfoTyped.isCollection());
- * return this;
- * }
- */
-
- public ResourceValidator isFilterString(final String expectedFilterTreeAsString) {
-
- ExpressionImpl filterTree = (ExpressionImpl) uriInfo.getFilterOption().getExpression();
- try {
- String filterTreeAsString = filterTree.accept(new FilterTreeToText());
- assertEquals(expectedFilterTreeAsString, filterTreeAsString);
- } catch (ExpressionVisitException e) {
- fail("isFilterString: Exception " + e.getMessage() + " occured");
- } catch (ODataApplicationException e) {
- fail("isFilterString: Exception " + e.getMessage() + " occured");
- }
-
- return this;
- }
-
- public ResourceValidator isKeyPredicateRef(final int index, final String name, final String refencedProperty) {
- if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourceWithKeysImpl info = (UriResourceWithKeysImpl) uriPathInfo;
- List<UriParameter> keyPredicates = info.getKeyPredicates();
- assertEquals(name, keyPredicates.get(index).getName());
- assertEquals(refencedProperty, keyPredicates.get(index).getRefencedProperty());
- return this;
-
- }
-
- public ResourceValidator isKeyPredicateAlias(final int index, final String name, final String alias) {
- if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourceWithKeysImpl info = (UriResourceWithKeysImpl) uriPathInfo;
- List<UriParameter> keyPredicates = info.getKeyPredicates();
- assertEquals(name, keyPredicates.get(index).getName());
- assertEquals(alias, keyPredicates.get(index).getAlias());
- return this;
-
- }
-
- public ResourceValidator isKeyPredicate(final int index, final String name, final String text) {
- if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourceWithKeysImpl info = (UriResourceWithKeysImpl) uriPathInfo;
- List<UriParameter> keyPredicates = info.getKeyPredicates();
- assertEquals(name, keyPredicates.get(index).getName());
- assertEquals(text, keyPredicates.get(index).getText());
- return this;
-
- }
-
- public ResourceValidator isParameter(final int index, final String name, final String text) {
- if (!(uriPathInfo instanceof UriResourceFunctionImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourceFunctionImpl info = (UriResourceFunctionImpl) uriPathInfo;
- List<UriParameter> keyPredicates = info.getParameters();
- assertEquals(name, keyPredicates.get(index).getName());
- assertEquals(text, keyPredicates.get(index).getText());
- return this;
-
- }
-
- public ResourceValidator isParameterAlias(final int index, final String name, final String alias) {
- if (!(uriPathInfo instanceof UriResourceFunctionImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourceFunctionImpl info = (UriResourceFunctionImpl) uriPathInfo;
- List<UriParameter> keyPredicates = info.getParameters();
- assertEquals(name, keyPredicates.get(index).getName());
- assertEquals(alias, keyPredicates.get(index).getAlias());
- return this;
-
- }
-
- public ResourceValidator isKind(final UriInfoKind kind) {
- assertEquals(kind, uriInfo.getKind());
- return this;
- }
-
- public ResourceValidator isPrimitiveProperty(final String name,
- final FullQualifiedName type, final boolean isCollection) {
- if (!(uriPathInfo instanceof UriResourcePrimitivePropertyImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourcePrimitivePropertyImpl uriPathInfoProp = (UriResourcePrimitivePropertyImpl) uriPathInfo;
-
- EdmElement property = uriPathInfoProp.getProperty();
-
- assertEquals(name, property.getName());
- assertEquals(type, new FullQualifiedName(property.getType().getNamespace(), property.getType().getName()));
- assertEquals(isCollection, property.isCollection());
- return this;
- }
-
- public ResourceValidator
- isComplexProperty(final String name, final FullQualifiedName type, final boolean isCollection) {
- if (!(uriPathInfo instanceof UriResourceComplexPropertyImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourceComplexPropertyImpl uriPathInfoProp = (UriResourceComplexPropertyImpl) uriPathInfo;
-
- EdmElement property = uriPathInfoProp.getProperty();
-
- assertEquals(name, property.getName());
- assertEquals(type, new FullQualifiedName(property.getType().getNamespace(), property.getType().getName()));
- assertEquals(isCollection, property.isCollection());
- return this;
- }
-
- public ResourceValidator isNavProperty(final String name, final FullQualifiedName type, final boolean isCollection) {
- if (!(uriPathInfo instanceof UriResourceNavigationPropertyImpl)) {
- fail("invalid resource kind: " + uriPathInfo.getKind().toString());
- }
-
- UriResourceNavigationPropertyImpl uriPathInfoProp = (UriResourceNavigationPropertyImpl) uriPathInfo;
-
- EdmElement property = uriPathInfoProp.getProperty();
-
- assertEquals(name, property.getName());
- assertEquals(type, new FullQualifiedName(property.getType().getNamespace(), property.getType().getName()));
- assertEquals(isCollection, uriPathInfoProp.isCollection());
- return this;
- }
-
- public ResourceValidator isUriPathInfoKind(final UriResourceKind infoType) {
- assertNotNull(uriPathInfo);
- assertEquals(infoType, uriPathInfo.getKind());
- return this;
- }
-
- public ResourceValidator isAction(final String name) {
- assertEquals(UriResourceKind.action, uriPathInfo.getKind());
- assertEquals(name, ((UriResourceActionImpl) uriPathInfo).getAction().getName());
- return this;
- }
-
- public ResourceValidator isFunction(final String name) {
- assertEquals(UriResourceKind.function, uriPathInfo.getKind());
- assertEquals(name, ((UriResourceFunctionImpl) uriPathInfo).getFunction().getName());
- return this;
- }
-
- public ResourceValidator isFunctionImport(final String name) {
- assertEquals(UriResourceKind.function, uriPathInfo.getKind());
- assertEquals(name, ((UriResourceFunctionImpl) uriPathInfo).getFunctionImport().getName());
- return this;
- }
-
- public ResourceValidator isEntitySet(final String name) {
- assertEquals(UriResourceKind.entitySet, uriPathInfo.getKind());
- assertEquals(name, ((UriResourceEntitySetImpl) uriPathInfo).getEntitySet().getName());
- return this;
- }
-
- public ResourceValidator isComplex(final String name) {
- assertEquals(UriResourceKind.complexProperty, uriPathInfo.getKind());
- assertEquals(name, ((UriResourceComplexPropertyImpl) uriPathInfo).getProperty().getName());
- return this;
- }
-
- public ResourceValidator isSingleton(final String name) {
- assertEquals(UriResourceKind.singleton, uriPathInfo.getKind());
- assertEquals(name, ((UriResourceSingletonImpl) uriPathInfo).getSingleton().getName());
- return this;
- }
-
- public ResourceValidator isValue() {
- assertEquals(UriResourceKind.value, uriPathInfo.getKind());
- return this;
- }
-
- public ResourceValidator isCount() {
- assertEquals(UriResourceKind.count, uriPathInfo.getKind());
- return this;
- }
-
- public ResourceValidator isRef() {
- assertEquals(UriResourceKind.ref, uriPathInfo.getKind());
- return this;
- }
-
- public ResourceValidator isActionImport(final String actionName) {
- assertEquals(UriResourceKind.action, uriPathInfo.getKind());
- assertEquals(actionName, ((UriResourceActionImpl) uriPathInfo).getActionImport().getName());
- return this;
- }
-
- public ResourceValidator isIt() {
- assertEquals(UriResourceKind.it, uriPathInfo.getKind());
- return this;
- }
-
- public ResourceValidator isTopText(final String topText) {
- assertEquals(topText, uriInfo.getTopOption().getText());
- return this;
- }
-
- public ResourceValidator isFormatText(final String formatText) {
- assertEquals(formatText, uriInfo.getFormatOption().getText());
- return this;
- }
-
- public ResourceValidator isInlineCountText(final String inlineCountText) {
- assertEquals(inlineCountText, uriInfo.getCountOption().getText());
- return this;
- }
-
- public ResourceValidator isSkipText(final String skipText) {
- assertEquals(skipText, uriInfo.getSkipOption().getText());
- return this;
- }
-
- public ResourceValidator isSkipTokenText(final String skipTokenText) {
- assertEquals(skipTokenText, uriInfo.getSkipTokenOption().getText());
- return this;
- }
-
- public ResourceValidator isSelectItemStar(final int index) {
- SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- assertEquals(true, item.isStar());
- return this;
- }
-
- public ResourceValidator isSelectItemAllOp(final int index, final FullQualifiedName fqn) {
- SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- assertEquals(fqn.toString(), item.getAllOperationsInSchemaNameSpace().toString());
- return this;
- }
-
- public ResourceValidator isSelectStartType(final int index, final FullQualifiedName fullName) {
- SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
- SelectItem item = select.getSelectItems().get(index);
-
- EdmType actualType = item.getStartTypeFilter();
-
- FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
- assertEquals(fullName, actualName);
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestErrorLogger.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestErrorLogger.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestErrorLogger.java
deleted file mode 100644
index 0153036..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestErrorLogger.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import java.util.BitSet;
-import java.util.Collections;
-import java.util.List;
-
-import org.antlr.v4.runtime.ANTLRErrorListener;
-import org.antlr.v4.runtime.Parser;
-import org.antlr.v4.runtime.RecognitionException;
-import org.antlr.v4.runtime.Recognizer;
-import org.antlr.v4.runtime.atn.ATNConfigSet;
-import org.antlr.v4.runtime.dfa.DFA;
-import org.apache.olingo.server.core.uri.antlr.UriLexer;
-
-class TestErrorLogger implements ANTLRErrorListener {
-
- private String prefix;
- private int logLevel = 0;
-
- public TestErrorLogger(final String prefix, final int logLevel) {
- this.prefix = prefix;
- this.logLevel = logLevel;
- }
-
- @Override
- public void syntaxError(final Recognizer<?, ?> recognizer, final Object offendingSymbol, final int line,
- final int charPositionInLine,
- final String msg, final RecognitionException e) {
-
- if (logLevel > 0) {
- System.out.println("\n" + prefix + " -- SyntaxError");
- trace(recognizer, offendingSymbol, line, charPositionInLine, msg, e);
- }
-
- }
-
- @Override
- public void reportAmbiguity(final Parser recognizer, final DFA dfa, final int startIndex, final int stopIndex,
- final boolean exact,
- final BitSet ambigAlts, final ATNConfigSet configs) {
-
- }
-
- @Override
- public void reportAttemptingFullContext(final Parser recognizer, final DFA dfa, final int startIndex,
- final int stopIndex,
- final BitSet conflictingAlts, final ATNConfigSet configs) {
-
- }
-
- @Override
- public void reportContextSensitivity(final Parser recognizer, final DFA dfa, final int startIndex,
- final int stopIndex, final int prediction,
- final ATNConfigSet configs) {
-
- }
-
- private void printStack(final Recognizer<?, ?> recognizer) {
- List<String> stack = ((Parser) recognizer).getRuleInvocationStack();
- Collections.reverse(stack);
- System.out.println(" rule stack: " + stack);
- }
-
- public void trace(final Recognizer<?, ?> recognizer, final Object offendingSymbol,
- final int line, final int charPositionInLine, final String msg, final RecognitionException e) {
-
- System.out.println("Error message: " + msg);
-
- printStack(recognizer);
-
- System.out.println(" line/char :" + line + " / " + charPositionInLine);
- System.out.println(" sym :" + offendingSymbol);
- if (e != null && e.getOffendingToken() != null) {
-
- String lexerTokenName = "";
- try {
- lexerTokenName = UriLexer.tokenNames[e.getOffendingToken().getType()];
- } catch (ArrayIndexOutOfBoundsException es) {
- lexerTokenName = "token error";
- }
-
- System.out.println(" tokenname:" + lexerTokenName);
- }
-
- }
-
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
deleted file mode 100644
index 35687f6..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.fail;
-
-import java.util.List;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
-import org.apache.olingo.server.api.uri.queryoption.SelectItem;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.parser.Parser;
-import org.apache.olingo.server.core.uri.parser.UriParserException;
-import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
-import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
-import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
-import org.apache.olingo.server.core.uri.validator.UriValidator;
-
-public class TestUriValidator implements TestValidator {
- private Edm edm;
-
- private UriInfoImpl uriInfo;
- private Exception exception;
-
- // Setup
- public TestUriValidator setEdm(final Edm edm) {
- this.edm = edm;
- return this;
- }
-
- // Execution
- public TestUriValidator run(final String uri) {
- Parser parser = new Parser();
- UriValidator validator = new UriValidator();
-
- uriInfo = null;
- try {
- uriInfo = (UriInfoImpl) parser.parseUri(uri, edm);
- validator.validate(uriInfo, "GET");
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
-
- return this;
- }
-
- public TestUriValidator runEx(final String uri) {
- Parser parser = new Parser();
- uriInfo = null;
- try {
- uriInfo = (UriInfoImpl) parser.parseUri(uri, edm);
- fail("Exception expected");
- } catch (UriParserException e) {
- exception = e;
- }
-
- return this;
- }
-
- public TestUriValidator log(final String uri) {
- ParserWithLogging parserTest = new ParserWithLogging();
- parserTest.setLogLevel(1);
- uriInfo = null;
- try {
- // uriInfoTmp = new UriParserImpl(edm).ParseUri(uri);
- uriInfo = (UriInfoImpl) parserTest.parseUri(uri, edm);
- } catch (UriParserException e) {
- fail("Exception occured while parsing the URI: " + uri + "\n"
- + " Exception: " + e.getMessage());
- }
-
- return this;
- }
-
- // Navigation
- public ResourceValidator goPath() {
- if (uriInfo.getKind() != UriInfoKind.resource) {
- fail("invalid resource kind: " + uriInfo.getKind().toString());
- }
-
- return new ResourceValidator()
- .setUpValidator(this)
- .setEdm(edm)
- .setUriInfoImplPath(uriInfo);
- }
-
- public FilterValidator goFilter() {
- FilterOptionImpl filter = (FilterOptionImpl) uriInfo.getFilterOption();
- if (filter == null) {
- fail("no filter found");
- }
- return new FilterValidator().setUriValidator(this).setFilter(filter);
-
- }
-
- public ExpandValidator goExpand() {
- ExpandOptionImpl expand = (ExpandOptionImpl) uriInfo.getExpandOption();
- if (expand == null) {
- fail("invalid resource kind: " + uriInfo.getKind().toString());
- }
-
- return new ExpandValidator().setUpValidator(this).setExpand(expand);
- }
-
- public ResourceValidator goSelectItemPath(final int index) {
- SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- UriInfoImpl uriInfo1 = (UriInfoImpl) item.getResourcePath();
-
- return new ResourceValidator()
- .setUpValidator(this)
- .setEdm(edm)
- .setUriInfoImplPath(uriInfo1);
-
- }
-
- public TestUriValidator isSelectStartType(final int index, final FullQualifiedName fullName) {
- SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
- SelectItem item = select.getSelectItems().get(index);
- EdmType actualType = item.getStartTypeFilter();
-
- FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
- assertEquals(fullName, actualName);
- return this;
-
- }
-
- // Validation
- public TestUriValidator isKind(final UriInfoKind kind) {
- assertEquals(kind, uriInfo.getKind());
- return this;
- }
-
- public TestUriValidator isCustomParameter(final int index, final String name, final String value) {
- if (uriInfo == null) {
- fail("hasQueryParameter: uriInfo == null");
- }
-
- List<CustomQueryOption> list = uriInfo.getCustomQueryOptions();
- if (list.size() <= index) {
- fail("not enought queryParameters");
- }
-
- CustomQueryOptionImpl option = (CustomQueryOptionImpl) list.get(index);
- assertEquals(name, option.getName());
- assertEquals(value, option.getText());
- return this;
- }
-
- public void isCrossJoinEntityList(final List<String> entitySets) {
- if (uriInfo.getKind() != UriInfoKind.crossjoin) {
- fail("invalid resource kind: " + uriInfo.getKind().toString());
- }
-
- int i = 0;
- for (String entitySet : entitySets) {
- assertEquals(entitySet, uriInfo.getEntitySetNames().get(i));
- i++;
- }
-
- }
-
- public TestUriValidator isExSyntax(final long errorID) {
- assertEquals(UriParserSyntaxException.class, exception.getClass());
- return this;
- }
-
- public TestUriValidator isExSemantic(final long errorID) {
- assertEquals(UriParserSemanticException.class, exception.getClass());
- return this;
- }
-
- public TestUriValidator isIdText(final String text) {
- assertEquals(text, uriInfo.getIdOption().getText());
- return this;
- }
-
- public TestUriValidator isExpandText(final String text) {
- assertEquals(text, uriInfo.getExpandOption().getText());
- return this;
- }
-
- public TestUriValidator isSelectText(final String text) {
- assertEquals(text, uriInfo.getSelectOption().getText());
- return this;
- }
-
- public TestUriValidator isFormatText(final String text) {
- assertEquals(text, uriInfo.getFormatOption().getText());
- return this;
- }
-
- public TestUriValidator isFragmentText(final String text) {
- if (uriInfo.getKind() != UriInfoKind.metadata) {
- fail("invalid resource kind: " + uriInfo.getKind().toString());
- }
-
- assertEquals(text, uriInfo.getFragment());
-
- return this;
- }
-
- public TestUriValidator isEntityType(final FullQualifiedName fullName) {
- if (uriInfo.getKind() != UriInfoKind.entityId) {
- fail("invalid resource kind: " + uriInfo.getKind().toString());
- }
-
- assertEquals(fullName.toString(), fullName(uriInfo.getEntityTypeCast()));
- return this;
- }
-
- private String fullName(final EdmEntityType type) {
- return type.getNamespace() + "." + type.getName();
- }
-
- public TestUriValidator isSelectItemStar(final int index) {
- SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- assertEquals(true, item.isStar());
- return this;
- }
-
- public TestUriValidator isSelectItemAllOp(final int index, final FullQualifiedName fqn) {
- SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
-
- SelectItem item = select.getSelectItems().get(index);
- assertEquals(fqn.toString(), item.getAllOperationsInSchemaNameSpace().toString());
- return this;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestValidator.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestValidator.java
deleted file mode 100644
index 7e64f86..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TestValidator.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-public interface TestValidator {
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
deleted file mode 100644
index 4a94bb3..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.List;
-
-import org.antlr.v4.runtime.ANTLRInputStream;
-import org.antlr.v4.runtime.Token;
-import org.apache.olingo.server.core.uri.antlr.UriLexer;
-
-//TODO extend to test also exception which can occure while paring
-public class TokenValidator {
-
- private String input = null;
-
- private List<? extends Token> tokens = null;
- private Token curToken = null;
- private Exception curException = null;
-
- private int startMode;
- private int logLevel = 0;
-
- // --- Setup ---
-
- public TokenValidator log(final int logLevel) {
- this.logLevel = logLevel;
- return this;
- }
-
- // --- Execution ---
-
- public TokenValidator run(final String uri) {
- input = uri;
-
- tokens = parseInput(uri);
- if (logLevel > 0) {
- showTokens();
- }
-
- first();
- exFirst();
- logLevel = 0;
-
- return this;
- }
-
- // --- Navigation ---
-
- // navigate within the tokenlist
- public TokenValidator first() {
- try {
- curToken = tokens.get(0);
- } catch (IndexOutOfBoundsException ex) {
- curToken = null;
- }
- return this;
- }
-
- public TokenValidator last() {
- curToken = tokens.get(tokens.size() - 1);
- return this;
- }
-
- public TokenValidator at(final int index) {
- try {
- curToken = tokens.get(index);
- } catch (IndexOutOfBoundsException ex) {
- curToken = null;
- }
- return this;
- }
-
- public TokenValidator exLast() {
- // curException = exceptions.get(exceptions.size() - 1);
- return this;
- }
-
- // navigate within the exception list
- public TokenValidator exFirst() {
- try {
- // curException = exceptions.get(0);
- } catch (IndexOutOfBoundsException ex) {
- curException = null;
- }
- return this;
-
- }
-
- public TokenValidator exAt(final int index) {
- try {
- // curException = exceptions.get(index);
- } catch (IndexOutOfBoundsException ex) {
- curException = null;
- }
- return this;
- }
-
- // --- Validation ---
-
- public TokenValidator isText(final String expected) {
- assertEquals(expected, curToken.getText());
- return this;
- }
-
- public TokenValidator isAllText(final String expected) {
- String actual = "";
-
- for (Token curToken : tokens) {
- actual += curToken.getText();
- }
- assertEquals(expected, actual);
- return this;
- }
-
- public TokenValidator isAllInput() {
- String actual = "";
-
- for (Token curToken : tokens) {
- actual += curToken.getText();
- }
- assertEquals(input, actual);
- return this;
- }
-
- public TokenValidator isInput() {
- assertEquals(input, curToken.getText());
- return this;
- }
-
- public TokenValidator isType(final int expected) {
- assertEquals(UriLexer.tokenNames[expected], UriLexer.tokenNames[curToken.getType()]);
- return this;
- }
-
- public TokenValidator isExType(final Class<?> exClass) {
- assertEquals(exClass, curException.getClass());
- return this;
- }
-
- public void globalMode(final int mode) {
- startMode = mode;
- }
-
- // --- Helper ---
-
- private List<? extends Token> parseInput(final String input) {
- ANTLRInputStream inputStream = new ANTLRInputStream(input);
-
- UriLexer lexer = new UriLexerWithTrace(inputStream, logLevel, startMode);
- // lexer.addErrorListener(new ErrorCollector(this));
- return lexer.getAllTokens();
- }
-
- public TokenValidator showTokens() {
- boolean first = true;
- System.out.println("input: " + input);
- String nL = "\n";
- String out = "[" + nL;
- for (Token token : tokens) {
- if (!first) {
- out += ",";
- first = false;
- }
- int index = token.getType();
- if (index != -1) {
- out += "\"" + token.getText() + "\"" + " " + UriLexer.tokenNames[index] + nL;
- } else {
- out += "\"" + token.getText() + "\"" + " " + index + nL;
- }
- }
- out += ']';
- System.out.println("tokens: " + out);
- return this;
- }
-
-}
[29/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
deleted file mode 100644
index 8713348..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.serializer.json;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.commons.api.edm.EdmSingleton;
-import org.apache.olingo.server.api.ODataServer;
-import org.apache.olingo.server.api.serializer.ODataFormat;
-import org.apache.olingo.server.api.serializer.ODataSerializer;
-import org.junit.Before;
-import org.junit.Test;
-
-public class ServiceDocumentTest {
-
- private Edm edm;
-
- @Before
- public void before() {
-
- EdmEntitySet edmEntitySet1 = mock(EdmEntitySet.class);
- when(edmEntitySet1.getName()).thenReturn("entitySetName1");
- when(edmEntitySet1.isIncludeInServiceDocument()).thenReturn(true);
-
- EdmEntitySet edmEntitySet2 = mock(EdmEntitySet.class);
- when(edmEntitySet2.getName()).thenReturn("entitySetName2");
- when(edmEntitySet2.isIncludeInServiceDocument()).thenReturn(true);
-
- EdmEntitySet edmEntitySet3 = mock(EdmEntitySet.class);
- when(edmEntitySet3.getName()).thenReturn("entitySetName3");
- when(edmEntitySet3.isIncludeInServiceDocument()).thenReturn(false);
-
- List<EdmEntitySet> entitySets = new ArrayList<EdmEntitySet>();
- entitySets.add(edmEntitySet1);
- entitySets.add(edmEntitySet2);
- entitySets.add(edmEntitySet3);
-
- EdmFunctionImport functionImport1 = mock(EdmFunctionImport.class);
- when(functionImport1.getName()).thenReturn("functionImport1");
- when(functionImport1.isIncludeInServiceDocument()).thenReturn(true);
-
- EdmFunctionImport functionImport2 = mock(EdmFunctionImport.class);
- when(functionImport2.getName()).thenReturn("functionImport2");
- when(functionImport2.isIncludeInServiceDocument()).thenReturn(true);
-
- EdmFunctionImport functionImport3 = mock(EdmFunctionImport.class);
- when(functionImport3.getName()).thenReturn("functionImport3");
- when(functionImport3.isIncludeInServiceDocument()).thenReturn(false);
-
- List<EdmFunctionImport> functionImports = new ArrayList<EdmFunctionImport>();
- functionImports.add(functionImport1);
- functionImports.add(functionImport2);
- functionImports.add(functionImport3);
-
- EdmSingleton singleton1 = mock(EdmSingleton.class);
- when(singleton1.getName()).thenReturn("singleton1");
-
- EdmSingleton singleton2 = mock(EdmSingleton.class);
- when(singleton2.getName()).thenReturn("singleton2");
-
- EdmSingleton singleton3 = mock(EdmSingleton.class);
- when(singleton3.getName()).thenReturn("singleton3");
-
- List<EdmSingleton> singletons = new ArrayList<EdmSingleton>();
- singletons.add(singleton1);
- singletons.add(singleton2);
- singletons.add(singleton3);
-
- EdmEntityContainer edmEntityContainer = mock(EdmEntityContainer.class);
- when(edmEntityContainer.getEntitySets()).thenReturn(entitySets);
- when(edmEntityContainer.getFunctionImports()).thenReturn(functionImports);
- when(edmEntityContainer.getSingletons()).thenReturn(singletons);
-
- edm = mock(Edm.class);
- when(edm.getEntityContainer(null)).thenReturn(edmEntityContainer);
- }
-
- @Test
- public void writeServiceDocumentJson() throws Exception {
- String serviceRoot = "http://localhost:8080/odata.svc";
-
- ODataServer server = ODataServer.newInstance();
- assertNotNull(server);
-
- ODataSerializer serializer = server.getSerializer(ODataFormat.JSON);
- assertNotNull(serializer);
-
- InputStream result = serializer.serviceDocument(edm, serviceRoot);
- assertNotNull(result);
- String jsonString = IOUtils.toString(result);
-
- assertTrue(jsonString.contains("entitySetName1"));
- assertTrue(jsonString.contains("entitySetName2"));
- assertFalse(jsonString.contains("entitySetName3"));
-
- assertTrue(jsonString.contains("functionImport1"));
- assertTrue(jsonString.contains("functionImport2"));
- assertFalse(jsonString.contains("functionImport3"));
-
- assertTrue(jsonString.contains("singleton1"));
- assertTrue(jsonString.contains("singleton2"));
- assertTrue(jsonString.contains("singleton3"));
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
deleted file mode 100644
index 7d3dee5..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.serializer.xml;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.mock;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.ODataRuntimeException;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.edm.Target;
-import org.apache.olingo.server.api.ODataServer;
-import org.apache.olingo.server.api.edm.provider.Action;
-import org.apache.olingo.server.api.edm.provider.ActionImport;
-import org.apache.olingo.server.api.edm.provider.ComplexType;
-import org.apache.olingo.server.api.edm.provider.EdmProvider;
-import org.apache.olingo.server.api.edm.provider.EntityContainer;
-import org.apache.olingo.server.api.edm.provider.EntitySet;
-import org.apache.olingo.server.api.edm.provider.EntityType;
-import org.apache.olingo.server.api.edm.provider.EnumMember;
-import org.apache.olingo.server.api.edm.provider.EnumType;
-import org.apache.olingo.server.api.edm.provider.Function;
-import org.apache.olingo.server.api.edm.provider.FunctionImport;
-import org.apache.olingo.server.api.edm.provider.NavigationProperty;
-import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding;
-import org.apache.olingo.server.api.edm.provider.Parameter;
-import org.apache.olingo.server.api.edm.provider.Property;
-import org.apache.olingo.server.api.edm.provider.ReturnType;
-import org.apache.olingo.server.api.edm.provider.Schema;
-import org.apache.olingo.server.api.edm.provider.Singleton;
-import org.apache.olingo.server.api.edm.provider.TypeDefinition;
-import org.apache.olingo.server.api.serializer.ODataFormat;
-import org.apache.olingo.server.api.serializer.ODataSerializer;
-import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
-import org.apache.olingo.server.ref.provider.EdmTechProvider;
-import org.junit.Test;
-
-public class MetadataDocumentTest {
-
- @Test(expected = ODataRuntimeException.class)
- public void metadataOnJsonResultsInException() {
- ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.JSON);
- serializer.metadataDocument(mock(Edm.class));
- }
-
- @Test
- public void writeMetadataWithEmptyMockedEdm() {
- ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
- Edm edm = mock(Edm.class);
- serializer.metadataDocument(edm);
- }
-
- @Test
- public void writeMetadataWithLocalTestEdm() throws Exception {
- ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
- Edm edm = new EdmProviderImpl(new TestMetadataProvider());
- InputStream metadata = serializer.metadataDocument(edm);
- assertNotNull(metadata);
-
- String metadataString = IOUtils.toString(metadata);
- assertTrue(metadataString
- .contains("<edmx:Edmx Version=\"4.0\" xmlns:edmx=\"http://docs.oasis-open.org/odata/ns/edmx\">"));
-
- assertTrue(metadataString
- .contains("<Schema xmlns=\"http://docs.oasis-open.org/odata/ns/edm\" " +
- "Namespace=\"namespace\" Alias=\"alias\">"));
-
- assertTrue(metadataString
- .contains("<EntityType Name=\"ETBaseName\"><Property Name=\"P1\" Type=\"Edm.Int16\"/><NavigationProperty " +
- "Name=\"N1\" Type=\"namespace.ETBaseName\" Nullable=\"true\" Partner=\"N1\"/></EntityType>"));
-
- assertTrue(metadataString
- .contains("<EntityType Name=\"ETDerivedName\" BaseType=\"namespace.ETBaseName\"><Property Name=\"P2\" " +
- "Type=\"Edm.Int16\"/><NavigationProperty Name=\"N2\" Type=\"namespace.ETDerivedName\" Nullable=\"true\" " +
- "Partner=\"N2\"/></EntityType>"));
-
- assertTrue(metadataString
- .contains("<ComplexType Name=\"CTBaseName\"><Property Name=\"P1\" Type=\"Edm.Int16\"/><NavigationProperty " +
- "Name=\"N1\" Type=\"namespace.ETBaseName\" Nullable=\"true\" Partner=\"N1\"/></ComplexType>"));
-
- assertTrue(metadataString
- .contains("<ComplexType Name=\"CTDerivedName\" BaseType=\"namespace.CTBaseName\"><Property Name=\"P2\" " +
- "Type=\"Edm.Int16\"/><NavigationProperty Name=\"N2\" Type=\"namespace.ETDerivedName\" Nullable=\"true\" " +
- "Partner=\"N2\"/></ComplexType>"));
-
- assertTrue(metadataString.contains("<TypeDefinition Name=\"typeDef\" Type=\"Edm.Int16\"/>"));
-
- assertTrue(metadataString.contains("<Action Name=\"ActionWOParameter\" IsBound=\"false\"/>"));
-
- assertTrue(metadataString
- .contains("<Action Name=\"ActionName\" IsBound=\"true\"><Parameter Name=\"param\" Type=\"Edm.Int16\"/>" +
- "<Parameter Name=\"param2\" Type=\"Collection(Edm.Int16)\"/><ReturnType Type=\"namespace.CTBaseName\"/>" +
- "</Action>"));
-
- assertTrue(metadataString
- .contains("<Function Name=\"FunctionWOParameter\" IsBound=\"false\" IsComposable=\"false\"><ReturnType " +
- "Type=\"namespace.CTBaseName\"/></Function>"));
-
- assertTrue(metadataString
- .contains("<Function Name=\"FunctionName\" IsBound=\"true\" IsComposable=\"false\"><Parameter Name=\"param\" " +
- "Type=\"Edm.Int16\"/><Parameter Name=\"param2\" Type=\"Collection(Edm.Int16)\"/><ReturnType " +
- "Type=\"namespace.CTBaseName\"/></Function>"));
-
- assertTrue(metadataString.contains("<EntityContainer Name=\"container\">"));
-
- assertTrue(metadataString
- .contains("<EntitySet Name=\"EntitySetName\" EntityType=\"namespace.ETBaseName\"><NavigationPropertyBinding " +
- "Path=\"N1\" Target=\"namespace.container/EntitySetName\"/></EntitySet>"));
- assertTrue(metadataString
- .contains("<Singleton Name=\"SingletonName\" EntityType=\"namespace.ETBaseName\"><NavigationPropertyBinding " +
- "Path=\"N1\" Target=\"namespace.container/EntitySetName\"/></Singleton>"));
-
- assertTrue(metadataString.contains("<ActionImport Name=\"actionImport\" Action=\"namespace.ActionWOParameter\"/>"));
-
- assertTrue(metadataString
- .contains("<FunctionImport Name=\"actionImport\" Function=\"namespace.FunctionName\" " +
- "EntitySet=\"namespace.EntitySetName\" IncludeInServiceDocument=\"false\"/>"));
-
- assertTrue(metadataString.contains("</EntityContainer></Schema></edmx:DataServices></edmx:Edmx>"));
- }
-
- @Test
- public void writeMetadataWithTechnicalScenario() {
- ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
- EdmProviderImpl edm = new EdmProviderImpl(new EdmTechProvider());
- InputStream metadata = serializer.metadataDocument(edm);
- assertNotNull(metadata);
- // The technical scenario is too big to verify. We are content for now to make sure we can serialize it.
- // System.out.println(StringUtils.inputStreamToString(metadata, false));
- }
-
- private class TestMetadataProvider extends EdmProvider {
-
- @Override
- public List<Schema> getSchemas() throws ODataException {
- Property p1 = new Property().setName("P1").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName());
- String ns = "namespace";
- NavigationProperty n1 = new NavigationProperty().setName("N1")
- .setType(new FullQualifiedName(ns, "ETBaseName")).setNullable(true).setPartner("N1");
- Property p2 = new Property().setName("P2").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName());
- NavigationProperty n2 = new NavigationProperty().setName("N2")
- .setType(new FullQualifiedName(ns, "ETDerivedName")).setNullable(true).setPartner("N2");
- Schema schema = new Schema().setNamespace(ns).setAlias("alias");
- List<ComplexType> complexTypes = new ArrayList<ComplexType>();
- schema.setComplexTypes(complexTypes);
- ComplexType ctBase =
- new ComplexType().setName("CTBaseName").setProperties(Arrays.asList(p1)).setNavigationProperties(
- Arrays.asList(n1));
- complexTypes.add(ctBase);
- ComplexType ctDerived =
- new ComplexType().setName("CTDerivedName").setBaseType(new FullQualifiedName(ns, "CTBaseName"))
- .setProperties(Arrays.asList(p2)).setNavigationProperties(Arrays.asList(n2));
- complexTypes.add(ctDerived);
-
- List<EntityType> entityTypes = new ArrayList<EntityType>();
- schema.setEntityTypes(entityTypes);
- EntityType etBase =
- new EntityType().setName("ETBaseName").setProperties(Arrays.asList(p1)).setNavigationProperties(
- Arrays.asList(n1));
- entityTypes.add(etBase);
- EntityType etDerived =
- new EntityType().setName("ETDerivedName").setBaseType(new FullQualifiedName(ns, "ETBaseName"))
- .setProperties(Arrays.asList(p2)).setNavigationProperties(Arrays.asList(n2));
- entityTypes.add(etDerived);
-
- List<Action> actions = new ArrayList<Action>();
- schema.setActions(actions);
- // TODO:EntitySetPath
- actions.add((new Action().setName("ActionWOParameter")));
- List<Parameter> parameters = new ArrayList<Parameter>();
- parameters.add(new Parameter().setName("param").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()));
- parameters.add(new Parameter().setName("param2").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName())
- .setCollection(true));
- actions.add(new Action().setName("ActionName").setBound(true).setParameters(parameters).setReturnType(
- new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName"))));
-
- List<Function> functions = new ArrayList<Function>();
- schema.setFunctions(functions);
- functions.add((new Function().setName("FunctionWOParameter")
- .setReturnType(new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName")))));
- functions.add(new Function().setName("FunctionName").setBound(true).setParameters(parameters).setReturnType(
- new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName"))));
-
- List<EnumType> enumTypes = new ArrayList<EnumType>();
- schema.setEnumTypes(enumTypes);
- List<EnumMember> members = new ArrayList<EnumMember>();
- members.add(new EnumMember().setName("member").setValue("1"));
- enumTypes.add(new EnumType().setName("EnumName").setFlags(true).setMembers(members));
-
- List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>();
- schema.setTypeDefinitions(typeDefinitions);
- typeDefinitions.add(new TypeDefinition().setName("typeDef")
- .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()));
-
- EntityContainer container = new EntityContainer().setName("container");
- schema.setEntityContainer(container);
-
- List<ActionImport> actionImports = new ArrayList<ActionImport>();
- container.setActionImports(actionImports);
- actionImports.add(new ActionImport().setName("actionImport").setAction(
- new FullQualifiedName(ns, "ActionWOParameter")).setEntitySet(
- new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
-
- List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
- container.setFunctionImports(functionImports);
- functionImports.add(new FunctionImport().setName("actionImport").setFunction(
- new FullQualifiedName(ns, "FunctionName")).setEntitySet(
- new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
-
- List<EntitySet> entitySets = new ArrayList<EntitySet>();
- container.setEntitySets(entitySets);
- List<NavigationPropertyBinding> nPB = new ArrayList<NavigationPropertyBinding>();
- nPB.add(new NavigationPropertyBinding().setPath("N1").setTarget(
- new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
- entitySets.add(new EntitySet().setName("EntitySetName").setType(new FullQualifiedName(ns, "ETBaseName"))
- .setNavigationPropertyBindings(nPB));
-
- List<Singleton> singletons = new ArrayList<Singleton>();
- container.setSingletons(singletons);
- singletons.add(new Singleton().setName("SingletonName").setType(new FullQualifiedName(ns, "ETBaseName"))
- .setNavigationPropertyBindings(nPB));
-
- List<Schema> schemas = new ArrayList<Schema>();
- schemas.add(schema);
- return schemas;
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
deleted file mode 100644
index f54ad57..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.olingo.server.core.uri.parser.RawUri;
-import org.apache.olingo.server.core.uri.parser.UriDecoder;
-import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
-import org.junit.Test;
-
-public class RawUriTest {
-
- private RawUri runRawParser(final String uri, final int scipSegments) throws UriParserSyntaxException {
- return UriDecoder.decodeUri(uri, scipSegments);
- }
-
- @Test
- public void testOption() throws Exception {
- RawUri rawUri;
- rawUri = runRawParser("?", 0);
- checkOptionCount(rawUri, 0);
-
- rawUri = runRawParser("?a", 0);
- checkOption(rawUri, 0, "a", "");
-
- rawUri = runRawParser("?a=b", 0);
- checkOption(rawUri, 0, "a", "b");
-
- rawUri = runRawParser("?=", 0);
- checkOption(rawUri, 0, "", "");
-
- rawUri = runRawParser("?=b", 0);
- checkOption(rawUri, 0, "", "b");
-
- rawUri = runRawParser("?a&c", 0);
- checkOption(rawUri, 0, "a", "");
- checkOption(rawUri, 1, "c", "");
-
- rawUri = runRawParser("?a=b&c", 0);
- checkOption(rawUri, 0, "a", "b");
- checkOption(rawUri, 1, "c", "");
-
- rawUri = runRawParser("?a=b&c=d", 0);
- checkOption(rawUri, 0, "a", "b");
- checkOption(rawUri, 1, "c", "d");
-
- rawUri = runRawParser("?=&=", 0);
- checkOption(rawUri, 0, "", "");
- checkOption(rawUri, 1, "", "");
-
- rawUri = runRawParser("?=&c=d", 0);
- checkOption(rawUri, 0, "", "");
- checkOption(rawUri, 1, "c", "d");
- }
-
- private void checkOption(final RawUri rawUri, final int index, final String name, final String value) {
- RawUri.QueryOption option = rawUri.queryOptionListDecoded.get(index);
-
- assertEquals(name, option.name);
- assertEquals(value, option.value);
-
- }
-
- private void checkOptionCount(final RawUri rawUri, final int count) {
- assertEquals(count, rawUri.queryOptionListDecoded.size());
- }
-
- @Test
- public void testPath() throws Exception {
- RawUri rawUri;
-
- rawUri = runRawParser("http://test.org", 0);
- checkPath(rawUri, "", new ArrayList<String>());
-
- rawUri = runRawParser("http://test.org/", 0);
- checkPath(rawUri, "/", Arrays.asList(""));
-
- rawUri = runRawParser("http://test.org/entitySet", 0);
- checkPath(rawUri, "/entitySet", Arrays.asList("entitySet"));
-
- rawUri = runRawParser("http://test.org/nonServiceSegment/entitySet", 0);
- checkPath(rawUri, "/nonServiceSegment/entitySet", Arrays.asList("nonServiceSegment", "entitySet"));
-
- rawUri = runRawParser("http://test.org/nonServiceSegment/entitySet", 1);
- checkPath(rawUri, "/nonServiceSegment/entitySet", Arrays.asList("entitySet"));
-
- rawUri = runRawParser("", 0);
- checkPath(rawUri, "", new ArrayList<String>());
-
- rawUri = runRawParser("/", 0);
- checkPath(rawUri, "/", Arrays.asList(""));
-
- rawUri = runRawParser("/entitySet", 0);
- checkPath(rawUri, "/entitySet", Arrays.asList("entitySet"));
-
- rawUri = runRawParser("entitySet", 0);
- checkPath(rawUri, "entitySet", Arrays.asList("entitySet"));
-
- rawUri = runRawParser("nonServiceSegment/entitySet", 0);
- checkPath(rawUri, "nonServiceSegment/entitySet", Arrays.asList("nonServiceSegment", "entitySet"));
-
- rawUri = runRawParser("nonServiceSegment/entitySet", 1);
- checkPath(rawUri, "nonServiceSegment/entitySet", Arrays.asList("entitySet"));
-
- rawUri = runRawParser("http://test.org/a?abc=xx+yz", 0);
- }
-
- @Test
- public void testSplitt() {
- UriDecoder.splitt("", '/');
- UriDecoder.splitt("/", '/');
- UriDecoder.splitt("a", '/');
- UriDecoder.splitt("a/", '/');
- UriDecoder.splitt("/a", '/');
- UriDecoder.splitt("a/a", '/');
- }
-
- private void checkPath(final RawUri rawUri, final String path, final List<String> list) {
- assertEquals(path, rawUri.path);
-
- assertEquals(list.size(), rawUri.pathSegmentListDecoded.size());
-
- int i = 0;
- while (i < list.size()) {
- assertEquals(list.get(i), rawUri.pathSegmentListDecoded.get(i));
- i++;
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
deleted file mode 100644
index f84562a..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.server.api.uri.UriInfoAll;
-import org.apache.olingo.server.api.uri.UriInfoBatch;
-import org.apache.olingo.server.api.uri.UriInfoCrossjoin;
-import org.apache.olingo.server.api.uri.UriInfoEntityId;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.UriInfoMetadata;
-import org.apache.olingo.server.api.uri.UriInfoResource;
-import org.apache.olingo.server.api.uri.UriInfoService;
-import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
-import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
-import org.apache.olingo.server.core.uri.queryoption.CountOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.FormatOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.IdOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.LevelsOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.QueryOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SearchOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SkipOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.SkipTokenOptionImpl;
-import org.apache.olingo.server.core.uri.queryoption.TopOptionImpl;
-import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
-import org.apache.olingo.server.ref.provider.EntityTypeProvider;
-import org.junit.Test;
-
-public class UriInfoImplTest {
-
- Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
-
- @Test
- public void testKind() {
- UriInfoImpl uriInfo = new UriInfoImpl().setKind(UriInfoKind.all);
- assertEquals(UriInfoKind.all, uriInfo.getKind());
- }
-
- @Test
- public void testCasts() {
- UriInfoImpl uriInfo = new UriInfoImpl();
-
- UriInfoAll all = uriInfo.asUriInfoAll();
- assertEquals(uriInfo, all);
-
- UriInfoBatch batch = uriInfo.asUriInfoBatch();
- assertEquals(uriInfo, batch);
-
- UriInfoCrossjoin crossjoin = uriInfo.asUriInfoCrossjoin();
- assertEquals(uriInfo, crossjoin);
-
- UriInfoEntityId entityID = uriInfo.asUriInfoEntityId();
- assertEquals(uriInfo, entityID);
-
- UriInfoMetadata metadata = uriInfo.asUriInfoMetadata();
- assertEquals(uriInfo, metadata);
-
- UriInfoResource resource = uriInfo.asUriInfoResource();
- assertEquals(uriInfo, resource);
-
- UriInfoService service = uriInfo.asUriInfoService();
- assertEquals(uriInfo, service);
-
- }
-
- @Test
- public void testEntityNames() {
- UriInfoImpl uriInfo = new UriInfoImpl();
- uriInfo.addEntitySetName("A");
- uriInfo.addEntitySetName("B");
-
- assertEquals("A", uriInfo.getEntitySetNames().get(0));
- assertEquals("B", uriInfo.getEntitySetNames().get(1));
-
- }
-
- @Test
- public void testResourceParts() {
- UriInfoImpl uriInfo = new UriInfoImpl();
-
- UriResourceActionImpl action = new UriResourceActionImpl();
- UriResourceEntitySetImpl entitySet0 = new UriResourceEntitySetImpl();
- UriResourceEntitySetImpl entitySet1 = new UriResourceEntitySetImpl();
-
- uriInfo.addResourcePart(action);
- uriInfo.addResourcePart(entitySet0);
-
- assertEquals(action, uriInfo.getUriResourceParts().get(0));
- assertEquals(entitySet0, uriInfo.getUriResourceParts().get(1));
-
- assertEquals(entitySet0, uriInfo.getLastResourcePart());
-
- uriInfo.addResourcePart(entitySet1);
- assertEquals(entitySet1, uriInfo.getLastResourcePart());
- }
-
- @Test
- public void testCustomQueryOption() {
- UriInfoImpl uriInfo = new UriInfoImpl();
-
- List<QueryOptionImpl> queryOptions = new ArrayList<QueryOptionImpl>();
-
- ExpandOptionImpl expand = new ExpandOptionImpl();
- FilterOptionImpl filter = new FilterOptionImpl();
- FormatOptionImpl format = new FormatOptionImpl();
- IdOptionImpl id = new IdOptionImpl();
- CountOptionImpl inlinecount = new CountOptionImpl();
- OrderByOptionImpl orderby = new OrderByOptionImpl();
- SearchOptionImpl search = new SearchOptionImpl();
- SelectOptionImpl select = new SelectOptionImpl();
- SkipOptionImpl skip = new SkipOptionImpl();
- SkipTokenOptionImpl skipToken = new SkipTokenOptionImpl();
- TopOptionImpl top = new TopOptionImpl();
- LevelsOptionImpl levels = new LevelsOptionImpl();
-
- CustomQueryOptionImpl customOption0 = new CustomQueryOptionImpl();
- customOption0.setText("A");
- CustomQueryOptionImpl customOption1 = new CustomQueryOptionImpl();
- customOption1.setText("B");
-
- QueryOptionImpl queryOption = new QueryOptionImpl();
-
- queryOptions.add(expand);
- queryOptions.add(filter);
- queryOptions.add(format);
- queryOptions.add(id);
- queryOptions.add(inlinecount);
- queryOptions.add(orderby);
- queryOptions.add(search);
- queryOptions.add(select);
- queryOptions.add(skip);
- queryOptions.add(skipToken);
- queryOptions.add(top);
- queryOptions.add(customOption0);
- queryOptions.add(customOption1);
- queryOptions.add(levels);// not stored
- queryOptions.add(queryOption);// not stored
- uriInfo.setQueryOptions(queryOptions);
-
- assertEquals(expand, uriInfo.getExpandOption());
- assertEquals(filter, uriInfo.getFilterOption());
- assertEquals(format, uriInfo.getFormatOption());
- assertEquals(id, uriInfo.getIdOption());
- assertEquals(inlinecount, uriInfo.getCountOption());
- assertEquals(orderby, uriInfo.getOrderByOption());
- assertEquals(search, uriInfo.getSearchOption());
- assertEquals(select, uriInfo.getSelectOption());
- assertEquals(skip, uriInfo.getSkipOption());
- assertEquals(skipToken, uriInfo.getSkipTokenOption());
- assertEquals(top, uriInfo.getTopOption());
-
- List<CustomQueryOption> customQueryOptions = uriInfo.getCustomQueryOptions();
- assertEquals(customOption0, customQueryOptions.get(0));
- assertEquals(customOption1, customQueryOptions.get(1));
- }
-
- @Test
- public void testFragment() {
- UriInfoImpl uriInfo = new UriInfoImpl();
- uriInfo.setFragment("F");
- assertEquals("F", uriInfo.getFragment());
- }
-
- @Test
- public void testEntityTypeCast() {
- UriInfoImpl uriInfo = new UriInfoImpl();
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
- assertNotNull(entityType);
-
- uriInfo.setEntityTypeCast(entityType);
- assertEquals(entityType, uriInfo.getEntityTypeCast());
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
deleted file mode 100644
index 61ca4ef..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmAction;
-import org.apache.olingo.commons.api.edm.EdmActionImport;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmFunction;
-import org.apache.olingo.commons.api.edm.EdmFunctionImport;
-import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.EdmProperty;
-import org.apache.olingo.commons.api.edm.EdmType;
-import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
-import org.apache.olingo.server.api.uri.UriResourceKind;
-import org.apache.olingo.server.core.edm.provider.EdmComplexTypeImpl;
-import org.apache.olingo.server.core.edm.provider.EdmEntitySetImpl;
-import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
-import org.apache.olingo.server.core.edm.provider.EdmSingletonImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.ExpressionImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
-import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
-import org.apache.olingo.server.ref.provider.ActionProvider;
-import org.apache.olingo.server.ref.provider.ComplexTypeProvider;
-import org.apache.olingo.server.ref.provider.EntityTypeProvider;
-import org.junit.Test;
-
-public class UriResourceImplTest {
-
- Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
-
- @Test
- public void testUriParameterImpl() {
- UriParameterImpl impl = new UriParameterImpl();
- ExpressionImpl expression = new LiteralImpl().setText("Expression");
-
- impl.setText("Text");
- impl.setName("A");
- impl.setAlias("@A");
- impl.setExpression(expression);
-
- assertEquals("Text", impl.getText());
- assertEquals("A", impl.getName());
- assertEquals("@A", impl.getAlias());
- assertEquals(expression, impl.getExression());
- }
-
- @Test
- public void testUriResourceActionImpl() {
- UriResourceActionImpl impl = new UriResourceActionImpl();
- assertEquals(UriResourceKind.action, impl.getKind());
- assertEquals("", impl.toString());
-
- // action
- EdmAction action = edm.getUnboundAction(ActionProvider.nameUARTETParam);
- impl.setAction(action);
- assertEquals(action, impl.getAction());
- assertEquals(ActionProvider.nameUARTETParam.getName(), impl.toString());
-
- // action import
- impl = new UriResourceActionImpl();
- EdmActionImport actionImport = edm.getEntityContainer(null).getActionImport("AIRTPrimParam");
- impl.setActionImport(actionImport);
- assertEquals(actionImport, impl.getActionImport());
- assertEquals(actionImport.getUnboundAction(), impl.getAction());
- assertEquals(false, impl.isCollection());
- assertEquals("AIRTPrimParam", impl.toString());
- assertEquals(actionImport.getUnboundAction().getReturnType().getType(), impl.getType());
- }
-
- @Test
- public void testUriResourceLambdaAllImpl() {
- UriResourceLambdaAllImpl impl = new UriResourceLambdaAllImpl();
- assertEquals(UriResourceKind.lambdaAll, impl.getKind());
-
- ExpressionImpl expression = new LiteralImpl().setText("Expression");
- impl.setExpression(expression);
- impl.setLamdaVariable("A");
-
- assertEquals(false, impl.isCollection());
- assertEquals(expression, impl.getExpression());
- assertEquals("A", impl.getLambdaVariable());
- assertEquals(EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean), impl.getType());
- assertEquals("all", impl.toString());
- }
-
- @Test
- public void testUriResourceLambdaAnyImpl() {
- UriResourceLambdaAnyImpl impl = new UriResourceLambdaAnyImpl();
- assertEquals(UriResourceKind.lambdaAny, impl.getKind());
-
- ExpressionImpl expression = new LiteralImpl().setText("Expression");
- impl.setExpression(expression);
- impl.setLamdaVariable("A");
-
- assertEquals(false, impl.isCollection());
- assertEquals(expression, impl.getExpression());
- assertEquals("A", impl.getLamdaVariable());
- assertEquals(EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean), impl.getType());
- assertEquals("any", impl.toString());
- }
-
- @Test
- public void testUriResourceComplexPropertyImpl() {
- UriResourceComplexPropertyImpl impl = new UriResourceComplexPropertyImpl();
- assertEquals(UriResourceKind.complexProperty, impl.getKind());
-
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
- EdmProperty property = (EdmProperty) entityType.getProperty("PropertyComplex");
- impl.setProperty(property);
-
- assertEquals(property, impl.getProperty());
- assertEquals(property.getName(), impl.toString());
- assertEquals(false, impl.isCollection());
- assertEquals(property.getType(), impl.getType());
- assertEquals(property.getType(), impl.getComplexType());
- impl.getComplexType();
-
- EdmComplexTypeImpl complexTypeImplType =
- (EdmComplexTypeImpl) edm.getComplexType(ComplexTypeProvider.nameCTBasePrimCompNav);
-
- impl.setTypeFilter(complexTypeImplType);
- assertEquals(complexTypeImplType, impl.getTypeFilter());
- assertEquals(complexTypeImplType, impl.getComplexTypeFilter());
- impl.getComplexTypeFilter();
-
- }
-
- @Test
- public void testUriResourcePrimitivePropertyImpl() {
- UriResourcePrimitivePropertyImpl impl = new UriResourcePrimitivePropertyImpl();
- assertEquals(UriResourceKind.primitiveProperty, impl.getKind());
-
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
- EdmProperty property = (EdmProperty) entityType.getProperty("PropertyInt16");
- impl.setProperty(property);
-
- assertEquals(property, impl.getProperty());
- assertEquals(property.getName(), impl.toString());
- assertEquals(false, impl.isCollection());
- assertEquals(property.getType(), impl.getType());
- }
-
- @Test
- public void testUriResourceCountImpl() {
- UriResourceCountImpl impl = new UriResourceCountImpl();
- assertEquals(UriResourceKind.count, impl.getKind());
- assertEquals("$count", impl.toString());
- }
-
- @Test
- public void testUriResourceEntitySetImpl() {
- UriResourceEntitySetImpl impl = new UriResourceEntitySetImpl();
- assertEquals(UriResourceKind.entitySet, impl.getKind());
-
- EdmEntitySetImpl entitySet = (EdmEntitySetImpl) edm.getEntityContainer(null).getEntitySet("ESAllPrim");
- impl.setEntitSet(entitySet);
-
- assertEquals("ESAllPrim", impl.toString());
- assertEquals(entitySet, impl.getEntitySet());
-
- assertEquals(entitySet.getEntityType(), impl.getType());
- assertEquals(entitySet.getEntityType(), impl.getEntityType());
- impl.getEntityType();
-
- // is Collection
- assertEquals(true, impl.isCollection());
- impl.setKeyPredicates(new ArrayList<UriParameterImpl>());
- assertEquals(false, impl.isCollection());
- }
-
- @Test
- public void testUriResourceFunctionImpl() {
- UriResourceFunctionImpl impl = new UriResourceFunctionImpl();
- assertEquals(UriResourceKind.function, impl.getKind());
- assertEquals("", impl.toString());
-
- // function
- EdmFunction function = (EdmFunction) edm.getEntityContainer(null).getFunctionImport("FINRTInt16")
- .getUnboundFunction(new ArrayList<String>());
- assertNotNull(function);
- impl.setFunction(function);
-
- assertEquals(function, impl.getFunction());
- assertEquals("UFNRTInt16", impl.toString());
- assertEquals(function.getReturnType().getType(), impl.getType());
- assertEquals(false, impl.isParameterListFilled());
-
- // function import
- impl = new UriResourceFunctionImpl();
- EdmFunctionImport functionImport = edm.getEntityContainer(null).getFunctionImport("FINRTInt16");
- impl.setFunctionImport(functionImport, new ArrayList<UriParameterImpl>());
- assertEquals(functionImport, impl.getFunctionImport());
- assertEquals("FINRTInt16", impl.toString());
-
- // function collection
- impl = new UriResourceFunctionImpl();
- functionImport = edm.getEntityContainer(null).getFunctionImport("FICRTESTwoKeyNavParam");
- assertNotNull(function);
- UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
- impl.setFunctionImport(functionImport, Arrays.asList(parameter));
- assertEquals("FICRTESTwoKeyNavParam", impl.toString());
-
- impl.setFunction(functionImport.getUnboundFunction(Arrays.asList("ParameterInt16")));
- assertEquals(true, impl.isCollection());
- impl.setKeyPredicates(new ArrayList<UriParameterImpl>());
- assertEquals(false, impl.isCollection());
-
- assertEquals(parameter, impl.getParameters().get(0));
- assertEquals(true, impl.isParameterListFilled());
- }
-
- @Test
- public void testUriResourceImplKeyPred() {
- class Mock extends UriResourceWithKeysImpl {
-
- EdmType type;
-
- public Mock() {
- super(UriResourceKind.action);
- }
-
- @Override
- public EdmType getType() {
- return type;
- }
-
- public Mock setType(final EdmType type) {
- this.type = type;
- return this;
- }
-
- @Override
- public boolean isCollection() {
- return false;
- }
-
- @Override
- public String toString() {
- return "mock";
- }
- }
-
- Mock impl = new Mock();
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
- EdmEntityType entityTypeBaseColl = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
- EdmEntityType entityTypeBaseEntry = edm.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
- impl.setType(entityType);
- assertEquals(entityType, impl.getType());
- assertEquals("mock", impl.toString(false));
- assertEquals("mock", impl.toString(true));
-
- // set both
- impl.setCollectionTypeFilter(entityTypeBaseColl);
- assertEquals(entityTypeBaseColl, impl.getTypeFilterOnCollection());
- assertEquals("mock", impl.toString(false));
- assertEquals("mock/com.sap.odata.test1.ETBaseTwoKeyNav", impl.toString(true));
- impl.setEntryTypeFilter(entityTypeBaseEntry);
- assertEquals(entityTypeBaseEntry, impl.getTypeFilterOnEntry());
- assertEquals("mock", impl.toString(false));
- assertEquals("mock/com.sap.odata.test1.ETBaseTwoKeyNav/()com.sap.odata.test1.ETTwoBaseTwoKeyNav",
- impl.toString(true));
-
- // set entry
- impl = new Mock();
- impl.setType(entityType);
- impl.setEntryTypeFilter(entityTypeBaseEntry);
- assertEquals(entityTypeBaseEntry, impl.getTypeFilterOnEntry());
- assertEquals("mock", impl.toString(false));
- assertEquals("mock/com.sap.odata.test1.ETTwoBaseTwoKeyNav", impl.toString(true));
-
- // set collection
- impl = new Mock();
- impl.setType(entityType);
- impl.setCollectionTypeFilter(entityTypeBaseColl);
- assertEquals(entityTypeBaseColl, impl.getTypeFilterOnCollection());
- assertEquals("mock", impl.toString(false));
- assertEquals("mock/com.sap.odata.test1.ETBaseTwoKeyNav", impl.toString(true));
-
- impl = new Mock();
- UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
- List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
- keyPredicates.add(parameter);
-
- impl.setKeyPredicates(keyPredicates);
- assertNotNull(null, impl.getKeyPredicates());
-
- }
-
- @Test
- public void testUriResourceImplTyped() {
- class Mock extends UriResourceTypedImpl {
-
- EdmType type;
-
- public Mock() {
- super(UriResourceKind.action);
- }
-
- @Override
- public EdmType getType() {
- return type;
- }
-
- @Override
- public boolean isCollection() {
- return false;
- }
-
- public Mock setType(final EdmType type) {
- this.type = type;
- return this;
- }
-
- @Override
- public String toString() {
- return "mock";
- }
-
- }
-
- Mock impl = new Mock();
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
- EdmEntityType entityTypeBaseColl = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
- edm.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
- impl.setType(entityType);
- assertEquals("mock", impl.toString());
- assertEquals("mock", impl.toString(true));
- assertEquals("mock", impl.toString(false));
-
- impl.setTypeFilter(entityTypeBaseColl);
- assertEquals(entityTypeBaseColl, impl.getTypeFilter());
- assertEquals("mock", impl.toString());
- assertEquals("mock/com.sap.odata.test1.ETBaseTwoKeyNav", impl.toString(true));
- assertEquals("mock", impl.toString(false));
- //
- }
-
- @Test
- public void testUriResourceItImpl() {
- UriResourceItImpl impl = new UriResourceItImpl();
- assertEquals(UriResourceKind.it, impl.getKind());
-
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
- assertEquals("$it", impl.toString());
-
- impl.setType(entityType);
- assertEquals(entityType, impl.getType());
-
- UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
- List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
- keyPredicates.add(parameter);
-
- assertEquals(false, impl.isCollection());
- impl.setCollection(true);
- assertEquals(true, impl.isCollection());
- impl.setKeyPredicates(keyPredicates);
- assertEquals(false, impl.isCollection());
- }
-
- @Test
- public void testUriResourceNavigationPropertyImpl() {
- UriResourceNavigationPropertyImpl impl = new UriResourceNavigationPropertyImpl();
- assertEquals(UriResourceKind.navigationProperty, impl.getKind());
-
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
- EdmNavigationProperty property = (EdmNavigationProperty) entityType.getProperty("NavPropertyETKeyNavMany");
- assertNotNull(property);
-
- impl.setNavigationProperty(property);
- assertEquals(property, impl.getProperty());
-
- assertEquals("NavPropertyETKeyNavMany", impl.toString());
- assertEquals(property.getType(), impl.getType());
-
- UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
- List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
- keyPredicates.add(parameter);
-
- assertEquals(true, impl.isCollection());
- impl.setKeyPredicates(keyPredicates);
- assertEquals(false, impl.isCollection());
- }
-
- @Test
- public void testUriResourceRefImpl() {
- UriResourceRefImpl impl = new UriResourceRefImpl();
- assertEquals(UriResourceKind.ref, impl.getKind());
- assertEquals("$ref", impl.toString());
- }
-
- @Test
- public void testUriResourceRootImpl() {
- UriResourceRootImpl impl = new UriResourceRootImpl();
- assertEquals(UriResourceKind.root, impl.getKind());
-
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
- assertEquals("$root", impl.toString());
-
- impl.setType(entityType);
- assertEquals(entityType, impl.getType());
-
- UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
- List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
- keyPredicates.add(parameter);
-
- assertEquals(false, impl.isCollection());
- impl.setCollection(true);
- assertEquals(true, impl.isCollection());
- impl.setKeyPredicates(keyPredicates);
- assertEquals(false, impl.isCollection());
- }
-
- @Test
- public void testUriResourceSingletonImpl() {
- UriResourceSingletonImpl impl = new UriResourceSingletonImpl();
- assertEquals(UriResourceKind.singleton, impl.getKind());
-
- EdmSingletonImpl singleton = (EdmSingletonImpl) edm.getEntityContainer(null).getSingleton("SINav");
- EdmEntityType entityTypeBaseColl = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
- impl.setSingleton(singleton);
-
- assertEquals("SINav", impl.toString());
- assertEquals(singleton, impl.getSingleton());
-
- assertEquals(singleton.getEntityType(), impl.getType());
- assertEquals(singleton.getEntityType(), impl.getEntityType());
- impl.getEntityType();
-
- impl.setTypeFilter(entityTypeBaseColl);
- assertEquals(entityTypeBaseColl, impl.getEntityTypeFilter());
-
- // is Collection
- assertEquals(false, impl.isCollection());
- }
-
- @Test
- public void testUriResourceValueImpl() {
- UriResourceValueImpl impl = new UriResourceValueImpl();
- assertEquals(UriResourceKind.value, impl.getKind());
- assertEquals("$value", impl.toString());
- }
-
- @Test
- public void testUriResourceLambdaVarImpl() {
- UriResourceLambdaVarImpl impl = new UriResourceLambdaVarImpl();
- assertEquals(UriResourceKind.lambdaVariable, impl.getKind());
-
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
- impl.setType(entityType);
- impl.setVariableText("A");
-
- assertEquals("A", impl.toString());
- assertEquals(entityType, impl.getType());
- assertEquals("A", impl.getVariableName());
- assertEquals(false, impl.isCollection());
- impl.setCollection(true);
- assertEquals(true, impl.isCollection());
- }
-
- @Test
- public void testUriResourceStartingTypeFilterImpl() {
- UriResourceStartingTypeFilterImpl impl = new UriResourceStartingTypeFilterImpl();
-
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
-
- impl.setType(entityType);
- assertEquals("com.sap.odata.test1.ETTwoKeyNav", impl.toString());
- assertEquals(entityType, impl.getType());
-
- UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
- List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
- keyPredicates.add(parameter);
-
- assertEquals(false, impl.isCollection());
- impl.setCollection(true);
- assertEquals(true, impl.isCollection());
- impl.setKeyPredicates(keyPredicates);
- assertEquals(false, impl.isCollection());
-
- }
-}
[16/31] [OLINGO-260] V3 proxy invoke
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Order.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Order.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Order.java
index 56ca048..2f399e4 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Order.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Order.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/OrderLine.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/OrderLine.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/OrderLine.java
index 5124fef..d0bb9ff 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/OrderLine.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/OrderLine.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PageView.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PageView.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PageView.java
index 6b49a3a..a2c9730 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PageView.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PageView.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Person.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Person.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Person.java
index 7afb903..ee88968 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Person.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Person.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PersonMetadata.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PersonMetadata.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PersonMetadata.java
index 35fe069..ac2d569 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PersonMetadata.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/PersonMetadata.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Product.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Product.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Product.java
index ce63ac6..6bda5af 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Product.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Product.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductDetail.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductDetail.java
index 4877ce4..e8ee8f0 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductDetail.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductDetail.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductPhoto.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductPhoto.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductPhoto.java
index 9c00c37..fd7acdc 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductPhoto.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductPhoto.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductReview.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductReview.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductReview.java
index 98dee31..e3f0cae 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductReview.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ProductReview.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/RSAToken.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/RSAToken.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/RSAToken.java
index 5d5c9b1..a97bfc9 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/RSAToken.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/RSAToken.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/package-info.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/package-info.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/package-info.java
index 09db110..132b14e 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/package-info.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/package-info.java
@@ -16,6 +16,5 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java
index e413f29..4c7e7df 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Aliases.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes.java
index c3c8ca6..fc7a89f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypesCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypesCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypesCollection.java
index 922fc0c..d192f52 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypesCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypesCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_Simple.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_Simple.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_Simple.java
index 2a58052..591f609 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_Simple.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_Simple.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_SimpleCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_SimpleCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_SimpleCollection.java
index c1f9517..5a7f81b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_SimpleCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialCollectionTypes_SimpleCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypes.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypes.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypes.java
index 500111d..3de845e 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypes.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypes.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypesCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypesCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypesCollection.java
index 6c89342..df8edbc 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypesCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AllSpatialTypesCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java
index 1b74f97..3681fab 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/AuditInfo.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java
index db9bb9c..e81db06 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java
index 4637c8b..e2a3618 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2Collection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2Collection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2Collection.java
index 706a202..1777b86 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2Collection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLine2Collection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLineCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLineCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLineCollection.java
index d39673c..d728be2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLineCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/BackOrderLineCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java
index d598cf9..b96f63b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Car.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CarCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CarCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CarCollection.java
index a8f8e06..5288113 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CarCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CarCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java
index 62cb22b..3738b8a 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexToCategory.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java
index 9270532..34c7896 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComplexWithAllPrimitiveTypes.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Computer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Computer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Computer.java
index f8b0bcb..60f8be8 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Computer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Computer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerCollection.java
index 5766948..745542c 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetail.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetail.java
index 2d5df3b..c7aa5b0 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetail.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetail.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetailCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetailCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetailCollection.java
index 1b0c246..940fd47 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetailCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ComputerDetailCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java
index 251f5ad..9a63635 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ConcurrencyInfo.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java
index 6d471b5..6f19aef 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContactDetails.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Contractor.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Contractor.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Contractor.java
index 7ebdd6c..c0a0e84 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Contractor.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Contractor.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContractorCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContractorCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContractorCollection.java
index 3322bdb..f9d2ac1 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContractorCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ContractorCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java
index db6bdff..78992d4 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Customer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerCollection.java
index 09f760f..87f44c2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfo.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfo.java
index 4051518..49d3998 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfo.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfo.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfoCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfoCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfoCollection.java
index a691210..c3cb026 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfoCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/CustomerInfoCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java
index f3d8733..4c803a6 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Dimensions.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java
index f9d6392..c903293 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProduct.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -358,6 +357,12 @@ public interface DiscontinuedProduct
+ @Override
+ Operations operations();
+
+ interface Operations extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product.Operations{
+
+ }
@Override
ComplexFactory factory();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProductCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProductCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProductCollection.java
index f1ed0f2..0feb751 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProductCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DiscontinuedProductCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Driver.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Driver.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Driver.java
index 9a4a583..51b1685 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Driver.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Driver.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DriverCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DriverCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DriverCollection.java
index f7ba14e..3673a0f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DriverCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/DriverCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Employee.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Employee.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Employee.java
index 7ecd7c4..7bca864 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Employee.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Employee.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/EmployeeCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/EmployeeCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/EmployeeCollection.java
index 76d4ee4..9c0c22f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/EmployeeCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/EmployeeCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLogin.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLogin.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLogin.java
index 482ba66..b5ae75b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLogin.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLogin.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLoginCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLoginCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLoginCollection.java
index 6f18a59..ab132b2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLoginCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LastLoginCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/License.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/License.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/License.java
index fb84e53..df9379e 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/License.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/License.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LicenseCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LicenseCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LicenseCollection.java
index 3d48053..c8cc61f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LicenseCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LicenseCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Login.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Login.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Login.java
index 1481f18..1837505 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Login.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Login.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LoginCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LoginCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LoginCollection.java
index 9c6031c..119e5e7 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LoginCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/LoginCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityType.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityType.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityType.java
index 175e2b0..1f23b42 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityType.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityType.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityTypeCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityTypeCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityTypeCollection.java
index 8981ccc..cc0b1c6 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityTypeCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MappedEntityTypeCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Message.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Message.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Message.java
index 9357035..fe01691 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Message.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Message.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachment.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachment.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachment.java
index 3f6f59b..6199fd4 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachment.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachment.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachmentCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachmentCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachmentCollection.java
index 67e7cd0..ea08cc0 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachmentCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageAttachmentCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageCollection.java
index cc4d726..713fa78 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java
index 03a3706..e626b61 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/MessageKey.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Order.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Order.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Order.java
index e4c1b24..d0bbe46 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Order.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Order.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderCollection.java
index 2c74b42..785f995 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java
index 8f4e882..c7451ad 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLine.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineCollection.java
index f099fb8..9be8a7d 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineKey.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineKey.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineKey.java
index 01ce42a..ab33ea2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineKey.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/OrderLineKey.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageView.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageView.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageView.java
index ffb6f23..dd00367 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageView.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageView.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageViewCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageViewCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageViewCollection.java
index 93fa4b8..ddfb436 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageViewCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PageViewCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Person.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Person.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Person.java
index 5227f1e..a00bcb2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Person.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Person.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonCollection.java
index be1a9c4..5505735 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadata.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadata.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadata.java
index 86032b4..07a23b5 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadata.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadata.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadataCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadataCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadataCollection.java
index e06f0e4..2e7e596 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadataCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/PersonMetadataCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java
index 9f92009..a5334d2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Phone.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java
index ab0271e..c3bfb85 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/Product.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductCollection.java
index 5c6d3c2..3ff5b2b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetail.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetail.java
index 4d34093..45b0ae4 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetail.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetail.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetailCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetailCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetailCollection.java
index 1320754..6045a0f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetailCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductDetailCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageView.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageView.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageView.java
index bbdab09..7f392ed 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageView.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageView.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
[08/31] git commit: [OLINGO-266] Merge remote-tracking branch
'origin/olingo-266-ref'
Posted by sk...@apache.org.
[OLINGO-266] Merge remote-tracking branch 'origin/olingo-266-ref'
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/330c5569
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/330c5569
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/330c5569
Branch: refs/heads/olingo-266-ref
Commit: 330c556995e21275830e23fd3eee54c398eded09
Parents: ed8e0e3 0d62d15
Author: Stephan Klevenz <st...@sap.com>
Authored: Mon May 12 14:51:07 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Mon May 12 14:51:07 2014 +0200
----------------------------------------------------------------------
fit/pom.xml | 53 +-
.../org/apache/olingo/fit/ref/PingITCase.java | 44 +
lib/pom.xml | 10 +-
lib/ref/pom.xml | 50 -
lib/server-api/pom.xml | 44 +-
.../apache/olingo/server/api/ODataHandler.java | 28 +
.../apache/olingo/server/api/ODataServer.java | 4 +
lib/server-core/pom.xml | 45 +-
.../olingo/server/core/ODataHandlerImpl.java | 81 +
.../olingo/server/core/ODataServerImpl.java | 9 +
.../server/core/servlet/ODataServlet.java | 86 -
.../serializer/json/ServiceDocumentTest.java | 133 -
.../serializer/xml/MetadataDocumentTest.java | 252 -
.../server/core/testutil/EdmTechProvider.java | 1976 -------
.../core/testutil/EdmTechTestProvider.java | 100 -
.../server/core/testutil/StringUtils.java | 52 -
.../testutil/techprovider/ActionProvider.java | 191 -
.../techprovider/ComplexTypeProvider.java | 175 -
.../techprovider/ContainerProvider.java | 361 --
.../testutil/techprovider/EdmTechProvider.java | 147 -
.../techprovider/EntityTypeProvider.java | 408 --
.../testutil/techprovider/EnumTypeProvider.java | 47 -
.../testutil/techprovider/FunctionProvider.java | 852 ---
.../testutil/techprovider/PropertyProvider.java | 590 --
.../testutil/techprovider/SchemaProvider.java | 250 -
.../techprovider/TypeDefinitionProvider.java | 30 -
.../olingo/server/core/uri/RawUriTest.java | 151 -
.../olingo/server/core/uri/UriInfoImplTest.java | 201 -
.../server/core/uri/UriResourceImplTest.java | 508 --
.../core/uri/antlr/TestFullResourcePath.java | 5110 ------------------
.../olingo/server/core/uri/antlr/TestLexer.java | 248 -
.../core/uri/antlr/TestUriParserImpl.java | 1144 ----
.../core/uri/queryoption/QueryOptionTest.java | 303 --
.../queryoption/expression/ExpressionTest.java | 239 -
.../core/uri/testutil/ExpandValidator.java | 230 -
.../core/uri/testutil/FilterTreeToText.java | 154 -
.../core/uri/testutil/FilterValidator.java | 534 --
.../core/uri/testutil/ParseTreeToText.java | 82 -
.../core/uri/testutil/ParserValidator.java | 162 -
.../core/uri/testutil/ParserWithLogging.java | 56 -
.../core/uri/testutil/ResourceValidator.java | 599 --
.../core/uri/testutil/TestErrorLogger.java | 105 -
.../core/uri/testutil/TestUriValidator.java | 258 -
.../server/core/uri/testutil/TestValidator.java | 23 -
.../core/uri/testutil/TokenValidator.java | 194 -
.../core/uri/testutil/UriLexerWithTrace.java | 85 -
.../core/uri/validator/UriValidatorTest.java | 378 --
.../src/test/resources/simplelogger.properties | 20 +
lib/server-ref/pom.xml | 83 +
.../olingo/server/ref/ReferenceServlet.java | 51 +
.../server/ref/provider/ActionProvider.java | 191 +
.../ref/provider/ComplexTypeProvider.java | 175 +
.../server/ref/provider/ContainerProvider.java | 361 ++
.../server/ref/provider/EdmTechProvider.java | 147 +
.../server/ref/provider/EntityTypeProvider.java | 408 ++
.../server/ref/provider/EnumTypeProvider.java | 47 +
.../server/ref/provider/FunctionProvider.java | 852 +++
.../server/ref/provider/PropertyProvider.java | 590 ++
.../server/ref/provider/SchemaProvider.java | 250 +
.../ref/provider/TypeDefinitionProvider.java | 30 +
.../src/main/resources/simplelogger.properties | 20 +
lib/server-ref/src/main/webapp/WEB-INF/web.xml | 42 +
lib/server-ref/src/main/webapp/index.html | 32 +
.../serializer/json/ServiceDocumentTest.java | 133 +
.../serializer/xml/MetadataDocumentTest.java | 254 +
.../olingo/server/core/uri/RawUriTest.java | 151 +
.../olingo/server/core/uri/UriInfoImplTest.java | 201 +
.../server/core/uri/UriResourceImplTest.java | 508 ++
.../core/uri/antlr/TestFullResourcePath.java | 5110 ++++++++++++++++++
.../olingo/server/core/uri/antlr/TestLexer.java | 248 +
.../core/uri/antlr/TestUriParserImpl.java | 1144 ++++
.../core/uri/queryoption/QueryOptionTest.java | 303 ++
.../queryoption/expression/ExpressionTest.java | 239 +
.../core/uri/testutil/EdmTechTestProvider.java | 100 +
.../core/uri/testutil/ExpandValidator.java | 230 +
.../core/uri/testutil/FilterTreeToText.java | 154 +
.../core/uri/testutil/FilterValidator.java | 534 ++
.../core/uri/testutil/ParseTreeToText.java | 82 +
.../core/uri/testutil/ParserValidator.java | 162 +
.../core/uri/testutil/ParserWithLogging.java | 56 +
.../core/uri/testutil/ResourceValidator.java | 599 ++
.../core/uri/testutil/TestErrorLogger.java | 105 +
.../core/uri/testutil/TestUriValidator.java | 258 +
.../server/core/uri/testutil/TestValidator.java | 23 +
.../core/uri/testutil/TokenValidator.java | 194 +
.../core/uri/testutil/UriLexerWithTrace.java | 85 +
.../core/uri/validator/UriValidatorTest.java | 378 ++
pom.xml | 2 +-
88 files changed, 14806 insertions(+), 16528 deletions(-)
----------------------------------------------------------------------
[17/31] git commit: [OLINGO-260] V3 proxy invoke
Posted by sk...@apache.org.
[OLINGO-260] V3 proxy invoke
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/389b554c
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/389b554c
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/389b554c
Branch: refs/heads/olingo-266-ref
Commit: 389b554c885f0bc62c982d5485b22dc516e3ebd3
Parents: 3af2c8c
Author: Francesco Chicchiriccò <--global>
Authored: Tue May 13 12:12:36 2014 +0200
Committer: Francesco Chicchiriccò <--global>
Committed: Tue May 13 12:12:36 2014 +0200
----------------------------------------------------------------------
.../commons/EntitySetInvocationHandler.java | 13 +-
.../commons/EntityTypeInvocationHandler.java | 20 +-
.../commons/OperationInvocationHandler.java | 21 +-
.../olingo/ext/proxy/context/EntityContext.java | 12 +-
.../olingo/ext/proxy/context/EntityUUID.java | 67 +++---
.../org/apache/olingo/fit/AbstractServices.java | 241 ++++++++++++++-----
.../olingo/fit/proxy/v3/AbstractTest.java | 150 ------------
.../olingo/fit/proxy/v3/AbstractTestITCase.java | 150 ++++++++++++
.../fit/proxy/v3/EntityCreateTestITCase.java | 17 +-
.../fit/proxy/v3/EntityRetrieveTestITCase.java | 2 +-
.../fit/proxy/v3/EntitySetTestITCase.java | 2 +-
.../olingo/fit/proxy/v3/InvokeTestITCase.java | 232 ++++++++++++++++++
.../AllGeoCollectionTypesSet.java | 1 -
.../astoriadefaultservice/AllGeoTypesSet.java | 1 -
.../services/astoriadefaultservice/Car.java | 1 -
.../astoriadefaultservice/Computer.java | 1 -
.../astoriadefaultservice/ComputerDetail.java | 1 -
.../astoriadefaultservice/Customer.java | 1 -
.../astoriadefaultservice/CustomerInfo.java | 1 -
.../astoriadefaultservice/DefaultContainer.java | 1 -
.../services/astoriadefaultservice/Driver.java | 1 -
.../astoriadefaultservice/LastLogin.java | 1 -
.../services/astoriadefaultservice/License.java | 1 -
.../services/astoriadefaultservice/Login.java | 1 -
.../astoriadefaultservice/MappedEntityType.java | 1 -
.../services/astoriadefaultservice/Message.java | 1 -
.../MessageAttachment.java | 1 -
.../services/astoriadefaultservice/Order.java | 1 -
.../astoriadefaultservice/OrderLine.java | 1 -
.../astoriadefaultservice/PageView.java | 1 -
.../services/astoriadefaultservice/Person.java | 1 -
.../astoriadefaultservice/PersonMetadata.java | 1 -
.../services/astoriadefaultservice/Product.java | 1 -
.../astoriadefaultservice/ProductDetail.java | 1 -
.../astoriadefaultservice/ProductPhoto.java | 1 -
.../astoriadefaultservice/ProductReview.java | 1 -
.../astoriadefaultservice/RSAToken.java | 1 -
.../astoriadefaultservice/package-info.java | 1 -
.../astoriadefaultservice/types/Aliases.java | 1 -
.../types/AllSpatialCollectionTypes.java | 1 -
.../AllSpatialCollectionTypesCollection.java | 1 -
.../types/AllSpatialCollectionTypes_Simple.java | 1 -
...SpatialCollectionTypes_SimpleCollection.java | 1 -
.../types/AllSpatialTypes.java | 1 -
.../types/AllSpatialTypesCollection.java | 1 -
.../astoriadefaultservice/types/AuditInfo.java | 1 -
.../types/BackOrderLine.java | 1 -
.../types/BackOrderLine2.java | 1 -
.../types/BackOrderLine2Collection.java | 1 -
.../types/BackOrderLineCollection.java | 1 -
.../astoriadefaultservice/types/Car.java | 1 -
.../types/CarCollection.java | 1 -
.../types/ComplexToCategory.java | 1 -
.../types/ComplexWithAllPrimitiveTypes.java | 1 -
.../astoriadefaultservice/types/Computer.java | 1 -
.../types/ComputerCollection.java | 1 -
.../types/ComputerDetail.java | 1 -
.../types/ComputerDetailCollection.java | 1 -
.../types/ConcurrencyInfo.java | 1 -
.../types/ContactDetails.java | 1 -
.../astoriadefaultservice/types/Contractor.java | 1 -
.../types/ContractorCollection.java | 1 -
.../astoriadefaultservice/types/Customer.java | 1 -
.../types/CustomerCollection.java | 1 -
.../types/CustomerInfo.java | 1 -
.../types/CustomerInfoCollection.java | 1 -
.../astoriadefaultservice/types/Dimensions.java | 1 -
.../types/DiscontinuedProduct.java | 7 +-
.../types/DiscontinuedProductCollection.java | 1 -
.../astoriadefaultservice/types/Driver.java | 1 -
.../types/DriverCollection.java | 1 -
.../astoriadefaultservice/types/Employee.java | 1 -
.../types/EmployeeCollection.java | 1 -
.../astoriadefaultservice/types/LastLogin.java | 1 -
.../types/LastLoginCollection.java | 1 -
.../astoriadefaultservice/types/License.java | 1 -
.../types/LicenseCollection.java | 1 -
.../astoriadefaultservice/types/Login.java | 1 -
.../types/LoginCollection.java | 1 -
.../types/MappedEntityType.java | 1 -
.../types/MappedEntityTypeCollection.java | 1 -
.../astoriadefaultservice/types/Message.java | 1 -
.../types/MessageAttachment.java | 1 -
.../types/MessageAttachmentCollection.java | 1 -
.../types/MessageCollection.java | 1 -
.../astoriadefaultservice/types/MessageKey.java | 1 -
.../astoriadefaultservice/types/Order.java | 1 -
.../types/OrderCollection.java | 1 -
.../astoriadefaultservice/types/OrderLine.java | 1 -
.../types/OrderLineCollection.java | 1 -
.../types/OrderLineKey.java | 1 -
.../astoriadefaultservice/types/PageView.java | 1 -
.../types/PageViewCollection.java | 1 -
.../astoriadefaultservice/types/Person.java | 1 -
.../types/PersonCollection.java | 1 -
.../types/PersonMetadata.java | 1 -
.../types/PersonMetadataCollection.java | 1 -
.../astoriadefaultservice/types/Phone.java | 1 -
.../astoriadefaultservice/types/Product.java | 1 -
.../types/ProductCollection.java | 1 -
.../types/ProductDetail.java | 1 -
.../types/ProductDetailCollection.java | 1 -
.../types/ProductPageView.java | 1 -
.../types/ProductPageViewCollection.java | 1 -
.../types/ProductPhoto.java | 1 -
.../types/ProductPhotoCollection.java | 1 -
.../types/ProductPhotoKey.java | 1 -
.../types/ProductReview.java | 1 -
.../types/ProductReviewCollection.java | 1 -
.../types/ProductReviewKey.java | 1 -
.../astoriadefaultservice/types/RSAToken.java | 1 -
.../types/RSATokenCollection.java | 1 -
.../types/SpecialEmployee.java | 7 +-
.../types/SpecialEmployeeCollection.java | 1 -
.../types/package-info.java | 1 -
.../olingo/fit/proxy/v4/AbstractTest.java | 81 -------
.../olingo/fit/proxy/v4/AbstractTestITCase.java | 81 +++++++
.../fit/proxy/v4/EntityRetrieveTestITCase.java | 2 +-
.../fit/proxy/v4/EntitySetTestITCase.java | 2 +-
.../services/odatawcfservice/Accounts.java | 1 -
.../odata/services/odatawcfservice/Boss.java | 1 -
.../odata/services/odatawcfservice/Company.java | 1 -
.../services/odatawcfservice/Customers.java | 1 -
.../odatawcfservice/DefaultStoredPI.java | 1 -
.../services/odatawcfservice/Departments.java | 1 -
.../services/odatawcfservice/Employees.java | 1 -
.../odatawcfservice/InMemoryEntities.java | 10 +-
.../services/odatawcfservice/LabourUnion.java | 1 -
.../services/odatawcfservice/OrderDetails.java | 1 -
.../odata/services/odatawcfservice/Orders.java | 1 -
.../odata/services/odatawcfservice/People.java | 1 -
.../odatawcfservice/ProductDetails.java | 1 -
.../odatawcfservice/ProductReviews.java | 1 -
.../services/odatawcfservice/Products.java | 1 -
.../services/odatawcfservice/PublicCompany.java | 1 -
.../services/odatawcfservice/StoredPIs.java | 1 -
.../odatawcfservice/SubscriptionTemplates.java | 1 -
.../services/odatawcfservice/VipCustomer.java | 1 -
.../services/odatawcfservice/package-info.java | 1 -
.../odatawcfservice/types/AccessLevel.java | 1 -
.../services/odatawcfservice/types/Account.java | 1 -
.../types/AccountCollection.java | 1 -
.../odatawcfservice/types/AccountInfo.java | 1 -
.../services/odatawcfservice/types/Address.java | 1 -
.../services/odatawcfservice/types/Asset.java | 1 -
.../odatawcfservice/types/AssetCollection.java | 1 -
.../services/odatawcfservice/types/Club.java | 1 -
.../odatawcfservice/types/ClubCollection.java | 1 -
.../services/odatawcfservice/types/Color.java | 1 -
.../services/odatawcfservice/types/Company.java | 5 +-
.../odatawcfservice/types/CompanyAddress.java | 11 -
.../odatawcfservice/types/CompanyCategory.java | 1 -
.../types/CompanyCollection.java | 1 -
.../odatawcfservice/types/CreditCardPI.java | 1 -
.../types/CreditCardPICollection.java | 1 -
.../odatawcfservice/types/CreditRecord.java | 1 -
.../types/CreditRecordCollection.java | 1 -
.../odatawcfservice/types/Customer.java | 7 +-
.../types/CustomerCollection.java | 1 -
.../odatawcfservice/types/Department.java | 24 +-
.../types/DepartmentCollection.java | 1 -
.../odatawcfservice/types/Employee.java | 7 +-
.../types/EmployeeCollection.java | 1 -
.../odatawcfservice/types/GiftCard.java | 24 +-
.../types/GiftCardCollection.java | 1 -
.../odatawcfservice/types/HomeAddress.java | 1 -
.../odatawcfservice/types/LabourUnion.java | 1 -
.../types/LabourUnionCollection.java | 1 -
.../services/odatawcfservice/types/Order.java | 1 -
.../odatawcfservice/types/OrderCollection.java | 1 -
.../odatawcfservice/types/OrderDetail.java | 1 -
.../types/OrderDetailCollection.java | 1 -
.../odatawcfservice/types/OrderDetailKey.java | 1 -
.../types/PaymentInstrument.java | 1 -
.../types/PaymentInstrumentCollection.java | 1 -
.../services/odatawcfservice/types/Person.java | 1 -
.../odatawcfservice/types/PersonCollection.java | 1 -
.../services/odatawcfservice/types/Product.java | 1 -
.../types/ProductCollection.java | 1 -
.../odatawcfservice/types/ProductDetail.java | 1 -
.../types/ProductDetailCollection.java | 1 -
.../odatawcfservice/types/ProductDetailKey.java | 1 -
.../odatawcfservice/types/ProductReview.java | 1 -
.../types/ProductReviewCollection.java | 1 -
.../odatawcfservice/types/ProductReviewKey.java | 1 -
.../odatawcfservice/types/PublicCompany.java | 9 +-
.../types/PublicCompanyCollection.java | 1 -
.../odatawcfservice/types/Statement.java | 1 -
.../types/StatementCollection.java | 1 -
.../odatawcfservice/types/StoredPI.java | 1 -
.../types/StoredPICollection.java | 1 -
.../odatawcfservice/types/Subscription.java | 1 -
.../types/SubscriptionCollection.java | 1 -
.../odatawcfservice/types/package-info.java | 1 -
.../commons/core/data/JSONEntitySerializer.java | 12 +-
195 files changed, 805 insertions(+), 579 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
index 9b14fd1..5c8380d 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntitySetInvocationHandler.java
@@ -172,7 +172,7 @@ class EntitySetInvocationHandler<C extends CommonEdmEnabledODataClient<?>, T ext
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {reference},
new EntityCollectionInvocationHandler<T, C>(
- containerHandler, new ArrayList<T>(), typeRef, containerHandler.getEntityContainerName()));
+ containerHandler, new ArrayList<T>(), typeRef, containerHandler.getEntityContainerName()));
}
@Override
@@ -232,12 +232,7 @@ class EntitySetInvocationHandler<C extends CommonEdmEnabledODataClient<?>, T ext
throw new IllegalArgumentException("Null key");
}
- final EntityUUID uuid = new EntityUUID(
- containerHandler.getEntityContainerName(),
- entitySetName,
- new FullQualifiedName(ClassUtils.getNamespace(typeRef), ClassUtils.getEntityTypeName(typeRef)),
- key);
-
+ final EntityUUID uuid = new EntityUUID(containerHandler.getEntityContainerName(), entitySetName, typeRef, key);
LOG.debug("Ask for '{}({})'", typeRef.getSimpleName(), key);
EntityTypeInvocationHandler<?> handler =
@@ -319,7 +314,7 @@ class EntitySetInvocationHandler<C extends CommonEdmEnabledODataClient<?>, T ext
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {collTypeRef},
new EntityCollectionInvocationHandler<S, C>(
- containerHandler, items, typeRef, containerHandler.getEntityContainerName(), entitySetURI));
+ containerHandler, items, typeRef, containerHandler.getEntityContainerName(), entitySetURI));
}
@Override
@@ -365,7 +360,7 @@ class EntitySetInvocationHandler<C extends CommonEdmEnabledODataClient<?>, T ext
EntityTypeInvocationHandler<?> entity = entityContext.getEntity(new EntityUUID(
containerHandler.getEntityContainerName(),
entitySetName,
- new FullQualifiedName(ClassUtils.getNamespace(typeRef), ClassUtils.getEntityTypeName(typeRef)),
+ typeRef,
key));
if (entity == null) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
index 3a825e8..3dfdf38 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
@@ -89,8 +89,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
final Class<?> typeRef,
final EntityContainerInvocationHandler<?> containerHandler) {
- return new EntityTypeInvocationHandler(
- entity, entitySetName, typeRef, containerHandler);
+ return new EntityTypeInvocationHandler(entity, entitySetName, typeRef, containerHandler);
}
private EntityTypeInvocationHandler(
@@ -107,10 +106,8 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
this.uuid = new EntityUUID(
containerHandler.getEntityContainerName(),
entitySetName,
- entity.getTypeName(),
+ typeRef,
CoreUtils.getKey(client, typeRef, entity));
-
- this.stream = null;
}
public void setEntity(final CommonODataEntity entity) {
@@ -120,7 +117,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
this.uuid = new EntityUUID(
getUUID().getContainerName(),
getUUID().getEntitySetName(),
- getUUID().getName(),
+ getUUID().getType(),
CoreUtils.getKey(client, typeRef, entity));
this.propertyChanges.clear();
@@ -128,7 +125,6 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
this.streamedPropertyChanges.clear();
this.propertiesTag = 0;
this.linksTag = 0;
- this.stream = null;
}
public EntityUUID getUUID() {
@@ -193,9 +189,9 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
@Override
protected Object getPropertyValue(final String name, final Type type) {
try {
- final Object res;
final CommonODataProperty property = getEntity().getProperty(name);
+ Object res;
if (propertyChanges.containsKey(name)) {
res = propertyChanges.get(name);
} else if (property == null) {
@@ -205,7 +201,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {(Class<?>) type},
ComplexTypeInvocationHandler.getInstance(
- client, property.getValue().asComplex(), (Class<?>) type, this));
+ client, property.getValue().asComplex(), (Class<?>) type, this));
addPropertyChanges(name, res);
} else if (property.hasCollectionValue()) {
@@ -224,7 +220,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
Thread.currentThread().getContextClassLoader(),
new Class<?>[] {collItemClass},
ComplexTypeInvocationHandler.getInstance(
- client, value.asComplex(), collItemClass, this));
+ client, value.asComplex(), collItemClass, this));
collection.add(collItem);
}
@@ -279,8 +275,8 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
if (property.type().equalsIgnoreCase(EdmPrimitiveTypeKind.Stream.toString())) {
setStreamedProperty(property, (InputStream) value);
} else {
- final Object toBeAdded;
-
+
+ Object toBeAdded;
if (value == null) {
toBeAdded = null;
} else if (Collection.class.isAssignableFrom(value.getClass())) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
index 0f61208..fd3aa89 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/OperationInvocationHandler.java
@@ -136,7 +136,8 @@ class OperationInvocationHandler<C extends CommonEdmEnabledODataClient<?>> exten
}
if (parameters.size() <= i) {
- throw new IllegalArgumentException("Paramter " + i + " is not annotated as @Parameter");
+ throw new IllegalArgumentException(
+ "Paramter " + i + " is not annotated as @" + Parameter.class.getSimpleName());
}
}
}
@@ -176,21 +177,20 @@ class OperationInvocationHandler<C extends CommonEdmEnabledODataClient<?>> exten
return new AbstractMap.SimpleEntry<URI, EdmOperation>(uriBuilder.build(), edmOperation);
}
- private Map.Entry<URI, EdmOperation> getBoundOperation(
- final Operation operation, final List<String> parameterNames) {
+ private Map.Entry<URI, EdmOperation> getBoundOperation(final Operation operation, final List<String> parameterNames) {
final CommonODataEntity entity = ((EntityTypeInvocationHandler<?>) target).getEntity();
- final ODataOperation boundOp =
- entity.getOperation(new FullQualifiedName(targetFQN.getNamespace(), operation.name()).toString());
-
- final EdmOperation edmOperation;
+ final ODataOperation boundOp = entity.getOperation(operation.name());
+ EdmOperation edmOperation;
if (operation.type() == OperationType.FUNCTION) {
edmOperation = client.getCachedEdm().getBoundFunction(
- new FullQualifiedName(boundOp.getTitle()), entity.getTypeName(), false, parameterNames);
+ new FullQualifiedName(targetFQN.getNamespace(), boundOp.getTitle()),
+ entity.getTypeName(), false, parameterNames);
} else {
edmOperation = client.getCachedEdm().getBoundAction(
- new FullQualifiedName(boundOp.getTitle()), entity.getTypeName(), false);
+ new FullQualifiedName(targetFQN.getNamespace(), boundOp.getTitle()),
+ entity.getTypeName(), false);
}
return new AbstractMap.SimpleEntry<URI, EdmOperation>(boundOp.getTarget(), edmOperation);
@@ -213,6 +213,7 @@ class OperationInvocationHandler<C extends CommonEdmEnabledODataClient<?>> exten
}
return new AbstractMap.SimpleEntry<URI, EdmOperation>(
- ((EntityCollectionInvocationHandler<?, C>) target).getURI(), edmOperation);
+ URI.create(((EntityCollectionInvocationHandler<?, C>) target).getURI().toASCIIString()
+ + "/" + edmOperation.getName()), edmOperation);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java
index 753f33e..7ca1a76 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityContext.java
@@ -33,7 +33,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Attached entities with not null key.
- * <p>
+ * <br/>
* This map have to be used to search for entities by key.
*/
private final Map<EntityUUID, EntityTypeInvocationHandler<?>> searchableEntities =
@@ -41,7 +41,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* All attached entities (new entities included).
- * <p>
+ * <br/>
* Attachment order will be maintained.
*/
private final Map<EntityTypeInvocationHandler<?>, AttachedEntityStatus> allAttachedEntities =
@@ -49,7 +49,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Attaches an entity with status <tt>NEW</tt>.
- * <p>
+ * <br/>
* Use this method to attach a new created entity.
*
* @see AttachedEntityStatus
@@ -64,7 +64,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Attaches an existing entity with status <tt>ATTACHED</tt>.
- * <p>
+ * <br/>
* Use this method to attach an existing entity.
*
* @see AttachedEntityStatus
@@ -76,7 +76,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Attaches an entity with specified status.
- * <p>
+ * <br/>
* Use this method to attach an existing entity.
*
* @see AttachedEntityStatus
@@ -109,7 +109,7 @@ public class EntityContext implements Iterable<AttachedEntity> {
/**
* Detaches all attached entities.
- * <p>
+ * <br/>
* Use this method to clears the entity context.
*/
public void detachAll() {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java
index de7a6f1..b79dbb4 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/context/EntityUUID.java
@@ -19,42 +19,45 @@
package org.apache.olingo.ext.proxy.context;
import java.io.Serializable;
+import org.apache.commons.lang3.ArrayUtils;
+import org.apache.commons.lang3.ClassUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
public class EntityUUID implements Serializable {
private static final long serialVersionUID = 4855025769803086495L;
- // needed by equals and hashcode
- private final int tempKey;
-
private final String containerName;
private final String entitySetName;
- private final FullQualifiedName name;
-
private final Object key;
- public EntityUUID(
- final String containerName,
- final String entitySetName,
- final FullQualifiedName name) {
- this(containerName, entitySetName, name, null);
+ private Class<?> type;
+
+ public EntityUUID(final String containerName, final String entitySetName, final Class<?> type) {
+ this(containerName, entitySetName, type, null);
}
- public EntityUUID(
- final String containerName,
- final String entitySetName,
- final FullQualifiedName name,
- final Object key) {
+ public EntityUUID(final String containerName, final String entitySetName, final Class<?> type, final Object key) {
this.containerName = containerName;
this.entitySetName = entitySetName;
- this.name = name;
this.key = key;
- this.tempKey = (int) (Math.random() * 1000000);
+
+ if (type == null || !Serializable.class.isAssignableFrom(type)) {
+ throw new IllegalArgumentException("Invalid Entity type class: " + type);
+ }
+ for (Class<?> clazz : ClassUtils.hierarchy(type, ClassUtils.Interfaces.INCLUDE)) {
+ if (this.type == null
+ && (clazz.getInterfaces().length == 0
+ || ArrayUtils.contains(clazz.getInterfaces(), Serializable.class))) {
+
+ this.type = clazz;
+ }
+ }
}
public String getContainerName() {
@@ -65,38 +68,26 @@ public class EntityUUID implements Serializable {
return entitySetName;
}
- public FullQualifiedName getName() {
- return name;
- }
-
public Object getKey() {
return key;
}
- /**
- * {@inheritDoc }
- */
+ public Class<?> getType() {
+ return type;
+ }
+
@Override
- public boolean equals(Object obj) {
- return key == null
- ? EqualsBuilder.reflectionEquals(this, obj)
- : EqualsBuilder.reflectionEquals(this, obj, "tempKey");
+ public boolean equals(final Object obj) {
+ return EqualsBuilder.reflectionEquals(this, obj);
}
- /**
- * {@inheritDoc }
- */
@Override
public int hashCode() {
- return HashCodeBuilder.reflectionHashCode(this, "tempKey");
+ return HashCodeBuilder.reflectionHashCode(this);
}
- /**
- * {@inheritDoc }
- */
@Override
public String toString() {
- return name.getNamespace() + ":" + containerName + ":" + entitySetName + ":" + name.getName()
- + "(" + (key == null ? null : key.toString()) + ")";
+ return ToStringBuilder.reflectionToString(this, ToStringStyle.SIMPLE_STYLE);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
index 948bcd9..0b4bb4a 100644
--- a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
+++ b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
@@ -420,7 +420,7 @@ public abstract class AbstractServices {
} else {
final ResWrap<JSONEntityImpl> jcont = mapper.readValue(IOUtils.toInputStream(changes, Constants.ENCODING),
new TypeReference<JSONEntityImpl>() {
- });
+ });
entryChanges = dataBinder.toAtomEntity(jcont.getPayload());
}
@@ -607,8 +607,8 @@ public abstract class AbstractServices {
} else {
final ResWrap<JSONEntityImpl> jcontainer =
mapper.readValue(IOUtils.toInputStream(entity, Constants.ENCODING),
- new TypeReference<JSONEntityImpl>() {
- });
+ new TypeReference<JSONEntityImpl>() {
+ });
entry = dataBinder.toAtomEntity(jcontainer.getPayload());
@@ -635,7 +635,7 @@ public abstract class AbstractServices {
ResWrap<AtomEntityImpl> result = atomDeserializer.read(serialization, AtomEntityImpl.class);
result = new ResWrap<AtomEntityImpl>(
URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX)
- + entitySetName + Constants.get(version, ConstantKey.ODATA_METADATA_ENTITY_SUFFIX)),
+ + entitySetName + Constants.get(version, ConstantKey.ODATA_METADATA_ENTITY_SUFFIX)),
null, result.getPayload());
final String path = Commons.getEntityBasePath(entitySetName, entityKey);
@@ -686,25 +686,19 @@ public abstract class AbstractServices {
throw new UnsupportedMediaTypeException("Unsupported media type");
}
- final Map.Entry<String, InputStream> entityInfo = utils.getValue().readEntity("Person", entityId, utils.getKey());
-
- InputStream entity = entityInfo.getValue();
try {
- final ByteArrayOutputStream copy = new ByteArrayOutputStream();
- IOUtils.copy(entity, copy);
- IOUtils.closeQuietly(entity);
+ final Map.Entry<String, InputStream> entityInfo = xml.readEntity("Person", entityId, Accept.ATOM);
- final String newContent = new String(copy.toByteArray(), "UTF-8").
- replaceAll("\"Salary\":[0-9]*,", "\"Salary\":0,").
- replaceAll("\"Title\":\".*\"", "\"Title\":\"[Sacked]\"").
- replaceAll("\\<d:Salary m:type=\"Edm.Int32\"\\>.*\\</d:Salary\\>",
- "<d:Salary m:type=\"Edm.Int32\">0</d:Salary>").
- replaceAll("\\<d:Title\\>.*\\</d:Title\\>", "<d:Title>[Sacked]</d:Title>");
+ final InputStream entity = entityInfo.getValue();
+ final ResWrap<AtomEntityImpl> container = atomDeserializer.read(entity, AtomEntityImpl.class);
+
+ container.getPayload().getProperty("Salary").setValue(new PrimitiveValueImpl("0"));
+ container.getPayload().getProperty("Title").setValue(new PrimitiveValueImpl("[Sacked]"));
final FSManager fsManager = FSManager.instance(version);
- fsManager.putInMemory(IOUtils.toInputStream(newContent, Constants.ENCODING),
+ fsManager.putInMemory(xml.writeEntity(Accept.ATOM, container),
fsManager.getAbsolutePath(Commons.getEntityBasePath("Person", entityId) + Constants.get(version,
- ConstantKey.ENTITY), utils.getKey()));
+ ConstantKey.ENTITY), Accept.ATOM));
return utils.getValue().createResponse(null, null, null, utils.getKey(), Response.Status.NO_CONTENT);
} catch (Exception e) {
@@ -756,9 +750,9 @@ public abstract class AbstractServices {
final Long newSalary = Long.valueOf(salaryMatcher.group(1)) + n;
newContent = newContent.
replaceAll("\"Salary\":" + salaryMatcher.group(1) + ",",
- "\"Salary\":" + newSalary + ",").
+ "\"Salary\":" + newSalary + ",").
replaceAll("\\<d:Salary m:type=\"Edm.Int32\"\\>" + salaryMatcher.group(1) + "</d:Salary\\>",
- "<d:Salary m:type=\"Edm.Int32\">" + newSalary + "</d:Salary>");
+ "<d:Salary m:type=\"Edm.Int32\">" + newSalary + "</d:Salary>");
}
FSManager.instance(version).putInMemory(IOUtils.toInputStream(newContent, Constants.ENCODING),
@@ -770,6 +764,77 @@ public abstract class AbstractServices {
}
}
+ @POST
+ @Path("/Product({entityId})/ChangeProductDimensions")
+ public Response actionChangeProductDimensions(
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
+ final String argument) {
+
+ final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
+
+ if (utils.getKey() == Accept.XML || utils.getKey() == Accept.TEXT) {
+ throw new UnsupportedMediaTypeException("Unsupported media type");
+ }
+
+ try {
+ final Map.Entry<String, InputStream> entityInfo = xml.readEntity("Product", entityId, Accept.ATOM);
+
+ final InputStream entity = entityInfo.getValue();
+ final ResWrap<AtomEntityImpl> container = atomDeserializer.read(entity, AtomEntityImpl.class);
+
+ final Entity param = xml.readEntity(utils.getKey(), IOUtils.toInputStream(argument, Constants.ENCODING));
+
+ container.getPayload().getProperty("Dimensions").setValue(param.getProperty("dimensions").getValue());
+
+ final FSManager fsManager = FSManager.instance(version);
+ fsManager.putInMemory(xml.writeEntity(Accept.ATOM, container),
+ fsManager.getAbsolutePath(Commons.getEntityBasePath("Product", entityId) + Constants.get(version,
+ ConstantKey.ENTITY), Accept.ATOM));
+
+ return utils.getValue().createResponse(null, null, null, utils.getKey(), Response.Status.NO_CONTENT);
+ } catch (Exception e) {
+ return xml.createFaultResponse(accept, e);
+ }
+ }
+
+ @POST
+ @Path("/ComputerDetail({entityId})/ResetComputerDetailsSpecifications")
+ public Response actionResetComputerDetailsSpecifications(
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format,
+ final String argument) {
+
+ final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
+
+ if (utils.getKey() == Accept.XML || utils.getKey() == Accept.TEXT) {
+ throw new UnsupportedMediaTypeException("Unsupported media type");
+ }
+
+ try {
+ final Map.Entry<String, InputStream> entityInfo = xml.readEntity("ComputerDetail", entityId, Accept.ATOM);
+
+ final InputStream entity = entityInfo.getValue();
+ final ResWrap<AtomEntityImpl> container = atomDeserializer.read(entity, AtomEntityImpl.class);
+
+ final Entity param = xml.readEntity(utils.getKey(), IOUtils.toInputStream(argument, Constants.ENCODING));
+
+ container.getPayload().getProperty("SpecificationsBag").setValue(param.getProperty("specifications").getValue());
+ container.getPayload().getProperty("PurchaseDate").setValue(param.getProperty("purchaseTime").getValue());
+
+ final FSManager fsManager = FSManager.instance(version);
+ fsManager.putInMemory(xml.writeEntity(Accept.ATOM, container),
+ fsManager.getAbsolutePath(Commons.getEntityBasePath("ComputerDetail", entityId) + Constants.get(version,
+ ConstantKey.ENTITY), Accept.ATOM));
+
+ return utils.getValue().createResponse(null, null, null, utils.getKey(), Response.Status.NO_CONTENT);
+ } catch (Exception e) {
+ return xml.createFaultResponse(accept, e);
+ }
+ }
+
/**
* Retrieve entities from the given entity set and the given type.
*
@@ -907,7 +972,7 @@ public abstract class AbstractServices {
} else {
mapper.writeValue(
writer, new JSONFeedContainer(container.getContextURL(), container.getMetadataETag(),
- dataBinder.toJSONEntitySet(container.getPayload())));
+ dataBinder.toJSONEntitySet(container.getPayload())));
}
return xml.createResponse(
@@ -923,17 +988,9 @@ public abstract class AbstractServices {
protected abstract void setInlineCount(final EntitySet feed, final String count);
- /**
- * Retrieve entity with key as segment.
- *
- * @param accept Accept header.
- * @param entityId entity id.
- * @param format format query option.
- * @return entity.
- */
@GET
@Path("/Person({entityId})")
- public Response getEntity(
+ public Response getPerson(
@Context UriInfo uriInfo,
@HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
@PathParam("entityId") final String entityId,
@@ -941,28 +998,98 @@ public abstract class AbstractServices {
final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
- if (utils.getKey() == Accept.XML || utils.getKey() == Accept.TEXT) {
- throw new UnsupportedMediaTypeException("Unsupported media type");
+ final Response internal = getEntityInternal(uriInfo.getRequestUri().toASCIIString(),
+ accept, "Person", entityId, format, null, null, false);
+ if (internal.getStatus() == 200) {
+ InputStream entity = (InputStream) internal.getEntity();
+ try {
+ if (utils.getKey() == Accept.JSON_FULLMETA || utils.getKey() == Accept.ATOM) {
+ entity = utils.getValue().addOperation(entity, "Sack", "#DefaultContainer.Sack",
+ uriInfo.getAbsolutePath().toASCIIString()
+ + "/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Sack");
+ }
+
+ return utils.getValue().createResponse(
+ uriInfo.getRequestUri().toASCIIString(),
+ entity,
+ internal.getHeaderString("ETag"),
+ utils.getKey());
+ } catch (Exception e) {
+ LOG.error("Error retrieving entity", e);
+ return xml.createFaultResponse(accept, e);
+ }
+ } else {
+ return internal;
}
+ }
+
+ @GET
+ @Path("/Product({entityId})")
+ public Response getProduct(
+ @Context UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
- final Map.Entry<String, InputStream> entityInfo = utils.getValue().readEntity("Person", entityId, utils.getKey());
+ final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
- InputStream entity = entityInfo.getValue();
- try {
- if (utils.getKey() == Accept.JSON_FULLMETA || utils.getKey() == Accept.ATOM) {
- entity = utils.getValue().addOperation(entity, "Sack", "#DefaultContainer.Sack",
- uriInfo.getAbsolutePath().toASCIIString()
- + "/Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee/Sack");
+ final Response internal = getEntityInternal(uriInfo.getRequestUri().toASCIIString(),
+ accept, "Product", entityId, format, null, null, false);
+ if (internal.getStatus() == 200) {
+ InputStream entity = (InputStream) internal.getEntity();
+ try {
+ if (utils.getKey() == Accept.JSON_FULLMETA || utils.getKey() == Accept.ATOM) {
+ entity = utils.getValue().addOperation(entity,
+ "ChangeProductDimensions", "#DefaultContainer.ChangeProductDimensions",
+ uriInfo.getAbsolutePath().toASCIIString() + "/ChangeProductDimensions");
+ }
+
+ return utils.getValue().createResponse(
+ uriInfo.getRequestUri().toASCIIString(),
+ entity,
+ internal.getHeaderString("ETag"),
+ utils.getKey());
+ } catch (Exception e) {
+ LOG.error("Error retrieving entity", e);
+ return xml.createFaultResponse(accept, e);
}
+ } else {
+ return internal;
+ }
+ }
- return utils.getValue().createResponse(
- uriInfo.getRequestUri().toASCIIString(),
- entity,
- Commons.getETag(entityInfo.getKey(), version),
- utils.getKey());
- } catch (Exception e) {
- LOG.error("Error retrieving entity", e);
- return xml.createFaultResponse(accept, e);
+ @GET
+ @Path("/ComputerDetail({entityId})")
+ public Response getComputerDetail(
+ @Context UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) final String accept,
+ @PathParam("entityId") final String entityId,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) final String format) {
+
+ final Map.Entry<Accept, AbstractUtilities> utils = getUtilities(accept, format);
+
+ final Response internal = getEntityInternal(uriInfo.getRequestUri().toASCIIString(),
+ accept, "ComputerDetail", entityId, format, null, null, false);
+ if (internal.getStatus() == 200) {
+ InputStream entity = (InputStream) internal.getEntity();
+ try {
+ if (utils.getKey() == Accept.JSON_FULLMETA || utils.getKey() == Accept.ATOM) {
+ entity = utils.getValue().addOperation(entity,
+ "ResetComputerDetailsSpecifications", "#DefaultContainer.ResetComputerDetailsSpecifications",
+ uriInfo.getAbsolutePath().toASCIIString() + "/ResetComputerDetailsSpecifications");
+ }
+
+ return utils.getValue().createResponse(
+ uriInfo.getRequestUri().toASCIIString(),
+ entity,
+ internal.getHeaderString("ETag"),
+ utils.getKey());
+ } catch (Exception e) {
+ LOG.error("Error retrieving entity", e);
+ return xml.createFaultResponse(accept, e);
+ }
+ } else {
+ return internal;
}
}
@@ -1570,8 +1697,8 @@ public abstract class AbstractServices {
mapper.writeValue(
writer,
new JSONFeedContainer(container.getContextURL(),
- container.getMetadataETag(),
- dataBinder.toJSONEntitySet((AtomEntitySetImpl) container.getPayload())));
+ container.getMetadataETag(),
+ dataBinder.toJSONEntitySet((AtomEntitySetImpl) container.getPayload())));
}
} else {
final ResWrap<Entity> container =
@@ -1584,8 +1711,8 @@ public abstract class AbstractServices {
mapper.writeValue(
writer,
new JSONEntryContainer(container.getContextURL(),
- container.getMetadataETag(),
- dataBinder.toJSONEntity((AtomEntityImpl) container.getPayload())));
+ container.getMetadataETag(),
+ dataBinder.toJSONEntity((AtomEntityImpl) container.getPayload())));
}
}
@@ -1655,9 +1782,9 @@ public abstract class AbstractServices {
final ResWrap<AtomPropertyImpl> container = new ResWrap<AtomPropertyImpl>(
URI.create(Constants.get(version, ConstantKey.ODATA_METADATA_PREFIX)
- + (version.compareTo(ODataServiceVersion.V40) >= 0
- ? entitySetName + "(" + entityId + ")/" + path
- : property.getType())),
+ + (version.compareTo(ODataServiceVersion.V40) >= 0
+ ? entitySetName + "(" + entityId + ")/" + path
+ : property.getType())),
entryContainer.getMetadataETag(),
property);
@@ -1665,9 +1792,9 @@ public abstract class AbstractServices {
null,
searchForValue
? IOUtils.toInputStream(
- container.getPayload().getValue() == null || container.getPayload().getValue().isNull()
- ? StringUtils.EMPTY
- : container.getPayload().getValue().asPrimitive().get(), Constants.ENCODING)
+ container.getPayload().getValue() == null || container.getPayload().getValue().isNull()
+ ? StringUtils.EMPTY
+ : container.getPayload().getValue().asPrimitive().get(), Constants.ENCODING)
: utils.writeProperty(acceptType, container),
Commons.getETag(Commons.getEntityBasePath(entitySetName, entityId), version),
acceptType);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTest.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTest.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTest.java
deleted file mode 100644
index fbee685..0000000
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.fit.proxy.v3;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collections;
-import org.apache.olingo.ext.proxy.EntityContainerFactory;
-import org.apache.olingo.ext.proxy.context.EntityContext;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- DefaultContainer;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- types.ContactDetails;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- types.Customer;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- types.Aliases;
-import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
- types.Phone;
-
-import org.junit.BeforeClass;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractTest {
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractTest.class);
-
- protected static final String TEST_PRODUCT_TYPE = "Microsoft.Test.OData.Services.AstoriaDefaultService.Product";
-
- protected static String testStaticServiceRootURL;
-
- protected static String testKeyAsSegmentServiceRootURL;
-
- protected static String testActionOverloadingServiceRootURL;
-
- protected static String testOpenTypeServiceRootURL;
-
- protected static String testLargeModelServiceRootURL;
-
- protected static String testAuthServiceRootURL;
-
- protected final EntityContext entityContext = EntityContainerFactory.getContext().entityContext();
-
- protected static EntityContainerFactory containerFactory;
-
- protected static DefaultContainer container;
-
- @BeforeClass
- public static void setUpODataServiceRoot() throws IOException {
- testStaticServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc";
- testKeyAsSegmentServiceRootURL = "http://localhost:9080/stub/StaticService/V30/KeyAsSegment.svc";
- testActionOverloadingServiceRootURL = "http://localhost:9080/stub/StaticService/V30/ActionOverloading.svc";
- testOpenTypeServiceRootURL = "http://localhost:9080/stub/StaticService/V30/OpenType.svc";
- testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc/large";
- testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc";
-
- containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL);
- container = containerFactory.getEntityContainer(DefaultContainer.class);
- assertNotNull(container);
- }
-
- protected Customer getSampleCustomerProfile(
- final Integer id,
- final String sampleName,
- final DefaultContainer container) {
-
- final Customer customer = container.getCustomer().newCustomer();
-
- // add name attribute
- customer.setName(sampleName);
-
- // add key attribute
- customer.setCustomerId(id);
-
- final ContactDetails cd = customer.factory().newPrimaryContactInfo();
- cd.setAlternativeNames(Arrays.asList("alternative1", "alternative2"));
- cd.setEmailBag(Collections.<String>singleton("myname@mydomain.org"));
- cd.setMobilePhoneBag(Collections.<Phone>emptySet());
- customer.setPrimaryContactInfo(cd);
-
- final Aliases aliases = cd.factory().newContactAlias();
- aliases.setAlternativeNames(Collections.<String>singleton("myAlternativeName"));
- cd.setContactAlias(aliases);
-
- final ContactDetails bcd = customer.factory().newBackupContactInfo();
- bcd.setAlternativeNames(Arrays.asList("alternative3", "alternative4"));
- bcd.setEmailBag(Collections.<String>emptySet());
- bcd.setMobilePhoneBag(Collections.<Phone>emptySet());
- customer.setBackupContactInfo(Collections.<ContactDetails>singleton(bcd));
-
- return customer;
- }
-
- protected void checkSampleCustomerProfile(
- final Customer customer,
- final Integer id,
- final String sampleName) {
-
- assertEquals(id, customer.getCustomerId());
- assertNotNull(customer.getPrimaryContactInfo());
- assertFalse(customer.getBackupContactInfo().isEmpty());
-
- final ContactDetails cd = customer.getPrimaryContactInfo();
- final ContactDetails bcd = customer.getBackupContactInfo().iterator().next();
-
- assertTrue(cd.getAlternativeNames().contains("alternative1"));
- assertTrue(cd.getAlternativeNames().contains("alternative2"));
- assertEquals("myname@mydomain.org", cd.getEmailBag().iterator().next());
- assertEquals("myAlternativeName", cd.getContactAlias().getAlternativeNames().iterator().next());
- assertTrue(cd.getMobilePhoneBag().isEmpty());
-
- assertTrue(bcd.getAlternativeNames().contains("alternative3"));
- assertTrue(bcd.getAlternativeNames().contains("alternative4"));
- assertTrue(bcd.getEmailBag().isEmpty());
- assertTrue(bcd.getMobilePhoneBag().isEmpty());
- }
-
- protected Customer readCustomer(final DefaultContainer container, int id) {
- final Customer customer = container.getCustomer().get(id);
- assertNotNull(customer);
- assertEquals(Integer.valueOf(id), customer.getCustomerId());
-
- return customer;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java
new file mode 100644
index 0000000..458963b
--- /dev/null
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AbstractTestITCase.java
@@ -0,0 +1,150 @@
+/*
+ * 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.fit.proxy.v3;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collections;
+import org.apache.olingo.ext.proxy.EntityContainerFactory;
+import org.apache.olingo.ext.proxy.context.EntityContext;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ DefaultContainer;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ types.ContactDetails;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ types.Customer;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ types.Aliases;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
+ types.Phone;
+
+import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractTestITCase {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractTestITCase.class);
+
+ protected static final String TEST_PRODUCT_TYPE = "Microsoft.Test.OData.Services.AstoriaDefaultService.Product";
+
+ protected static String testStaticServiceRootURL;
+
+ protected static String testKeyAsSegmentServiceRootURL;
+
+ protected static String testActionOverloadingServiceRootURL;
+
+ protected static String testOpenTypeServiceRootURL;
+
+ protected static String testLargeModelServiceRootURL;
+
+ protected static String testAuthServiceRootURL;
+
+ protected final EntityContext entityContext = EntityContainerFactory.getContext().entityContext();
+
+ protected static EntityContainerFactory containerFactory;
+
+ protected static DefaultContainer container;
+
+ @BeforeClass
+ public static void setUpODataServiceRoot() throws IOException {
+ testStaticServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc";
+ testKeyAsSegmentServiceRootURL = "http://localhost:9080/stub/StaticService/V30/KeyAsSegment.svc";
+ testActionOverloadingServiceRootURL = "http://localhost:9080/stub/StaticService/V30/ActionOverloading.svc";
+ testOpenTypeServiceRootURL = "http://localhost:9080/stub/StaticService/V30/OpenType.svc";
+ testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V30/Static.svc/large";
+ testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc";
+
+ containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL);
+ container = containerFactory.getEntityContainer(DefaultContainer.class);
+ assertNotNull(container);
+ }
+
+ protected Customer getSampleCustomerProfile(
+ final Integer id,
+ final String sampleName,
+ final DefaultContainer container) {
+
+ final Customer customer = container.getCustomer().newCustomer();
+
+ // add name attribute
+ customer.setName(sampleName);
+
+ // add key attribute
+ customer.setCustomerId(id);
+
+ final ContactDetails cd = customer.factory().newPrimaryContactInfo();
+ cd.setAlternativeNames(Arrays.asList("alternative1", "alternative2"));
+ cd.setEmailBag(Collections.<String>singleton("myname@mydomain.org"));
+ cd.setMobilePhoneBag(Collections.<Phone>emptySet());
+ customer.setPrimaryContactInfo(cd);
+
+ final Aliases aliases = cd.factory().newContactAlias();
+ aliases.setAlternativeNames(Collections.<String>singleton("myAlternativeName"));
+ cd.setContactAlias(aliases);
+
+ final ContactDetails bcd = customer.factory().newBackupContactInfo();
+ bcd.setAlternativeNames(Arrays.asList("alternative3", "alternative4"));
+ bcd.setEmailBag(Collections.<String>emptySet());
+ bcd.setMobilePhoneBag(Collections.<Phone>emptySet());
+ customer.setBackupContactInfo(Collections.<ContactDetails>singleton(bcd));
+
+ return customer;
+ }
+
+ protected void checkSampleCustomerProfile(
+ final Customer customer,
+ final Integer id,
+ final String sampleName) {
+
+ assertEquals(id, customer.getCustomerId());
+ assertNotNull(customer.getPrimaryContactInfo());
+ assertFalse(customer.getBackupContactInfo().isEmpty());
+
+ final ContactDetails cd = customer.getPrimaryContactInfo();
+ final ContactDetails bcd = customer.getBackupContactInfo().iterator().next();
+
+ assertTrue(cd.getAlternativeNames().contains("alternative1"));
+ assertTrue(cd.getAlternativeNames().contains("alternative2"));
+ assertEquals("myname@mydomain.org", cd.getEmailBag().iterator().next());
+ assertEquals("myAlternativeName", cd.getContactAlias().getAlternativeNames().iterator().next());
+ assertTrue(cd.getMobilePhoneBag().isEmpty());
+
+ assertTrue(bcd.getAlternativeNames().contains("alternative3"));
+ assertTrue(bcd.getAlternativeNames().contains("alternative4"));
+ assertTrue(bcd.getEmailBag().isEmpty());
+ assertTrue(bcd.getMobilePhoneBag().isEmpty());
+ }
+
+ protected Customer readCustomer(final DefaultContainer container, int id) {
+ final Customer customer = container.getCustomer().get(id);
+ assertNotNull(customer);
+ assertEquals(Integer.valueOf(id), customer.getCustomerId());
+
+ return customer;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
index a930100..2ae58e8 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
@@ -18,9 +18,11 @@
*/
package org.apache.olingo.fit.proxy.v3;
-import java.lang.reflect.Proxy;
-import org.apache.olingo.ext.proxy.commons.EntityTypeInvocationHandler;
-import static org.apache.olingo.fit.proxy.v3.AbstractTest.container;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Customer;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
@@ -33,18 +35,12 @@ import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.service
types.Order;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.OrderCollection;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import org.junit.Ignore;
-
import org.junit.Test;
/**
* This is the unit test class to check entity create operations.
*/
-public class EntityCreateTestITCase extends AbstractTest {
+public class EntityCreateTestITCase extends AbstractTestITCase {
@Test
public void create() {
@@ -78,7 +74,6 @@ public class EntityCreateTestITCase extends AbstractTest {
}
@Test
- @Ignore
public void createEmployee() {
final Integer id = 101;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java
index 92def52..7ec8cdf 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityRetrieveTestITCase.java
@@ -80,7 +80,7 @@ import org.junit.Test;
/**
* This is the unit test class to check entity retrieve operations.
*/
-public class EntityRetrieveTestITCase extends AbstractTest {
+public class EntityRetrieveTestITCase extends AbstractTestITCase {
protected DefaultContainer getContainer() {
return container;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java
index c6b9108..29049b1 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntitySetTestITCase.java
@@ -32,7 +32,7 @@ import org.junit.Test;
/**
* This is the unit test class to check basic feed operations.
*/
-public class EntitySetTestITCase extends AbstractTest {
+public class EntitySetTestITCase extends AbstractTestITCase {
@Test
public void count() {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java
new file mode 100644
index 0000000..a91fb68
--- /dev/null
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/InvokeTestITCase.java
@@ -0,0 +1,232 @@
+/*
+ * 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.fit.proxy.v3;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.math.BigDecimal;
+import java.util.Calendar;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ ComputerDetail;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ ContactDetails;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Customer;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ CustomerCollection;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ Dimensions;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Employee;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.
+ EmployeeCollection;
+import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Product;
+import org.junit.Test;
+
+public class InvokeTestITCase extends AbstractTestITCase {
+
+ @Test
+ public void getWithNoParams() {
+ // 1. primitive result
+ final String string = container.operations().getPrimitiveString();
+ assertEquals("Foo", string);
+
+ // 2. complex collection result
+ final Collection<ContactDetails> details = container.operations().entityProjectionReturnsCollectionOfComplexTypes();
+ assertFalse(details.isEmpty());
+ for (ContactDetails detail : details) {
+ assertNotNull(detail);
+ }
+ assertNotNull(details.iterator().next());
+ }
+
+ @Test
+ public void getWithParam() {
+ // 1. primitive result
+ assertEquals(155, container.operations().getArgumentPlusOne(154), 0);
+
+ // 2. entity collection result
+ final CustomerCollection customers = container.operations().getSpecificCustomer(StringUtils.EMPTY);
+ assertNotNull(customers);
+ assertFalse(customers.isEmpty());
+ final Set<Integer> customerIds = new HashSet<Integer>(customers.size());
+ for (Customer customer : customers) {
+ assertNotNull(customer);
+ customerIds.add(customer.getCustomerId());
+ }
+ assertTrue(customerIds.contains(-8));
+ }
+
+ @Test
+ public void entityBoundPost() {
+ // 0. create an employee
+ final Integer id = 101;
+
+ Employee employee = container.getPerson().newEmployee();
+ employee.setPersonId(id);
+ employee.setName("sample employee from proxy");
+ employee.setManagersPersonId(-9918);
+ employee.setSalary(2147483647);
+ employee.setTitle("CEO");
+
+ container.flush();
+
+ employee = container.getPerson().get(id, Employee.class);
+ assertNotNull(employee);
+ assertEquals(id, employee.getPersonId());
+
+ try {
+ // 1. invoke action bound to the employee just created
+ employee.operations().sack();
+
+ // 2. check that invoked action has effectively run
+ employee = container.getPerson().get(id, Employee.class);
+ assertEquals(0, employee.getSalary(), 0);
+ assertTrue(employee.getTitle().endsWith("[Sacked]"));
+ } catch (Exception e) {
+ fail("Should never get here");
+ } finally {
+ // 3. remove the test employee
+ container.getPerson().delete(employee.getPersonId());
+ container.flush();
+ }
+ }
+
+ @Test
+ public void entityCollectionBoundPostWithParam() {
+ EmployeeCollection employees = container.getPerson().getAll(EmployeeCollection.class);
+ assertFalse(employees.isEmpty());
+ final Map<Integer, Integer> preSalaries = new HashMap<Integer, Integer>(employees.size());
+ for (Employee employee : employees) {
+ preSalaries.put(employee.getPersonId(), employee.getSalary());
+ }
+ assertFalse(preSalaries.isEmpty());
+
+ employees.operations().increaseSalaries(1);
+
+ employees = container.getPerson().getAll(EmployeeCollection.class);
+ assertFalse(employees.isEmpty());
+ for (Employee employee : employees) {
+ assertTrue(preSalaries.get(employee.getPersonId()) < employee.getSalary());
+ }
+ }
+
+ @Test
+ public void changeProductDimensions() {
+ // 0. create a product
+ final Integer id = 101;
+
+ Product product = container.getProduct().newProduct();
+ product.setProductId(id);
+ product.setDescription("New product");
+
+ final Dimensions origDimensions = product.factory().newDimensions();
+ origDimensions.setDepth(BigDecimal.ZERO);
+ origDimensions.setHeight(BigDecimal.ZERO);
+ origDimensions.setWidth(BigDecimal.ZERO);
+ product.setDimensions(origDimensions);
+
+ container.flush();
+
+ product = container.getProduct().get(id);
+ assertNotNull(product);
+ assertEquals(id, product.getProductId());
+ assertEquals(BigDecimal.ZERO, product.getDimensions().getDepth());
+ assertEquals(BigDecimal.ZERO, product.getDimensions().getHeight());
+ assertEquals(BigDecimal.ZERO, product.getDimensions().getWidth());
+
+ try {
+ // 1. invoke action bound to the product just created
+ final Dimensions newDimensions = product.factory().newDimensions();
+ newDimensions.setDepth(BigDecimal.ONE);
+ newDimensions.setHeight(BigDecimal.ONE);
+ newDimensions.setWidth(BigDecimal.ONE);
+
+ product.operations().changeProductDimensions(newDimensions);
+
+ // 2. check that invoked action has effectively run
+ product = container.getProduct().get(id);
+ assertEquals(BigDecimal.ONE, product.getDimensions().getDepth());
+ assertEquals(BigDecimal.ONE, product.getDimensions().getHeight());
+ assertEquals(BigDecimal.ONE, product.getDimensions().getWidth());
+ } catch (Exception e) {
+ fail("Should never get here");
+ } finally {
+ // 3. remove the test product
+ container.getProduct().delete(product.getProductId());
+ container.flush();
+ }
+ }
+
+ @Test
+ public void resetComputerDetailsSpecifications() {
+ // 0. create a computer detail
+ final Integer id = 101;
+
+ final Calendar purchaseDate = Calendar.getInstance();
+ purchaseDate.clear();
+ purchaseDate.set(Calendar.YEAR, 1);
+ purchaseDate.set(Calendar.MONTH, 0);
+ purchaseDate.set(Calendar.DAY_OF_MONTH, 1);
+
+ ComputerDetail computerDetail = container.getComputerDetail().newComputerDetail();
+ computerDetail.setComputerDetailId(id);
+ computerDetail.setSpecificationsBag(Collections.singleton("First spec"));
+ computerDetail.setPurchaseDate(purchaseDate);
+
+ container.flush();
+
+ computerDetail = container.getComputerDetail().get(id);
+ assertNotNull(computerDetail);
+ assertEquals(id, computerDetail.getComputerDetailId());
+ assertEquals(1, computerDetail.getSpecificationsBag().size());
+ assertTrue(computerDetail.getSpecificationsBag().contains("First spec"));
+ assertEquals(purchaseDate.getTimeInMillis(), computerDetail.getPurchaseDate().getTimeInMillis());
+
+ try {
+ // 1. invoke action bound to the computer detail just created
+ computerDetail.operations().resetComputerDetailsSpecifications(
+ Collections.singleton("Second spec"), Calendar.getInstance());
+
+ // 2. check that invoked action has effectively run
+ computerDetail = container.getComputerDetail().get(id);
+ assertNotNull(computerDetail);
+ assertEquals(id, computerDetail.getComputerDetailId());
+ assertEquals(1, computerDetail.getSpecificationsBag().size());
+ assertTrue(computerDetail.getSpecificationsBag().contains("Second spec"));
+ assertNotEquals(purchaseDate.getTimeInMillis(), computerDetail.getPurchaseDate().getTimeInMillis());
+ } catch (Exception e) {
+ fail("Should never get here");
+ } finally {
+ // 3. remove the test product
+ container.getComputerDetail().delete(computerDetail.getComputerDetailId());
+ container.flush();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java
index 920320f..21f037a 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoCollectionTypesSet.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java
index 0af2cd9..f6d6b14 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/AllGeoTypesSet.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java
index dd62c22..0e61b57 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Car.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java
index 93fbfc3..9f5f00c 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Computer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java
index c8b6463..2ecb362 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/ComputerDetail.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java
index d2b6492..8c2c842 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Customer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java
index 5dd3151..18f23cc 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/CustomerInfo.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java
index b926510..80eda13 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/DefaultContainer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java
index fc5a9a2..b091269 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Driver.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java
index 8d627e5..f194888 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/LastLogin.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java
index 94331be..9717fbb 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/License.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java
index c3b400a..0111069 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Login.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java
index 6a544b2..f7bec52 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MappedEntityType.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java
index 00bee19..0662bb2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/Message.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java
index a90742b..e3d46c7 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/MessageAttachment.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
[03/31] git commit: [OLINGO-260] fix for integration test deadlock
Posted by sk...@apache.org.
[OLINGO-260] fix for integration test deadlock
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/fc42d2ad
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/fc42d2ad
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/fc42d2ad
Branch: refs/heads/olingo-266-ref
Commit: fc42d2ad57d9d612d04a8f52d2ac68ae91a51ad7
Parents: f1cbc4a
Author: fmartelli <fa...@gmail.com>
Authored: Mon May 12 11:55:18 2014 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Mon May 12 11:55:18 2014 +0200
----------------------------------------------------------------------
ext/pojogen-maven-plugin/pom.xml | 7 -
.../proxy/v3/AuthEntityRetrieveTestITCase.java | 14 +-
.../fit/proxy/v3/EntityCreateTestITCase.java | 253 +++++++++----------
.../proxy/v4/AuthEntityRetrieveTestITCase.java | 20 +-
.../olingo/fit/v3/EntityCreateTestITCase.java | 2 +-
.../apache/olingo/client/core/uri/URIUtils.java | 14 +-
6 files changed, 155 insertions(+), 155 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fc42d2ad/ext/pojogen-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/pom.xml b/ext/pojogen-maven-plugin/pom.xml
index f0fc429..3a77451 100644
--- a/ext/pojogen-maven-plugin/pom.xml
+++ b/ext/pojogen-maven-plugin/pom.xml
@@ -110,13 +110,6 @@
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
- <resource>
- <directory>..</directory>
- <targetPath>META-INF</targetPath>
- <includes>
- <include>LICENSE</include>
- </includes>
- </resource>
</resources>
<testResources>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fc42d2ad/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AuthEntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AuthEntityRetrieveTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AuthEntityRetrieveTestITCase.java
index 40543e9..cca4f1f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AuthEntityRetrieveTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/AuthEntityRetrieveTestITCase.java
@@ -19,11 +19,11 @@
package org.apache.olingo.fit.proxy.v3;
import static org.junit.Assert.assertNotNull;
+
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory;
-import org.apache.olingo.client.core.http.DefaultHttpClientFactory;
import org.apache.olingo.ext.proxy.EntityContainerFactory;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
DefaultContainer;
@@ -31,19 +31,17 @@ import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.service
public class AuthEntityRetrieveTestITCase extends EntityRetrieveTestITCase {
@BeforeClass
- public static void enableBasicAuth() {
+ public static void setupContaner() {
+ containerFactory = EntityContainerFactory.getV3(testAuthServiceRootURL);
containerFactory.getConfiguration().
setHttpClientFactory(new BasicAuthHttpClientFactory("odatajclient", "odatajclient"));
+ container = containerFactory.getEntityContainer(DefaultContainer.class);
+ assertNotNull(container);
}
@AfterClass
public static void disableBasicAuth() {
- containerFactory.getConfiguration().setHttpClientFactory(new DefaultHttpClientFactory());
- }
-
- @BeforeClass
- public static void setupContaner() {
- containerFactory = EntityContainerFactory.getV3(testAuthServiceRootURL);
+ containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL);
container = containerFactory.getEntityContainer(DefaultContainer.class);
assertNotNull(container);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fc42d2ad/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
index 3ef2691..4118706 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
@@ -18,6 +18,7 @@
*/
package org.apache.olingo.fit.proxy.v3;
+import static org.apache.olingo.fit.proxy.v3.AbstractTest.container;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Customer;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
@@ -43,168 +44,166 @@ import org.junit.Test;
*/
public class EntityCreateTestITCase extends AbstractTest {
- @Test
- @Ignore
- public void create() {
- final String sampleName = "sample customer from proxy";
- final Integer id = 100;
+ @Test
+ public void create() {
+ container.getCustomer().get(-10);
+ final String sampleName = "sample customer from proxy";
+ final Integer id = 100;
- getSampleCustomerProfile(id, sampleName, container);
- container.flush();
+ getSampleCustomerProfile(id, sampleName, container);
+ container.flush();
- Customer actual = readCustomer(container, id);
- checkSampleCustomerProfile(actual, id, sampleName);
+ Customer actual = readCustomer(container, id);
+ checkSampleCustomerProfile(actual, id, sampleName);
- container.getCustomer().delete(actual.getCustomerId());
- actual = container.getCustomer().get(id);
- assertNull(actual);
+ container.getCustomer().delete(actual.getCustomerId());
+ actual = container.getCustomer().get(id);
+ assertNull(actual);
- entityContext.detachAll();
- actual = container.getCustomer().get(id);
- assertNotNull(actual);
+ entityContext.detachAll();
+ actual = container.getCustomer().get(id);
+ assertNotNull(actual);
- container.getCustomer().delete(actual.getCustomerId());
- container.flush();
+ container.getCustomer().delete(actual.getCustomerId());
+ container.flush();
- actual = container.getCustomer().get(id);
- assertNull(actual);
+ actual = container.getCustomer().get(id);
+ assertNull(actual);
- entityContext.detachAll();
- actual = container.getCustomer().get(id);
- assertNull(actual);
- }
+ entityContext.detachAll();
+ actual = container.getCustomer().get(id);
+ assertNull(actual);
+ }
- @Test
- @Ignore
- public void createEmployee() {
- final Integer id = 101;
+ @Test
+ @Ignore
+ public void createEmployee() {
+ final Integer id = 101;
- final Employee employee = container.getPerson().newEmployee();
- employee.setPersonId(id);
- employee.setName("sample employee from proxy");
- employee.setManagersPersonId(-9918);
- employee.setSalary(2147483647);
- employee.setTitle("CEO");
+ final Employee employee = container.getPerson().newEmployee();
+ employee.setPersonId(id);
+ employee.setName("sample employee from proxy");
+ employee.setManagersPersonId(-9918);
+ employee.setSalary(2147483647);
+ employee.setTitle("CEO");
- container.flush();
+ container.flush();
- Employee actual = container.getPerson().get(id, Employee.class);
- assertNotNull(actual);
- assertEquals(id, actual.getPersonId());
+ Employee actual = container.getPerson().get(id, Employee.class);
+ assertNotNull(actual);
+ assertEquals(id, actual.getPersonId());
- entityContext.detachAll();
- actual = container.getPerson().get(id, Employee.class);
- assertNotNull(actual);
+ entityContext.detachAll();
+ actual = container.getPerson().get(id, Employee.class);
+ assertNotNull(actual);
- container.getPerson().delete(actual.getPersonId());
- container.flush();
+ container.getPerson().delete(actual.getPersonId());
+ container.flush();
- actual = container.getPerson().get(id, Employee.class);
- assertNull(actual);
+ actual = container.getPerson().get(id, Employee.class);
+ assertNull(actual);
- entityContext.detachAll();
- actual = container.getPerson().get(id, Employee.class);
- assertNull(actual);
- }
+ entityContext.detachAll();
+ actual = container.getPerson().get(id, Employee.class);
+ assertNull(actual);
+ }
- @Test
- @Ignore
- public void createWithNavigation() {
- final String sampleName = "sample customer from proxy with navigation";
- final Integer id = 101;
+ @Test
+ public void createWithNavigation() {
+ final String sampleName = "sample customer from proxy with navigation";
+ final Integer id = 101;
- final Customer original = getSampleCustomerProfile(id, sampleName, container);
- original.setInfo(container.getCustomerInfo().get(16));
- container.flush();
+ final Customer original = getSampleCustomerProfile(id, sampleName, container);
+ original.setInfo(container.getCustomerInfo().get(16));
+ container.flush();
- Customer actual = readCustomer(container, id);
- checkSampleCustomerProfile(actual, id, sampleName);
- assertEquals(Integer.valueOf(16), actual.getInfo().getCustomerInfoId());
+ Customer actual = readCustomer(container, id);
+ checkSampleCustomerProfile(actual, id, sampleName);
+ assertEquals(Integer.valueOf(16), actual.getInfo().getCustomerInfoId());
- container.getCustomer().delete(actual.getCustomerId());
- container.flush();
+ container.getCustomer().delete(actual.getCustomerId());
+ container.flush();
- actual = container.getCustomer().get(id);
- assertNull(actual);
- }
+ actual = container.getCustomer().get(id);
+ assertNull(actual);
+ }
- @Test
- @Ignore
- public void createWithBackNavigation() {
- final String sampleName = "sample customer from proxy with back navigation";
- final Integer id = 102;
+ @Test
+ @Ignore
+ public void createWithBackNavigation() {
+ final String sampleName = "sample customer from proxy with back navigation";
+ final Integer id = 102;
- Order order = container.getOrder().newOrder();
- order.setCustomerId(id);
- order.setOrderId(id); // same id ...
+ Order order = container.getOrder().newOrder();
+ order.setCustomerId(id);
+ order.setOrderId(id); // same id ...
- final Customer customer = getSampleCustomerProfile(id, sampleName, container);
+ final Customer customer = getSampleCustomerProfile(id, sampleName, container);
- final OrderCollection orders = container.getOrder().newOrderCollection();
- orders.add(order);
+ final OrderCollection orders = container.getOrder().newOrderCollection();
+ orders.add(order);
- customer.setOrders(orders);
- order.setCustomer(customer);
- container.flush();
+ customer.setOrders(orders);
+ order.setCustomer(customer);
+ container.flush();
- assertEquals(id, order.getOrderId());
- assertEquals(id, order.getCustomerId());
+ assertEquals(id, order.getOrderId());
+ assertEquals(id, order.getCustomerId());
- Customer actual = readCustomer(container, id);
- checkSampleCustomerProfile(actual, id, sampleName);
+ Customer actual = readCustomer(container, id);
+ checkSampleCustomerProfile(actual, id, sampleName);
- assertEquals(1, actual.getOrders().size());
- assertEquals(id, actual.getOrders().iterator().next().getOrderId());
- assertEquals(id, actual.getOrders().iterator().next().getCustomerId());
+ assertEquals(1, actual.getOrders().size());
+ assertEquals(id, actual.getOrders().iterator().next().getOrderId());
+ assertEquals(id, actual.getOrders().iterator().next().getCustomerId());
- order = container.getOrder().get(id);
- assertNotNull(order);
- assertEquals(id, order.getCustomer().getCustomerId());
+ order = container.getOrder().get(id);
+ assertNotNull(order);
+ assertEquals(id, order.getCustomer().getCustomerId());
- container.getOrder().delete(actual.getOrders());
- container.flush();
-
- order = container.getOrder().get(id);
- assertNull(order);
-
- actual = readCustomer(container, id);
- assertTrue(actual.getOrders().isEmpty());
-
- container.getCustomer().delete(actual.getCustomerId());
- container.flush();
+ container.getOrder().delete(actual.getOrders());
+ container.flush();
- actual = container.getCustomer().get(id);
- assertNull(actual);
- }
+ order = container.getOrder().get(id);
+ assertNull(order);
- @Test
- @Ignore
- public void multiKey() {
- Message message = container.getMessage().newMessage();
- message.setMessageId(100);
- message.setFromUsername("fromusername");
- message.setToUsername("myusername");
- message.setIsRead(false);
- message.setSubject("test message");
- message.setBody("test");
+ actual = readCustomer(container, id);
+ assertTrue(actual.getOrders().isEmpty());
- container.flush();
+ container.getCustomer().delete(actual.getCustomerId());
+ container.flush();
- MessageKey key = new MessageKey();
- key.setFromUsername("fromusername");
- key.setMessageId(100);
+ actual = container.getCustomer().get(id);
+ assertNull(actual);
+ }
- message = container.getMessage().get(key);
- assertNotNull(message);
- assertEquals(Integer.valueOf(100), message.getMessageId());
- assertEquals("fromusername", message.getFromUsername());
- assertEquals("myusername", message.getToUsername());
- assertEquals("test message", message.getSubject());
- assertEquals("test", message.getBody());
+ @Test
+ public void multiKey() {
+ Message message = container.getMessage().newMessage();
+ message.setMessageId(100);
+ message.setFromUsername("fromusername");
+ message.setToUsername("myusername");
+ message.setIsRead(false);
+ message.setSubject("test message");
+ message.setBody("test");
- container.getMessage().delete(key);
- container.flush();
+ container.flush();
- assertNull(container.getMessage().get(key));
- }
+ MessageKey key = new MessageKey();
+ key.setFromUsername("fromusername");
+ key.setMessageId(100);
+
+ message = container.getMessage().get(key);
+ assertNotNull(message);
+ assertEquals(Integer.valueOf(100), message.getMessageId());
+ assertEquals("fromusername", message.getFromUsername());
+ assertEquals("myusername", message.getToUsername());
+ assertEquals("test message", message.getSubject());
+ assertEquals("test", message.getBody());
+
+ container.getMessage().delete(key);
+ container.flush();
+
+ assertNull(container.getMessage().get(key));
+ }
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fc42d2ad/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AuthEntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AuthEntityRetrieveTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AuthEntityRetrieveTestITCase.java
index 973449e..bafddad 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AuthEntityRetrieveTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AuthEntityRetrieveTestITCase.java
@@ -18,31 +18,29 @@
*/
package org.apache.olingo.fit.proxy.v4;
-import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory;
-import org.apache.olingo.client.core.http.DefaultHttpClientFactory;
-import org.apache.olingo.ext.proxy.EntityContainerFactory;
-import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.InMemoryEntities;
import static org.junit.Assert.assertNotNull;
import org.junit.AfterClass;
import org.junit.BeforeClass;
+import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory;
+import org.apache.olingo.ext.proxy.EntityContainerFactory;
+import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.InMemoryEntities;
+
public class AuthEntityRetrieveTestITCase extends EntityRetrieveTestITCase {
@BeforeClass
- public static void enableBasicAuth() {
+ public static void setupContaner() {
+ containerFactory = EntityContainerFactory.getV3(testAuthServiceRootURL);
containerFactory.getConfiguration().
setHttpClientFactory(new BasicAuthHttpClientFactory("odatajclient", "odatajclient"));
+ container = containerFactory.getEntityContainer(InMemoryEntities.class);
+ assertNotNull(container);
}
@AfterClass
public static void disableBasicAuth() {
- containerFactory.getConfiguration().setHttpClientFactory(new DefaultHttpClientFactory());
- }
-
- @BeforeClass
- public static void setupContaner() {
- containerFactory = EntityContainerFactory.getV3(testAuthServiceRootURL);
+ containerFactory = EntityContainerFactory.getV3(testStaticServiceRootURL);
container = containerFactory.getEntityContainer(InMemoryEntities.class);
assertNotNull(container);
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fc42d2ad/fit/src/test/java/org/apache/olingo/fit/v3/EntityCreateTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v3/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v3/EntityCreateTestITCase.java
index cc97521..db26eee 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v3/EntityCreateTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v3/EntityCreateTestITCase.java
@@ -261,7 +261,7 @@ public class EntityCreateTestITCase extends AbstractTestITCase {
createReq.setPrefer(client.newPreferences().returnContent());
try {
- final ODataEntityCreateResponse createRes = createReq.execute();
+ final ODataEntityCreateResponse<ODataEntity> createRes = createReq.execute();
assertEquals(201, createRes.getStatusCode());
} catch (Exception e) {
fail(e.getMessage());
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/fc42d2ad/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java
index 0e1d029..017041b 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/uri/URIUtils.java
@@ -407,8 +407,20 @@ public final class URIUtils {
public static HttpEntity buildInputStreamEntity(final CommonODataClient<?> client, final InputStream input) {
HttpEntity entity;
+
+ // --------------------------
+ // Check just required by batch requests since their ansynchronous entity specification mechanism
+ // --------------------------
+ boolean contentAvailable;
+ try {
+ contentAvailable = input.available()>0;
+ } catch (IOException ex) {
+ contentAvailable = false;
+ }
+ // --------------------------
+
boolean repeatableRequired = shouldUseRepeatableHttpBodyEntry(client);
- if (!repeatableRequired) {
+ if (!contentAvailable || !repeatableRequired) {
entity = new InputStreamEntity(input, -1);
} else {
byte[] bytes = new byte[0];
[06/31] git commit: Various small improvements,
added test for instance annotations
Posted by sk...@apache.org.
Various small improvements, added test for instance annotations
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/8720a30e
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/8720a30e
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/8720a30e
Branch: refs/heads/olingo-266-ref
Commit: 8720a30e21948d0984339c8dc1ec8d8b89049621
Parents: c32f4a0
Author: Francesco Chicchiriccò <--global>
Authored: Mon May 12 12:41:25 2014 +0200
Committer: Francesco Chicchiriccò <--global>
Committed: Mon May 12 12:41:25 2014 +0200
----------------------------------------------------------------------
.../java/org/apache/olingo/fit/V4Services.java | 11 +
.../org/apache/olingo/fit/utils/DataBinder.java | 2 +
.../main/resources/V40/Boss/entity.full.json | 46 ++
fit/src/main/resources/V40/Boss/entity.xml | 51 ++
fit/src/main/resources/V40/badRequest.json | 25 +-
fit/src/main/resources/V40/metadata.xml | 523 ++++++++++---------
fit/src/main/resources/V40/notFound.json | 26 +-
.../olingo/fit/v4/ErrorResponseTestITCase.java | 65 +--
.../olingo/fit/v4/MetadataTestITCase.java | 36 +-
.../olingo/fit/v4/SingletonTestITCase.java | 37 +-
.../core/edm/v4/annotation/EdmRecordImpl.java | 8 +-
.../client/core/op/impl/v4/ODataBinderImpl.java | 11 +-
.../apache/olingo/commons/api/Constants.java | 4 +-
.../olingo/commons/api/domain/ODataError.java | 7 +-
.../commons/api/domain/ODataErrorDetail.java | 4 +-
.../core/data/AbstractJsonSerializer.java | 2 +-
.../commons/core/data/AbstractODataError.java | 42 +-
.../core/data/JSONODataErrorDeserializer.java | 39 +-
.../data/JSONODataErrorDetailDeserializer.java | 56 +-
.../core/data/JSONODataErrorDetailImpl.java | 50 +-
20 files changed, 589 insertions(+), 456 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/main/java/org/apache/olingo/fit/V4Services.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/V4Services.java b/fit/src/main/java/org/apache/olingo/fit/V4Services.java
index fb31f09..49b2e4c 100644
--- a/fit/src/main/java/org/apache/olingo/fit/V4Services.java
+++ b/fit/src/main/java/org/apache/olingo/fit/V4Services.java
@@ -346,6 +346,17 @@ public class V4Services extends AbstractServices {
}
@GET
+ @Path("/Boss")
+ public Response getSingletonBoss(
+ @Context UriInfo uriInfo,
+ @HeaderParam("Accept") @DefaultValue(StringUtils.EMPTY) String accept,
+ @QueryParam("$format") @DefaultValue(StringUtils.EMPTY) String format) {
+
+ return getEntityInternal(
+ uriInfo.getRequestUri().toASCIIString(), accept, "Boss", StringUtils.EMPTY, format, null, null, false);
+ }
+
+ @GET
@Path("/Company")
public Response getSingletonCompany(
@Context UriInfo uriInfo,
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java b/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java
index bddb017..58e5772 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/DataBinder.java
@@ -125,6 +125,8 @@ public class DataBinder {
properties.add(toJSONProperty((AtomPropertyImpl) property));
}
+ jsonEntity.getAnnotations().addAll(atomEntity.getAnnotations());
+
return jsonEntity;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/main/resources/V40/Boss/entity.full.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/Boss/entity.full.json b/fit/src/main/resources/V40/Boss/entity.full.json
new file mode 100644
index 0000000..d89b4a5
--- /dev/null
+++ b/fit/src/main/resources/V40/Boss/entity.full.json
@@ -0,0 +1,46 @@
+{
+ "@odata.context": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/$metadata#Boss",
+ "@odata.type": "#Microsoft.Test.OData.Services.ODataWCFService.Customer",
+ "@odata.id": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss",
+ "@odata.editLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer",
+ "@Microsoft.Test.OData.Services.ODataWCFService.IsBoss": true,
+ "PersonID": 2,
+ "FirstName": "Jill",
+ "LastName": "Jones",
+ "MiddleName": null,
+ "HomeAddress": null,
+ "Home@odata.type": "#GeographyPoint",
+ "Home": {
+ "type": "Point",
+ "coordinates": [161.8, 15.0],
+ "crs": {
+ "type": "name",
+ "properties": {
+ "name": "EPSG:4326"
+ }
+ }
+ },
+ "Numbers@odata.type": "#Collection(String)",
+ "Numbers": [],
+ "Emails@odata.type": "#Collection(String)",
+ "Emails": [],
+ "City": "Sydney",
+ "Birthday@odata.type": "#DateTimeOffset",
+ "Birthday": "1983-01-15T00:00:00Z",
+ "TimeBetweenLastTwoOrders@odata.type": "#Duration",
+ "TimeBetweenLastTwoOrders": "PT0.0000002S",
+ "Parent@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent/$ref",
+ "Parent@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent",
+ "Orders@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders/$ref",
+ "Orders@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders",
+ "Company@odata.associationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company/$ref",
+ "Company@odata.navigationLink": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company",
+ "#Microsoft.Test.OData.Services.ODataWCFService.ResetAddress": {
+ "title": "Microsoft.Test.OData.Services.ODataWCFService.ResetAddress",
+ "target": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Microsoft.Test.OData.Services.ODataWCFService.ResetAddress"
+ },
+ "#Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress": {
+ "title": "Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress",
+ "target": "http://localhost:${cargo.servlet.port}/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Microsoft.Test.OData.Services.ODataWCFService.GetHomeAddress"
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/main/resources/V40/Boss/entity.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/Boss/entity.xml b/fit/src/main/resources/V40/Boss/entity.xml
new file mode 100644
index 0000000..72ccb4c
--- /dev/null
+++ b/fit/src/main/resources/V40/Boss/entity.xml
@@ -0,0 +1,51 @@
+<?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.
+
+-->
+<entry xmlns="http://www.w3.org/2005/Atom" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:m="http://docs.oasis-open.org/odata/ns/metadata" xmlns:d="http://docs.oasis-open.org/odata/ns/data" xmlns:gml="http://www.opengis.net/gml" xmlns:georss="http://www.georss.org/georss">
+ <id>http://localhost:9080/stub/StaticService/V40/Static.svc/Boss</id>
+ <category scheme="http://docs.oasis-open.org/odata/ns/scheme" term="#Microsoft.Test.OData.Services.ODataWCFService.Customer"/>
+ <link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/Parent" title="Parent" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent/$ref" type="application/xml"/>
+ <link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/Orders" title="Orders" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders/$ref" type="application/xml"/>
+ <link rel="http://docs.oasis-open.org/odata/ns/relatedlinks/Company" title="Company" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company/$ref" type="application/xml"/>
+ <link rel="http://docs.oasis-open.org/odata/ns/related/Parent" title="Parent" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Parent" type="application/atom+xml;type=entry"/>
+ <link rel="http://docs.oasis-open.org/odata/ns/related/Orders" title="Orders" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Orders" type="application/atom+xml;type=entry"/>
+ <link rel="http://docs.oasis-open.org/odata/ns/related/Company" title="Company" href="http://localhost:9080/stub/StaticService/V40/Static.svc/Boss/Microsoft.Test.OData.Services.ODataWCFService.Customer/Company" type="application/atom+xml;type=entry"/>
+ <content type="application/xml">
+ <m:properties>
+ <d:PersonID m:type="Int32">2</d:PersonID>
+ <d:FirstName>Jill</d:FirstName>
+ <d:LastName>Jones</d:LastName>
+ <d:MiddleName m:null="true"/>
+ <d:HomeAddress m:null="true"/>
+ <d:Home m:type="GeographyPoint">
+ <gml:Point gml:srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
+ <gml:pos>161.8 15.0</gml:pos>
+ </gml:Point>
+ </d:Home>
+ <d:Numbers m:type="#Collection(String)"/>
+ <d:Emails m:type="#Collection(String)"/>
+ <d:City>Sydney</d:City>
+ <d:Birthday m:type="DateTimeOffset">1983-01-15T01:00:00+01:00</d:Birthday>
+ <d:TimeBetweenLastTwoOrders m:type="Duration">PT0.0000002S</d:TimeBetweenLastTwoOrders>
+ </m:properties>
+ </content>
+ <m:annotation term="Microsoft.Test.OData.Services.ODataWCFService.IsBoss" m:type="Boolean">true</m:annotation>
+</entry>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/main/resources/V40/badRequest.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/badRequest.json b/fit/src/main/resources/V40/badRequest.json
index fbc0c63..a7150b1 100644
--- a/fit/src/main/resources/V40/badRequest.json
+++ b/fit/src/main/resources/V40/badRequest.json
@@ -1,35 +1,24 @@
{
-
"error": {
-
"code": "400",
-
"message": "Bad request.",
-
"target": "query",
-
"details": [
-
{
-
- "code": "400",
-
- "target": "$search" ,
-
- "message": "Microsoft.Data.OData.BadRequest"
+ "code": "400",
+ "target": "$search",
+ "message": "Microsoft.Data.OData.BadRequest"
}
],
-
"innererror": {
-
- "trace": ["at Microsoft.Data.OData.MediaTypeUtils.GetContentTypeFromSettings....","callmethod2 etc"],
-
- "context": {"key1":"for debug deployment only"}
+ "trace": ["at Microsoft.Data.OData.MediaTypeUtils.GetContentTypeFromSettings....", "callmethod2 etc"],
+ "context": {
+ "key1": "for debug deployment only"
+ }
}
}
-
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/main/resources/V40/metadata.xml
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/metadata.xml b/fit/src/main/resources/V40/metadata.xml
index 5e7c9c6..4bb360c 100644
--- a/fit/src/main/resources/V40/metadata.xml
+++ b/fit/src/main/resources/V40/metadata.xml
@@ -22,418 +22,441 @@
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
<edmx:DataServices>
<Schema Namespace="Microsoft.Test.OData.Services.ODataWCFService" xmlns="http://docs.oasis-open.org/odata/ns/edm">
+ <Term Name="IsBoss" Type="Edm.Boolean"/>
<ComplexType Name="Address">
- <Property Name="Street" Type="Edm.String" Nullable="false" />
- <Property Name="City" Type="Edm.String" Nullable="false" />
- <Property Name="PostalCode" Type="Edm.String" Nullable="false" />
+ <Property Name="Street" Type="Edm.String" Nullable="false"/>
+ <Property Name="City" Type="Edm.String" Nullable="false"/>
+ <Property Name="PostalCode" Type="Edm.String" Nullable="false"/>
</ComplexType>
<ComplexType Name="HomeAddress" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Address">
- <Property Name="FamilyName" Type="Edm.String" />
+ <Property Name="FamilyName" Type="Edm.String"/>
</ComplexType>
<ComplexType Name="CompanyAddress" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Address">
- <Property Name="CompanyName" Type="Edm.String" Nullable="false" />
- <NavigationProperty Name="Contact" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="true" />
+ <Property Name="CompanyName" Type="Edm.String" Nullable="false"/>
</ComplexType>
<EnumType Name="AccessLevel" IsFlags="true">
- <Member Name="None" Value="0" />
- <Member Name="Read" Value="1" />
- <Member Name="Write" Value="2" />
- <Member Name="Execute" Value="4" />
- <Member Name="ReadWrite" Value="3" />
+ <Member Name="None" Value="0"/>
+ <Member Name="Read" Value="1"/>
+ <Member Name="Write" Value="2"/>
+ <Member Name="Execute" Value="4"/>
+ <Member Name="ReadWrite" Value="3"/>
</EnumType>
<EnumType Name="Color">
- <Member Name="Red" Value="1" />
- <Member Name="Green" Value="2" />
- <Member Name="Blue" Value="4" />
+ <Member Name="Red" Value="1"/>
+ <Member Name="Green" Value="2"/>
+ <Member Name="Blue" Value="4"/>
</EnumType>
<EnumType Name="CompanyCategory">
- <Member Name="IT" Value="0" />
- <Member Name="Communication" Value="1" />
- <Member Name="Electronics" Value="2" />
- <Member Name="Others" Value="4" />
+ <Member Name="IT" Value="0"/>
+ <Member Name="Communication" Value="1"/>
+ <Member Name="Electronics" Value="2"/>
+ <Member Name="Others" Value="4"/>
</EnumType>
<EntityType Name="Person">
<Key>
- <PropertyRef Name="PersonID" />
+ <PropertyRef Name="PersonID"/>
</Key>
- <Property Name="PersonID" Type="Edm.Int32" Nullable="false" />
- <Property Name="FirstName" Type="Edm.String" Nullable="false" />
- <Property Name="LastName" Type="Edm.String" Nullable="false" />
- <Property Name="MiddleName" Type="Edm.String" />
- <Property Name="HomeAddress" Type="Microsoft.Test.OData.Services.ODataWCFService.Address" />
- <Property Name="Home" Type="Edm.GeographyPoint" SRID="4326" />
- <Property Name="Numbers" Type="Collection(Edm.String)" Nullable="false" />
- <Property Name="Emails" Type="Collection(Edm.String)" />
- <NavigationProperty Name="Parent" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false" />
+ <Property Name="PersonID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="FirstName" Type="Edm.String" Nullable="false"/>
+ <Property Name="LastName" Type="Edm.String" Nullable="false"/>
+ <Property Name="MiddleName" Type="Edm.String"/>
+ <Property Name="HomeAddress" Type="Microsoft.Test.OData.Services.ODataWCFService.Address"/>
+ <Property Name="Home" Type="Edm.GeographyPoint" SRID="4326"/>
+ <Property Name="Numbers" Type="Collection(Edm.String)" Nullable="false"/>
+ <Property Name="Emails" Type="Collection(Edm.String)"/>
+ <NavigationProperty Name="Parent" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
</EntityType>
<EntityType Name="Customer" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Person">
- <Property Name="City" Type="Edm.String" Nullable="false" />
- <Property Name="Birthday" Type="Edm.DateTimeOffset" Nullable="false" />
- <Property Name="TimeBetweenLastTwoOrders" Type="Edm.Duration" Nullable="false" />
- <NavigationProperty Name="Orders" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Order)" />
- <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="VipCustomer" />
+ <Property Name="City" Type="Edm.String" Nullable="false"/>
+ <Property Name="Birthday" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="TimeBetweenLastTwoOrders" Type="Edm.Duration" Nullable="false"/>
+ <NavigationProperty Name="Orders" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Order)"/>
+ <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="VipCustomer"/>
</EntityType>
<EntityType Name="Employee" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Person">
- <Property Name="DateHired" Type="Edm.DateTimeOffset" Nullable="false" />
- <Property Name="Office" Type="Edm.GeographyPoint" SRID="4326" />
- <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="Employees" />
+ <Property Name="DateHired" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="Office" Type="Edm.GeographyPoint" SRID="4326"/>
+ <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="Employees"/>
</EntityType>
<EntityType Name="Product">
<Key>
- <PropertyRef Name="ProductID" />
+ <PropertyRef Name="ProductID"/>
</Key>
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" Nullable="false" />
- <Property Name="QuantityPerUnit" Type="Edm.String" Nullable="false" />
- <Property Name="UnitPrice" Type="Edm.Single" Nullable="false" />
- <Property Name="QuantityInStock" Type="Edm.Int32" Nullable="false" />
- <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false" />
- <Property Name="UserAccess" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel" />
- <Property Name="SkinColor" Type="Microsoft.Test.OData.Services.ODataWCFService.Color" />
- <Property Name="CoverColors" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Color)" Nullable="false" />
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String" Nullable="false"/>
+ <Property Name="QuantityPerUnit" Type="Edm.String" Nullable="false"/>
+ <Property Name="UnitPrice" Type="Edm.Single" Nullable="false"/>
+ <Property Name="QuantityInStock" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false"/>
+ <Property Name="UserAccess" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel"/>
+ <Property Name="SkinColor" Type="Microsoft.Test.OData.Services.ODataWCFService.Color"/>
+ <Property Name="CoverColors" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Color)" Nullable="false"/>
<NavigationProperty Name="Details" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.ProductDetail)">
- <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID" />
+ <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID"/>
</NavigationProperty>
</EntityType>
<EntityType Name="ProductDetail">
<Key>
- <PropertyRef Name="ProductID" />
- <PropertyRef Name="ProductDetailID" />
+ <PropertyRef Name="ProductID"/>
+ <PropertyRef Name="ProductDetailID"/>
</Key>
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductDetailID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductName" Type="Edm.String" Nullable="false" />
- <Property Name="Description" Type="Edm.String" Nullable="false" />
- <NavigationProperty Name="RelatedProduct" Type="Microsoft.Test.OData.Services.ODataWCFService.Product" />
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ProductDetailID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ProductName" Type="Edm.String" Nullable="false"/>
+ <Property Name="Description" Type="Edm.String" Nullable="false"/>
+ <NavigationProperty Name="RelatedProduct" Type="Microsoft.Test.OData.Services.ODataWCFService.Product"/>
<NavigationProperty Name="Reviews" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.ProductReview)">
- <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID" />
- <ReferentialConstraint Property="ProductDetailID" ReferencedProperty="ProductDetailID" />
+ <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID"/>
+ <ReferentialConstraint Property="ProductDetailID" ReferencedProperty="ProductDetailID"/>
</NavigationProperty>
</EntityType>
<EntityType Name="ProductReview">
<Key>
- <PropertyRef Name="ProductID" />
- <PropertyRef Name="ProductDetailID" />
- <PropertyRef Name="ReviewTitle" />
- <PropertyRef Name="RevisionID" />
+ <PropertyRef Name="ProductID"/>
+ <PropertyRef Name="ProductDetailID"/>
+ <PropertyRef Name="ReviewTitle"/>
+ <PropertyRef Name="RevisionID"/>
</Key>
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductDetailID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ReviewTitle" Type="Edm.String" Nullable="false" />
- <Property Name="RevisionID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Comment" Type="Edm.String" Nullable="false" />
- <Property Name="Author" Type="Edm.String" Nullable="false" />
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ProductDetailID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ReviewTitle" Type="Edm.String" Nullable="false"/>
+ <Property Name="RevisionID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Comment" Type="Edm.String" Nullable="false"/>
+ <Property Name="Author" Type="Edm.String" Nullable="false"/>
</EntityType>
<EntityType Name="Order">
<Key>
- <PropertyRef Name="OrderID" />
+ <PropertyRef Name="OrderID"/>
</Key>
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="OrderDate" Type="Edm.DateTimeOffset" Nullable="false" />
- <Property Name="ShelfLife" Type="Edm.Duration" />
- <Property Name="OrderShelfLifes" Type="Collection(Edm.Duration)" />
- <NavigationProperty Name="LoggedInEmployee" Type="Microsoft.Test.OData.Services.ODataWCFService.Employee" Nullable="false" />
- <NavigationProperty Name="CustomerForOrder" Type="Microsoft.Test.OData.Services.ODataWCFService.Customer" Nullable="false" />
- <NavigationProperty Name="OrderDetails" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.OrderDetail)" />
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="OrderDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="ShelfLife" Type="Edm.Duration"/>
+ <Property Name="OrderShelfLifes" Type="Collection(Edm.Duration)"/>
+ <NavigationProperty Name="LoggedInEmployee" Type="Microsoft.Test.OData.Services.ODataWCFService.Employee" Nullable="false"/>
+ <NavigationProperty Name="CustomerForOrder" Type="Microsoft.Test.OData.Services.ODataWCFService.Customer" Nullable="false"/>
+ <NavigationProperty Name="OrderDetails" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.OrderDetail)"/>
</EntityType>
<EntityType Name="OrderDetail">
<Key>
- <PropertyRef Name="OrderID" />
- <PropertyRef Name="ProductID" />
+ <PropertyRef Name="OrderID"/>
+ <PropertyRef Name="ProductID"/>
</Key>
- <Property Name="OrderID" Type="Edm.Int32" Nullable="false" />
- <Property Name="ProductID" Type="Edm.Int32" Nullable="false" />
- <Property Name="OrderPlaced" Type="Edm.DateTimeOffset" Nullable="false" />
- <Property Name="Quantity" Type="Edm.Int32" Nullable="false" />
- <Property Name="UnitPrice" Type="Edm.Single" Nullable="false" />
- <NavigationProperty Name="ProductOrdered" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" />
- <NavigationProperty Name="AssociatedOrder" Type="Microsoft.Test.OData.Services.ODataWCFService.Order" Nullable="false" />
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="OrderPlaced" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="Quantity" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="UnitPrice" Type="Edm.Single" Nullable="false"/>
+ <NavigationProperty Name="ProductOrdered" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)"/>
+ <NavigationProperty Name="AssociatedOrder" Type="Microsoft.Test.OData.Services.ODataWCFService.Order" Nullable="false"/>
</EntityType>
<EntityType Name="Department">
<Key>
- <PropertyRef Name="DepartmentID" />
+ <PropertyRef Name="DepartmentID"/>
</Key>
- <Property Name="DepartmentID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" Nullable="false" />
- <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="Departments" />
+ <Property Name="DepartmentID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String" Nullable="false"/>
+ <Property Name="DepartmentNO" Type="Edm.String"/>
+ <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="Departments"/>
</EntityType>
- <EntityType Name="Company">
+ <EntityType Name="Company" OpenType="true">
<Key>
- <PropertyRef Name="CompanyID" />
+ <PropertyRef Name="CompanyID"/>
</Key>
- <Property Name="CompanyID" Type="Edm.Int32" Nullable="false" />
- <Property Name="CompanyCategory" Type="Microsoft.Test.OData.Services.ODataWCFService.CompanyCategory" />
- <Property Name="Revenue" Type="Edm.Int64" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <Property Name="Address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address" />
- <NavigationProperty Name="Employees" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Employee)" Partner="Company" />
- <NavigationProperty Name="VipCustomer" Type="Microsoft.Test.OData.Services.ODataWCFService.Customer" Nullable="false" Partner="Company" />
- <NavigationProperty Name="Departments" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Department)" Partner="Company" />
- <NavigationProperty Name="CoreDepartment" Type="Microsoft.Test.OData.Services.ODataWCFService.Department" Nullable="false" />
+ <Property Name="CompanyID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="CompanyCategory" Type="Microsoft.Test.OData.Services.ODataWCFService.CompanyCategory"/>
+ <Property Name="Revenue" Type="Edm.Int64" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
+ <Property Name="Address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address"/>
+ <NavigationProperty Name="Employees" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Employee)" Partner="Company"/>
+ <NavigationProperty Name="VipCustomer" Type="Microsoft.Test.OData.Services.ODataWCFService.Customer" Nullable="false" Partner="Company"/>
+ <NavigationProperty Name="Departments" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Department)" Partner="Company"/>
+ <NavigationProperty Name="CoreDepartment" Type="Microsoft.Test.OData.Services.ODataWCFService.Department" Nullable="false"/>
</EntityType>
- <EntityType Name="PublicCompany" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Company">
- <Property Name="StockExchange" Type="Edm.String" />
- <NavigationProperty Name="Assets" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Asset)" ContainsTarget="true" />
- <NavigationProperty Name="Club" Type="Microsoft.Test.OData.Services.ODataWCFService.Club" Nullable="false" ContainsTarget="true" />
- <NavigationProperty Name="LabourUnion" Type="Microsoft.Test.OData.Services.ODataWCFService.LabourUnion" Nullable="false" />
+ <EntityType Name="PublicCompany" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Company" OpenType="true">
+ <Property Name="StockExchange" Type="Edm.String"/>
+ <NavigationProperty Name="Assets" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Asset)" ContainsTarget="true"/>
+ <NavigationProperty Name="Club" Type="Microsoft.Test.OData.Services.ODataWCFService.Club" Nullable="false" ContainsTarget="true"/>
+ <NavigationProperty Name="LabourUnion" Type="Microsoft.Test.OData.Services.ODataWCFService.LabourUnion" Nullable="false"/>
</EntityType>
<EntityType Name="Asset">
<Key>
- <PropertyRef Name="AssetID" />
+ <PropertyRef Name="AssetID"/>
</Key>
- <Property Name="AssetID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
- <Property Name="Number" Type="Edm.Int32" Nullable="false" />
+ <Property Name="AssetID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
+ <Property Name="Number" Type="Edm.Int32" Nullable="false"/>
</EntityType>
<EntityType Name="Club">
<Key>
- <PropertyRef Name="ClubID" />
+ <PropertyRef Name="ClubID"/>
</Key>
- <Property Name="ClubID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
+ <Property Name="ClubID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
</EntityType>
<EntityType Name="LabourUnion">
<Key>
- <PropertyRef Name="LabourUnionID" />
+ <PropertyRef Name="LabourUnionID"/>
</Key>
- <Property Name="LabourUnionID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Name" Type="Edm.String" />
+ <Property Name="LabourUnionID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
</EntityType>
<Action Name="AddAccessRight" IsBound="true">
- <Parameter Name="product" Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false" />
- <Parameter Name="accessRight" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel" />
+ <Parameter Name="product" Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false"/>
+ <Parameter Name="accessRight" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel"/>
</Action>
<Action Name="IncreaseRevenue" IsBound="true">
- <Parameter Name="p" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" />
- <Parameter Name="IncreaseValue" Type="Edm.Int64" />
- <ReturnType Type="Edm.Int64" Nullable="false" />
+ <Parameter Name="p" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false"/>
+ <Parameter Name="IncreaseValue" Type="Edm.Int64"/>
+ <ReturnType Type="Edm.Int64" Nullable="false"/>
</Action>
<Action Name="ResetAddress" IsBound="true" EntitySetPath="person">
- <Parameter Name="person" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false" />
- <Parameter Name="addresses" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Address)" Nullable="false" />
- <Parameter Name="index" Type="Edm.Int32" Nullable="false" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false" />
+ <Parameter Name="person" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
+ <Parameter Name="addresses" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Address)" Nullable="false"/>
+ <Parameter Name="index" Type="Edm.Int32" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
</Action>
<Action Name="Discount" IsBound="true" EntitySetPath="products">
- <Parameter Name="products" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false" />
- <Parameter Name="percentage" Type="Edm.Int32" Nullable="false" />
- <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false" />
+ <Parameter Name="products" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false"/>
+ <Parameter Name="percentage" Type="Edm.Int32" Nullable="false"/>
+ <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false"/>
</Action>
<Action Name="Discount">
- <Parameter Name="percentage" Type="Edm.Int32" Nullable="false" />
+ <Parameter Name="percentage" Type="Edm.Int32" Nullable="false"/>
</Action>
<Action Name="ResetBossEmail">
- <Parameter Name="emails" Type="Collection(Edm.String)" Nullable="false" />
- <ReturnType Type="Collection(Edm.String)" Nullable="false" />
+ <Parameter Name="emails" Type="Collection(Edm.String)" Nullable="false"/>
+ <ReturnType Type="Collection(Edm.String)" Nullable="false"/>
</Action>
<Action Name="ResetBossAddress">
- <Parameter Name="address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false" />
+ <Parameter Name="address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false"/>
</Action>
+ <Action Name="ResetDataSource"/>
<Function Name="GetEmployeesCount" IsBound="true">
- <Parameter Name="p" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" />
- <ReturnType Type="Edm.Int32" Nullable="false" />
+ <Parameter Name="p" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false"/>
+ <ReturnType Type="Edm.Int32" Nullable="false"/>
</Function>
<Function Name="GetProductDetails" IsBound="true" EntitySetPath="product/Details" IsComposable="true">
- <Parameter Name="product" Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false" />
- <Parameter Name="count" Type="Edm.Int32" />
- <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.ProductDetail)" Nullable="false" />
+ <Parameter Name="product" Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false"/>
+ <Parameter Name="count" Type="Edm.Int32"/>
+ <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.ProductDetail)" Nullable="false"/>
</Function>
- <Function Name="GetRelatedProduct" IsBound="true" EntitySetPath="productDetail/Products" IsComposable="true">
- <Parameter Name="productDetail" Type="Microsoft.Test.OData.Services.ODataWCFService.ProductDetail" Nullable="false" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false" />
+ <Function Name="GetRelatedProduct" IsBound="true" EntitySetPath="productDetail/RelatedProduct" IsComposable="true">
+ <Parameter Name="productDetail" Type="Microsoft.Test.OData.Services.ODataWCFService.ProductDetail" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false"/>
</Function>
<Function Name="GetDefaultColor" IsComposable="true">
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Color" />
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Color"/>
</Function>
<Function Name="GetPerson" IsComposable="true">
- <Parameter Name="address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false" />
+ <Parameter Name="address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
</Function>
<Function Name="GetPerson2" IsComposable="true">
- <Parameter Name="city" Type="Edm.String" Nullable="false" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false" />
+ <Parameter Name="city" Type="Edm.String" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
</Function>
<Function Name="GetAllProducts" IsComposable="true">
- <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false" />
+ <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false"/>
</Function>
<Function Name="GetBossEmails">
- <Parameter Name="start" Type="Edm.Int32" Nullable="false" />
- <Parameter Name="count" Type="Edm.Int32" Nullable="false" />
- <ReturnType Type="Collection(Edm.String)" Nullable="false" />
+ <Parameter Name="start" Type="Edm.Int32" Nullable="false"/>
+ <Parameter Name="count" Type="Edm.Int32" Nullable="false"/>
+ <ReturnType Type="Collection(Edm.String)" Nullable="false"/>
</Function>
<Function Name="GetProductsByAccessLevel">
- <Parameter Name="accessLevel" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel" />
- <ReturnType Type="Collection(Edm.String)" Nullable="false" />
+ <Parameter Name="accessLevel" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel" Nullable="false"/>
+ <ReturnType Type="Collection(Edm.String)" Nullable="false"/>
</Function>
<Function Name="GetActualAmount" IsBound="true">
- <Parameter Name="giftcard" Type="Microsoft.Test.OData.Services.ODataWCFService.GiftCard" Nullable="false" />
- <Parameter Name="bonusRate" Type="Edm.Double" />
- <ReturnType Type="Edm.Double" Nullable="false" />
+ <Parameter Name="giftcard" Type="Microsoft.Test.OData.Services.ODataWCFService.GiftCard" Nullable="false"/>
+ <Parameter Name="bonusRate" Type="Edm.Double"/>
+ <ReturnType Type="Edm.Double" Nullable="false"/>
</Function>
<Function Name="GetDefaultPI" IsBound="true" EntitySetPath="account/MyPaymentInstruments">
- <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument" />
+ <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument"/>
</Function>
<Action Name="RefreshDefaultPI" IsBound="true" EntitySetPath="account/MyPaymentInstruments">
- <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false" />
- <Parameter Name="newDate" Type="Edm.DateTimeOffset" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument" />
+ <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false"/>
+ <Parameter Name="newDate" Type="Edm.DateTimeOffset"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument"/>
</Action>
<Function Name="GetHomeAddress" IsBound="true" IsComposable="true">
- <Parameter Name="person" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.HomeAddress" Nullable="false" />
+ <Parameter Name="person" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.HomeAddress" Nullable="false"/>
</Function>
<Function Name="GetAccountInfo" IsBound="true" IsComposable="true">
- <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false" />
- <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.AccountInfo" Nullable="false" />
+ <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.AccountInfo" Nullable="false"/>
</Function>
<ComplexType Name="AccountInfo" OpenType="true">
- <Property Name="FirstName" Type="Edm.String" Nullable="false" />
- <Property Name="LastName" Type="Edm.String" Nullable="false" />
+ <Property Name="FirstName" Type="Edm.String" Nullable="false"/>
+ <Property Name="LastName" Type="Edm.String" Nullable="false"/>
</ComplexType>
<EntityType Name="Account">
<Key>
- <PropertyRef Name="AccountID" />
+ <PropertyRef Name="AccountID"/>
</Key>
- <Property Name="AccountID" Type="Edm.Int32" Nullable="false" />
- <Property Name="Country" Type="Edm.String" Nullable="false" />
- <Property Name="AccountInfo" Type="Microsoft.Test.OData.Services.ODataWCFService.AccountInfo" />
- <NavigationProperty Name="MyGiftCard" Type="Microsoft.Test.OData.Services.ODataWCFService.GiftCard" ContainsTarget="true" />
- <NavigationProperty Name="MyPaymentInstruments" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument)" ContainsTarget="true" />
- <NavigationProperty Name="ActiveSubscriptions" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Subscription)" ContainsTarget="true" />
- <NavigationProperty Name="AvailableSubscriptionTemplatess" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Subscription)" />
+ <Property Name="AccountID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Country" Type="Edm.String" Nullable="false"/>
+ <Property Name="AccountInfo" Type="Microsoft.Test.OData.Services.ODataWCFService.AccountInfo"/>
+ <NavigationProperty Name="MyGiftCard" Type="Microsoft.Test.OData.Services.ODataWCFService.GiftCard" ContainsTarget="true"/>
+ <NavigationProperty Name="MyPaymentInstruments" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument)" ContainsTarget="true"/>
+ <NavigationProperty Name="ActiveSubscriptions" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Subscription)" ContainsTarget="true"/>
+ <NavigationProperty Name="AvailableSubscriptionTemplatess" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Subscription)"/>
</EntityType>
<EntityType Name="GiftCard">
<Key>
- <PropertyRef Name="GiftCardID" />
+ <PropertyRef Name="GiftCardID"/>
</Key>
- <Property Name="GiftCardID" Type="Edm.Int32" Nullable="false" />
- <Property Name="GiftCardNO" Type="Edm.String" Nullable="false" />
- <Property Name="Amount" Type="Edm.Double" Nullable="false" />
- <Property Name="ExperationDate" Type="Edm.DateTimeOffset" Nullable="false" />
+ <Property Name="GiftCardID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="GiftCardNO" Type="Edm.String" Nullable="false"/>
+ <Property Name="Amount" Type="Edm.Double" Nullable="false"/>
+ <Property Name="ExperationDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="OwnerName" Type="Edm.String"/>
</EntityType>
<EntityType Name="PaymentInstrument">
<Key>
- <PropertyRef Name="PaymentInstrumentID" />
+ <PropertyRef Name="PaymentInstrumentID"/>
</Key>
- <Property Name="PaymentInstrumentID" Type="Edm.Int32" Nullable="false" />
- <Property Name="FriendlyName" Type="Edm.String" Nullable="false" />
- <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false" />
- <NavigationProperty Name="TheStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI" Nullable="false" />
- <NavigationProperty Name="BillingStatements" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Statement)" ContainsTarget="true" />
- <NavigationProperty Name="BackupStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI" Nullable="false" />
+ <Property Name="PaymentInstrumentID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="FriendlyName" Type="Edm.String" Nullable="false"/>
+ <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <NavigationProperty Name="TheStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI" Nullable="false"/>
+ <NavigationProperty Name="BillingStatements" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Statement)" ContainsTarget="true"/>
+ <NavigationProperty Name="BackupStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI" Nullable="false"/>
</EntityType>
<EntityType Name="CreditCardPI" BaseType="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument">
- <Property Name="CardNumber" Type="Edm.String" Nullable="false" />
- <Property Name="CVV" Type="Edm.String" Nullable="false" />
- <Property Name="HolderName" Type="Edm.String" Nullable="false" />
- <Property Name="Balance" Type="Edm.Double" Nullable="false" />
- <Property Name="ExperationDate" Type="Edm.DateTimeOffset" Nullable="false" />
- <NavigationProperty Name="CreditRecords" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.CreditRecord)" ContainsTarget="true" />
+ <Property Name="CardNumber" Type="Edm.String" Nullable="false"/>
+ <Property Name="CVV" Type="Edm.String" Nullable="false"/>
+ <Property Name="HolderName" Type="Edm.String" Nullable="false"/>
+ <Property Name="Balance" Type="Edm.Double" Nullable="false"/>
+ <Property Name="ExperationDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <NavigationProperty Name="CreditRecords" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.CreditRecord)" ContainsTarget="true"/>
</EntityType>
<EntityType Name="StoredPI">
<Key>
- <PropertyRef Name="StoredPIID" />
+ <PropertyRef Name="StoredPIID"/>
</Key>
- <Property Name="StoredPIID" Type="Edm.Int32" Nullable="false" />
- <Property Name="PIName" Type="Edm.String" Nullable="false" />
- <Property Name="PIType" Type="Edm.String" Nullable="false" />
- <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false" />
+ <Property Name="StoredPIID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="PIName" Type="Edm.String" Nullable="false"/>
+ <Property Name="PIType" Type="Edm.String" Nullable="false"/>
+ <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false"/>
</EntityType>
<EntityType Name="Statement">
<Key>
- <PropertyRef Name="StatementID" />
+ <PropertyRef Name="StatementID"/>
</Key>
- <Property Name="StatementID" Type="Edm.Int32" Nullable="false" />
- <Property Name="TransactionType" Type="Edm.String" Nullable="false" />
- <Property Name="TransactionDescription" Type="Edm.String" Nullable="false" />
- <Property Name="Amount" Type="Edm.Double" Nullable="false" />
+ <Property Name="StatementID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="TransactionType" Type="Edm.String" Nullable="false"/>
+ <Property Name="TransactionDescription" Type="Edm.String" Nullable="false"/>
+ <Property Name="Amount" Type="Edm.Double" Nullable="false"/>
</EntityType>
<EntityType Name="CreditRecord">
<Key>
- <PropertyRef Name="CreditRecordID" />
+ <PropertyRef Name="CreditRecordID"/>
</Key>
- <Property Name="CreditRecordID" Type="Edm.Int32" Nullable="false" />
- <Property Name="IsGood" Type="Edm.Boolean" Nullable="false" />
- <Property Name="Reason" Type="Edm.String" Nullable="false" />
- <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false" />
+ <Property Name="CreditRecordID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="IsGood" Type="Edm.Boolean" Nullable="false"/>
+ <Property Name="Reason" Type="Edm.String" Nullable="false"/>
+ <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false"/>
</EntityType>
<EntityType Name="Subscription">
<Key>
- <PropertyRef Name="SubscriptionID" />
+ <PropertyRef Name="SubscriptionID"/>
</Key>
- <Property Name="SubscriptionID" Type="Edm.Int32" Nullable="false" />
- <Property Name="TemplateGuid" Type="Edm.String" Nullable="false" />
- <Property Name="Title" Type="Edm.String" Nullable="false" />
- <Property Name="Category" Type="Edm.String" Nullable="false" />
- <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false" />
+ <Property Name="SubscriptionID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="TemplateGuid" Type="Edm.String" Nullable="false"/>
+ <Property Name="Title" Type="Edm.String" Nullable="false"/>
+ <Property Name="Category" Type="Edm.String" Nullable="false"/>
+ <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false"/>
</EntityType>
<EntityContainer Name="InMemoryEntities">
<EntitySet Name="People" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Person">
- <NavigationPropertyBinding Path="Parent" Target="People" />
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
</EntitySet>
- <Singleton Name="Boss" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" />
+ <Singleton Name="Boss" Type="Microsoft.Test.OData.Services.ODataWCFService.Person">
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
+ </Singleton>
<EntitySet Name="Customers" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Customer">
- <NavigationPropertyBinding Path="Orders" Target="Orders" />
+ <NavigationPropertyBinding Path="Orders" Target="Orders"/>
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
</EntitySet>
<Singleton Name="VipCustomer" Type="Microsoft.Test.OData.Services.ODataWCFService.Customer">
- <NavigationPropertyBinding Path="Orders" Target="Orders" />
- <NavigationPropertyBinding Path="Company" Target="Company" />
+ <NavigationPropertyBinding Path="Orders" Target="Orders"/>
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
+ <NavigationPropertyBinding Path="Company" Target="Company"/>
</Singleton>
<EntitySet Name="Employees" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Employee">
- <NavigationPropertyBinding Path="Company" Target="Company" />
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
+ <NavigationPropertyBinding Path="Company" Target="Company"/>
</EntitySet>
<EntitySet Name="Products" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Product">
- <NavigationPropertyBinding Path="Details" Target="ProductDetails" />
+ <NavigationPropertyBinding Path="Details" Target="ProductDetails"/>
</EntitySet>
<EntitySet Name="ProductDetails" EntityType="Microsoft.Test.OData.Services.ODataWCFService.ProductDetail">
- <NavigationPropertyBinding Path="RelatedProduct" Target="Products" />
- <NavigationPropertyBinding Path="Reviews" Target="ProductReviews" />
+ <NavigationPropertyBinding Path="RelatedProduct" Target="Products"/>
+ <NavigationPropertyBinding Path="Reviews" Target="ProductReviews"/>
</EntitySet>
- <EntitySet Name="ProductReviews" EntityType="Microsoft.Test.OData.Services.ODataWCFService.ProductReview" />
+ <EntitySet Name="ProductReviews" EntityType="Microsoft.Test.OData.Services.ODataWCFService.ProductReview"/>
<EntitySet Name="Orders" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Order">
- <NavigationPropertyBinding Path="LoggedInEmployee" Target="Employees" />
- <NavigationPropertyBinding Path="CustomerForOrder" Target="Customers" />
- <NavigationPropertyBinding Path="OrderDetails" Target="OrderDetails" />
+ <NavigationPropertyBinding Path="LoggedInEmployee" Target="Employees"/>
+ <NavigationPropertyBinding Path="CustomerForOrder" Target="Customers"/>
+ <NavigationPropertyBinding Path="OrderDetails" Target="OrderDetails"/>
+ <Annotation Term="Core.ChangeTracking">
+ <Record>
+ <PropertyValue Property="Supported" Bool="true"/>
+ <PropertyValue Property="FilterableProperties">
+ <Collection>
+ <PropertyPath>OrderID</PropertyPath>
+ </Collection>
+ </PropertyValue>
+ <PropertyValue Property="ExpandableProperties">
+ <Collection>
+ <PropertyPath>OrderDetails</PropertyPath>
+ </Collection>
+ </PropertyValue>
+ </Record>
+ </Annotation>
</EntitySet>
<EntitySet Name="OrderDetails" EntityType="Microsoft.Test.OData.Services.ODataWCFService.OrderDetail">
- <NavigationPropertyBinding Path="AssociatedOrder" Target="Orders" />
- <NavigationPropertyBinding Path="ProductOrdered" Target="Products" />
+ <NavigationPropertyBinding Path="AssociatedOrder" Target="Orders"/>
+ <NavigationPropertyBinding Path="ProductOrdered" Target="Products"/>
</EntitySet>
<EntitySet Name="Departments" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Department">
- <NavigationPropertyBinding Path="Company" Target="Company" />
+ <NavigationPropertyBinding Path="Company" Target="Company"/>
</EntitySet>
<Singleton Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company">
- <NavigationPropertyBinding Path="Employees" Target="Employees" />
- <NavigationPropertyBinding Path="VipCustomer" Target="VipCustomer" />
- <NavigationPropertyBinding Path="Departments" Target="Departments" />
- <NavigationPropertyBinding Path="CoreDepartment" Target="Departments" />
+ <NavigationPropertyBinding Path="Employees" Target="Employees"/>
+ <NavigationPropertyBinding Path="VipCustomer" Target="VipCustomer"/>
+ <NavigationPropertyBinding Path="Departments" Target="Departments"/>
+ <NavigationPropertyBinding Path="CoreDepartment" Target="Departments"/>
</Singleton>
<Singleton Name="PublicCompany" Type="Microsoft.Test.OData.Services.ODataWCFService.Company">
- <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PublicCompany/LabourUnion" Target="LabourUnion" />
+ <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PublicCompany/LabourUnion" Target="LabourUnion"/>
</Singleton>
- <Singleton Name="LabourUnion" Type="Microsoft.Test.OData.Services.ODataWCFService.LabourUnion" />
- <ActionImport Name="Discount" Action="Microsoft.Test.OData.Services.ODataWCFService.Discount" />
- <ActionImport Name="ResetBossEmail" Action="Microsoft.Test.OData.Services.ODataWCFService.ResetBossEmail" />
- <ActionImport Name="ResetBossAddress" Action="Microsoft.Test.OData.Services.ODataWCFService.ResetBossAddress" />
- <FunctionImport Name="GetDefaultColor" Function="Microsoft.Test.OData.Services.ODataWCFService.GetDefaultColor" />
- <FunctionImport Name="GetPerson" Function="Microsoft.Test.OData.Services.ODataWCFService.GetPerson" EntitySet="People" />
- <FunctionImport Name="GetPerson2" Function="Microsoft.Test.OData.Services.ODataWCFService.GetPerson2" EntitySet="People" />
- <FunctionImport Name="GetAllProducts" Function="Microsoft.Test.OData.Services.ODataWCFService.GetAllProducts" EntitySet="Products" />
- <FunctionImport Name="GetBossEmails" Function="Microsoft.Test.OData.Services.ODataWCFService.GetBossEmails" />
- <FunctionImport Name="GetProductsByAccessLevel" Function="Microsoft.Test.OData.Services.ODataWCFService.GetProductsByAccessLevel" />
+ <Singleton Name="LabourUnion" Type="Microsoft.Test.OData.Services.ODataWCFService.LabourUnion"/>
+ <ActionImport Name="Discount" Action="Microsoft.Test.OData.Services.ODataWCFService.Discount"/>
+ <ActionImport Name="ResetBossEmail" Action="Microsoft.Test.OData.Services.ODataWCFService.ResetBossEmail"/>
+ <ActionImport Name="ResetBossAddress" Action="Microsoft.Test.OData.Services.ODataWCFService.ResetBossAddress"/>
+ <ActionImport Name="ResetDataSource" Action="Microsoft.Test.OData.Services.ODataWCFService.ResetDataSource"/>
+ <FunctionImport Name="GetDefaultColor" Function="Microsoft.Test.OData.Services.ODataWCFService.GetDefaultColor" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetPerson" Function="Microsoft.Test.OData.Services.ODataWCFService.GetPerson" EntitySet="People" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetPerson2" Function="Microsoft.Test.OData.Services.ODataWCFService.GetPerson2" EntitySet="People" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetAllProducts" Function="Microsoft.Test.OData.Services.ODataWCFService.GetAllProducts" EntitySet="Products" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetBossEmails" Function="Microsoft.Test.OData.Services.ODataWCFService.GetBossEmails" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetProductsByAccessLevel" Function="Microsoft.Test.OData.Services.ODataWCFService.GetProductsByAccessLevel" IncludeInServiceDocument="true"/>
<EntitySet Name="Accounts" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Account">
- <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument/TheStoredPI" Target="StoredPIs" />
- <NavigationPropertyBinding Path="AvailableSubscriptionTemplatess" Target="SubscriptionTemplates" />
- <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument/BackupStoredPI" Target="DefaultStoredPI" />
+ <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument/TheStoredPI" Target="StoredPIs"/>
+ <NavigationPropertyBinding Path="AvailableSubscriptionTemplatess" Target="SubscriptionTemplates"/>
+ <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument/BackupStoredPI" Target="DefaultStoredPI"/>
</EntitySet>
- <EntitySet Name="StoredPIs" EntityType="Microsoft.Test.OData.Services.ODataWCFService.StoredPI" />
- <EntitySet Name="SubscriptionTemplates" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Subscription" />
- <Singleton Name="DefaultStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI" />
+ <EntitySet Name="StoredPIs" EntityType="Microsoft.Test.OData.Services.ODataWCFService.StoredPI"/>
+ <EntitySet Name="SubscriptionTemplates" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Subscription"/>
+ <Singleton Name="DefaultStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI"/>
</EntityContainer>
</Schema>
</edmx:DataServices>
-</edmx:Edmx>
-
+</edmx:Edmx>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/main/resources/V40/notFound.json
----------------------------------------------------------------------
diff --git a/fit/src/main/resources/V40/notFound.json b/fit/src/main/resources/V40/notFound.json
index 2af4618..3f2d311 100644
--- a/fit/src/main/resources/V40/notFound.json
+++ b/fit/src/main/resources/V40/notFound.json
@@ -1,35 +1,23 @@
{
-
"error": {
-
"code": "501",
-
"message": "Unsupported functionality",
-
"target": "query",
-
"details": [
-
{
-
- "code": "301",
-
- "target": "$search",
-
- "message": "$search query option not supported"
+ "code": "301",
+ "target": "$search",
+ "message": "$search query option not supported"
}
],
-
"innererror": {
-
- "trace": ["callmethod1 etc","callmethod2 etc"],
-
- "context": {"key1":"for debug deployment only"}
+ "trace": ["callmethod1 etc", "callmethod2 etc"],
+ "context": {
+ "key1": "for debug deployment only"
+ }
}
-
}
-
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
index 7e576f0..a9530cc 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/ErrorResponseTestITCase.java
@@ -19,11 +19,10 @@
package org.apache.olingo.fit.v4;
import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
import java.net.URI;
-import java.util.Dictionary;
-
+import java.util.Map;
import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRequest;
import org.apache.olingo.commons.api.domain.ODataError;
@@ -34,43 +33,33 @@ import org.junit.Test;
public class ErrorResponseTestITCase extends AbstractTestITCase {
- @Test
- public void jsonError() {
-
- ODataPubFormat format = ODataPubFormat.JSON;
- final URI readURI = getClient().getURIBuilder(testStaticServiceRootURL)
- .appendEntitySetSegment("Customers").appendKeySegment(32)
- .build();
+ @Test
+ public void jsonError() {
+ final URI readURI = getClient().getURIBuilder(testStaticServiceRootURL).
+ appendEntitySetSegment("Customers").appendKeySegment(32).
+ build();
- final ODataEntityRequest<ODataEntity> req = getClient()
- .getRetrieveRequestFactory().getEntityRequest(readURI);
- try {
- final ODataEntity read = read(format, readURI);
- } catch (Exception ex) {
- ODataError err = ((ODataClientErrorException) ex).getODataError();
+ final ODataEntityRequest<ODataEntity> req = getClient().getRetrieveRequestFactory().getEntityRequest(readURI);
+ try {
+ final ODataEntity read = read(ODataPubFormat.JSON, readURI);
- // verify details
- ODataErrorDetail detail = (ODataErrorDetail) err.getDetails()
- .get(0);
- assertEquals("Code should be correct", "301", detail.getCode());
- assertEquals("Target should be correct", "$search",
- detail.getTarget());
- assertEquals("Message should be correct",
- "$search query option not supported", detail.getMessage());
+ fail("should have got exception");
+ } catch (Exception ex) {
+ final ODataError err = ((ODataClientErrorException) ex).getODataError();
- // verify inner error dictionary
- Dictionary<String, Object> innerErr = err.getInnerError();
- assertEquals("innerError dictionary size should be correct", 2,
- innerErr.size());
- assertEquals("innerError['context'] should be correct",
- "{\"key1\":\"for debug deployment only\"}",
- innerErr.get("context"));
- assertEquals("innerError['trace'] should be correct",
- "[\"callmethod1 etc\",\"callmethod2 etc\"]",
- innerErr.get("trace"));
- return;
- }
+ // verify details
+ final ODataErrorDetail detail = (ODataErrorDetail) err.getDetails().get(0);
+ assertEquals("Code should be correct", "301", detail.getCode());
+ assertEquals("Target should be correct", "$search", detail.getTarget());
+ assertEquals("Message should be correct", "$search query option not supported", detail.getMessage());
- assertNotNull("should have got exception", null);
- }
+ // verify inner error dictionary
+ final Map<String, String> innerErr = err.getInnerError();
+ assertEquals("innerError dictionary size should be correct", 2, innerErr.size());
+ assertEquals("innerError['context'] should be correct",
+ "{\"key1\":\"for debug deployment only\"}", innerErr.get("context"));
+ assertEquals("innerError['trace'] should be correct",
+ "[\"callmethod1 etc\",\"callmethod2 etc\"]", innerErr.get("trace"));
+ }
+ }
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java
index 4a21437..6db1804 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/MetadataTestITCase.java
@@ -20,6 +20,7 @@ package org.apache.olingo.fit.v4;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.apache.olingo.commons.api.edm.Edm;
@@ -28,35 +29,56 @@ import org.apache.olingo.commons.api.edm.EdmEntityContainer;
import org.apache.olingo.commons.api.edm.EdmEntitySet;
import org.apache.olingo.commons.api.edm.EdmEntityType;
import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.EdmProperty;
import org.apache.olingo.commons.api.edm.EdmSchema;
import org.apache.olingo.commons.api.edm.EdmTerm;
import org.apache.olingo.commons.api.edm.EdmTypeDefinition;
import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.annotation.EdmRecord;
import org.apache.olingo.commons.core.edm.primitivetype.EdmBoolean;
import org.junit.Test;
public class MetadataTestITCase extends AbstractTestITCase {
@Test
- public void retrieve() {
- final Edm metadata = client.getRetrieveRequestFactory().
- getMetadataRequest(testStaticServiceRootURL).execute().getBody();
- assertNotNull(metadata);
+ public void retrieve() throws EdmPrimitiveTypeException {
+ final Edm edm = client.getRetrieveRequestFactory().getMetadataRequest(testStaticServiceRootURL).execute().getBody();
+ assertNotNull(edm);
- final EdmEntityType order = metadata.getEntityType(
+ final EdmEntityType order = edm.getEntityType(
new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService", "Order"));
assertNotNull(order);
final EdmProperty orderDate = order.getStructuralProperty("OrderDate");
assertNotNull(orderDate);
assertEquals("Edm.DateTimeOffset", orderDate.getType().getFullQualifiedName().toString());
+
+ final EdmTerm isBoss = edm.getTerm(new FullQualifiedName(edm.getSchemas().get(0).getNamespace(), "IsBoss"));
+ assertNotNull(isBoss);
+ assertEquals(EdmBoolean.getInstance(), isBoss.getType());
+
+ final EdmEntitySet orders = edm.getSchemas().get(0).getEntityContainer().getEntitySet("Orders");
+ assertNotNull(orders);
+ assertFalse(orders.getAnnotations().isEmpty());
+ assertTrue(orders.getAnnotations().get(0).getExpression().isDynamic());
+ assertTrue(orders.getAnnotations().get(0).getExpression().asDynamic().isRecord());
+ final EdmRecord record = orders.getAnnotations().get(0).getExpression().asDynamic().asRecord();
+ assertNotNull(record);
+ assertEquals(3, record.getPropertyValues().size());
+ assertTrue(record.getPropertyValues().get(0).getValue().isConstant());
+ assertTrue(record.getPropertyValues().get(0).getValue().asConstant().getValue().asPrimitive().
+ toCastValue(Boolean.class));
+ assertTrue(record.getPropertyValues().get(1).getValue().asDynamic().isCollection());
+ assertEquals(1, record.getPropertyValues().get(1).getValue().asDynamic().asCollection().getItems().size());
+ assertTrue(record.getPropertyValues().get(1).getValue().asDynamic().asCollection().getItems().get(0).isDynamic());
+ assertEquals("OrderID", record.getPropertyValues().get(1).getValue().asDynamic().asCollection().
+ getItems().get(0).asDynamic().asPropertyPath().getValue());
}
@Test
public void include() {
- final Edm edm = client.getRetrieveRequestFactory().
- getMetadataRequest(testNorthwindRootURL).execute().getBody();
+ final Edm edm = client.getRetrieveRequestFactory().getMetadataRequest(testNorthwindRootURL).execute().getBody();
assertNotNull(edm);
final EdmEntityContainer container = edm.getEntityContainer(
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java
index 4d2df42..64e7f71 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v4/SingletonTestITCase.java
@@ -20,6 +20,7 @@ package org.apache.olingo.fit.v4;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.net.URI;
@@ -29,6 +30,7 @@ import org.apache.olingo.client.api.communication.request.retrieve.ODataEntityRe
import org.apache.olingo.client.api.communication.response.ODataEntityUpdateResponse;
import org.apache.olingo.client.api.uri.v4.URIBuilder;
import org.apache.olingo.client.api.v4.ODataClient;
+import org.apache.olingo.commons.api.domain.v4.ODataAnnotation;
import org.apache.olingo.commons.api.domain.v4.ODataValuable;
import org.apache.olingo.commons.api.domain.v4.Singleton;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
@@ -55,12 +57,12 @@ public class SingletonTestITCase extends AbstractTestITCase {
}
@Test
- public void readfromAtom() throws EdmPrimitiveTypeException {
+ public void readFromAtom() throws EdmPrimitiveTypeException {
read(client, ODataPubFormat.ATOM);
}
@Test
- public void readfromJSON() throws EdmPrimitiveTypeException {
+ public void readFromJSON() throws EdmPrimitiveTypeException {
read(edmClient, ODataPubFormat.JSON);
}
@@ -69,6 +71,37 @@ public class SingletonTestITCase extends AbstractTestITCase {
read(client, ODataPubFormat.JSON_FULL_METADATA);
}
+ private void readWithAnnotations(final ODataClient client, final ODataPubFormat format)
+ throws EdmPrimitiveTypeException {
+
+ final URIBuilder builder = client.getURIBuilder(testStaticServiceRootURL).appendSingletonSegment("Boss");
+ final ODataEntityRequest<Singleton> singleton =
+ client.getRetrieveRequestFactory().getSingletonRequest(builder.build());
+ singleton.setFormat(format);
+ singleton.setPrefer(client.newPreferences().includeAnnotations("*"));
+ final Singleton boss = singleton.execute().getBody();
+ assertNotNull(boss);
+
+ assertFalse(boss.getAnnotations().isEmpty());
+ final ODataAnnotation isBoss = boss.getAnnotations().get(0);
+ assertTrue(isBoss.getPrimitiveValue().toCastValue(Boolean.class));
+ }
+
+ @Test
+ public void readWithAnnotationsFromAtom() throws EdmPrimitiveTypeException {
+ readWithAnnotations(client, ODataPubFormat.ATOM);
+ }
+
+ @Test
+ public void readWithAnnotationsFromJSON() throws EdmPrimitiveTypeException {
+ readWithAnnotations(edmClient, ODataPubFormat.JSON);
+ }
+
+ @Test
+ public void readWithAnnotationsFromJSONFull() throws EdmPrimitiveTypeException {
+ readWithAnnotations(client, ODataPubFormat.JSON_FULL_METADATA);
+ }
+
private void update(final ODataPubFormat format) throws EdmPrimitiveTypeException {
final Singleton changes = getClient().getObjectFactory().newSingleton(
new FullQualifiedName("Microsoft.Test.OData.Services.ODataWCFService.Company"));
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java
index 270cf87..e01f7b0 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/edm/v4/annotation/EdmRecordImpl.java
@@ -32,14 +32,16 @@ public class EdmRecordImpl extends AbstractEdmAnnotatableDynamicAnnotationExpres
private final List<EdmPropertyValue> propertyValues;
- private final EdmStructuredType type;
+ private EdmStructuredType type;
public EdmRecordImpl(final Edm edm, final String type, final List<EdmPropertyValue> propertyValues) {
this.edm = edm;
this.propertyValues = propertyValues;
- final EdmTypeInfo typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(type).build();
- this.type = typeInfo.getEntityType() == null ? typeInfo.getComplexType() : typeInfo.getEntityType();
+ if (type != null) {
+ final EdmTypeInfo typeInfo = new EdmTypeInfo.Builder().setEdm(edm).setTypeExpression(type).build();
+ this.type = typeInfo.getEntityType() == null ? typeInfo.getComplexType() : typeInfo.getEntityType();
+ }
}
@Override
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java
----------------------------------------------------------------------
diff --git a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java
index a4a38ea..0527951 100644
--- a/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java
+++ b/lib/client-core/src/main/java/org/apache/olingo/client/core/op/impl/v4/ODataBinderImpl.java
@@ -145,6 +145,7 @@ public class ODataBinderImpl extends AbstractODataBinder implements ODataBinder
final Annotation annotation = new AnnotationImpl();
annotation.setTerm(odataAnnotation.getTerm());
+ annotation.setType(odataAnnotation.getValue().getTypeName());
updateValuable(annotation, odataAnnotation, reference);
annotatable.getAnnotations().add(annotation);
@@ -230,8 +231,16 @@ public class ODataBinderImpl extends AbstractODataBinder implements ODataBinder
}
}
+ if (fqn == null && annotation.getType() != null) {
+ final EdmTypeInfo typeInfo = new EdmTypeInfo.Builder().setTypeExpression(annotation.getType()).build();
+ if (typeInfo.isPrimitiveType()) {
+ fqn = typeInfo.getPrimitiveTypeKind().getFullQualifiedName();
+ }
+ }
+
final ODataAnnotation odataAnnotation = new ODataAnnotationImpl(annotation.getTerm(),
(org.apache.olingo.commons.api.domain.v4.ODataValue) getODataValue(fqn, annotation, null, null));
+ odataAnnotatable.getAnnotations().add(odataAnnotation);
}
}
@@ -278,7 +287,7 @@ public class ODataBinderImpl extends AbstractODataBinder implements ODataBinder
final ODataProperty property = new ODataPropertyImpl(resource.getPayload().getName(),
getODataValue(typeInfo == null ? null : typeInfo.getFullQualifiedName(),
- resource.getPayload(), resource.getContextURL(), resource.getMetadataETag()));
+ resource.getPayload(), resource.getContextURL(), resource.getMetadataETag()));
odataAnnotations(resource.getPayload(), property);
return property;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
index a9e0b06..2edab5e 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
@@ -246,8 +246,8 @@ public interface Constants {
public static final String ERROR_TARGET = "target";
public static final String ERROR_DETAILS = "details";
-
- public static final String ERROR_INNERERROR= "innererror";
+
+ public static final String ERROR_INNERERROR = "innererror";
// canonical functions to be applied via dynamic annotation <tt>Apply</tt>
public static final String CANONICAL_FUNCTION_CONCAT = "odata.concat";
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java
index f899d9a..1d2b83e 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataError.java
@@ -18,8 +18,8 @@
*/
package org.apache.olingo.commons.api.domain;
-import java.util.Dictionary;
import java.util.List;
+import java.util.Map;
/**
* OData error.
@@ -46,7 +46,6 @@ public interface ODataError {
* @return error message.
*/
String getTarget();
-
/**
* Gets error details.
@@ -58,7 +57,7 @@ public interface ODataError {
/**
* Gets server defined key-value pairs for debug environment only.
*
- * @return a Dictionary representing server defined object.
+ * @return a pair representing server defined object.
*/
- Dictionary<String, Object> getInnerError();
+ Map<String, String> getInnerError();
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java
----------------------------------------------------------------------
diff --git a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java
index 462e91e..48985e5 100644
--- a/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java
+++ b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/domain/ODataErrorDetail.java
@@ -19,9 +19,9 @@
package org.apache.olingo.commons.api.domain;
/**
- * OData details, for example - { "error": {..., "details":[
+ * OData details, for example <tt>{ "error": {..., "details":[
* {"code": "301","target": "$search" ,"message": "$search query option not supported"}
- * ],...}}
+ * ],...}}</tt>.
*/
public interface ODataErrorDetail {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java
index 2401a09..bb115cf 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractJsonSerializer.java
@@ -209,7 +209,7 @@ abstract class AbstractJsonSerializer<T> extends ODataJacksonSerializer<T> {
}
protected void valuable(final JsonGenerator jgen, final Valuable valuable, final String name) throws IOException {
- if (serverMode && !Constants.VALUE.equals(name)) {
+ if (serverMode && !Constants.VALUE.equals(name) && !(valuable instanceof Annotation)) {
String type = valuable.getType();
if (StringUtils.isBlank(type) && valuable.getValue().isPrimitive() || valuable.getValue().isNull()) {
type = EdmPrimitiveTypeKind.String.getFullQualifiedName().toString();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java
index 62cbebf..1e9cf51 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/AbstractODataError.java
@@ -18,30 +18,22 @@
*/
package org.apache.olingo.commons.core.data;
-import java.util.Dictionary;
+import java.util.LinkedHashMap;
import java.util.List;
+import java.util.Map;
import org.apache.olingo.commons.api.domain.ODataError;
import org.apache.olingo.commons.api.domain.ODataErrorDetail;
-// {
-// "error": {
-// "code": "501",
-// "message": "Unsupported functionality",
-// "target": "query",
-// "details": [
-// {
-// "code": "301",
-// "target": "$search",
-// "message": "$search query option not supported"
-// }
-// ],
-// "innererror": {
-// "trace": [...],
-// "context": {...}
-// }
-// }
-// }
+/**
+ * Example:
+ * <tt>
+ * {
+ * "error": { "code": "501", "message": "Unsupported functionality", "target": "query", "details": [ { "code": "301",
+ * "target": "$search", "message": "$search query option not supported" } ], "innererror": { "trace": [...], "context":
+ * {...} } } }
+ * </tt>.
+ */
public abstract class AbstractODataError implements ODataError {
private String code;
@@ -51,9 +43,9 @@ public abstract class AbstractODataError implements ODataError {
private String target;
private List<ODataErrorDetail> details;
-
- private Dictionary<String,Object> innerError;
-
+
+ private Map<String, String> innerError = new LinkedHashMap<String, String>();
+
@Override
public String getCode() {
return code;
@@ -91,11 +83,7 @@ public abstract class AbstractODataError implements ODataError {
}
@Override
- public Dictionary<String,Object> getInnerError() {
+ public Map<String, String> getInnerError() {
return innerError;
}
-
- public void setInnerError(final Dictionary<String,Object> innerError) {
- this.innerError = innerError;
- }
}
[25/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/UriLexerWithTrace.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/UriLexerWithTrace.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/UriLexerWithTrace.java
deleted file mode 100644
index 9005080..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/UriLexerWithTrace.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import org.antlr.v4.runtime.ANTLRInputStream;
-import org.antlr.v4.runtime.Token;
-import org.apache.olingo.server.core.uri.antlr.UriLexer;
-
-public class UriLexerWithTrace extends UriLexer {
- int logLevel = 0;
-
- public UriLexerWithTrace(final ANTLRInputStream antlrInputStream, final int logLevel) {
- super(antlrInputStream);
- this.logLevel = logLevel;
- }
-
- public UriLexerWithTrace(final ANTLRInputStream antlrInputStream, final int logLevel, final int mode) {
- super(antlrInputStream);
- super.mode(mode);
- this.logLevel = logLevel;
- }
-
- @Override
- public void emit(final Token token) {
- if (logLevel > 1) {
- String out = String.format("%1$-" + 20 + "s", token.getText());
-
- int tokenType = token.getType();
- if (tokenType == -1) {
- out += "-1/EOF";
- } else {
- out += UriLexer.tokenNames[tokenType];
- }
- System.out.println("Lexer.emit(...):" + out);
- }
-
- super.emit(token);
- }
-
- @Override
- public void pushMode(final int m) {
-
- String out = UriLexer.modeNames[_mode] + "-->";
-
- super.pushMode(m);
-
- out += UriLexer.modeNames[_mode];
-
- if (logLevel > 1) {
- System.out.println(out + " ");
- }
- }
-
- @Override
- public int popMode() {
-
- String out = UriLexer.modeNames[_mode] + "-->";
-
- int m = super.popMode();
-
- out += UriLexer.modeNames[_mode];
-
- if (logLevel > 1) {
- System.out.println(out + " ");
- }
-
- return m;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
deleted file mode 100644
index 719a229..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.validator;
-
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.util.ArrayList;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.server.api.uri.UriInfo;
-import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
-import org.apache.olingo.server.core.uri.parser.Parser;
-import org.apache.olingo.server.core.uri.parser.UriParserException;
-import org.apache.olingo.server.ref.provider.EdmTechProvider;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class UriValidatorTest {
-
- private static final String URI_ALL = "$all";
- private static final String URI_BATCH = "$batch";
- private static final String URI_CROSSJOIN = "$crossjoin(ESAllPrim)";
- private static final String URI_ENTITY_ID = "/$entity";
- private static final String URI_METADATA = "$metadata";
- private static final String URI_SERVICE = "";
- private static final String URI_ENTITY_SET = "/ESAllPrim";
- private static final String URI_ENTITY_SET_COUNT = "/ESAllPrim/$count";
- private static final String URI_ENTITY = "/ESAllPrim(1)";
- private static final String URI_MEDIA_STREAM = "/ESMedia(1)/$value";
- private static final String URI_REFERENCES = "/ESAllPrim/$ref";
- private static final String URI_REFERENCE = "/ESAllPrim(1)/$ref";
- private static final String URI_PROPERTY_COMPLEX = "/ESCompComp(1)/PropertyComplex";
- private static final String URI_PROPERTY_COMPLEX_COLLECTION =
- "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex";
- private static final String URI_PROPERTY_COMPLEX_COLLECTION_COUNT =
- "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex/$count";
- private static final String URI_PROPERTY_PRIMITIVE = "/ESAllPrim(1)/PropertyString";
- private static final String URI_PROPERTY_PRIMITIVE_COLLECTION = "/ESCollAllPrim/CollPropertyString";
- private static final String URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT =
- "/ESCollAllPrim/CollPropertyString/$count";
- private static final String URI_PROPERTY_PRIMITIVE_VALUE = "/ESAllPrim(1)/PropertyString/$value";
- private static final String URI_SINGLETON = "/SI";
- private static final String URI_NAV_ENTITY = "/ESKeyNav/NavPropertyETKeyNavOne";
- private static final String URI_NAV_ENTITY_SET = "/ESKeyNav/NavPropertyETKeyNavMany";
-
- private static final String QO_FILTER = "$filter='1' eq '1'";
- private static final String QO_FORMAT = "$format=bla";
- private static final String QO_EXPAND = "$expand=*";
- private static final String QO_ID = "$id=Products(0)";
- private static final String QO_COUNT = "$count";
- private static final String QO_ORDERBY = "$orderby=true";
-// private static final String QO_SEARCH = "$search='bla'";
- private static final String QO_SELECT = "$select=*";
- private static final String QO_SKIP = "$skip=3";
- private static final String QO_SKIPTOKEN = "$skiptoken=123";
- private static final String QO_LEVELS = "$expand=*($levels=1)";
- private static final String QO_TOP = "$top=1";
-
- private String[][] urisWithValidSystemQueryOptions = {
- { URI_ALL, QO_FILTER, }, { URI_ALL, QO_FORMAT }, { URI_ALL, QO_EXPAND }, { URI_ALL, QO_COUNT },
- { URI_ALL, QO_ORDERBY }, /* { URI_ALL, QO_SEARCH }, */{ URI_ALL, QO_SELECT }, { URI_ALL, QO_SKIP },
- { URI_ALL, QO_SKIPTOKEN }, { URI_ALL, QO_LEVELS },
-
- { URI_CROSSJOIN, QO_FILTER, }, { URI_CROSSJOIN, QO_FORMAT },
- { URI_CROSSJOIN, QO_EXPAND }, { URI_CROSSJOIN, QO_COUNT }, { URI_CROSSJOIN, QO_ORDERBY },
- /* { URI_CROSSJOIN, QO_SEARCH }, */{ URI_CROSSJOIN, QO_SELECT }, { URI_CROSSJOIN, QO_SKIP },
- { URI_CROSSJOIN, QO_SKIPTOKEN }, { URI_CROSSJOIN, QO_LEVELS }, { URI_CROSSJOIN, QO_TOP },
-
- { URI_ENTITY_ID, QO_ID, QO_FORMAT }, { URI_ENTITY_ID, QO_ID, }, { URI_ENTITY_ID, QO_ID, QO_EXPAND },
- { URI_ENTITY_ID, QO_ID, QO_SELECT }, { URI_ENTITY_ID, QO_ID, QO_LEVELS },
-
- { URI_METADATA, QO_FORMAT },
-
- { URI_SERVICE, QO_FORMAT },
-
- { URI_ENTITY_SET, QO_FILTER, }, { URI_ENTITY_SET, QO_FORMAT }, { URI_ENTITY_SET, QO_EXPAND },
- { URI_ENTITY_SET, QO_COUNT }, { URI_ENTITY_SET, QO_ORDERBY }, /* { URI_ENTITY_SET, QO_SEARCH }, */
- { URI_ENTITY_SET, QO_SELECT },
- { URI_ENTITY_SET, QO_SKIP }, { URI_ENTITY_SET, QO_SKIPTOKEN }, { URI_ENTITY_SET, QO_LEVELS },
- { URI_ENTITY_SET, QO_TOP },
-
- { URI_ENTITY_SET_COUNT, QO_FILTER }, /* { URI_ENTITY_SET_COUNT, QO_SEARCH }, */
-
- { URI_ENTITY, QO_FORMAT }, { URI_ENTITY, QO_EXPAND }, { URI_ENTITY, QO_SELECT }, { URI_ENTITY, QO_LEVELS },
-
- { URI_MEDIA_STREAM, QO_FORMAT },
-
- { URI_REFERENCES, QO_FILTER }, { URI_REFERENCES, QO_FORMAT }, { URI_REFERENCES, QO_ORDERBY },
- /* { URI_REFERENCES, QO_SEARCH }, */{ URI_REFERENCES, QO_SKIP }, { URI_REFERENCES, QO_SKIPTOKEN },
- { URI_REFERENCES, QO_TOP },
-
- { URI_REFERENCE, QO_FORMAT },
-
- { URI_PROPERTY_COMPLEX, QO_FORMAT }, { URI_PROPERTY_COMPLEX, QO_SELECT }, { URI_PROPERTY_COMPLEX, QO_EXPAND },
- { URI_PROPERTY_COMPLEX, QO_LEVELS },
-
- { URI_PROPERTY_COMPLEX_COLLECTION, QO_FILTER }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_FORMAT },
- { URI_PROPERTY_COMPLEX_COLLECTION, QO_EXPAND }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_COUNT },
- { URI_PROPERTY_COMPLEX_COLLECTION, QO_SKIP }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_SKIPTOKEN },
- { URI_PROPERTY_COMPLEX_COLLECTION, QO_LEVELS }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_TOP },
- { URI_PROPERTY_COMPLEX_COLLECTION, QO_ORDERBY },
-
- { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_FILTER }, /* { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SEARCH }, */
-
- { URI_PROPERTY_PRIMITIVE, QO_FORMAT },
-
- { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_FILTER }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_FORMAT },
- { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_ORDERBY }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIP },
- { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_TOP },
-
- { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_FILTER },
- /* { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SEARCH }, */
-
- { URI_PROPERTY_PRIMITIVE_VALUE, QO_FORMAT },
-
- { URI_SINGLETON, QO_FORMAT }, { URI_SINGLETON, QO_EXPAND }, { URI_SINGLETON, QO_SELECT },
- { URI_SINGLETON, QO_LEVELS },
-
- { URI_NAV_ENTITY, QO_FORMAT }, { URI_NAV_ENTITY, QO_EXPAND }, { URI_NAV_ENTITY, QO_SELECT },
- { URI_NAV_ENTITY, QO_LEVELS },
-
- { URI_NAV_ENTITY_SET, QO_FILTER, }, { URI_NAV_ENTITY_SET, QO_FORMAT }, { URI_NAV_ENTITY_SET, QO_EXPAND },
- { URI_NAV_ENTITY_SET, QO_COUNT }, { URI_NAV_ENTITY_SET, QO_ORDERBY },
- /* { URI_NAV_ENTITY_SET, QO_SEARCH }, */{ URI_NAV_ENTITY_SET, QO_SELECT }, { URI_NAV_ENTITY_SET, QO_SKIP },
- { URI_NAV_ENTITY_SET, QO_SKIPTOKEN }, { URI_NAV_ENTITY_SET, QO_LEVELS }, { URI_NAV_ENTITY_SET, QO_TOP },
-
- { "FINRTInt16()" },
- { "FICRTETKeyNav()" },
- { "FICRTESTwoKeyNavParam(ParameterInt16=1)" },
- { "FICRTCollString()" },
- { "FICRTCTTwoPrim()" },
- { "FICRTCollCTTwoPrim()" },
- { "FICRTETMedia()" },
-
- { "ESTwoKeyNav/com.sap.odata.test1.BAESTwoKeyNavRTESTwoKeyNav" },
- { "ESAllPrim/com.sap.odata.test1.BAESAllPrimRTETAllPrim" },
- { "AIRTPrimCollParam" },
- { "AIRTETParam" },
- { "AIRTPrimParam" },
-
- };
-
- private String[][] urisWithNonValidSystemQueryOptions = {
- { URI_ALL, QO_ID, }, { URI_ALL, QO_TOP },
-
- { URI_BATCH, QO_FILTER, }, { URI_BATCH, QO_FORMAT }, { URI_BATCH, QO_ID, }, { URI_BATCH, QO_EXPAND },
- { URI_BATCH, QO_COUNT }, { URI_BATCH, QO_ORDERBY }, /* { URI_BATCH, QO_SEARCH }, */{ URI_BATCH, QO_SELECT },
- { URI_BATCH, QO_SKIP }, { URI_BATCH, QO_SKIPTOKEN }, { URI_BATCH, QO_LEVELS }, { URI_BATCH, QO_TOP },
-
- { URI_CROSSJOIN, QO_ID, },
-
- { URI_ENTITY_ID, QO_ID, QO_FILTER, },
- { URI_ENTITY_ID, QO_ID, QO_COUNT }, { URI_ENTITY_ID, QO_ORDERBY }, /* { URI_ENTITY_ID, QO_SEARCH }, */
-
- { URI_ENTITY_ID, QO_ID, QO_SKIP }, { URI_ENTITY_ID, QO_ID, QO_SKIPTOKEN }, { URI_ENTITY_ID, QO_ID, QO_TOP },
-
- { URI_METADATA, QO_FILTER, }, { URI_METADATA, QO_ID, }, { URI_METADATA, QO_EXPAND },
- { URI_METADATA, QO_COUNT }, { URI_METADATA, QO_ORDERBY }, /* { URI_METADATA, QO_SEARCH }, */
- { URI_METADATA, QO_SELECT }, { URI_METADATA, QO_SKIP }, { URI_METADATA, QO_SKIPTOKEN },
- { URI_METADATA, QO_LEVELS }, { URI_METADATA, QO_TOP },
-
- { URI_SERVICE, QO_FILTER }, { URI_SERVICE, QO_ID }, { URI_SERVICE, QO_EXPAND }, { URI_SERVICE, QO_COUNT },
- { URI_SERVICE, QO_ORDERBY }, /* { URI_SERVICE, QO_SEARCH }, */{ URI_SERVICE, QO_SELECT },
- { URI_SERVICE, QO_SKIP }, { URI_SERVICE, QO_SKIPTOKEN }, { URI_SERVICE, QO_LEVELS }, { URI_SERVICE, QO_TOP },
-
- { URI_ENTITY_SET, QO_ID },
-
- { URI_ENTITY_SET_COUNT, QO_FORMAT }, { URI_ENTITY_SET_COUNT, QO_ID },
- { URI_ENTITY_SET_COUNT, QO_EXPAND }, { URI_ENTITY_SET_COUNT, QO_COUNT },
- { URI_ENTITY_SET_COUNT, QO_ORDERBY },
- { URI_ENTITY_SET_COUNT, QO_SELECT }, { URI_ENTITY_SET_COUNT, QO_SKIP }, { URI_ENTITY_SET_COUNT, QO_SKIPTOKEN },
- { URI_ENTITY_SET_COUNT, QO_LEVELS }, { URI_ENTITY_SET_COUNT, QO_TOP },
-
- { URI_ENTITY, QO_FILTER }, { URI_ENTITY, QO_ID }, { URI_ENTITY, QO_COUNT }, /* { URI_ENTITY, QO_ORDERBY }, */
- /* { URI_ENTITY, QO_SEARCH }, */{ URI_ENTITY, QO_SKIP }, { URI_ENTITY, QO_SKIPTOKEN }, { URI_ENTITY, QO_TOP },
-
- { URI_MEDIA_STREAM, QO_FILTER }, { URI_MEDIA_STREAM, QO_ID, }, { URI_MEDIA_STREAM, QO_EXPAND },
- { URI_MEDIA_STREAM, QO_COUNT }, { URI_MEDIA_STREAM, QO_ORDERBY }, /* { URI_MEDIA_STREAM, QO_SEARCH }, */
- { URI_MEDIA_STREAM, QO_SELECT }, { URI_MEDIA_STREAM, QO_SKIP }, { URI_MEDIA_STREAM, QO_SKIPTOKEN },
- { URI_MEDIA_STREAM, QO_LEVELS }, { URI_MEDIA_STREAM, QO_TOP },
-
- { URI_REFERENCES, QO_ID, }, { URI_REFERENCES, QO_EXPAND }, { URI_REFERENCES, QO_COUNT },
- { URI_REFERENCES, QO_SELECT }, { URI_REFERENCES, QO_LEVELS },
-
- { URI_REFERENCE, QO_FILTER }, { URI_REFERENCE, QO_ID, }, { URI_REFERENCE, QO_EXPAND },
- { URI_REFERENCE, QO_COUNT }, { URI_REFERENCE, QO_ORDERBY }, /* { URI_REFERENCE, QO_SEARCH }, */
- { URI_REFERENCE, QO_SELECT }, { URI_REFERENCE, QO_SKIP }, { URI_REFERENCE, QO_SKIPTOKEN },
- { URI_REFERENCE, QO_LEVELS }, { URI_REFERENCE, QO_TOP },
-
- { URI_PROPERTY_COMPLEX, QO_FILTER }, { URI_PROPERTY_COMPLEX, QO_ID, }, { URI_PROPERTY_COMPLEX, QO_COUNT },
- { URI_PROPERTY_COMPLEX, QO_ORDERBY }, /* { URI_PROPERTY_COMPLEX, QO_SEARCH }, */
- { URI_PROPERTY_COMPLEX, QO_SKIP }, { URI_PROPERTY_COMPLEX, QO_SKIPTOKEN }, { URI_PROPERTY_COMPLEX, QO_TOP },
-
- { URI_PROPERTY_COMPLEX_COLLECTION, QO_ID, },
- /* { URI_PROPERTY_COMPLEX_COLLECTION, QO_SEARCH }, */{ URI_PROPERTY_COMPLEX_COLLECTION, QO_SELECT },
-
- { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_FORMAT },
- { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_ID, }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_EXPAND },
- { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_COUNT }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_ORDERBY },
- { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SELECT },
- { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SKIP }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SKIPTOKEN },
- { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_LEVELS }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_TOP },
-
- { URI_PROPERTY_PRIMITIVE, QO_FILTER }, { URI_PROPERTY_PRIMITIVE, QO_ID, }, { URI_PROPERTY_PRIMITIVE, QO_EXPAND },
- { URI_PROPERTY_PRIMITIVE, QO_COUNT }, { URI_PROPERTY_PRIMITIVE, QO_ORDERBY },
- /* { URI_PROPERTY_PRIMITIVE, QO_SEARCH }, */{ URI_PROPERTY_PRIMITIVE, QO_SELECT },
- { URI_PROPERTY_PRIMITIVE, QO_SKIP }, { URI_PROPERTY_PRIMITIVE, QO_SKIPTOKEN },
- { URI_PROPERTY_PRIMITIVE, QO_LEVELS }, { URI_PROPERTY_PRIMITIVE, QO_TOP },
-
- { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_ID, }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_EXPAND },
- { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_COUNT }, /* { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SEARCH }, */
- { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_LEVELS },
-
- { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_FORMAT },
- { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_ID, }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_EXPAND },
- { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_COUNT },
- { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_ORDERBY },
- { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SKIP },
- { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SKIPTOKEN },
- { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_LEVELS }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_TOP },
-
- { URI_PROPERTY_PRIMITIVE_VALUE, QO_FILTER }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_ID, },
- { URI_PROPERTY_PRIMITIVE_VALUE, QO_EXPAND }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_COUNT },
- { URI_PROPERTY_PRIMITIVE_VALUE, QO_ORDERBY },/* { URI_PROPERTY_PRIMITIVE_VALUE, QO_SEARCH }, */
- { URI_PROPERTY_PRIMITIVE_VALUE, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIP },
- { URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_LEVELS },
- { URI_PROPERTY_PRIMITIVE_VALUE, QO_TOP },
-
- { URI_SINGLETON, QO_FILTER }, { URI_SINGLETON, QO_ID }, { URI_SINGLETON, QO_COUNT },
- { URI_SINGLETON, QO_ORDERBY }, /* { URI_SINGLETON, QO_SEARCH }, */{ URI_SINGLETON, QO_SKIP },
- { URI_SINGLETON, QO_SKIPTOKEN }, { URI_SINGLETON, QO_TOP },
-
- { URI_NAV_ENTITY, QO_FILTER }, { URI_NAV_ENTITY, QO_ID }, { URI_NAV_ENTITY, QO_COUNT },
- { URI_NAV_ENTITY, QO_ORDERBY }, /* { URI_NAV_ENTITY, QO_SEARCH }, */{ URI_NAV_ENTITY, QO_SKIP },
- { URI_NAV_ENTITY, QO_SKIPTOKEN }, { URI_SINGLETON, QO_TOP },
-
- { URI_NAV_ENTITY_SET, QO_ID },
-
- };
-
- private Parser parser;
- private Edm edm;
-
- @Before
- public void before() {
- parser = new Parser();
- edm = new EdmProviderImpl(new EdmTechProvider());
- }
-
- @Test
- public void validateSelect() throws Exception {
- String[] uris = { "/ESAllPrim(1)?$select=PropertyString" };
- for (String uri : uris) {
- parseAndValidate(uri, "GET");
- }
- }
-
- @Test(expected = UriValidationException.class)
- public void validateForHttpMethodsFail() throws Exception {
- String uri = URI_ENTITY;
- parseAndValidate(uri, "xyz");
- }
-
- @Test
- public void validateForHttpMethods() throws Exception {
- String uri = URI_ENTITY;
- parseAndValidate(uri, "GET");
- parseAndValidate(uri, "POST");
- parseAndValidate(uri, "PUT");
- parseAndValidate(uri, "DELETE");
- parseAndValidate(uri, "PATCH");
- parseAndValidate(uri, "MERGE");
- }
-
- @Test
- public void validateOrderBy() throws Exception {
- String[] uris = { "/ESAllPrim?$orderby=PropertyString" };
- for (String uri : uris) {
- parseAndValidate(uri, "GET");
- }
- }
-
- @Test(expected = UriValidationException.class)
- @Ignore("uri parser doen't support orderby yet")
- public void validateOrderByInvalid() throws Exception {
- String uri = "/ESAllPrim(1)?$orderBy=XXXX";
- parseAndValidate(uri, "GET");
- }
-
- @Test(expected = UriValidationException.class)
- public void validateKeyPredicatesWrongKey() throws Exception {
- String uri = "ESTwoKeyNav(xxx=1, yyy='abc')";
- parseAndValidate(uri, "GET");
- }
-
- @Test
- public void validateKeyPredicates() throws Exception {
- String uri = "ESTwoKeyNav(PropertyInt16=1, PropertyString='abc')";
- parseAndValidate(uri, "GET");
- }
-
- @Test(expected = UriValidationException.class)
- public void validateKeyPredicatesWrongValueType() throws Exception {
- String uri = "ESTwoKeyNav(PropertyInt16='abc', PropertyString=1)";
- parseAndValidate(uri, "GET");
- }
-
- @Test
- public void checkValidSystemQueryOption() throws Exception {
- String[] uris = constructUri(urisWithValidSystemQueryOptions);
-
- for (String uri : uris) {
- try {
- parseAndValidate(uri, "GET");
- } catch (Exception e) {
- throw new Exception("Faild for uri: " + uri, e);
- }
- }
- }
-
- @Test
- public void checkNonValidSystemQueryOption() throws Exception {
- String[] uris = constructUri(urisWithNonValidSystemQueryOptions);
-
- for (String uri : uris) {
- try {
- parseAndValidate(uri, "GET");
- fail("Validation Exception not thrown: " + uri);
- } catch (UriValidationException e) {
- assertTrue(e instanceof UriValidationException);
- }
- }
- }
-
- private String[] constructUri(final String[][] uriParameterMatrix) {
- ArrayList<String> uris = new ArrayList<String>();
- for (String[] uriParameter : uriParameterMatrix) {
- String uri = uriParameter[0];
- if (uriParameter.length > 1) {
- uri += "?";
- }
- for (int i = 1; i < uriParameter.length; i++) {
- uri += uriParameter[i];
- if (i < (uriParameter.length - 1)) {
- uri += "&";
- }
- }
- uris.add(uri);
- }
- return uris.toArray(new String[0]);
- }
-
- private void parseAndValidate(final String uri, String method) throws UriParserException, UriValidationException {
- UriInfo uriInfo = parser.parseUri(uri.trim(), edm);
- UriValidator validator = new UriValidator();
-
- validator.validate(uriInfo, method);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/pom.xml b/lib/server-tecsvc/pom.xml
new file mode 100644
index 0000000..717ad60
--- /dev/null
+++ b/lib/server-tecsvc/pom.xml
@@ -0,0 +1,83 @@
+<?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.
+
+-->
+<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-server-tecsvc</artifactId>
+ <packaging>war</packaging>
+ <name>${project.artifactId}</name>
+
+ <parent>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-lib</artifactId>
+ <version>0.1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <dependencies>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.5</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-server-api</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-server-core</artifactId>
+ <version>${project.version}</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java
new file mode 100644
index 0000000..21d1ae3
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/TechnicalServlet.java
@@ -0,0 +1,51 @@
+/*
+ * 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.server.tecsvc;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.olingo.server.api.ODataHandler;
+import org.apache.olingo.server.api.ODataServer;
+import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class TechnicalServlet extends HttpServlet {
+
+ private static final long serialVersionUID = 1L;
+
+ private static final Logger LOG = LoggerFactory.getLogger(TechnicalServlet.class);
+
+ @Override
+ protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+ LOG.debug("ReferenceServlet:service() called");
+
+
+ ODataHandler handler = ODataServer.newInstance().getHandler(new EdmTechProvider());
+
+ handler.process(req, resp);
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java
new file mode 100644
index 0000000..0db486e
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ActionProvider.java
@@ -0,0 +1,191 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.Action;
+import org.apache.olingo.server.api.edm.provider.Parameter;
+import org.apache.olingo.server.api.edm.provider.ReturnType;
+
+public class ActionProvider {
+
+ // Bound Actions
+ public static final FullQualifiedName nameBAESAllPrimRTETAllPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BAESAllPrimRTETAllPrim");
+
+ public static final FullQualifiedName nameBAESTwoKeyNavRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BAESTwoKeyNavRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BAETBaseTwoKeyNavRTETBaseTwoKeyNav");
+
+ public static final FullQualifiedName nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav");
+
+ public static final FullQualifiedName nameBAETTwoKeyNavRTETTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BAETTwoKeyNavRTETTwoKeyNav");
+
+ // Unbound Actions
+ public static final FullQualifiedName nameUARTCompCollParam = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UARTCompCollParam");
+ public static final FullQualifiedName nameUARTCompParam = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UARTCompParam");
+ public static final FullQualifiedName nameUARTESParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UARTESParam");
+
+ public static final FullQualifiedName nameUARTETParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UARTETParam");
+
+ public static final FullQualifiedName nameUARTPrimParam = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UARTPrimParam");
+ public static final FullQualifiedName nameUARTPrimCollParam = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UARTPrimCollParam");
+
+ public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
+ if (actionName.equals(nameUARTPrimParam)) {
+ return Arrays.asList(
+ new Action().setName("UARTPrimParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
+
+ .setReturnType(new ReturnType().setType(PropertyProvider.nameString))
+ );
+
+ } else if (actionName.equals(nameUARTPrimCollParam)) {
+ return Arrays.asList(
+ new Action().setName("UARTPrimCollParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
+
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameString).setCollection(true))
+ );
+
+ } else if (actionName.equals(nameUARTCompParam)) {
+ return Arrays.asList(
+ new Action().setName("UARTCompParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
+
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim))
+ );
+
+ } else if (actionName.equals(nameUARTCompCollParam)) {
+ return Arrays.asList(
+ new Action().setName("UARTCompCollParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
+
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true))
+ );
+
+ } else if (actionName.equals(nameUARTETParam)) {
+ return Arrays.asList(
+ new Action().setName("UARTETParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyTwoPrim))
+ );
+
+ } else if (actionName.equals(nameUARTESParam)) {
+ return Arrays.asList(
+ new Action().setName("UARTESParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setCollection(true))
+ );
+
+ } else if (actionName.equals(nameBAETTwoKeyNavRTETTwoKeyNav)) {
+ return Arrays.asList(
+ new Action().setName("BAETTwoKeyNavRTETTwoKeyNav")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setNullable(false)))
+ .setBound(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav))
+ ,
+ new Action().setName("BAETTwoKeyNavRTETTwoKeyNav")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterETKeyNav").setType(EntityTypeProvider.nameETKeyNav)
+ .setNullable(false)))
+ .setBound(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav))
+ );
+
+ } else if (actionName.equals(nameBAESAllPrimRTETAllPrim)) {
+ return Arrays.asList(
+ new Action().setName("BAESAllPrimRTETAllPrim")
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("ParameterESAllPrim").setType(EntityTypeProvider.nameETAllPrim)
+ .setCollection(true).setNullable(false)))
+ .setBound(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETAllPrim))
+ );
+
+ } else if (actionName.equals(nameBAESTwoKeyNavRTESTwoKeyNav)) {
+ return Arrays.asList(
+ new Action().setName("BAESTwoKeyNavRTESTwoKeyNav")
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setBound(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true))
+ );
+
+ } else if (actionName.equals(nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav)) {
+ return Arrays.asList(
+ new Action().setName("BAETBaseTwoKeyNavRTETBaseTwoKeyNav")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .setNullable(false)))
+ .setBound(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav))
+ );
+
+ } else if (actionName.equals(nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav)) {
+ return Arrays.asList(
+ new Action().setName("BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav")
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("ParameterETTwoBaseTwoKeyNav").setType(
+ EntityTypeProvider.nameETTwoBaseTwoKeyNav).setNullable(false)))
+ .setBound(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav))
+ );
+ }
+
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java
new file mode 100644
index 0000000..d4ee37a
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ComplexTypeProvider.java
@@ -0,0 +1,175 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import java.util.Arrays;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.ComplexType;
+import org.apache.olingo.server.api.edm.provider.NavigationProperty;
+import org.apache.olingo.server.api.edm.provider.Property;
+
+public class ComplexTypeProvider {
+
+ public static final FullQualifiedName nameCTAllPrim = new FullQualifiedName(SchemaProvider.nameSpace, "CTAllPrim");
+ public static final FullQualifiedName nameCTBase = new FullQualifiedName(SchemaProvider.nameSpace, "CTBase");
+ public static final FullQualifiedName nameCTBasePrimCompNav = new FullQualifiedName(SchemaProvider.nameSpace,
+ "CTBasePrimCompNav");
+ public static final FullQualifiedName nameCTCollAllPrim = new FullQualifiedName(SchemaProvider.nameSpace,
+ "CTCollAllPrim");
+ public static final FullQualifiedName nameCTCompCollComp = new FullQualifiedName(SchemaProvider.nameSpace,
+ "CTCompCollComp");
+ public static final FullQualifiedName nameCTCompComp = new FullQualifiedName(SchemaProvider.nameSpace, "CTCompComp");
+ public static final FullQualifiedName nameCTCompNav = new FullQualifiedName(SchemaProvider.nameSpace, "CTCompNav");
+
+ public static final FullQualifiedName nameCTMixPrimCollComp = new FullQualifiedName(SchemaProvider.nameSpace,
+ "CTMixPrimCollComp");
+ public static final FullQualifiedName nameCTNavFiveProp = new FullQualifiedName(SchemaProvider.nameSpace,
+ "CTNavFiveProp");
+ public static final FullQualifiedName nameCTPrim = new FullQualifiedName(SchemaProvider.nameSpace, "CTPrim");
+ public static final FullQualifiedName nameCTPrimComp = new FullQualifiedName(SchemaProvider.nameSpace, "CTPrimComp");
+ public static final FullQualifiedName nameCTPrimEnum = new FullQualifiedName(SchemaProvider.nameSpace, "CTPrimEnum");
+ public static final FullQualifiedName nameCTTwoBase = new FullQualifiedName(SchemaProvider.nameSpace, "CTTwoBase");
+ public static final FullQualifiedName nameCTTwoBasePrimCompNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "CTTwoBasePrimCompNav");
+ public static final FullQualifiedName nameCTTwoPrim = new FullQualifiedName(SchemaProvider.nameSpace, "CTTwoPrim");
+
+ public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
+
+ if (complexTypeName.equals(nameCTPrim)) {
+ return new ComplexType()
+ .setName("CTPrim")
+ .setProperties(Arrays.asList(PropertyProvider.propertyInt16));
+
+ } else if (complexTypeName.equals(nameCTAllPrim)) {
+ return new ComplexType()
+ .setName("CTAllPrim")
+ .setProperties(
+ Arrays.asList(PropertyProvider.propertyString, PropertyProvider.propertyBinary,
+ PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertyDate,
+ PropertyProvider.propertyDateTimeOffset, PropertyProvider.propertyDecimal,
+ PropertyProvider.propertySingle, PropertyProvider.propertyDouble, PropertyProvider.propertyDuration,
+ PropertyProvider.propertyGuid, PropertyProvider.propertyInt16, PropertyProvider.propertyInt32,
+ PropertyProvider.propertyInt64, PropertyProvider.propertySByte, PropertyProvider.propertyTimeOfDay
+ /* TODO add propertyStream */));
+
+ } else if (complexTypeName.equals(nameCTCollAllPrim)) {
+ return new ComplexType()
+ .setName("CTCollAllPrim")
+ .setProperties(
+ Arrays.asList(
+ PropertyProvider.collPropertyString, PropertyProvider.collPropertyBoolean,
+ PropertyProvider.collPropertyByte, PropertyProvider.collPropertySByte,
+ PropertyProvider.collPropertyInt16, PropertyProvider.collPropertyInt32,
+ PropertyProvider.collPropertyInt64, PropertyProvider.collPropertySingle,
+ PropertyProvider.collPropertyDouble, PropertyProvider.collPropertyDecimal,
+ PropertyProvider.collPropertyBinary, PropertyProvider.collPropertyDate,
+ PropertyProvider.collPropertyDateTimeOffset, PropertyProvider.collPropertyDuration,
+ PropertyProvider.collPropertyGuid, PropertyProvider.collPropertyTimeOfDay
+ /* TODO add collectionPropertyStream */));
+
+ } else if (complexTypeName.equals(nameCTTwoPrim)) {
+ return new ComplexType()
+ .setName("CTTwoPrim")
+ .setProperties(Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.propertyString));
+
+ } else if (complexTypeName.equals(nameCTCompNav)) {
+ return new ComplexType()
+ .setName("CTCompNav")
+ .setProperties(Arrays.asList(PropertyProvider.propertyString,
+ PropertyProvider.propertyComplex_CTNavFiveProp));
+
+ } else if (complexTypeName.equals(nameCTMixPrimCollComp)) {
+ return new ComplexType()
+ .setName("CTMixPrimCollComp")
+ .setProperties(
+ Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.collPropertyString,
+ PropertyProvider.propertyComplex_CTTwoPrim, PropertyProvider.collPropertyComplex_CTTwoPrim));
+
+ } else if (complexTypeName.equals(nameCTBase)) {
+ return new ComplexType()
+ .setName("CTBase")
+ .setBaseType(nameCTTwoPrim)
+ .setProperties(Arrays.asList(
+ new Property()
+ .setName("AdditionalPropString")
+ .setType(new FullQualifiedName("Edm", "String"))));
+
+ } else if (complexTypeName.equals(nameCTTwoBase)) {
+ return new ComplexType()
+ .setName("CTTwoBase")
+ .setBaseType(nameCTBase);
+
+ } else if (complexTypeName.equals(nameCTCompComp)) {
+ return new ComplexType()
+ .setName("CTCompComp")
+ .setProperties(Arrays.asList(PropertyProvider.propertyComplex_CTTwoPrim));
+
+ } else if (complexTypeName.equals(nameCTCompCollComp)) {
+ return new ComplexType()
+ .setName("CTCompCollComp")
+ .setProperties(Arrays.asList(PropertyProvider.collPropertyComplex_CTTwoPrim));
+
+ } else if (complexTypeName.equals(nameCTPrimComp)) {
+ return new ComplexType()
+ .setName("CTPrimComp")
+ .setProperties(Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.propertyComplex_CTAllPrim));
+
+ } else if (complexTypeName.equals(nameCTNavFiveProp)) {
+ return new ComplexType()
+ .setName("CTNavFiveProp")
+ .setProperties(Arrays.asList(PropertyProvider.propertyInt16))
+ .setNavigationProperties((Arrays.asList(
+ PropertyProvider.collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav,
+ PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav,
+ new NavigationProperty()
+ .setName("NavPropertyETMediaOne")
+ .setType(EntityTypeProvider.nameETMedia),
+ new NavigationProperty()
+ .setName("NavPropertyETMediaMany")
+ .setType(EntityTypeProvider.nameETMedia).setCollection(true)
+ )));
+
+ } else if (complexTypeName.equals(nameCTBasePrimCompNav)) {
+ return new ComplexType()
+ .setName("CTBasePrimCompNav")
+ .setBaseType(nameCTPrimComp)
+ .setNavigationProperties(Arrays.asList(
+ PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav,
+ PropertyProvider.collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav,
+ PropertyProvider.navPropertyETKeyNavOne_ETKeyNav,
+ PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav));
+
+ } else if (complexTypeName.equals(nameCTPrimEnum)) {
+ return new ComplexType()
+ .setName("CTPrimEnum")
+ .setProperties(Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.propertyEnumString_ENString));
+
+ } else if (complexTypeName.equals(nameCTTwoBasePrimCompNav)) {
+ return new ComplexType()
+ .setName("CTTwoBasePrimCompNav")
+ .setBaseType(nameCTBasePrimCompNav);
+
+ }
+
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
new file mode 100644
index 0000000..24fe6bc
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/ContainerProvider.java
@@ -0,0 +1,361 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import java.util.Arrays;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.Target;
+import org.apache.olingo.server.api.edm.provider.ActionImport;
+import org.apache.olingo.server.api.edm.provider.EntityContainer;
+import org.apache.olingo.server.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.server.api.edm.provider.EntitySet;
+import org.apache.olingo.server.api.edm.provider.FunctionImport;
+import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding;
+import org.apache.olingo.server.api.edm.provider.Singleton;
+
+public class ContainerProvider {
+
+ public static final FullQualifiedName nameContainer = new FullQualifiedName(SchemaProvider.nameSpace, "Container");
+
+ EntityContainerInfo entityContainerInfoTest1 =
+ new EntityContainerInfo().setContainerName(nameContainer);
+
+ public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException {
+ if (entityContainerName == null) {
+ return entityContainerInfoTest1;
+ } else if (entityContainerName.equals(nameContainer)) {
+ return entityContainerInfoTest1;
+ }
+
+ return null;
+ }
+
+ public EntityContainer getEntityContainer() throws ODataException {
+ return null;
+ }
+
+ public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException {
+ if (entityContainer == nameContainer) {
+ if (name.equals("ESAllPrim")) {
+ return new EntitySet()
+ .setName("ESAllPrim")
+ .setType(EntityTypeProvider.nameETAllPrim);
+
+ } else if (name.equals("ESCollAllPrim")) {
+ return new EntitySet()
+ .setName("ESCollAllPrim")
+ .setType(EntityTypeProvider.nameETCollAllPrim);
+
+ } else if (name.equals("ESTwoPrim")) {
+ return new EntitySet()
+ .setName("ESTwoPrim")
+ .setType(EntityTypeProvider.nameETTwoPrim);
+
+ } else if (name.equals("ESMixPrimCollComp")) {
+ return new EntitySet()
+ .setName("ESMixPrimCollComp")
+ .setType(EntityTypeProvider.nameETMixPrimCollComp);
+
+ } else if (name.equals("ESBase")) {
+ return new EntitySet()
+ .setName("ESBase")
+ .setType(EntityTypeProvider.nameETBase);
+
+ } else if (name.equals("ESTwoBase")) {
+ return new EntitySet()
+ .setName("ESTwoBase")
+ .setType(EntityTypeProvider.nameETTwoBase);
+
+ } else if (name.equals("ESTwoKeyTwoPrim")) {
+ return new EntitySet()
+ .setName("ESTwoKeyTwoPrim")
+ .setType(EntityTypeProvider.nameETTwoKeyTwoPrim);
+
+ } else if (name.equals("ESBaseTwoKeyTwoPrim")) {
+ return new EntitySet()
+ .setName("ESBaseTwoKeyTwoPrim")
+ .setType(EntityTypeProvider.nameETBaseTwoKeyTwoPrim);
+
+ } else if (name.equals("ESTwoBaseTwoKeyTwoPrim")) {
+ return new EntitySet()
+ .setName("ESTwoBaseTwoKeyTwoPrim")
+ .setType(EntityTypeProvider.nameETTwoBaseTwoKeyTwoPrim);
+
+ } else if (name.equals("ESAllKey")) {
+ return new EntitySet()
+ .setName("ESAllKey")
+ .setType(EntityTypeProvider.nameETAllKey);
+
+ } else if (name.equals("ESCompAllPrim")) {
+ return new EntitySet()
+ .setName("ESCompAllPrim")
+ .setType(EntityTypeProvider.nameETCompAllPrim);
+
+ } else if (name.equals("ESCompCollAllPrim")) {
+ return new EntitySet()
+ .setName("ESCompCollAllPrim")
+ .setType(EntityTypeProvider.nameETCompCollAllPrim);
+
+ } else if (name.equals("ESCompComp")) {
+ return new EntitySet()
+ .setName("ESCompComp")
+ .setType(EntityTypeProvider.nameETCompComp);
+
+ } else if (name.equals("ESCompCollComp")) {
+ return new EntitySet()
+ .setName("ESCompCollComp")
+ .setType(EntityTypeProvider.nameETCompCollComp);
+
+ } else if (name.equals("ESMedia")) {
+ return new EntitySet()
+ .setName("ESMedia")
+ .setType(EntityTypeProvider.nameETMedia)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("ESKeyTwoKeyComp")) {
+ return new EntitySet()
+ .setName("ESKeyTwoKeyComp")
+ .setType(EntityTypeProvider.nameETKeyTwoKeyComp);
+
+ } else if (name.equals("ESInvisible")) {
+ return new EntitySet()
+ .setName("ESInvisible")
+ .setType(EntityTypeProvider.nameETAllPrim);
+
+ } else if (name.equals("ESServerSidePaging")) {
+ return new EntitySet()
+ .setName("ESServerSidePaging")
+ .setType(EntityTypeProvider.nameETServerSidePaging);
+
+ } else if (name.equals("ESAllNullable")) {
+ return new EntitySet()
+ .setName("ESAllNullable")
+ .setType(EntityTypeProvider.nameETAllNullable);
+
+ } else if (name.equals("ESKeyNav")) {
+ return new EntitySet()
+ .setName("ESKeyNav")
+ .setType(EntityTypeProvider.nameETKeyNav);
+
+ } else if (name.equals("ESTwoKeyNav")) {
+ return new EntitySet()
+ .setName("ESTwoKeyNav")
+ .setType(EntityTypeProvider.nameETTwoKeyNav);
+
+ } else if (name.equals("ESBaseTwoKeyNav")) {
+ return new EntitySet()
+ .setName("ESBaseTwoKeyNav")
+ .setType(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+ } else if (name.equals("ESCompMixPrimCollComp")) {
+ return new EntitySet()
+ .setName("ESCompMixPrimCollComp")
+ .setType(EntityTypeProvider.nameETCompMixPrimCollComp);
+
+ } else if (name.equals("ESFourKeyAlias")) {
+ return new EntitySet()
+ .setName("ESFourKeyAlias")
+ .setType(EntityTypeProvider.nameETFourKeyAlias);
+ }
+ }
+
+ return null;
+ }
+
+ public ActionImport getActionImport(final FullQualifiedName entityContainer, final String name) throws ODataException
+ {
+ if (entityContainer.equals(nameContainer)) {
+ if (name.equals("AIRTPrimParam")) {
+ return new ActionImport()
+ .setName("AIRTPrimParam")
+ .setAction(ActionProvider.nameUARTPrimParam);
+
+ } else if (name.equals("AIRTPrimCollParam")) {
+ return new ActionImport()
+ .setName("AIRTPrimCollParam")
+ .setAction(ActionProvider.nameUARTPrimCollParam);
+
+ } else if (name.equals("AIRTCompParam")) {
+ return new ActionImport()
+ .setName("AIRTCompParam")
+ .setAction(ActionProvider.nameUARTCompParam);
+
+ } else if (name.equals("AIRTCompCollParam")) {
+ return new ActionImport()
+ .setName("AIRTCompCollParam")
+ .setAction(ActionProvider.nameUARTCompCollParam);
+
+ } else if (name.equals("AIRTETParam")) {
+ return new ActionImport()
+ .setName("AIRTETParam")
+ .setAction(ActionProvider.nameUARTETParam);
+
+ } else if (name.equals("AIRTETCollAllPrimParam")) {
+ return new ActionImport()
+ .setName("AIRTETCollAllPrimParam")
+ .setAction(ActionProvider.nameUARTESParam);
+ }
+ }
+
+ return null;
+ }
+
+ public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String name)
+ throws ODataException {
+
+ if (entityContainer.equals(nameContainer)) {
+ if (name.equals("FINRTInt16")) {
+ return new FunctionImport()
+ .setName("FINRTInt16")
+ .setFunction(FunctionProvider.nameUFNRTInt16)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FINInvisibleRTInt16")) {
+ return new FunctionImport()
+ .setName("FINInvisibleRTInt16")
+ .setFunction(FunctionProvider.nameUFNRTInt16);
+
+ } else if (name.equals("FINInvisible2RTInt16")) {
+ return new FunctionImport()
+ .setName("FINInvisible2RTInt16")
+ .setFunction(FunctionProvider.nameUFNRTInt16);
+
+ } else if (name.equals("FICRTETKeyNav")) {
+ return new FunctionImport()
+ .setName("FICRTETKeyNav")
+ .setFunction(FunctionProvider.nameUFCRTETKeyNav);
+
+ } else if (name.equals("FICRTETTwoKeyNavParam")) {
+ return new FunctionImport()
+ .setName("FICRTETTwoKeyNavParam")
+ .setFunction(FunctionProvider.nameUFCRTETTwoKeyNavParam)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTStringTwoParam")) {
+ return new FunctionImport()
+ .setName("FICRTStringTwoParam")
+ .setFunction(FunctionProvider.nameUFCRTStringTwoParam)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTCollStringTwoParam")) {
+ return new FunctionImport()
+ .setName("FICRTCollStringTwoParam")
+ .setFunction(FunctionProvider.nameUFCRTCollStringTwoParam)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTCTAllPrimTwoParam")) {
+ return new FunctionImport()
+ .setName("FICRTCTAllPrimTwoParam")
+ .setFunction(FunctionProvider.nameUFCRTCTAllPrimTwoParam)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTESMixPrimCollCompTwoParam")) {
+ return new FunctionImport()
+ .setName("FICRTESMixPrimCollCompTwoParam")
+ .setFunction(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FINRTESMixPrimCollCompTwoParam")) {
+ return new FunctionImport()
+ .setName("FINRTESMixPrimCollCompTwoParam")
+ .setFunction(FunctionProvider.nameUFNRTESMixPrimCollCompTwoParam)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTCollCTTwoPrim")) {
+ return new FunctionImport()
+ .setName("FICRTCollCTTwoPrim")
+ .setFunction(FunctionProvider.nameUFCRTCollCTTwoPrim)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTETMedia")) {
+ return new FunctionImport()
+ .setName("FICRTETMedia")
+ .setFunction(FunctionProvider.nameUFCRTETMedia)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTCTTwoPrimParam")) {
+ return new FunctionImport()
+ .setName("FICRTCTTwoPrimParam")
+ .setFunction(FunctionProvider.nameUFCRTCTTwoPrimParam)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTCTTwoPrim")) {
+ return new FunctionImport()
+ .setName("FICRTCTTwoPrim")
+ .setFunction(FunctionProvider.nameUFCRTCTTwoPrim)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTCollString")) {
+ return new FunctionImport()
+ .setName("FICRTCollString")
+ .setFunction(FunctionProvider.nameUFCRTCollString)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTString")) {
+ return new FunctionImport()
+ .setName("FICRTString")
+ .setFunction(FunctionProvider.nameUFCRTString)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTESTwoKeyNavParam")) {
+ return new FunctionImport()
+ .setName("FICRTESTwoKeyNavParam")
+ .setFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam)
+ .setIncludeInServiceDocument(true);
+
+ } else if (name.equals("FICRTCollCTTwoPrimParam")) {
+ return new FunctionImport()
+ .setName("FICRTCollCTTwoPrimParam")
+ .setFunction(FunctionProvider.nameUFCRTCollCTTwoPrimParam)
+ .setIncludeInServiceDocument(true);
+
+ }
+ }
+
+ return null;
+ }
+
+ public Singleton getSingleton(final FullQualifiedName entityContainer, final String name) throws ODataException {
+ if (entityContainer.equals(nameContainer)) {
+
+ if (name.equals("SI")) {
+ return new Singleton()
+ .setName("SI")
+ .setType(EntityTypeProvider.nameETTwoPrim);
+
+ } else if (name.equals("SINav")) {
+ return new Singleton()
+ .setName("SINav")
+ .setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setNavigationPropertyBindings(Arrays.asList(
+ new NavigationPropertyBinding()
+ .setPath("NavPropertyETTwoKeyNavMany")
+ .setTarget(new Target().setTargetName("ESTwoKeyNav"))));
+
+ } else if (name.equals("SIMedia")) {
+ return new Singleton()
+ .setName("SIMedia")
+ .setType(EntityTypeProvider.nameETMedia);
+ }
+ }
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java
new file mode 100644
index 0000000..fd9980a
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EdmTechProvider.java
@@ -0,0 +1,147 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.Action;
+import org.apache.olingo.server.api.edm.provider.ActionImport;
+import org.apache.olingo.server.api.edm.provider.AliasInfo;
+import org.apache.olingo.server.api.edm.provider.ComplexType;
+import org.apache.olingo.server.api.edm.provider.EdmProvider;
+import org.apache.olingo.server.api.edm.provider.EntityContainer;
+import org.apache.olingo.server.api.edm.provider.EntityContainerInfo;
+import org.apache.olingo.server.api.edm.provider.EntitySet;
+import org.apache.olingo.server.api.edm.provider.EntityType;
+import org.apache.olingo.server.api.edm.provider.EnumType;
+import org.apache.olingo.server.api.edm.provider.Function;
+import org.apache.olingo.server.api.edm.provider.FunctionImport;
+import org.apache.olingo.server.api.edm.provider.Schema;
+import org.apache.olingo.server.api.edm.provider.Singleton;
+import org.apache.olingo.server.api.edm.provider.Term;
+import org.apache.olingo.server.api.edm.provider.TypeDefinition;
+
+public class EdmTechProvider extends EdmProvider {
+
+ public static final String nameSpace = "com.sap.odata.test1";
+
+ private final SchemaProvider schemaProvider;
+ private final EntityTypeProvider entityTypeProvider;
+ private final ContainerProvider containerProvider;
+ private final ComplexTypeProvider complexTypeProvider;
+ private final EnumTypeProvider enumTypeProvider;
+ private final ActionProvider actionProvider;
+ private final FunctionProvider functionProvider;
+ private final TypeDefinitionProvider typeDefinitionProvider;
+
+ public EdmTechProvider() {
+ containerProvider = new ContainerProvider();
+ entityTypeProvider = new EntityTypeProvider();
+ complexTypeProvider = new ComplexTypeProvider();
+ enumTypeProvider = new EnumTypeProvider();
+ actionProvider = new ActionProvider();
+ functionProvider = new FunctionProvider();
+ typeDefinitionProvider = new TypeDefinitionProvider();
+ schemaProvider = new SchemaProvider(this);
+ }
+
+ @Override
+ public List<AliasInfo> getAliasInfos() throws ODataException {
+ return Arrays.asList(
+ new AliasInfo().setAlias("Namespace1_Alias").setNamespace(nameSpace)
+ );
+ }
+
+ @Override
+ public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
+ return enumTypeProvider.getEnumType(enumTypeName);
+ }
+
+ @Override
+ public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
+ return typeDefinitionProvider.getTypeDefinition(typeDefinitionName);
+ }
+
+ @Override
+ public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
+ return entityTypeProvider.getEntityType(entityTypeName);
+ }
+
+ @Override
+ public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
+ return complexTypeProvider.getComplexType(complexTypeName);
+ }
+
+ @Override
+ public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
+ return actionProvider.getActions(actionName);
+ }
+
+ @Override
+ public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
+ return functionProvider.getFunctions(functionName);
+ }
+
+ @Override
+ public Term getTerm(final FullQualifiedName termName) throws ODataException {
+ return null;
+ }
+
+ @Override
+ public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
+ throws ODataException {
+ return containerProvider.getEntitySet(entityContainer, entitySetName);
+ }
+
+ @Override
+ public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
+ throws ODataException {
+ return containerProvider.getSingleton(entityContainer, singletonName);
+ }
+
+ @Override
+ public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
+ throws ODataException {
+ return containerProvider.getActionImport(entityContainer, actionImportName);
+ }
+
+ @Override
+ public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
+ throws ODataException {
+ return containerProvider.getFunctionImport(entityContainer, functionImportName);
+ }
+
+ @Override
+ public List<Schema> getSchemas() throws ODataException {
+ return schemaProvider.getSchemas();
+ }
+
+ @Override
+ public EntityContainer getEntityContainer() throws ODataException {
+ return containerProvider.getEntityContainer();
+ }
+
+ @Override
+ public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException {
+ return containerProvider.getEntityContainerInfo(entityContainerName);
+ }
+}
[14/31] [OLINGO-260] V3 proxy invoke
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailKey.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailKey.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailKey.java
index a6251db..ba6b8b1 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailKey.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailKey.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java
index a866228..9f1d550 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrument.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java
index f093eb3..878a3ff 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PaymentInstrumentCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java
index b175259..5a0b7b5 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Person.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java
index c34786d..778e8cc 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PersonCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java
index 271f976..7510863 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Product.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java
index 39a23b5..88cd63d 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java
index 3a6432c..d9db8ab 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetail.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java
index 2678102..31b8c1b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailKey.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailKey.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailKey.java
index fbe7632..713ba99 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailKey.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductDetailKey.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java
index 2faa843..9d0d3cf 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReview.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java
index 745ce9c..9825a70 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewKey.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewKey.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewKey.java
index aad0cdd..601b574 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewKey.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ProductReviewKey.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java
index 02fd1e3..86169a3 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompany.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -54,7 +53,7 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.ODataWCFService")
@EntityType(name = "PublicCompany",
- openType = false,
+ openType = true,
hasStream = false,
isAbstract = false,
baseType = "Microsoft.Test.OData.Services.ODataWCFService.Company")
@@ -273,6 +272,12 @@ public interface PublicCompany
+ @Override
+ Operations operations();
+
+ interface Operations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Company.Operations{
+
+ }
@Override
ComplexFactory factory();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java
index f7a149d..b90e82f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/PublicCompanyCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java
index ed3f6ee..ba4755b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Statement.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java
index 7a52544..2f4c0a6 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StatementCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java
index 4035fed..1a1df52 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPI.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java
index 2435a26..ba7ab8f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/StoredPICollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java
index 60345e8..e9b10a8 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Subscription.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java
index 17885bf..08393e7 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/SubscriptionCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/package-info.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/package-info.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/package-info.java
index 1b20c6b..4bc5702 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/package-info.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/package-info.java
@@ -16,6 +16,5 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONEntitySerializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONEntitySerializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONEntitySerializer.java
index 0ee4166..3f2a5fa 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONEntitySerializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONEntitySerializer.java
@@ -88,16 +88,12 @@ public class JSONEntitySerializer extends AbstractJsonSerializer<JSONEntityImpl>
}
if (serverMode && entity.getEditLink() != null && StringUtils.isNotBlank(entity.getEditLink().getHref())) {
- final URI link = URI.create(entity.getEditLink().getHref());
- final String editLink = link.isAbsolute() ? link.toASCIIString()
- : URI.create(entity.getBaseURI() + "/" + link.toASCIIString()).normalize().toASCIIString();
-
- jgen.writeStringField(
- version.getJSONMap().get(ODataServiceVersion.JSON_EDIT_LINK), editLink);
+ jgen.writeStringField(version.getJSONMap().get(ODataServiceVersion.JSON_EDIT_LINK),
+ entity.getEditLink().getHref());
if (entity.isMediaEntity()) {
- jgen.writeStringField(
- version.getJSONMap().get(ODataServiceVersion.JSON_MEDIAREAD_LINK), editLink + "/$value");
+ jgen.writeStringField(version.getJSONMap().get(ODataServiceVersion.JSON_MEDIAREAD_LINK),
+ entity.getEditLink().getHref() + "/$value");
}
}
[19/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
new file mode 100644
index 0000000..fde13c8
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ExpandValidator.java
@@ -0,0 +1,230 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import org.apache.olingo.commons.api.ODataApplicationException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.queryoption.ExpandItem;
+import org.apache.olingo.server.api.uri.queryoption.SelectItem;
+import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
+import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.QueryOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
+
+public class ExpandValidator implements TestValidator {
+ private Edm edm;
+ private TestValidator invokedByValidator;
+
+ private int expandItemIndex;
+ private ExpandOptionImpl expandOption;
+ private ExpandItem expandItem;
+
+ // --- Setup ---
+
+ public ExpandValidator setUpValidator(final TestValidator validator) {
+ invokedByValidator = validator;
+ return this;
+ }
+
+ public ExpandValidator setExpand(final ExpandOptionImpl expand) {
+ expandOption = expand;
+ first();
+ return this;
+ }
+
+ public ExpandValidator setEdm(final Edm edm) {
+ this.edm = edm;
+ return this;
+ }
+
+ // --- Navigation ---
+
+ public ExpandValidator goUpToExpandValidator() {
+ return (ExpandValidator) invokedByValidator;
+ }
+
+ public ResourceValidator goUpToUriResourceValidator() {
+ return (ResourceValidator) invokedByValidator;
+ }
+
+ public ResourceValidator goPath() {
+ UriInfoImpl uriInfo = (UriInfoImpl) expandItem.getResourcePath();
+
+ if (uriInfo.getKind() != UriInfoKind.resource) {
+ fail("goPath() can only be used on UriInfoKind.resource");
+ }
+
+ return new ResourceValidator()
+ .setUpValidator(this)
+ .setEdm(edm)
+ .setUriInfoImplPath(uriInfo);
+
+ }
+
+ public FilterValidator goOrder(final int index) {
+ OrderByOptionImpl orderBy = (OrderByOptionImpl) expandItem.getOrderByOption();
+
+ return new FilterValidator()
+ .setValidator(this)
+ .setEdm(edm)
+ .setExpression(orderBy.getOrders().get(index).getExpression());
+ }
+
+ public ResourceValidator goSelectItem(final int index) {
+ SelectOptionImpl select = (SelectOptionImpl) expandItem.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ UriInfoImpl uriInfo = (UriInfoImpl) item.getResourcePath();
+
+ return new ResourceValidator()
+ .setUpValidator(this)
+ .setEdm(edm)
+ .setUriInfoImplPath(uriInfo);
+
+ }
+
+ public ExpandValidator goExpand() {
+ ExpandValidator val = new ExpandValidator()
+ .setExpand((ExpandOptionImpl) expandItem.getExpandOption())
+ .setUpValidator(this);
+ return val;
+ }
+
+ public ExpandValidator first() {
+ expandItemIndex = 0;
+ expandItem = expandOption.getExpandItems().get(expandItemIndex);
+ return this;
+ }
+
+ public ExpandValidator next() {
+ expandItemIndex++;
+
+ try {
+ expandItem = expandOption.getExpandItems().get(expandItemIndex);
+ } catch (IndexOutOfBoundsException ex) {
+ fail("not enought segments");
+ }
+ return this;
+
+ }
+
+ public ExpandValidator isSegmentStar(final int index) {
+ assertEquals(true, expandItem.isStar());
+ return this;
+ }
+
+ public ExpandValidator isSegmentRef(final int index) {
+ assertEquals(true, expandItem.isRef());
+ return this;
+ }
+
+ public ExpandValidator isLevelText(final String text) {
+ QueryOptionImpl option = (QueryOptionImpl) expandItem.getLevelsOption();
+ assertEquals(text, option.getText());
+ return this;
+ }
+
+ public ExpandValidator isSkipText(final String text) {
+ QueryOptionImpl option = (QueryOptionImpl) expandItem.getSkipOption();
+ assertEquals(text, option.getText());
+ return this;
+ }
+
+ public ExpandValidator isTopText(final String text) {
+ QueryOptionImpl option = (QueryOptionImpl) expandItem.getTopOption();
+ assertEquals(text, option.getText());
+ return this;
+ }
+
+ public ExpandValidator isInlineCountText(final String text) {
+ QueryOptionImpl option = (QueryOptionImpl) expandItem.getCountOption();
+ assertEquals(text, option.getText());
+ return this;
+ }
+
+ public ExpandValidator isSelectText(final String text) {
+ QueryOptionImpl option = (QueryOptionImpl) expandItem.getSelectOption();
+ assertEquals(text, option.getText());
+ return this;
+ }
+
+ public ExpandValidator isSelectItemStar(final int index) {
+ SelectOptionImpl select = (SelectOptionImpl) expandItem.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ assertEquals(true, item.isStar());
+ return this;
+ }
+
+ public ExpandValidator isSelectItemAllOperations(final int index, final FullQualifiedName fqn) {
+ SelectOptionImpl select = (SelectOptionImpl) expandItem.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ assertEquals(fqn.toString(), item.getAllOperationsInSchemaNameSpace().toString());
+ return this;
+ }
+
+ public ExpandValidator isFilterOptionText(final String text) {
+ QueryOptionImpl option = (QueryOptionImpl) expandItem.getFilterOption();
+ assertEquals(text, option.getText());
+ return this;
+ }
+
+ public ExpandValidator isFilterSerialized(final String serialized) {
+ FilterOptionImpl filter = (FilterOptionImpl) expandItem.getFilterOption();
+
+ try {
+ String tmp = FilterTreeToText.Serialize(filter);
+ assertEquals(serialized, tmp);
+ } catch (ExpressionVisitException e) {
+ fail("Exception occured while converting the filterTree into text" + "\n"
+ + " Exception: " + e.getMessage());
+ } catch (ODataApplicationException e) {
+ fail("Exception occured while converting the filterTree into text" + "\n"
+ + " Exception: " + e.getMessage());
+ }
+
+ return this;
+ }
+
+ public ExpandValidator isSortOrder(final int index, final boolean descending) {
+ OrderByOptionImpl orderBy = (OrderByOptionImpl) expandItem.getOrderByOption();
+ assertEquals(descending, orderBy.getOrders().get(index).isDescending());
+ return this;
+ }
+
+ public ExpandValidator isExpandStartType(final FullQualifiedName fullName) {
+ EdmType actualType = expandItem.getStartTypeFilter();
+
+ FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
+ assertEquals(fullName, actualName);
+ return this;
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java
new file mode 100644
index 0000000..06056e0
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterTreeToText.java
@@ -0,0 +1,154 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataApplicationException;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+import org.apache.olingo.server.api.uri.UriResource;
+import org.apache.olingo.server.api.uri.UriResourceLambdaAll;
+import org.apache.olingo.server.api.uri.UriResourceLambdaAny;
+import org.apache.olingo.server.api.uri.UriResourcePartTyped;
+import org.apache.olingo.server.api.uri.queryoption.FilterOption;
+import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
+import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitor;
+import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.UnaryOperatorKind;
+
+public class FilterTreeToText implements ExpressionVisitor<String> {
+
+ public static String Serialize(final FilterOption filter)
+ throws ExpressionVisitException, ODataApplicationException {
+
+ Expression expression = filter.getExpression();
+ return expression.accept(new FilterTreeToText());
+ }
+
+ public static String Serialize(final Expression expression)
+ throws ExpressionVisitException, ODataApplicationException {
+
+ return expression.accept(new FilterTreeToText());
+ }
+
+ @Override
+ public String visitBinaryOperator(final BinaryOperatorKind operator, final String left, final String right)
+ throws ExpressionVisitException {
+
+ return "<" + left + " " + operator.toString() + " " + right + ">";
+ }
+
+ @Override
+ public String visitUnaryOperator(final UnaryOperatorKind operator, final String operand)
+ throws ExpressionVisitException {
+
+ return "<" + operator + " " + operand.toString() + ">";
+ }
+
+ @Override
+ public String visitMethodCall(final MethodKind methodCall, final List<String> parameters)
+ throws ExpressionVisitException {
+
+ String text = "<" + methodCall + "(";
+ int i = 0;
+ while (i < parameters.size()) {
+ if (i > 0) {
+ text += ",";
+ }
+ text += parameters.get(i);
+ i++;
+ }
+ return text + ")>";
+ }
+
+ @Override
+ public String visitLiteral(final String literal) throws ExpressionVisitException {
+ return "<" + literal + ">";
+ }
+
+ @Override
+ public String visitMember(final UriInfoResource resource) throws ExpressionVisitException, ODataApplicationException {
+ String ret = "";
+
+ UriInfoResource path = resource;
+
+ for (UriResource item : path.getUriResourceParts()) {
+ String tmp = "";
+ if (item instanceof UriResourceLambdaAll) {
+ UriResourceLambdaAll all = (UriResourceLambdaAll) item;
+ tmp = visitLambdaExpression("ALL", all.getLambdaVariable(), all.getExpression());
+ } else if (item instanceof UriResourceLambdaAny) {
+ UriResourceLambdaAny any = (UriResourceLambdaAny) item;
+ tmp = visitLambdaExpression("ANY", any.getLamdaVariable(), any.getExpression());
+ } else if (item instanceof UriResourcePartTyped) {
+ UriResourcePartTyped typed = (UriResourcePartTyped) item;
+ tmp = typed.toString(true);
+ }
+
+ if (ret.length() != 0) {
+ ret += "/";
+ }
+ ret += tmp;
+
+ }
+ return "<" + ret + ">";
+ }
+
+ @Override
+ public String visitAlias(final String referenceName) throws ExpressionVisitException {
+ return "<" + referenceName + ">";
+ }
+
+ @Override
+ public String visitLambdaExpression(final String functionText, final String string, final Expression expression)
+ throws ExpressionVisitException, ODataApplicationException {
+
+ return "<" + functionText + ";" + ((expression == null) ? "" : expression.accept(this)) + ">";
+ }
+
+ @Override
+ public String visitTypeLiteral(final EdmType type) {
+ return "<" + type.getNamespace() + "." + type.getName() + ">";
+ }
+
+ @Override
+ public String visitLambdaReference(final String variableText) {
+ return "<" + variableText + ">";
+ }
+
+ @Override
+ public String visitEnum(final EdmEnumType type, final List<String> enumValues)
+ throws ExpressionVisitException, ODataApplicationException {
+ String tmp = "";
+
+ for (String item : enumValues) {
+ if (tmp.length() > 0) {
+ tmp += ",";
+ }
+ tmp += item;
+ }
+
+ return "<" + type.getNamespace() + "." + type.getName() + "<" + tmp + ">>";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
new file mode 100644
index 0000000..58e429f
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/FilterValidator.java
@@ -0,0 +1,534 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataApplicationException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.Expression;
+import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
+import org.apache.olingo.server.api.uri.queryoption.expression.Member;
+import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
+import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.parser.Parser;
+import org.apache.olingo.server.core.uri.parser.UriParserException;
+import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
+import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
+import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.BinaryImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.EnumerationImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.MemberImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.MethodImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.TypeLiteralImpl;
+
+public class FilterValidator implements TestValidator {
+ private Edm edm;
+
+ private TestValidator invokedByValidator;
+ private FilterOptionImpl filter;
+
+ private Expression curExpression;
+ private Expression rootExpression;
+
+ private OrderByOptionImpl orderBy;
+
+ private UriParserException exception;
+
+ // --- Setup ---
+ public FilterValidator setUriResourcePathValidator(final ResourceValidator uriResourcePathValidator) {
+ invokedByValidator = uriResourcePathValidator;
+ return this;
+ }
+
+ public FilterValidator setUriValidator(final TestUriValidator uriValidator) {
+ invokedByValidator = uriValidator;
+ return this;
+ }
+
+ public FilterValidator setValidator(final TestValidator uriValidator) {
+ invokedByValidator = uriValidator;
+ return this;
+ }
+
+ public FilterValidator setEdm(final Edm edm) {
+ this.edm = edm;
+ return this;
+ }
+
+ public FilterValidator setFilter(final FilterOptionImpl filter) {
+ this.filter = filter;
+
+ if (filter.getExpression() == null) {
+ fail("FilterValidator: no filter found");
+ }
+ setExpression(filter.getExpression());
+ return this;
+ }
+
+ public FilterValidator setOrderBy(final OrderByOptionImpl orderBy) {
+ this.orderBy = orderBy;
+
+ return this;
+ }
+
+ public FilterValidator setExpression(final Expression expression) {
+ rootExpression = curExpression = expression;
+ return this;
+ }
+
+ // --- Execution ---
+
+ public FilterValidator runOrderByOnETAllPrim(final String orderBy) throws UriParserException {
+ String uri = "ESAllPrim?$orderby=" + orderBy.trim();
+ return runUriOrderBy(uri);
+ }
+
+ public FilterValidator runOrderByOnETTwoKeyNav(final String orderBy) throws UriParserException {
+ String uri = "ESTwoKeyNav?$orderby=" + orderBy.trim();
+ return runUriOrderBy(uri);
+ }
+
+ public FilterValidator runOrderByOnETTwoKeyNavEx(final String orderBy) throws UriParserException {
+ String uri = "ESTwoKeyNav?$orderby=" + orderBy.trim();
+ return runUriOrderByEx(uri);
+ }
+
+ public FilterValidator runOnETTwoKeyNav(final String filter) throws UriParserException {
+ String uri = "ESTwoKeyNav?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnETTwoKeyNavSingle(final String filter) throws UriParserException {
+ String uri = "SINav?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnETTwoKeyNavEx(final String filter) throws UriParserException {
+ String uri = "ESTwoKeyNav?$filter=" + filter.trim();
+ return runUriEx(uri);
+ }
+
+ public FilterValidator runOnETAllPrim(final String filter) throws UriParserException {
+ String uri = "ESAllPrim(1)?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnETKeyNav(final String filter) throws UriParserException {
+ String uri = "ESKeyNav(1)?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnETKeyNavEx(final String filter) throws UriParserException {
+ String uri = "ESKeyNav(1)?$filter=" + filter.trim();
+ return runUriEx(uri);
+ }
+
+ public FilterValidator runOnCTTwoPrim(final String filter) throws UriParserException {
+ String uri = "SINav/PropertyComplexTwoPrim?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnString(final String filter) throws UriParserException {
+ String uri = "SINav/PropertyString?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnInt32(final String filter) throws UriParserException {
+ String uri = "ESCollAllPrim(1)/CollPropertyInt32?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnDateTimeOffset(final String filter) throws UriParserException {
+ String uri = "ESCollAllPrim(1)/CollPropertyDateTimeOffset?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnDuration(final String filter) throws UriParserException {
+ String uri = "ESCollAllPrim(1)/CollPropertyDuration?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runOnTimeOfDay(final String filter) throws UriParserException {
+ String uri = "ESCollAllPrim(1)/CollPropertyTimeOfDay?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runESabc(final String filter) throws UriParserException {
+ String uri = "ESabc?$filter=" + filter.trim();
+ return runUri(uri);
+ }
+
+ public FilterValidator runUri(final String uri) throws UriParserException {
+ Parser parser = new Parser();
+ UriInfo uriInfo = null;
+
+ uriInfo = parser.parseUri(uri, edm);
+
+ if (uriInfo.getKind() != UriInfoKind.resource) {
+ fail("Filtervalidator can only be used on resourcePaths");
+ }
+
+ setFilter((FilterOptionImpl) uriInfo.getFilterOption());
+ curExpression = filter.getExpression();
+ return this;
+ }
+
+ public FilterValidator runUriEx(final String uri) {
+ Parser parser = new Parser();
+ UriInfo uriInfo = null;
+
+ try {
+ uriInfo = parser.parseUri(uri, edm);
+ } catch (UriParserException e) {
+ exception = e;
+ return this;
+ }
+
+ if (uriInfo.getKind() != UriInfoKind.resource) {
+ fail("Filtervalidator can only be used on resourcePaths");
+ }
+
+ setFilter((FilterOptionImpl) uriInfo.getFilterOption());
+ curExpression = filter.getExpression();
+ return this;
+ }
+
+ public FilterValidator runUriOrderBy(final String uri) throws UriParserException {
+ Parser parser = new Parser();
+ UriInfo uriInfo = null;
+
+ uriInfo = parser.parseUri(uri, edm);
+
+ if (uriInfo.getKind() != UriInfoKind.resource) {
+ fail("Filtervalidator can only be used on resourcePaths");
+ }
+
+ setOrderBy((OrderByOptionImpl) uriInfo.getOrderByOption());
+ return this;
+ }
+
+ public FilterValidator runUriOrderByEx(final String uri) {
+ Parser parser = new Parser();
+ UriInfo uriInfo = null;
+
+ try {
+ uriInfo = parser.parseUri(uri, edm);
+ } catch (UriParserException e) {
+ exception = e;
+ return this;
+ }
+
+ if (uriInfo.getKind() != UriInfoKind.resource) {
+ fail("Filtervalidator can only be used on resourcePaths");
+ }
+
+ setOrderBy((OrderByOptionImpl) uriInfo.getOrderByOption());
+ return this;
+ }
+
+ // --- Navigation ---
+
+ public ExpandValidator goUpToExpandValidator() {
+ return (ExpandValidator) invokedByValidator;
+ }
+
+ public ResourceValidator goUpToResourceValidator() {
+ return (ResourceValidator) invokedByValidator;
+ }
+
+ public ResourceValidator goPath() {
+ if (!(curExpression instanceof MemberImpl)) {
+ fail("Current expression not a member");
+ }
+
+ MemberImpl member = (MemberImpl) curExpression;
+
+ return new ResourceValidator()
+ .setEdm(edm)
+ .setUriInfoImplPath((UriInfoImpl) member.getResourcePath())
+ .setUpValidator(this);
+
+ }
+
+ public FilterValidator goParameter(final int parameterIndex) {
+ if (curExpression instanceof MethodImpl) {
+ MethodImpl methodCall = (MethodImpl) curExpression;
+ curExpression = methodCall.getParameters().get(parameterIndex);
+ } else {
+ fail("Current expression not a methodCall");
+ }
+ return this;
+ }
+
+ // --- Validation ---
+
+ /**
+ * Validates the serialized filterTree against a given filterString
+ * The given expected filterString is compressed before to allow better readable code in the unit tests
+ * @param toBeCompr
+ * @return
+ */
+ public FilterValidator isCompr(final String toBeCompr) {
+ return is(compress(toBeCompr));
+ }
+
+ public FilterValidator is(final String expectedFilterAsString) {
+ try {
+ String actualFilterAsText = FilterTreeToText.Serialize((FilterOptionImpl) filter);
+ assertEquals(expectedFilterAsString, actualFilterAsText);
+ } catch (ExpressionVisitException e) {
+ fail("Exception occured while converting the filterTree into text" + "\n"
+ + " Exception: " + e.getMessage());
+ } catch (ODataApplicationException e) {
+ fail("Exception occured while converting the filterTree into text" + "\n"
+ + " Exception: " + e.getMessage());
+ }
+
+ return this;
+ }
+
+ // --- Helper ---
+
+ private String compress(final String expected) {
+ String ret = expected.replaceAll("\\s+", " ");
+ ret = ret.replaceAll("< ", "<");
+ ret = ret.replaceAll(" >", ">");
+ return ret;
+ }
+
+ public FilterValidator isType(final FullQualifiedName fullName) {
+ EdmType actualType = null;
+
+ if (curExpression instanceof MemberImpl) {
+ Member member = (Member) curExpression;
+ actualType = member.getType();
+ } else if (curExpression instanceof TypeLiteralImpl) {
+ TypeLiteralImpl typeLiteral = (TypeLiteralImpl) curExpression;
+ actualType = typeLiteral.getType();
+ } else if (curExpression instanceof LiteralImpl) {
+ LiteralImpl typeLiteral = (LiteralImpl) curExpression;
+ actualType = typeLiteral.getType();
+ }
+
+ if (actualType == null) {
+ fail("Current expression not typed");
+ }
+
+ FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
+ assertEquals(fullName, actualName);
+ return this;
+ }
+
+ public FilterValidator left() {
+ if (!(curExpression instanceof BinaryImpl)) {
+ fail("Current expression not a binary operator");
+ }
+
+ curExpression = ((BinaryImpl) curExpression).getLeftOperand();
+
+ return this;
+ }
+
+ public FilterValidator root() {
+ if (filter != null) {
+ curExpression = filter.getExpression();
+ } else {
+ curExpression = rootExpression;
+ }
+
+ return this;
+ }
+
+ public FilterValidator right() {
+ if (!(curExpression instanceof BinaryImpl)) {
+ fail("Current expression is not a binary operator");
+ }
+
+ curExpression = ((BinaryImpl) curExpression).getRightOperand();
+
+ return this;
+
+ }
+
+ public FilterValidator isLiteral(final String literalText) {
+ if (!(curExpression instanceof LiteralImpl)) {
+ fail("Current expression is not a literal");
+ }
+
+ String actualLiteralText = ((LiteralImpl) curExpression).getText();
+ assertEquals(literalText, actualLiteralText);
+
+ return this;
+ }
+
+ public FilterValidator isMethod(final MethodKind methodKind, final int parameterCount) {
+ if (!(curExpression instanceof MethodImpl)) {
+ fail("Current expression is not a methodCall");
+ }
+
+ MethodImpl methodCall = (MethodImpl) curExpression;
+ assertEquals(methodKind, methodCall.getMethod());
+ assertEquals(parameterCount, methodCall.getParameters().size());
+
+ return this;
+ }
+
+ public FilterValidator isParameterText(final int parameterIndex, final String parameterText)
+ throws ExpressionVisitException, ODataApplicationException {
+
+ if (!(curExpression instanceof MethodImpl)) {
+ fail("Current expression is not a method");
+ }
+
+ MethodImpl methodCall = (MethodImpl) curExpression;
+
+ Expression parameter = methodCall.getParameters().get(parameterIndex);
+ String actualParameterText = FilterTreeToText.Serialize(parameter);
+ assertEquals(parameterText, actualParameterText);
+
+ return this;
+ }
+
+ public FilterValidator isBinary(final BinaryOperatorKind binaryOperator) {
+ if (!(curExpression instanceof BinaryImpl)) {
+ fail("Current expression is not a binary operator");
+ }
+
+ BinaryImpl binary = (BinaryImpl) curExpression;
+ assertEquals(binaryOperator, binary.getOperator());
+
+ return this;
+ }
+
+ public FilterValidator isTypedLiteral(final FullQualifiedName fullName) {
+ if (!(curExpression instanceof TypeLiteralImpl)) {
+ fail("Current expression not a typeLiteral");
+ }
+
+ isType(fullName);
+
+ return this;
+ }
+
+ public FilterValidator isMember() {
+ if (!(curExpression instanceof MemberImpl)) {
+ fail("Current expression not a member");
+ }
+
+ return this;
+ }
+
+ public FilterValidator isMemberStartType(final FullQualifiedName fullName) {
+ if (!(curExpression instanceof MemberImpl)) {
+ fail("Current expression not a member");
+ }
+
+ MemberImpl member = (MemberImpl) curExpression;
+ EdmType actualType = member.getStartTypeFilter();
+
+ FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
+ assertEquals(fullName, actualName);
+ return this;
+ }
+
+ public FilterValidator isEnum(final FullQualifiedName nameenstring, final List<String> enumValues) {
+ if (!(curExpression instanceof EnumerationImpl)) {
+ fail("Current expression not a enumeration");
+ }
+
+ EnumerationImpl enumeration = (EnumerationImpl) curExpression;
+
+ FullQualifiedName actualName =
+ new FullQualifiedName(enumeration.getType().getNamespace(), enumeration.getType().getName());
+
+ // check name
+ assertEquals(nameenstring.toString(), actualName.toString());
+
+ // check values
+ int i = 0;
+ for (String item : enumValues) {
+ assertEquals(item, enumeration.getValues().get(i));
+ i++;
+ }
+
+ return this;
+ }
+
+ public FilterValidator isSortOrder(final int index, final boolean descending) {
+ assertEquals(descending, orderBy.getOrders().get(index).isDescending());
+ return this;
+ }
+
+ public FilterValidator goOrder(final int index) {
+ curExpression = orderBy.getOrders().get(index).getExpression();
+ return this;
+ }
+
+ public FilterValidator isExSyntax(final long errorID) {
+ assertEquals(UriParserSyntaxException.class, exception.getClass());
+ return this;
+ }
+
+ public FilterValidator isExSemantic(final long errorID) {
+ assertEquals(UriParserSemanticException.class, exception.getClass());
+ return this;
+ }
+
+ public FilterValidator isNull() {
+ if (!(curExpression instanceof LiteralImpl)) {
+ fail("Current expression is not a literal");
+ }
+
+ String actualLiteralText = ((LiteralImpl) curExpression).getText();
+ assertEquals("null", actualLiteralText);
+ return this;
+ }
+
+ public FilterValidator isTrue() {
+ if (!(curExpression instanceof LiteralImpl)) {
+ fail("Current expression is not a literal");
+ }
+
+ String actualLiteralText = ((LiteralImpl) curExpression).getText();
+ assertEquals("true", actualLiteralText);
+ return this;
+ }
+
+ public FilterValidator isFalse() {
+ if (!(curExpression instanceof LiteralImpl)) {
+ fail("Current expression is not a literal");
+ }
+
+ String actualLiteralText = ((LiteralImpl) curExpression).getText();
+ assertEquals("false", actualLiteralText);
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParseTreeToText.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParseTreeToText.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParseTreeToText.java
new file mode 100644
index 0000000..f6a3086
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParseTreeToText.java
@@ -0,0 +1,82 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.antlr.v4.runtime.Token;
+import org.antlr.v4.runtime.misc.NotNull;
+import org.antlr.v4.runtime.misc.Nullable;
+import org.antlr.v4.runtime.misc.Utils;
+import org.antlr.v4.runtime.tree.ErrorNode;
+import org.antlr.v4.runtime.tree.RuleNode;
+import org.antlr.v4.runtime.tree.TerminalNode;
+import org.antlr.v4.runtime.tree.Tree;
+
+public class ParseTreeToText {
+
+ public static String getTreeAsText(final Tree contextTree, final String[] ruleNames) {
+ return toStringTree(contextTree, Arrays.asList(ruleNames));
+ }
+
+ private static String toStringTree(final Tree t, @Nullable final List<String> ruleNames) {
+
+ if (t.getChildCount() == 0) {
+ return Utils.escapeWhitespace(getNodeText(t, ruleNames), false);
+ }
+
+ StringBuilder buf = new StringBuilder();
+ String s = Utils.escapeWhitespace(getNodeText(t, ruleNames), false);
+ buf.append(s);
+ buf.append("(");
+
+ for (int i = 0; i < t.getChildCount(); i++) {
+ if (i > 0) {
+ buf.append(' ');
+ }
+ buf.append(toStringTree(t.getChild(i), ruleNames));
+ }
+ buf.append(")");
+ return buf.toString();
+ }
+
+ private static String getNodeText(@NotNull final Tree t, @Nullable final List<String> ruleNames) {
+ if (ruleNames != null) {
+ if (t instanceof RuleNode) {
+ int ruleIndex = ((RuleNode) t).getRuleContext().getRuleIndex();
+ return ruleNames.get(ruleIndex);
+ } else if (t instanceof ErrorNode) {
+ return t.toString();
+ } else if (t instanceof TerminalNode) {
+ Token symbol = ((TerminalNode) t).getSymbol();
+ if (symbol != null) {
+ String s = symbol.getText();
+ return s;
+ }
+ }
+ }
+ // no recog for rule names
+ Object payload = t.getPayload();
+ if (payload instanceof Token) {
+ return ((Token) payload).getText();
+ }
+ return t.getPayload().toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserValidator.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserValidator.java
new file mode 100644
index 0000000..3f73b97
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserValidator.java
@@ -0,0 +1,162 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.antlr.v4.runtime.ParserRuleContext;
+import org.apache.olingo.server.core.uri.antlr.UriParserParser;
+
+public class ParserValidator {
+
+ private String input = null;
+ private ParserRuleContext root;
+
+ int logLevel = 0;
+ private int lexerLogLevel = 0;
+
+ boolean allowFullContext;
+ boolean allowContextSensitifity;
+ boolean allowAmbiguity;
+
+ List<Exception> exceptions = new ArrayList<Exception>();
+ private Exception curException = null;
+
+ // --- Setup ---
+
+ public ParserValidator log(final int logLevel) {
+ this.logLevel = logLevel;
+ return this;
+ }
+
+ public ParserValidator lexerLog(final int logLevel) {
+ lexerLogLevel = logLevel;
+ return this;
+ }
+
+ /**
+ * Used in fast LL Parsing:
+ * Don't stop the parsing process when the slower full context parsing (with prediction mode SLL) is
+ * required
+ * @return
+ */
+ public ParserValidator aFC() {
+ allowFullContext = true;
+ return this;
+ }
+
+ /**
+ * Used in fast LL Parsing:
+ * Allows ContextSensitifity Errors which occur often when using the slower full context parsing
+ * and indicate that there is a context sensitivity ( which may not be an error).
+ * @return
+ */
+ public ParserValidator aCS() {
+ allowContextSensitifity = true;
+ return this;
+ }
+
+ /**
+ * Used in fast LL Parsing:
+ * Allows ambiguities
+ * @return
+ */
+ public ParserValidator aAM() {
+ allowAmbiguity = true;
+ return this;
+ }
+
+ // --- Execution ---
+
+ public ParserValidator run(final String uri) {
+ input = uri;
+
+ // just run a short lexer step. E.g. to print the tokens
+ if (lexerLogLevel > 0) {
+ (new TokenValidator()).log(lexerLogLevel).run(input);
+ }
+
+ /**/// root = parseInput(uri);
+
+ // if LOG > 0 - Write serialized tree
+ if (logLevel > 0) {
+ if (root != null) {
+ System.out.println(ParseTreeToText.getTreeAsText(root, new UriParserParser(null).getRuleNames()));
+ } else {
+ System.out.println("root == null");
+ }
+ }
+
+ // reset for next test
+ allowFullContext = false;
+ allowContextSensitifity = false;
+ allowAmbiguity = false;
+ logLevel = 0;
+
+ return this;
+ }
+
+ // --- Navigation ---
+
+ public ParserValidator exFirst() {
+ try {
+ // curWeakException = exceptions.get(0);
+ } catch (IndexOutOfBoundsException ex) {
+ // curWeakException = null;
+ }
+ return this;
+
+ }
+
+ public ParserValidator exLast() {
+ // curWeakException = exceptions.get(exceptions.size() - 1);
+ return this;
+ }
+
+ public ParserValidator exAt(final int index) {
+ try {
+ // curWeakException = exceptions.get(index);
+ } catch (IndexOutOfBoundsException ex) {
+ // curWeakException = null;
+ }
+ return this;
+ }
+
+ // --- Validation ---
+
+ public ParserValidator isText(final String expected) {
+
+ assertEquals(null, curException);
+ assertEquals(0, exceptions.size());
+
+ String actualTreeAsText = ParseTreeToText.getTreeAsText(root, new UriParserParser(null).getRuleNames());
+
+ assertEquals(expected, actualTreeAsText);
+ return this;
+ }
+
+ public ParserValidator isExeptionType(final Class<?> exClass) {
+ assertEquals(exClass, curException.getClass());
+ return this;
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserWithLogging.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserWithLogging.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserWithLogging.java
new file mode 100644
index 0000000..524a38a
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ParserWithLogging.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.olingo.server.core.uri.testutil;
+
+import org.antlr.v4.runtime.DefaultErrorStrategy;
+import org.antlr.v4.runtime.DiagnosticErrorListener;
+import org.apache.olingo.server.core.uri.antlr.UriParserParser;
+import org.apache.olingo.server.core.uri.parser.Parser;
+
+public class ParserWithLogging extends Parser {
+ TestErrorLogger errorCollector1;
+ TestErrorLogger errorCollector2;
+
+ public ParserWithLogging() {
+ errorCollector1 = new TestErrorLogger("Stage 1", 1);
+ errorCollector2 = new TestErrorLogger("Stage 2", 1);
+ }
+
+ @Override
+ protected void addStage2ErrorStategy(final UriParserParser parser) {
+ // Don't throw an at first syntax error, so the error listener will be called
+ parser.setErrorHandler(new DefaultErrorStrategy());
+ }
+
+ @Override
+ protected void addStage1ErrorListener(final UriParserParser parser) {
+ // Log error to console
+ parser.removeErrorListeners();
+ parser.addErrorListener(errorCollector1);
+ parser.addErrorListener(new DiagnosticErrorListener());
+ }
+
+ @Override
+ protected void addStage2ErrorListener(final UriParserParser parser) {
+ // Log error to console
+ parser.removeErrorListeners();
+ parser.addErrorListener(errorCollector2);
+ parser.addErrorListener(new DiagnosticErrorListener());
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ResourceValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ResourceValidator.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ResourceValidator.java
new file mode 100644
index 0000000..143871a
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/ResourceValidator.java
@@ -0,0 +1,599 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataApplicationException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmElement;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriParameter;
+import org.apache.olingo.server.api.uri.UriResourceKind;
+import org.apache.olingo.server.api.uri.UriResourcePartTyped;
+import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
+import org.apache.olingo.server.api.uri.queryoption.SelectItem;
+import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
+import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.UriResourceActionImpl;
+import org.apache.olingo.server.core.uri.UriResourceComplexPropertyImpl;
+import org.apache.olingo.server.core.uri.UriResourceEntitySetImpl;
+import org.apache.olingo.server.core.uri.UriResourceFunctionImpl;
+import org.apache.olingo.server.core.uri.UriResourceImpl;
+import org.apache.olingo.server.core.uri.UriResourceLambdaAllImpl;
+import org.apache.olingo.server.core.uri.UriResourceLambdaAnyImpl;
+import org.apache.olingo.server.core.uri.UriResourceNavigationPropertyImpl;
+import org.apache.olingo.server.core.uri.UriResourcePrimitivePropertyImpl;
+import org.apache.olingo.server.core.uri.UriResourceSingletonImpl;
+import org.apache.olingo.server.core.uri.UriResourceWithKeysImpl;
+import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.ExpressionImpl;
+import org.apache.olingo.server.core.uri.validator.UriValidator;
+
+public class ResourceValidator implements TestValidator {
+ private Edm edm;
+ private TestValidator invokedBy;
+ private UriInfo uriInfo = null;
+
+ private UriResourceImpl uriPathInfo = null;
+ private int uriResourceIndex;
+
+ // --- Setup ---
+
+ public ResourceValidator setUpValidator(final TestValidator uriValidator) {
+ invokedBy = uriValidator;
+ return this;
+ }
+
+ public ResourceValidator setEdm(final Edm edm) {
+ this.edm = edm;
+ return this;
+ }
+
+ public ResourceValidator setUriInfoImplPath(final UriInfoImpl uriInfoPath) {
+ uriInfo = uriInfoPath;
+ last();
+ return this;
+ }
+
+ // --- Execution ---
+
+ public ResourceValidator run(final String uri) {
+ ParserWithLogging testParser = new ParserWithLogging();
+
+ UriInfoImpl uriInfoTmp = null;
+ uriPathInfo = null;
+ try {
+ uriInfoTmp = (UriInfoImpl) testParser.parseUri(uri, edm);
+
+ UriValidator uriValidator = new UriValidator();
+ uriValidator.validate(uriInfoTmp, "GET");
+ } catch (Exception e) {
+ fail("Exception occured while parsing the URI: " + uri + "\n"
+ + " Message: " + e.getMessage());
+ }
+
+ if (uriInfoTmp.getKind() != UriInfoKind.resource) {
+ fail("Invalid UriInfoKind: " + uriInfoTmp.getKind().toString());
+ }
+ uriInfo = uriInfoTmp;
+
+ first();
+ return this;
+ }
+
+ // --- Navigation ---
+
+ public TestUriValidator goUpUriValidator() {
+ return (TestUriValidator) invokedBy;
+ }
+
+ public ExpandValidator goUpExpandValidator() {
+ return (ExpandValidator) invokedBy;
+ }
+
+ public FilterValidator goUpFilterValidator() {
+ return (FilterValidator) invokedBy;
+ }
+
+ public FilterValidator goParameter(final int index) {
+ assertEquals(UriResourceKind.function, uriPathInfo.getKind());
+ UriResourceFunctionImpl function = (UriResourceFunctionImpl) uriPathInfo;
+
+ return new FilterValidator()
+ .setEdm(edm)
+ .setExpression(function.getParameters().get(index).getExression())
+ .setValidator(this);
+ }
+
+ public FilterValidator goLambdaExpression() {
+ if (uriPathInfo.getKind() == UriResourceKind.lambdaAll) {
+ return new FilterValidator()
+ .setEdm(edm)
+ .setExpression(((UriResourceLambdaAllImpl) uriPathInfo).getExpression());
+
+ } else if (uriPathInfo.getKind() == UriResourceKind.lambdaAny) {
+ return new FilterValidator()
+ .setEdm(edm)
+ .setExpression(((UriResourceLambdaAnyImpl) uriPathInfo).getExpression());
+ } else {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+ return null;
+ }
+
+ public ResourceValidator goSelectItem(final int index) {
+ SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ UriInfoImpl uriInfo1 = (UriInfoImpl) item.getResourcePath();
+
+ return new ResourceValidator()
+ .setUpValidator(this)
+ .setEdm(edm)
+ .setUriInfoImplPath(uriInfo1);
+
+ }
+
+ public ExpandValidator goExpand() {
+ ExpandOptionImpl expand = (ExpandOptionImpl) uriInfo.getExpandOption();
+ if (expand == null) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ return new ExpandValidator().setUpValidator(this).setExpand(expand);
+ }
+
+ public ResourceValidator first() {
+ uriResourceIndex = 0;
+ uriPathInfo = (UriResourceImpl) uriInfo.getUriResourceParts().get(0);
+ return this;
+ }
+
+ public ResourceValidator last() {
+ uriResourceIndex = 0;
+
+ try {
+ uriPathInfo = (UriResourceImpl) uriInfo.getUriResourceParts().get(uriInfo.getUriResourceParts().size() - 1);
+ uriResourceIndex = uriInfo.getUriResourceParts().size() - 1;
+ } catch (IndexOutOfBoundsException ex) {
+ fail("not enough segments");
+ }
+
+ return this;
+ }
+
+ public ResourceValidator n() {
+ uriResourceIndex++;
+
+ try {
+ uriPathInfo = (UriResourceImpl) uriInfo.getUriResourceParts().get(uriResourceIndex);
+ } catch (IndexOutOfBoundsException ex) {
+ fail("not enough segments");
+ }
+
+ return this;
+ }
+
+ public ResourceValidator at(final int index) {
+ uriResourceIndex = index;
+ try {
+ uriPathInfo = (UriResourceImpl) uriInfo.getUriResourceParts().get(index);
+ } catch (IndexOutOfBoundsException ex) {
+ fail("not enough segments");
+ }
+ return this;
+ }
+
+ // --- Validation ---
+
+ public ResourceValidator isLambdaVar(final String var) {
+ String actualVar = null;
+ if (uriPathInfo.getKind() == UriResourceKind.lambdaAll) {
+ actualVar = ((UriResourceLambdaAllImpl) uriPathInfo).getLambdaVariable();
+ } else if (uriPathInfo.getKind() == UriResourceKind.lambdaAny) {
+ actualVar = ((UriResourceLambdaAnyImpl) uriPathInfo).getLamdaVariable();
+ } else {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ assertEquals(var, actualVar);
+ return this;
+ }
+
+ public ResourceValidator isTypeFilter(final FullQualifiedName expectedType) {
+
+ if (uriPathInfo.getKind() != UriResourceKind.complexProperty &&
+ uriPathInfo.getKind() != UriResourceKind.singleton) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ EdmType actualType = null;
+ if (uriPathInfo instanceof UriResourceComplexPropertyImpl) {
+ actualType = ((UriResourceComplexPropertyImpl) uriPathInfo).getComplexTypeFilter();
+ } else if (uriPathInfo instanceof UriResourceSingletonImpl) {
+ actualType = ((UriResourceSingletonImpl) uriPathInfo).getEntityTypeFilter();
+ }
+
+ if (actualType == null) {
+ fail("type information not set");
+ }
+
+ FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
+
+ assertEquals(expectedType.toString(), actualName.toString());
+ return this;
+ }
+
+ public ResourceValidator isType(final FullQualifiedName type) {
+ if (!(uriPathInfo instanceof UriResourcePartTyped)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+ UriResourcePartTyped uriPathInfoTyped = (UriResourcePartTyped) uriPathInfo;
+
+ EdmType actualType = uriPathInfoTyped.getType();
+ if (actualType == null) {
+ fail("type information not set");
+ }
+
+ FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
+
+ assertEquals(type.toString(), actualName.toString());
+
+ return this;
+ }
+
+ public ResourceValidator isType(final FullQualifiedName type, final boolean isFinallyACollection) {
+ isType(type);
+ assertEquals(isFinallyACollection, ((UriResourcePartTyped) uriPathInfo).isCollection());
+ return this;
+ }
+
+ public ResourceValidator isTypeFilterOnEntry(final FullQualifiedName type) {
+ if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourceWithKeysImpl uriPathInfoKeyPred = (UriResourceWithKeysImpl) uriPathInfo;
+
+ // input parameter type may be null in order to assert that the singleTypeFilter is not set
+ EdmType actualType = uriPathInfoKeyPred.getTypeFilterOnEntry();
+ if (type == null) {
+ assertEquals(type, actualType);
+ } else {
+ assertEquals(type.toString(), new FullQualifiedName(actualType.getNamespace(), actualType.getName()).toString());
+ }
+
+ return this;
+ }
+
+ public ResourceValidator isTypeFilterOnCollection(final FullQualifiedName expectedType) {
+ if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+ UriResourceWithKeysImpl uriPathInfoKeyPred = (UriResourceWithKeysImpl) uriPathInfo;
+
+ // input parameter type may be null in order to assert that the collectionTypeFilter is not set
+ EdmType actualType = uriPathInfoKeyPred.getTypeFilterOnCollection();
+ if (expectedType == null) {
+ assertEquals(expectedType, actualType);
+ } else {
+ FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
+ assertEquals(expectedType.toString(), actualName.toString());
+ }
+
+ return this;
+ }
+
+ // other functions
+ public ResourceValidator checkCustomParameter(final int index, final String name, final String value) {
+ if (uriInfo == null) {
+ fail("hasQueryParameter: uriInfo == null");
+ }
+
+ List<CustomQueryOption> list = uriInfo.getCustomQueryOptions();
+ if (list.size() <= index) {
+ fail("not enough queryParameters");
+ }
+
+ CustomQueryOptionImpl option = (CustomQueryOptionImpl) list.get(index);
+ assertEquals(name, option.getName());
+ assertEquals(value, option.getText());
+ return this;
+ }
+
+ // TODO remove
+ /*
+ * public ResourceValidator isCollection(final boolean isCollection) {
+ * if (!(uriPathInfo instanceof UriResourcePartTyped)) {
+ * fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ * }
+ * UriResourcePartTyped uriPathInfoTyped = (UriResourcePartTyped) uriPathInfo;
+ *
+ * EdmType type = uriPathInfoTyped.getType();
+ * if (type == null) {
+ * fail("isCollection: type == null");
+ * }
+ * assertEquals(isCollection, uriPathInfoTyped.isCollection());
+ * return this;
+ * }
+ */
+
+ public ResourceValidator isFilterString(final String expectedFilterTreeAsString) {
+
+ ExpressionImpl filterTree = (ExpressionImpl) uriInfo.getFilterOption().getExpression();
+ try {
+ String filterTreeAsString = filterTree.accept(new FilterTreeToText());
+ assertEquals(expectedFilterTreeAsString, filterTreeAsString);
+ } catch (ExpressionVisitException e) {
+ fail("isFilterString: Exception " + e.getMessage() + " occured");
+ } catch (ODataApplicationException e) {
+ fail("isFilterString: Exception " + e.getMessage() + " occured");
+ }
+
+ return this;
+ }
+
+ public ResourceValidator isKeyPredicateRef(final int index, final String name, final String refencedProperty) {
+ if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourceWithKeysImpl info = (UriResourceWithKeysImpl) uriPathInfo;
+ List<UriParameter> keyPredicates = info.getKeyPredicates();
+ assertEquals(name, keyPredicates.get(index).getName());
+ assertEquals(refencedProperty, keyPredicates.get(index).getRefencedProperty());
+ return this;
+
+ }
+
+ public ResourceValidator isKeyPredicateAlias(final int index, final String name, final String alias) {
+ if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourceWithKeysImpl info = (UriResourceWithKeysImpl) uriPathInfo;
+ List<UriParameter> keyPredicates = info.getKeyPredicates();
+ assertEquals(name, keyPredicates.get(index).getName());
+ assertEquals(alias, keyPredicates.get(index).getAlias());
+ return this;
+
+ }
+
+ public ResourceValidator isKeyPredicate(final int index, final String name, final String text) {
+ if (!(uriPathInfo instanceof UriResourceWithKeysImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourceWithKeysImpl info = (UriResourceWithKeysImpl) uriPathInfo;
+ List<UriParameter> keyPredicates = info.getKeyPredicates();
+ assertEquals(name, keyPredicates.get(index).getName());
+ assertEquals(text, keyPredicates.get(index).getText());
+ return this;
+
+ }
+
+ public ResourceValidator isParameter(final int index, final String name, final String text) {
+ if (!(uriPathInfo instanceof UriResourceFunctionImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourceFunctionImpl info = (UriResourceFunctionImpl) uriPathInfo;
+ List<UriParameter> keyPredicates = info.getParameters();
+ assertEquals(name, keyPredicates.get(index).getName());
+ assertEquals(text, keyPredicates.get(index).getText());
+ return this;
+
+ }
+
+ public ResourceValidator isParameterAlias(final int index, final String name, final String alias) {
+ if (!(uriPathInfo instanceof UriResourceFunctionImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourceFunctionImpl info = (UriResourceFunctionImpl) uriPathInfo;
+ List<UriParameter> keyPredicates = info.getParameters();
+ assertEquals(name, keyPredicates.get(index).getName());
+ assertEquals(alias, keyPredicates.get(index).getAlias());
+ return this;
+
+ }
+
+ public ResourceValidator isKind(final UriInfoKind kind) {
+ assertEquals(kind, uriInfo.getKind());
+ return this;
+ }
+
+ public ResourceValidator isPrimitiveProperty(final String name,
+ final FullQualifiedName type, final boolean isCollection) {
+ if (!(uriPathInfo instanceof UriResourcePrimitivePropertyImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourcePrimitivePropertyImpl uriPathInfoProp = (UriResourcePrimitivePropertyImpl) uriPathInfo;
+
+ EdmElement property = uriPathInfoProp.getProperty();
+
+ assertEquals(name, property.getName());
+ assertEquals(type, new FullQualifiedName(property.getType().getNamespace(), property.getType().getName()));
+ assertEquals(isCollection, property.isCollection());
+ return this;
+ }
+
+ public ResourceValidator
+ isComplexProperty(final String name, final FullQualifiedName type, final boolean isCollection) {
+ if (!(uriPathInfo instanceof UriResourceComplexPropertyImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourceComplexPropertyImpl uriPathInfoProp = (UriResourceComplexPropertyImpl) uriPathInfo;
+
+ EdmElement property = uriPathInfoProp.getProperty();
+
+ assertEquals(name, property.getName());
+ assertEquals(type, new FullQualifiedName(property.getType().getNamespace(), property.getType().getName()));
+ assertEquals(isCollection, property.isCollection());
+ return this;
+ }
+
+ public ResourceValidator isNavProperty(final String name, final FullQualifiedName type, final boolean isCollection) {
+ if (!(uriPathInfo instanceof UriResourceNavigationPropertyImpl)) {
+ fail("invalid resource kind: " + uriPathInfo.getKind().toString());
+ }
+
+ UriResourceNavigationPropertyImpl uriPathInfoProp = (UriResourceNavigationPropertyImpl) uriPathInfo;
+
+ EdmElement property = uriPathInfoProp.getProperty();
+
+ assertEquals(name, property.getName());
+ assertEquals(type, new FullQualifiedName(property.getType().getNamespace(), property.getType().getName()));
+ assertEquals(isCollection, uriPathInfoProp.isCollection());
+ return this;
+ }
+
+ public ResourceValidator isUriPathInfoKind(final UriResourceKind infoType) {
+ assertNotNull(uriPathInfo);
+ assertEquals(infoType, uriPathInfo.getKind());
+ return this;
+ }
+
+ public ResourceValidator isAction(final String name) {
+ assertEquals(UriResourceKind.action, uriPathInfo.getKind());
+ assertEquals(name, ((UriResourceActionImpl) uriPathInfo).getAction().getName());
+ return this;
+ }
+
+ public ResourceValidator isFunction(final String name) {
+ assertEquals(UriResourceKind.function, uriPathInfo.getKind());
+ assertEquals(name, ((UriResourceFunctionImpl) uriPathInfo).getFunction().getName());
+ return this;
+ }
+
+ public ResourceValidator isFunctionImport(final String name) {
+ assertEquals(UriResourceKind.function, uriPathInfo.getKind());
+ assertEquals(name, ((UriResourceFunctionImpl) uriPathInfo).getFunctionImport().getName());
+ return this;
+ }
+
+ public ResourceValidator isEntitySet(final String name) {
+ assertEquals(UriResourceKind.entitySet, uriPathInfo.getKind());
+ assertEquals(name, ((UriResourceEntitySetImpl) uriPathInfo).getEntitySet().getName());
+ return this;
+ }
+
+ public ResourceValidator isComplex(final String name) {
+ assertEquals(UriResourceKind.complexProperty, uriPathInfo.getKind());
+ assertEquals(name, ((UriResourceComplexPropertyImpl) uriPathInfo).getProperty().getName());
+ return this;
+ }
+
+ public ResourceValidator isSingleton(final String name) {
+ assertEquals(UriResourceKind.singleton, uriPathInfo.getKind());
+ assertEquals(name, ((UriResourceSingletonImpl) uriPathInfo).getSingleton().getName());
+ return this;
+ }
+
+ public ResourceValidator isValue() {
+ assertEquals(UriResourceKind.value, uriPathInfo.getKind());
+ return this;
+ }
+
+ public ResourceValidator isCount() {
+ assertEquals(UriResourceKind.count, uriPathInfo.getKind());
+ return this;
+ }
+
+ public ResourceValidator isRef() {
+ assertEquals(UriResourceKind.ref, uriPathInfo.getKind());
+ return this;
+ }
+
+ public ResourceValidator isActionImport(final String actionName) {
+ assertEquals(UriResourceKind.action, uriPathInfo.getKind());
+ assertEquals(actionName, ((UriResourceActionImpl) uriPathInfo).getActionImport().getName());
+ return this;
+ }
+
+ public ResourceValidator isIt() {
+ assertEquals(UriResourceKind.it, uriPathInfo.getKind());
+ return this;
+ }
+
+ public ResourceValidator isTopText(final String topText) {
+ assertEquals(topText, uriInfo.getTopOption().getText());
+ return this;
+ }
+
+ public ResourceValidator isFormatText(final String formatText) {
+ assertEquals(formatText, uriInfo.getFormatOption().getText());
+ return this;
+ }
+
+ public ResourceValidator isInlineCountText(final String inlineCountText) {
+ assertEquals(inlineCountText, uriInfo.getCountOption().getText());
+ return this;
+ }
+
+ public ResourceValidator isSkipText(final String skipText) {
+ assertEquals(skipText, uriInfo.getSkipOption().getText());
+ return this;
+ }
+
+ public ResourceValidator isSkipTokenText(final String skipTokenText) {
+ assertEquals(skipTokenText, uriInfo.getSkipTokenOption().getText());
+ return this;
+ }
+
+ public ResourceValidator isSelectItemStar(final int index) {
+ SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ assertEquals(true, item.isStar());
+ return this;
+ }
+
+ public ResourceValidator isSelectItemAllOp(final int index, final FullQualifiedName fqn) {
+ SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ assertEquals(fqn.toString(), item.getAllOperationsInSchemaNameSpace().toString());
+ return this;
+ }
+
+ public ResourceValidator isSelectStartType(final int index, final FullQualifiedName fullName) {
+ SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
+ SelectItem item = select.getSelectItems().get(index);
+
+ EdmType actualType = item.getStartTypeFilter();
+
+ FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
+ assertEquals(fullName, actualName);
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestErrorLogger.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestErrorLogger.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestErrorLogger.java
new file mode 100644
index 0000000..0153036
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestErrorLogger.java
@@ -0,0 +1,105 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import java.util.BitSet;
+import java.util.Collections;
+import java.util.List;
+
+import org.antlr.v4.runtime.ANTLRErrorListener;
+import org.antlr.v4.runtime.Parser;
+import org.antlr.v4.runtime.RecognitionException;
+import org.antlr.v4.runtime.Recognizer;
+import org.antlr.v4.runtime.atn.ATNConfigSet;
+import org.antlr.v4.runtime.dfa.DFA;
+import org.apache.olingo.server.core.uri.antlr.UriLexer;
+
+class TestErrorLogger implements ANTLRErrorListener {
+
+ private String prefix;
+ private int logLevel = 0;
+
+ public TestErrorLogger(final String prefix, final int logLevel) {
+ this.prefix = prefix;
+ this.logLevel = logLevel;
+ }
+
+ @Override
+ public void syntaxError(final Recognizer<?, ?> recognizer, final Object offendingSymbol, final int line,
+ final int charPositionInLine,
+ final String msg, final RecognitionException e) {
+
+ if (logLevel > 0) {
+ System.out.println("\n" + prefix + " -- SyntaxError");
+ trace(recognizer, offendingSymbol, line, charPositionInLine, msg, e);
+ }
+
+ }
+
+ @Override
+ public void reportAmbiguity(final Parser recognizer, final DFA dfa, final int startIndex, final int stopIndex,
+ final boolean exact,
+ final BitSet ambigAlts, final ATNConfigSet configs) {
+
+ }
+
+ @Override
+ public void reportAttemptingFullContext(final Parser recognizer, final DFA dfa, final int startIndex,
+ final int stopIndex,
+ final BitSet conflictingAlts, final ATNConfigSet configs) {
+
+ }
+
+ @Override
+ public void reportContextSensitivity(final Parser recognizer, final DFA dfa, final int startIndex,
+ final int stopIndex, final int prediction,
+ final ATNConfigSet configs) {
+
+ }
+
+ private void printStack(final Recognizer<?, ?> recognizer) {
+ List<String> stack = ((Parser) recognizer).getRuleInvocationStack();
+ Collections.reverse(stack);
+ System.out.println(" rule stack: " + stack);
+ }
+
+ public void trace(final Recognizer<?, ?> recognizer, final Object offendingSymbol,
+ final int line, final int charPositionInLine, final String msg, final RecognitionException e) {
+
+ System.out.println("Error message: " + msg);
+
+ printStack(recognizer);
+
+ System.out.println(" line/char :" + line + " / " + charPositionInLine);
+ System.out.println(" sym :" + offendingSymbol);
+ if (e != null && e.getOffendingToken() != null) {
+
+ String lexerTokenName = "";
+ try {
+ lexerTokenName = UriLexer.tokenNames[e.getOffendingToken().getType()];
+ } catch (ArrayIndexOutOfBoundsException es) {
+ lexerTokenName = "token error";
+ }
+
+ System.out.println(" tokenname:" + lexerTokenName);
+ }
+
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
new file mode 100644
index 0000000..35687f6
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestUriValidator.java
@@ -0,0 +1,258 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
+import org.apache.olingo.server.api.uri.queryoption.SelectItem;
+import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.parser.Parser;
+import org.apache.olingo.server.core.uri.parser.UriParserException;
+import org.apache.olingo.server.core.uri.parser.UriParserSemanticException;
+import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
+import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
+import org.apache.olingo.server.core.uri.validator.UriValidator;
+
+public class TestUriValidator implements TestValidator {
+ private Edm edm;
+
+ private UriInfoImpl uriInfo;
+ private Exception exception;
+
+ // Setup
+ public TestUriValidator setEdm(final Edm edm) {
+ this.edm = edm;
+ return this;
+ }
+
+ // Execution
+ public TestUriValidator run(final String uri) {
+ Parser parser = new Parser();
+ UriValidator validator = new UriValidator();
+
+ uriInfo = null;
+ try {
+ uriInfo = (UriInfoImpl) parser.parseUri(uri, edm);
+ validator.validate(uriInfo, "GET");
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ return this;
+ }
+
+ public TestUriValidator runEx(final String uri) {
+ Parser parser = new Parser();
+ uriInfo = null;
+ try {
+ uriInfo = (UriInfoImpl) parser.parseUri(uri, edm);
+ fail("Exception expected");
+ } catch (UriParserException e) {
+ exception = e;
+ }
+
+ return this;
+ }
+
+ public TestUriValidator log(final String uri) {
+ ParserWithLogging parserTest = new ParserWithLogging();
+ parserTest.setLogLevel(1);
+ uriInfo = null;
+ try {
+ // uriInfoTmp = new UriParserImpl(edm).ParseUri(uri);
+ uriInfo = (UriInfoImpl) parserTest.parseUri(uri, edm);
+ } catch (UriParserException e) {
+ fail("Exception occured while parsing the URI: " + uri + "\n"
+ + " Exception: " + e.getMessage());
+ }
+
+ return this;
+ }
+
+ // Navigation
+ public ResourceValidator goPath() {
+ if (uriInfo.getKind() != UriInfoKind.resource) {
+ fail("invalid resource kind: " + uriInfo.getKind().toString());
+ }
+
+ return new ResourceValidator()
+ .setUpValidator(this)
+ .setEdm(edm)
+ .setUriInfoImplPath(uriInfo);
+ }
+
+ public FilterValidator goFilter() {
+ FilterOptionImpl filter = (FilterOptionImpl) uriInfo.getFilterOption();
+ if (filter == null) {
+ fail("no filter found");
+ }
+ return new FilterValidator().setUriValidator(this).setFilter(filter);
+
+ }
+
+ public ExpandValidator goExpand() {
+ ExpandOptionImpl expand = (ExpandOptionImpl) uriInfo.getExpandOption();
+ if (expand == null) {
+ fail("invalid resource kind: " + uriInfo.getKind().toString());
+ }
+
+ return new ExpandValidator().setUpValidator(this).setExpand(expand);
+ }
+
+ public ResourceValidator goSelectItemPath(final int index) {
+ SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ UriInfoImpl uriInfo1 = (UriInfoImpl) item.getResourcePath();
+
+ return new ResourceValidator()
+ .setUpValidator(this)
+ .setEdm(edm)
+ .setUriInfoImplPath(uriInfo1);
+
+ }
+
+ public TestUriValidator isSelectStartType(final int index, final FullQualifiedName fullName) {
+ SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
+ SelectItem item = select.getSelectItems().get(index);
+ EdmType actualType = item.getStartTypeFilter();
+
+ FullQualifiedName actualName = new FullQualifiedName(actualType.getNamespace(), actualType.getName());
+ assertEquals(fullName, actualName);
+ return this;
+
+ }
+
+ // Validation
+ public TestUriValidator isKind(final UriInfoKind kind) {
+ assertEquals(kind, uriInfo.getKind());
+ return this;
+ }
+
+ public TestUriValidator isCustomParameter(final int index, final String name, final String value) {
+ if (uriInfo == null) {
+ fail("hasQueryParameter: uriInfo == null");
+ }
+
+ List<CustomQueryOption> list = uriInfo.getCustomQueryOptions();
+ if (list.size() <= index) {
+ fail("not enought queryParameters");
+ }
+
+ CustomQueryOptionImpl option = (CustomQueryOptionImpl) list.get(index);
+ assertEquals(name, option.getName());
+ assertEquals(value, option.getText());
+ return this;
+ }
+
+ public void isCrossJoinEntityList(final List<String> entitySets) {
+ if (uriInfo.getKind() != UriInfoKind.crossjoin) {
+ fail("invalid resource kind: " + uriInfo.getKind().toString());
+ }
+
+ int i = 0;
+ for (String entitySet : entitySets) {
+ assertEquals(entitySet, uriInfo.getEntitySetNames().get(i));
+ i++;
+ }
+
+ }
+
+ public TestUriValidator isExSyntax(final long errorID) {
+ assertEquals(UriParserSyntaxException.class, exception.getClass());
+ return this;
+ }
+
+ public TestUriValidator isExSemantic(final long errorID) {
+ assertEquals(UriParserSemanticException.class, exception.getClass());
+ return this;
+ }
+
+ public TestUriValidator isIdText(final String text) {
+ assertEquals(text, uriInfo.getIdOption().getText());
+ return this;
+ }
+
+ public TestUriValidator isExpandText(final String text) {
+ assertEquals(text, uriInfo.getExpandOption().getText());
+ return this;
+ }
+
+ public TestUriValidator isSelectText(final String text) {
+ assertEquals(text, uriInfo.getSelectOption().getText());
+ return this;
+ }
+
+ public TestUriValidator isFormatText(final String text) {
+ assertEquals(text, uriInfo.getFormatOption().getText());
+ return this;
+ }
+
+ public TestUriValidator isFragmentText(final String text) {
+ if (uriInfo.getKind() != UriInfoKind.metadata) {
+ fail("invalid resource kind: " + uriInfo.getKind().toString());
+ }
+
+ assertEquals(text, uriInfo.getFragment());
+
+ return this;
+ }
+
+ public TestUriValidator isEntityType(final FullQualifiedName fullName) {
+ if (uriInfo.getKind() != UriInfoKind.entityId) {
+ fail("invalid resource kind: " + uriInfo.getKind().toString());
+ }
+
+ assertEquals(fullName.toString(), fullName(uriInfo.getEntityTypeCast()));
+ return this;
+ }
+
+ private String fullName(final EdmEntityType type) {
+ return type.getNamespace() + "." + type.getName();
+ }
+
+ public TestUriValidator isSelectItemStar(final int index) {
+ SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ assertEquals(true, item.isStar());
+ return this;
+ }
+
+ public TestUriValidator isSelectItemAllOp(final int index, final FullQualifiedName fqn) {
+ SelectOptionImpl select = (SelectOptionImpl) uriInfo.getSelectOption();
+
+ SelectItem item = select.getSelectItems().get(index);
+ assertEquals(fqn.toString(), item.getAllOperationsInSchemaNameSpace().toString());
+ return this;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestValidator.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestValidator.java
new file mode 100644
index 0000000..7e64f86
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TestValidator.java
@@ -0,0 +1,23 @@
+/*
+ * 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.server.core.uri.testutil;
+
+public interface TestValidator {
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
new file mode 100644
index 0000000..4a94bb3
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/TokenValidator.java
@@ -0,0 +1,194 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.antlr.v4.runtime.ANTLRInputStream;
+import org.antlr.v4.runtime.Token;
+import org.apache.olingo.server.core.uri.antlr.UriLexer;
+
+//TODO extend to test also exception which can occure while paring
+public class TokenValidator {
+
+ private String input = null;
+
+ private List<? extends Token> tokens = null;
+ private Token curToken = null;
+ private Exception curException = null;
+
+ private int startMode;
+ private int logLevel = 0;
+
+ // --- Setup ---
+
+ public TokenValidator log(final int logLevel) {
+ this.logLevel = logLevel;
+ return this;
+ }
+
+ // --- Execution ---
+
+ public TokenValidator run(final String uri) {
+ input = uri;
+
+ tokens = parseInput(uri);
+ if (logLevel > 0) {
+ showTokens();
+ }
+
+ first();
+ exFirst();
+ logLevel = 0;
+
+ return this;
+ }
+
+ // --- Navigation ---
+
+ // navigate within the tokenlist
+ public TokenValidator first() {
+ try {
+ curToken = tokens.get(0);
+ } catch (IndexOutOfBoundsException ex) {
+ curToken = null;
+ }
+ return this;
+ }
+
+ public TokenValidator last() {
+ curToken = tokens.get(tokens.size() - 1);
+ return this;
+ }
+
+ public TokenValidator at(final int index) {
+ try {
+ curToken = tokens.get(index);
+ } catch (IndexOutOfBoundsException ex) {
+ curToken = null;
+ }
+ return this;
+ }
+
+ public TokenValidator exLast() {
+ // curException = exceptions.get(exceptions.size() - 1);
+ return this;
+ }
+
+ // navigate within the exception list
+ public TokenValidator exFirst() {
+ try {
+ // curException = exceptions.get(0);
+ } catch (IndexOutOfBoundsException ex) {
+ curException = null;
+ }
+ return this;
+
+ }
+
+ public TokenValidator exAt(final int index) {
+ try {
+ // curException = exceptions.get(index);
+ } catch (IndexOutOfBoundsException ex) {
+ curException = null;
+ }
+ return this;
+ }
+
+ // --- Validation ---
+
+ public TokenValidator isText(final String expected) {
+ assertEquals(expected, curToken.getText());
+ return this;
+ }
+
+ public TokenValidator isAllText(final String expected) {
+ String actual = "";
+
+ for (Token curToken : tokens) {
+ actual += curToken.getText();
+ }
+ assertEquals(expected, actual);
+ return this;
+ }
+
+ public TokenValidator isAllInput() {
+ String actual = "";
+
+ for (Token curToken : tokens) {
+ actual += curToken.getText();
+ }
+ assertEquals(input, actual);
+ return this;
+ }
+
+ public TokenValidator isInput() {
+ assertEquals(input, curToken.getText());
+ return this;
+ }
+
+ public TokenValidator isType(final int expected) {
+ assertEquals(UriLexer.tokenNames[expected], UriLexer.tokenNames[curToken.getType()]);
+ return this;
+ }
+
+ public TokenValidator isExType(final Class<?> exClass) {
+ assertEquals(exClass, curException.getClass());
+ return this;
+ }
+
+ public void globalMode(final int mode) {
+ startMode = mode;
+ }
+
+ // --- Helper ---
+
+ private List<? extends Token> parseInput(final String input) {
+ ANTLRInputStream inputStream = new ANTLRInputStream(input);
+
+ UriLexer lexer = new UriLexerWithTrace(inputStream, logLevel, startMode);
+ // lexer.addErrorListener(new ErrorCollector(this));
+ return lexer.getAllTokens();
+ }
+
+ public TokenValidator showTokens() {
+ boolean first = true;
+ System.out.println("input: " + input);
+ String nL = "\n";
+ String out = "[" + nL;
+ for (Token token : tokens) {
+ if (!first) {
+ out += ",";
+ first = false;
+ }
+ int index = token.getType();
+ if (index != -1) {
+ out += "\"" + token.getText() + "\"" + " " + UriLexer.tokenNames[index] + nL;
+ } else {
+ out += "\"" + token.getText() + "\"" + " " + index + nL;
+ }
+ }
+ out += ']';
+ System.out.println("tokens: " + out);
+ return this;
+ }
+
+}
[20/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
new file mode 100644
index 0000000..e8aa9ce
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
@@ -0,0 +1,248 @@
+/*
+ * 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.server.core.uri.antlr;
+
+import org.antlr.v4.runtime.Lexer;
+import org.apache.olingo.server.core.uri.testutil.TokenValidator;
+import org.junit.Test;
+
+public class TestLexer {
+
+ private TokenValidator test = null;
+
+ private static final String cPCT_ENCODED = "%45%46%47" + "%22" + "%5C";// last two chars are not in
+ // cPCT_ENCODED_UNESCAPED
+ private static final String cUNRESERVED = "ABCabc123-._~";
+ private static final String cOTHER_DELIMS = "!()*+,;";
+ private static final String cSUB_DELIMS = "$&'=" + cOTHER_DELIMS;
+
+ private static final String cPCHAR = cUNRESERVED + cPCT_ENCODED + cSUB_DELIMS + ":@";
+
+ public TestLexer() {
+ test = new TokenValidator();
+ }
+
+ @Test
+ public void test() {
+
+ // test.log(1).run("ESAllPrim?$orderby=PropertyDouble eq 3.5E+38");
+ }
+
+ // ;------------------------------------------------------------------------------
+ // ; 0. URI
+ // ;------------------------------------------------------------------------------
+
+ @Test
+ public void testUriTokens() {
+ test.globalMode(UriLexer.MODE_QUERY);
+ test.run("#").isText("#").isType(UriLexer.FRAGMENT);
+ test.run("$count").isText("$count").isType(UriLexer.COUNT);
+ test.run("$ref").isText("$ref").isType(UriLexer.REF);
+ test.run("$value").isText("$value").isType(UriLexer.VALUE);
+ }
+
+ // ;------------------------------------------------------------------------------
+ // ; 2. Query Options
+ // ;------------------------------------------------------------------------------
+ @Test
+ public void testQueryOptionsTokens() {
+
+ test.globalMode(UriLexer.MODE_QUERY);
+ test.run("$skip=1").isAllText("$skip=1").isType(UriLexer.SKIP);
+ test.run("$skip=2").isAllText("$skip=2").isType(UriLexer.SKIP);
+ test.run("$skip=123").isAllText("$skip=123").isType(UriLexer.SKIP);
+
+ test.run("$top=1").isAllText("$top=1").isType(UriLexer.TOP);
+ test.run("$top=2").isAllText("$top=2").isType(UriLexer.TOP);
+ test.run("$top=123").isAllText("$top=123").isType(UriLexer.TOP);
+
+ test.run("$levels=1").isAllText("$levels=1").isType(UriLexer.LEVELS);
+ test.run("$levels=2").isAllText("$levels=2").isType(UriLexer.LEVELS);
+ test.run("$levels=123").isAllText("$levels=123").isType(UriLexer.LEVELS);
+ test.run("$levels=max").isAllText("$levels=max").isType(UriLexer.LEVELS);
+
+ test.run("$format=atom").isAllText("$format=atom").isType(UriLexer.FORMAT);
+ test.run("$format=json").isAllText("$format=json").isType(UriLexer.FORMAT);
+ test.run("$format=xml").isAllText("$format=xml").isType(UriLexer.FORMAT);
+ test.run("$format=abc/def").isAllText("$format=abc/def").isType(UriLexer.FORMAT);
+
+ test.run("$id=123").isAllText("$id=123").isType(UriLexer.ID);
+ test.run("$id=ABC").isAllText("$id=ABC").isType(UriLexer.ID);
+
+ test.run("$skiptoken=ABC").isAllText("$skiptoken=ABC").isType(UriLexer.SKIPTOKEN);
+ test.run("$skiptoken=ABC").isAllText("$skiptoken=ABC").isType(UriLexer.SKIPTOKEN);
+
+ test.run("$search=\"ABC\"").isAllText("$search=\"ABC\"").isType(UriLexer.SEARCH);
+ test.run("$search=ABC").isAllText("$search=ABC").isType(UriLexer.SEARCH);
+ test.run("$search=\"A%20B%20C\"").isAllText("$search=\"A%20B%20C\"").isType(UriLexer.SEARCH);
+ }
+
+ // ;------------------------------------------------------------------------------
+ // ; 4. Expressions
+ // ;------------------------------------------------------------------------------
+ @Test
+ public void testQueryExpressions() {
+ test.globalMode(Lexer.DEFAULT_MODE);
+
+ test.run("$it").isText("$it").isType(UriLexer.IT);
+
+ test.run("$filter=contains(").at(2).isText("contains(").isType(UriLexer.CONTAINS_WORD);
+
+ test.run("$filter=containsabc").at(2).isText("containsabc")
+ .isType(UriLexer.ODATAIDENTIFIER); // test that this is a ODI
+
+ test.run("$filter=startswith(").at(2).isText("startswith(").isType(UriLexer.STARTSWITH_WORD);
+ test.run("$filter=endswith(").at(2).isText("endswith(").isType(UriLexer.ENDSWITH_WORD);
+ test.run("$filter=length(").at(2).isText("length(").isType(UriLexer.LENGTH_WORD);
+ test.run("$filter=indexof(").at(2).isText("indexof(").isType(UriLexer.INDEXOF_WORD);
+ test.run("$filter=substring(").at(2).isText("substring(").isType(UriLexer.SUBSTRING_WORD);
+ test.run("$filter=tolower(").at(2).isText("tolower(").isType(UriLexer.TOLOWER_WORD);
+ test.run("$filter=toupper(").at(2).isText("toupper(").isType(UriLexer.TOUPPER_WORD);
+ test.run("$filter=trim(").at(2).isText("trim(").isType(UriLexer.TRIM_WORD);
+ test.run("$filter=concat(").at(2).isText("concat(").isType(UriLexer.CONCAT_WORD);
+
+ }
+
+ // ;------------------------------------------------------------------------------
+ // ; 7. Literal Data Values
+ // ;------------------------------------------------------------------------------
+
+ @Test
+ public void testLiteralDataValues() {
+ test.globalMode(Lexer.DEFAULT_MODE);
+ // null
+ test.run("null").isInput().isType(UriLexer.NULLVALUE);
+
+ // binary
+ test.run("binary'ABCD'").isInput().isType(UriLexer.BINARY);
+ test.run("BiNaRy'ABCD'").isInput().isType(UriLexer.BINARY);
+
+ // boolean
+ test.run("true").isInput().isType(UriLexer.TRUE);
+ test.run("false").isInput().isType(UriLexer.FALSE);
+ test.run("TrUe").isInput().isType(UriLexer.BOOLEAN);
+ test.run("FaLsE").isInput().isType(UriLexer.BOOLEAN);
+
+ // Lexer rule INT
+ test.run("123").isInput().isType(UriLexer.INT);
+ test.run("123456789").isInput().isType(UriLexer.INT);
+ test.run("+123").isInput().isType(UriLexer.INT);
+ test.run("+123456789").isInput().isType(UriLexer.INT);
+ test.run("-123").isInput().isType(UriLexer.INT);
+ test.run("-123456789").isInput().isType(UriLexer.INT);
+
+ // Lexer rule DECIMAL
+ test.run("0.1").isInput().isType(UriLexer.DECIMAL);
+ test.run("1.1").isInput().isType(UriLexer.DECIMAL);
+ test.run("+0.1").isInput().isType(UriLexer.DECIMAL);
+ test.run("+1.1").isInput().isType(UriLexer.DECIMAL);
+ test.run("-0.1").isInput().isType(UriLexer.DECIMAL);
+ test.run("-1.1").isInput().isType(UriLexer.DECIMAL);
+
+ // Lexer rule EXP
+ test.run("1.1e+1").isInput().isType(UriLexer.DECIMAL);
+ test.run("1.1e-1").isInput().isType(UriLexer.DECIMAL);
+
+ test.run("NaN").isInput().isType(UriLexer.NANINFINITY);
+ test.run("-INF").isInput().isType(UriLexer.NANINFINITY);
+ test.run("INF").isInput().isType(UriLexer.NANINFINITY);
+
+ // Lexer rule GUID
+ test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").isInput().isType(UriLexer.GUID);
+ test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").isInput().isType(UriLexer.GUID);
+
+ // Lexer rule DATE
+ test.run("2013-11-15").isInput().isType(UriLexer.DATE);
+
+ // Lexer rule DATETIMEOFFSET
+ test.run("2013-11-15T13:35Z").isInput().isType(UriLexer.DATETIMEOFFSET);
+ test.run("2013-11-15T13:35:10Z").isInput().isType(UriLexer.DATETIMEOFFSET);
+ test.run("2013-11-15T13:35:10.1234Z").isInput().isType(UriLexer.DATETIMEOFFSET);
+
+ test.run("2013-11-15T13:35:10.1234+01:30").isInput().isType(UriLexer.DATETIMEOFFSET);
+ test.run("2013-11-15T13:35:10.1234-01:12").isInput().isType(UriLexer.DATETIMEOFFSET);
+
+ test.run("2013-11-15T13:35Z").isInput().isType(UriLexer.DATETIMEOFFSET);
+
+ // Lexer rule DURATION
+ test.run("duration'PT67S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'PT67.89S'").isInput().isType(UriLexer.DURATION);
+
+ test.run("duration'PT5M'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'PT5M67S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'PT5M67.89S'").isInput().isType(UriLexer.DURATION);
+
+ test.run("duration'PT4H'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'PT4H67S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'PT4H67.89S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'PT4H5M'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'PT4H5M67S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'PT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
+
+ test.run("duration'P3D'");
+ test.run("duration'P3DT67S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT67.89S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT5M'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT5M67S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT5M67.89S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT4H'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT4H67S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT4H67.89S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT4H5M'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT4H5M67S'").isInput().isType(UriLexer.DURATION);
+ test.run("duration'P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
+
+ test.run("DuRaTiOn'P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
+ test.run("DuRaTiOn'-P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
+
+ test.run("20:00").isInput().isType(UriLexer.TIMEOFDAY);
+ test.run("20:15:01").isInput().isType(UriLexer.TIMEOFDAY);
+ test.run("20:15:01.02").isInput().isType(UriLexer.TIMEOFDAY);
+
+ test.run("20:15:01.02").isInput().isType(UriLexer.TIMEOFDAY);
+
+ // String
+ test.run("'ABC'").isText("'ABC'").isType(UriLexer.STRING);
+ test.run("'A%20C'").isInput().isType(UriLexer.STRING);
+ test.run("'%20%20%20ABC'").isInput().isType(UriLexer.STRING);
+
+ }
+
+ @Test
+ public void testDelims() {
+ String reserved = "/";
+ test.globalMode(UriLexer.MODE_QUERY);
+ // Test lexer rule UNRESERVED
+ test.run("$format=A/" + cUNRESERVED).isAllInput().isType(UriLexer.FORMAT);
+ test.run("$format=A/" + cUNRESERVED + reserved).isType(UriLexer.FORMAT).at(4).isText(cUNRESERVED);
+ // Test lexer rule PCT_ENCODED
+ test.run("$format=A/" + cPCT_ENCODED).isAllInput().isType(UriLexer.FORMAT);
+ test.run("$format=A/" + cPCT_ENCODED + reserved).isType(UriLexer.FORMAT).at(4).isText(cPCT_ENCODED);
+ // Test lexer rule SUB_DELIMS
+ test.run("$format=A/" + cSUB_DELIMS).isAllInput().isType(UriLexer.FORMAT);
+ test.run("$format=A/" + cSUB_DELIMS + reserved).isType(UriLexer.FORMAT).at(4).isText("$");
+ // Test lexer rule PCHAR rest
+ test.run("$format=A/:@").isAllText("$format=A/:@").isType(UriLexer.FORMAT);
+ test.run("$format=A/:@" + reserved).isType(UriLexer.FORMAT).at(4).isText(":@");
+ // Test lexer rule PCHAR all
+ test.run("$format=" + cPCHAR + "/" + cPCHAR).isAllInput().isType(UriLexer.FORMAT);
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
new file mode 100644
index 0000000..f928ad2
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
@@ -0,0 +1,1144 @@
+/*
+ * 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.server.core.uri.antlr;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.Arrays;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriResourceKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.core.uri.parser.UriParserException;
+import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
+import org.apache.olingo.server.core.uri.testutil.FilterValidator;
+import org.apache.olingo.server.core.uri.testutil.ResourceValidator;
+import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
+import org.apache.olingo.server.tecsvc.provider.ComplexTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
+import org.junit.Test;
+
+public class TestUriParserImpl {
+ Edm edm = null;
+ private final String PropertyBoolean = "PropertyBoolean=true";
+ private final String PropertyByte = "PropertyByte=1";
+
+ private final String PropertyDate = "PropertyDate=2013-09-25";
+ private final String PropertyDateTimeOffset = "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00";
+ private final String PropertyDecimal = "PropertyDecimal=12";
+ private final String PropertyDuration = "PropertyDuration=duration'P10DT5H34M21.123456789012S'";
+ private final String PropertyGuid = "PropertyGuid=12345678-1234-1234-1234-123456789012";
+ private final String PropertyInt16 = "PropertyInt16=1";
+ private final String PropertyInt32 = "PropertyInt32=12";
+ private final String PropertyInt64 = "PropertyInt64=64";
+ private final String PropertySByte = "PropertySByte=1";
+ private final String PropertyString = "PropertyString='ABC'";
+ private final String PropertyTimeOfDay = "PropertyTimeOfDay=12:34:55.123456789012";
+
+ private final String allKeys = PropertyString + "," + PropertyInt16 + "," + PropertyBoolean + "," + PropertyByte
+ + "," + PropertySByte + "," + PropertyInt32 + "," + PropertyInt64 + "," + PropertyDecimal + "," + PropertyDate
+ + "," + PropertyDateTimeOffset + "," + PropertyDuration + "," + PropertyGuid + "," + PropertyTimeOfDay;
+
+ TestUriValidator testUri = null;
+ ResourceValidator testRes = null;
+ FilterValidator testFilter = null;
+
+ public TestUriParserImpl() {
+ edm = new EdmProviderImpl(new EdmTechTestProvider());
+ testUri = new TestUriValidator().setEdm(edm);
+ testRes = new ResourceValidator().setEdm(edm);
+ testFilter = new FilterValidator().setEdm(edm);
+ }
+
+ @Test
+ public void test() throws UriParserException, UnsupportedEncodingException {
+
+ }
+
+ @Test
+ public void testBoundFunctionImport_VarParameters() {
+
+ // no input
+ testRes.run("ESKeyNav(1)/com.sap.odata.test1.BFCETKeyNavRTETKeyNav()")
+ .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
+ .at(1).isUriPathInfoKind(UriResourceKind.function);
+
+ // one input
+ testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')")
+ .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
+ .at(1).isUriPathInfoKind(UriResourceKind.function)
+ .isParameter(0, "ParameterString", "'ABC'");
+
+ // two input
+ testRes.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'2'");
+ }
+
+ @Test
+ public void testFunctionBound_varReturnType() {
+
+ String esTwoKeyNav = "ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')";
+
+ // returning primitive
+ testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTString()")
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(PropertyProvider.nameString, false);
+
+ // returning collection of primitive
+ testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollString()")
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(PropertyProvider.nameString, true);
+
+ // returning single complex
+ testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()")
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(ComplexTypeProvider.nameCTTwoPrim, false);
+
+ // returning collection of complex
+ testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+ // returning single entity
+ testRes.run(
+ esTwoKeyNav + "/com.sap.odata.test1.ETBaseTwoKeyNav/com.sap.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false);
+
+ // returning collection of entity (aka entitySet)
+ testRes.run(esTwoKeyNav + "/com.sap.odata.test1.BFCSINavRTESTwoKeyNav()")
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+ }
+
+ @Test
+ public void runActionImport_VarReturnType() {
+
+ testRes.run("AIRTPrimParam").isKind(UriInfoKind.resource)
+ .first()
+ .isActionImport("AIRTPrimParam")
+ .isAction("UARTPrimParam")
+ .isType(PropertyProvider.nameString, false);
+
+ testRes.run("AIRTPrimCollParam").isKind(UriInfoKind.resource)
+ .first()
+ .isActionImport("AIRTPrimCollParam")
+ .isAction("UARTPrimCollParam")
+ .isType(PropertyProvider.nameString, true);
+
+ testRes.run("AIRTCompParam").isKind(UriInfoKind.resource)
+ .first()
+ .isActionImport("AIRTCompParam")
+ .isAction("UARTCompParam")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, false);
+
+ testRes.run("AIRTCompCollParam").isKind(UriInfoKind.resource)
+ .first()
+ .isActionImport("AIRTCompCollParam")
+ .isAction("UARTCompCollParam")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+ testRes.run("AIRTETParam").isKind(UriInfoKind.resource)
+ .first()
+ .isActionImport("AIRTETParam")
+ .isAction("UARTETParam")
+ .isType(EntityTypeProvider.nameETTwoKeyTwoPrim, false);
+
+ testUri.runEx("AIRTPrimParam/invalidElement").isExSemantic(0);
+ }
+
+ @Test
+ public void runCount() {
+
+ // count entity set
+ testRes.run("ESAllPrim/$count")
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETAllPrim, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.count);
+
+ // count on collection of complex
+ testRes.run("ESKeyNav(1)/CollPropertyComplex/$count")
+ .at(0)
+ .isType(EntityTypeProvider.nameETKeyNav)
+ .at(1)
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .at(2)
+ .isUriPathInfoKind(UriResourceKind.count);
+
+ // count on collection of primitive
+ testRes.run("ESCollAllPrim(1)/CollPropertyString/$count")
+ .at(1)
+ .isType(PropertyProvider.nameString, true)
+ .at(2)
+ .isUriPathInfoKind(UriResourceKind.count);
+ }
+
+ @Test
+ public void runCrossJoin() {
+ testUri.run("$crossjoin(ESAllKey)")
+ .isKind(UriInfoKind.crossjoin)
+ .isCrossJoinEntityList(Arrays.asList("ESAllKey"));
+
+ testUri.run("$crossjoin(ESAllKey,ESTwoPrim)")
+ .isKind(UriInfoKind.crossjoin)
+ .isCrossJoinEntityList(Arrays.asList("ESAllKey", "ESTwoPrim"));
+ }
+
+ @Test(expected = Exception.class)
+ public void testEntityFailOnValidation1() {
+ // simple entity set; with qualifiedentityTypeName; with filter
+ testUri.run("$entity/com.sap.odata.test1.ETTwoPrim?$filter=PropertyInt16 eq 123&$id=ESAllKey")
+ .isIdText("ESAllKey")
+ .goFilter().is("<<PropertyInt16> eq <123>>");
+ }
+
+ @Test(expected = Exception.class)
+ public void testEntityFailOnValidation2() {
+ // simple entity set; with qualifiedentityTypeName; with 2xformat(before and after), expand, filter
+ testUri.run("$entity/com.sap.odata.test1.ETTwoPrim?"
+ + "$format=xml&$expand=*&abc=123&$id=ESBase&xyz=987&$filter=PropertyInt16 eq 123&$format=atom&$select=*")
+ .isFormatText("atom")
+ .isCustomParameter(0, "abc", "123")
+ .isIdText("ESBase")
+ .isCustomParameter(1, "xyz", "987")
+ .isSelectItemStar(0);
+ }
+
+ @Test
+ public void testEntity() {
+
+ // simple entity set
+ testUri.run("$entity?$id=ESAllPrim").isKind(UriInfoKind.entityId)
+ .isKind(UriInfoKind.entityId)
+ .isIdText("ESAllPrim");
+
+ // simple entity set; $format before $id
+ testUri.run("$entity?$format=xml&$id=ETAllPrim").isKind(UriInfoKind.entityId)
+ .isFormatText("xml")
+ .isIdText("ETAllPrim");
+
+ testUri.run("$entity?$format=xml&abc=123&$id=ESAllKey").isKind(UriInfoKind.entityId)
+ .isFormatText("xml")
+ .isCustomParameter(0, "abc", "123")
+ .isIdText("ESAllKey");
+
+ // simple entity set; $format after $id
+ testUri.run("$entity?$id=ETAllPrim&$format=xml").isKind(UriInfoKind.entityId)
+ .isIdText("ETAllPrim")
+ .isFormatText("xml");
+
+ // simple entity set; $format and custom parameter after $id
+ testUri.run("$entity?$id=ETAllPrim&$format=xml&abc=123").isKind(UriInfoKind.entityId)
+ .isIdText("ETAllPrim")
+ .isFormatText("xml")
+ .isCustomParameter(0, "abc", "123");
+
+ // simple entity set; $format before $id and custom parameter after $id
+ testUri.run("$entity?$format=xml&$id=ETAllPrim&abc=123").isKind(UriInfoKind.entityId)
+ .isFormatText("xml")
+ .isIdText("ETAllPrim")
+ .isCustomParameter(0, "abc", "123");
+
+ // simple entity set; with qualifiedentityTypeName
+ testUri.run("$entity/com.sap.odata.test1.ETTwoPrim?$id=ESBase")
+ .isEntityType(EntityTypeProvider.nameETTwoPrim)
+ .isIdText("ESBase");
+
+ // simple entity set; with qualifiedentityTypeName;
+ testUri.run("$entity/com.sap.odata.test1.ETBase?$id=ESTwoPrim")
+ .isEntityType(EntityTypeProvider.nameETBase)
+ .isKind(UriInfoKind.entityId)
+ .isIdText("ESTwoPrim");
+
+ // simple entity set; with qualifiedentityTypeName; with format
+ testUri.run("$entity/com.sap.odata.test1.ETBase?$id=ESTwoPrim&$format=atom")
+ .isKind(UriInfoKind.entityId)
+ .isEntityType(EntityTypeProvider.nameETBase)
+ .isIdText("ESTwoPrim")
+ .isFormatText("atom");
+
+ // simple entity set; with qualifiedentityTypeName; with select
+ testUri.run("$entity/com.sap.odata.test1.ETBase?$id=ESTwoPrim&$select=*")
+ .isKind(UriInfoKind.entityId)
+ .isEntityType(EntityTypeProvider.nameETBase)
+ .isIdText("ESTwoPrim")
+ .isSelectItemStar(0);
+
+ // simple entity set; with qualifiedentityTypeName; with expand
+ testUri.run("$entity/com.sap.odata.test1.ETBase?$id=ESTwoPrim&$expand=*")
+ .isKind(UriInfoKind.entityId)
+ .isEntityType(EntityTypeProvider.nameETBase)
+ .isIdText("ESTwoPrim")
+ .isExpandText("*")
+ .goExpand().first().isSegmentStar(0);
+
+ }
+
+ @Test
+ public void testEntitySet() throws UnsupportedEncodingException {
+
+ // plain entity set
+ testRes.run("ESAllPrim")
+ .isEntitySet("ESAllPrim")
+ .isType(EntityTypeProvider.nameETAllPrim);
+
+ // with one key; simple key notation
+ testRes.run("ESAllPrim(1)")
+ .isEntitySet("ESAllPrim")
+ .isType(EntityTypeProvider.nameETAllPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1");
+
+ // with one key; name value key notation
+ testRes.run("ESAllPrim(PropertyInt16=1)")
+ .isEntitySet("ESAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1");
+
+ // with two keys
+ testRes.run("ESTwoKeyTwoPrim(PropertyInt16=1, PropertyString='ABC')")
+ .isEntitySet("ESTwoKeyTwoPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'ABC'");
+
+ // with all keys
+ testRes.run("ESAllKey(" + encode(allKeys) + ")")
+ .isEntitySet("ESAllKey")
+ .isKeyPredicate(0, "PropertyString", "'ABC'")
+ .isKeyPredicate(1, "PropertyInt16", "1")
+ .isKeyPredicate(2, "PropertyBoolean", "true")
+ .isKeyPredicate(3, "PropertyByte", "1")
+ .isKeyPredicate(4, "PropertySByte", "1")
+ .isKeyPredicate(5, "PropertyInt32", "12")
+ .isKeyPredicate(6, "PropertyInt64", "64")
+ .isKeyPredicate(7, "PropertyDecimal", "12")
+ .isKeyPredicate(8, "PropertyDate", "2013-09-25")
+ .isKeyPredicate(9, "PropertyDateTimeOffset", "2002-10-10T12:00:00-05:00")
+ .isKeyPredicate(10, "PropertyDuration", "duration'P10DT5H34M21.123456789012S'")
+ .isKeyPredicate(11, "PropertyGuid", "12345678-1234-1234-1234-123456789012")
+ .isKeyPredicate(12, "PropertyTimeOfDay", "12:34:55.123456789012");
+ }
+
+ @Test
+ public void testEntitySet_NavigationPropperty() {
+
+ // plain entity set ...
+
+ // with navigation property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
+ .at(0)
+ .isEntitySet("ESKeyNav")
+ .isType(EntityTypeProvider.nameETKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(1)
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ // with navigation property -> property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/PropertyString")
+ .at(0)
+ .isEntitySet("ESKeyNav")
+ .isType(EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(1)
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .at(2)
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ // with navigation property -> navigation property -> navigation property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
+ .at(0)
+ .isEntitySet("ESKeyNav")
+ .isType(EntityTypeProvider.nameETKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(1)
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .at(2)
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .isType(EntityTypeProvider.nameETKeyNav);
+
+ // with navigation property(key)
+ testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)")
+ .at(0)
+ .isEntitySet("ESKeyNav")
+ .at(1)
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1");
+
+ // with navigation property(key) -> property
+ testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/PropertyString").at(0)
+ .at(0)
+ .isEntitySet("ESKeyNav")
+ .at(1)
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(2)
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ // with navigation property(key) -> navigation property
+ testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavOne")
+ .isEntitySet("ESKeyNav")
+ .at(1)
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(2)
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+ // with navigation property(key) -> navigation property(key)
+ testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavMany(1)")
+ .isEntitySet("ESKeyNav")
+ .isType(EntityTypeProvider.nameETKeyNav)
+ .at(1)
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(2)
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1");
+
+ // with navigation property(key) -> navigation property -> property
+ testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavOne/PropertyString")
+ .at(0)
+ .isEntitySet("ESKeyNav")
+ .isType(EntityTypeProvider.nameETKeyNav)
+ .at(1)
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(2)
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .isType(EntityTypeProvider.nameETKeyNav)
+ .at(3)
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ // with navigation property(key) -> navigation property(key) -> property
+ testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavMany(1)/PropertyString")
+ .at(0)
+ .isEntitySet("ESKeyNav")
+ .isType(EntityTypeProvider.nameETKeyNav)
+ .at(1)
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(2)
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(3)
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ }
+
+ @Test
+ public void testEntitySet_Property() {
+
+ // plain entity set ...
+
+ // with property
+ testRes.run("ESAllPrim(1)/PropertyString")
+ .at(0)
+ .isEntitySet("ESAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(1)
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ // with complex property
+ testRes.run("ESCompAllPrim(1)/PropertyComplex")
+ .at(0)
+ .isEntitySet("ESCompAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(1)
+ .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTAllPrim, false);
+
+ // with two properties
+ testRes.run("ESCompAllPrim(1)/PropertyComplex/PropertyString")
+ .at(0)
+ .isEntitySet("ESCompAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(1)
+ .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTAllPrim, false)
+ .at(2)
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+ }
+
+ @Test
+ public void testEntitySet_TypeFilter() {
+
+ // filter
+ testRes.run("ESTwoPrim/com.sap.odata.test1.ETBase")
+ .at(0)
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, true)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+ .isTypeFilterOnEntry(null);
+
+ // filter before key predicate
+ testRes.run("ESTwoPrim/com.sap.odata.test1.ETBase(PropertyInt16=1)")
+ .at(0)
+ .isEntitySet("ESTwoPrim")
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+ .isTypeFilterOnEntry(null)
+ .at(0)
+ .isType(EntityTypeProvider.nameETTwoPrim, false)
+ .isKeyPredicate(0, "PropertyInt16", "1");
+
+ // filter before key predicate; property of sub type
+ testRes.run("ESTwoPrim/com.sap.odata.test1.ETBase(PropertyInt16=1)/AdditionalPropertyString_5")
+ .at(0)
+ .isEntitySet("ESTwoPrim")
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+ .isTypeFilterOnEntry(null)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(1)
+ .isType(PropertyProvider.nameString)
+ .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false);
+
+ // filter after key predicate
+ testRes.run("ESTwoPrim(PropertyInt16=1)/com.sap.odata.test1.ETBase")
+ .at(0)
+ .isEntitySet("ESTwoPrim")
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoPrim, false)
+ .isTypeFilterOnCollection(null)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBase)
+ .isKeyPredicate(0, "PropertyInt16", "1");
+
+ // filter after key predicate; property of sub type
+ testRes.run("ESTwoPrim(PropertyInt16=1)/com.sap.odata.test1.ETBase/AdditionalPropertyString_5")
+ .at(0)
+ .isEntitySet("ESTwoPrim")
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isTypeFilterOnCollection(null)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBase)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(1)
+ .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false)
+ .isType(PropertyProvider.nameString);
+
+ }
+
+ @Test
+ public void testFilterComplexMixedPriority() throws UriParserException {
+ testFilter.runESabc("a or c and e ").isCompr("< <a> or < <c> and <e> >>");
+ testFilter.runESabc("a or c and e eq f").isCompr("< <a> or < <c> and <<e> eq <f>>>>");
+ testFilter.runESabc("a or c eq d and e ").isCompr("< <a> or <<<c> eq <d>> and <e> >>");
+ testFilter.runESabc("a or c eq d and e eq f").isCompr("< <a> or <<<c> eq <d>> and <<e> eq <f>>>>");
+ testFilter.runESabc("a eq b or c and e ").isCompr("<<<a> eq <b>> or < <c> and <e> >>");
+ testFilter.runESabc("a eq b or c and e eq f").isCompr("<<<a> eq <b>> or < <c> and <<e> eq <f>>>>");
+ testFilter.runESabc("a eq b or c eq d and e ").isCompr("<<<a> eq <b>> or <<<c> eq <d>> and <e> >>");
+ testFilter.runESabc("a eq b or c eq d and e eq f").isCompr("<<<a> eq <b>> or <<<c> eq <d>> and <<e> eq <f>>>>");
+ }
+
+ @Test
+ public void testFilterSimpleSameBinaryBinaryBinaryPriority() throws UriParserException {
+
+ testFilter.runESabc("1 add 2 add 3 add 4").isCompr("<<< <1> add <2>> add <3>> add <4>>");
+ testFilter.runESabc("1 add 2 add 3 div 4").isCompr("<< <1> add <2>> add <<3> div <4>>>");
+ testFilter.runESabc("1 add 2 div 3 add 4").isCompr("<< <1> add <<2> div <3>>> add <4>>");
+ testFilter.runESabc("1 add 2 div 3 div 4").isCompr("< <1> add <<<2> div <3>> div <4>>>");
+ testFilter.runESabc("1 div 2 add 3 add 4").isCompr("<<< <1> div <2>> add <3>> add <4>>");
+ testFilter.runESabc("1 div 2 add 3 div 4").isCompr("<< <1> div <2>> add <<3> div <4>>>");
+ testFilter.runESabc("1 div 2 div 3 add 4").isCompr("<<< <1> div <2>> div <3>> add <4>>");
+ testFilter.runESabc("1 div 2 div 3 div 4").isCompr("<<< <1> div <2>> div <3>> div <4>>");
+
+ }
+
+ @Test
+ public void testFunctionImport_VarParameters() {
+
+ // no input
+ testRes.run("FINRTInt16()")
+ .isFunctionImport("FINRTInt16")
+ .isFunction("UFNRTInt16")
+ .isType(PropertyProvider.nameInt16);
+
+ // one input
+ testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isFunction("UFCRTETTwoKeyNavParam")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ // two input
+ testRes.run("FICRTStringTwoParam(ParameterString='ABC',ParameterInt16=1)")
+ .isFunctionImport("FICRTStringTwoParam")
+ .isFunction("UFCRTStringTwoParam")
+ .isType(PropertyProvider.nameString);
+ }
+
+ @Test
+ public void testFunctionImport_VarRetruning() {
+ // returning primitive
+ testRes.run("FINRTInt16()")
+ .isFunctionImport("FINRTInt16")
+ .isFunction("UFNRTInt16")
+ .isType(PropertyProvider.nameInt16, false);
+
+ // returning collection of primitive
+ testRes.run("FICRTCollStringTwoParam(ParameterString='ABC',ParameterInt16=1)")
+ .isFunctionImport("FICRTCollStringTwoParam")
+ .isFunction("UFCRTCollStringTwoParam")
+ .isType(PropertyProvider.nameString, true);
+
+ // returning single complex
+ testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)")
+ .isFunctionImport("FICRTCTAllPrimTwoParam")
+ .isFunction("UFCRTCTAllPrimTwoParam")
+ .isType(ComplexTypeProvider.nameCTAllPrim, false);
+
+ // returning collection of complex
+ testRes.run("FICRTCollCTTwoPrim()")
+ .isFunctionImport("FICRTCollCTTwoPrim")
+ .isFunction("UFCRTCollCTTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+ // returning single entity
+ testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isFunction("UFCRTETTwoKeyNavParam")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false);
+
+ // returning collection of entity (aka entitySet)
+ testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)")
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+ }
+
+ @Test
+ public void testFunctionImportChain() {
+
+ // test chain; returning single complex
+ testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)/PropertyInt16")
+ .at(0)
+ .isFunctionImport("FICRTCTAllPrimTwoParam")
+ .isFunction("UFCRTCTAllPrimTwoParam")
+ .isType(ComplexTypeProvider.nameCTAllPrim, false)
+ .isParameter(0, "ParameterString", "'ABC'")
+ .isParameter(1, "ParameterInt16", "1")
+ .at(1)
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ // test chains; returning single entity
+ testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/PropertyInt16")
+ .at(0)
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isFunction("UFCRTETTwoKeyNavParam")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isParameter(0, "ParameterInt16", "1")
+ .at(1)
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ // test chains; returning collection of entity (aka entitySet)
+ testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')")
+ .at(0)
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isParameter(0, "ParameterInt16", "1")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'ABC'");
+
+ // test chains; returning collection of entity (aka entitySet)
+ testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')/PropertyInt16")
+ .at(0)
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isParameter(0, "ParameterInt16", "1")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'ABC'")
+ .at(1)
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ }
+
+ @Test
+ public void testMetaData() {
+
+ // Parsing the fragment may be used if a uri has to be parsed on the consumer side.
+ // On the producer side this feature is currently not supported, so the context fragment
+ // part is only available as text.
+
+ testUri.run("$metadata")
+ .isKind(UriInfoKind.metadata);
+
+ testUri.run("$metadata?$format=atom")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom");
+
+ // with context (client usage)
+
+ testUri.run("$metadata#$ref")
+ .isKind(UriInfoKind.metadata)
+ .isFragmentText("$ref");
+
+ testUri.run("$metadata?$format=atom#$ref")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("$ref");
+
+ testUri.run("$metadata?$format=atom#Collection($ref)")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("Collection($ref)");
+
+ testUri.run("$metadata?$format=atom#Collection(Edm.EntityType)")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("Collection(Edm.EntityType)");
+
+ testUri.run("$metadata?$format=atom#Collection(Edm.ComplexType)")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("Collection(Edm.ComplexType)");
+
+ testUri.run("$metadata?$format=atom#SINav")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("SINav");
+
+ testUri.run("$metadata?$format=atom#SINav/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("SINav/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#SINav/NavPropertyETKeyNavOne")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("SINav/NavPropertyETKeyNavOne");
+
+ testUri.run("$metadata?$format=atom#SINav/NavPropertyETKeyNavMany(1)")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("SINav/NavPropertyETKeyNavMany(1)");
+
+ testUri.run("$metadata?$format=atom#SINav/NavPropertyETKeyNavOne/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("SINav/NavPropertyETKeyNavOne/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#SINav/NavPropertyETKeyNavMany(1)/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("SINav/NavPropertyETKeyNavMany(1)/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#SINav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("SINav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#SINav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("SINav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#com.sap.odata.test1.ETAllKey")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("com.sap.odata.test1.ETAllKey");
+
+ testUri.run("$metadata?$format=atom#ESTwoPrim/$deletedEntity")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESTwoPrim/$deletedEntity");
+
+ testUri.run("$metadata?$format=atom#ESTwoPrim/$link")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESTwoPrim/$link");
+
+ testUri.run("$metadata?$format=atom#ESTwoPrim/$deletedLink")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESTwoPrim/$deletedLink");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/NavPropertyETKeyNavOne")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/NavPropertyETKeyNavOne");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/NavPropertyETKeyNavMany(1)")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/NavPropertyETKeyNavMany(1)");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/NavPropertyETKeyNavOne/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/NavPropertyETKeyNavOne/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/NavPropertyETKeyNavMany(1)/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/NavPropertyETKeyNavMany(1)/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16");
+
+ testUri.run(
+ "$metadata?$format=atom#ESKeyNav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav(PropertyInt16,PropertyString)")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav(PropertyInt16,PropertyString)");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/$entity")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/$entity");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/$delta")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/$delta");
+
+ testUri.run("$metadata?$format=atom#ESKeyNav/(PropertyInt16,PropertyString)/$delta")
+ .isKind(UriInfoKind.metadata)
+ .isFormatText("atom")
+ .isFragmentText("ESKeyNav/(PropertyInt16,PropertyString)/$delta");
+
+ }
+
+ @Test
+ public void testRef() {
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/$ref");
+ }
+
+ @Test
+ public void testSingleton() {
+ // plain singleton
+ testRes.run("SINav")
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+ }
+
+ @Test
+ public void testNavigationProperty() {
+
+ // plain entity set ...
+
+ // with navigation property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
+
+ // with navigation property -> property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/PropertyString")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .at(2).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ // with navigation property -> navigation property -> navigation property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+ // with navigation property(key)
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'1'");
+
+ // with navigation property(key) -> property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')/PropertyString")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'1'")
+ .at(2).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ // with navigation property(key) -> navigation property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')/NavPropertyETKeyNavOne")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'1'")
+ .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+ // with navigation property(key) -> navigation property(key)
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
+ + "/NavPropertyETKeyNavMany(1)")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'1'")
+ .at(2).isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1");
+
+ // with navigation property(key) -> navigation property -> property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
+ + "/NavPropertyETKeyNavOne/PropertyString")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'1'")
+ .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .at(3).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ // with navigation property(key) -> navigation property(key) -> property
+ testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
+ + "/NavPropertyETKeyNavMany(1)/PropertyString")
+ .at(0).isEntitySet("ESKeyNav")
+ .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'1'")
+ .at(2).isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .at(3).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+ }
+
+ @Test
+ public void testSingleton_Property() {
+
+ // plain singleton ...
+
+ // with property
+ testRes.run("SINav/PropertyInt16")
+ .at(0)
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .at(1)
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ // with complex property
+ testRes.run("SINav/PropertyComplex")
+ .at(0)
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .at(1)
+ .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false);
+
+ // with two properties
+ testRes.run("SINav/PropertyComplex/PropertyInt16")
+ .at(0)
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .at(1)
+ .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false)
+ .at(2)
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ }
+
+ @Test
+ public void testValue() {
+ testUri.run("ESAllPrim(1)/PropertyString/$value");
+ }
+
+ @Test(expected = Exception.class)
+ public void testMemberStartingWithCastFailOnValidation1() {
+ // on EntityType entry
+ testUri.run("ESTwoKeyNav(ParameterInt16=1,PropertyString='ABC')?"
+ + "$filter=com.sap.odata.test1.ETBaseTwoKeyNav/PropertyDate")
+ .goFilter().root().isMember()
+ .isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
+ // .at(0)
+ // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
+ // .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ // .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .at(0).isType(PropertyProvider.nameDate);
+ }
+
+ @Test(expected = Exception.class)
+ public void testMemberStartingWithCastFailOnValidation2() {
+ testUri.run("FICRTCTTwoPrimParam(ParameterInt16=1,ParameterString='2')?"
+ + "$filter=com.sap.odata.test1.CTBase/AdditionalPropString")
+ .goFilter().root().isMember()
+ .isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
+ // .at(0)
+ // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
+ // .isType(ComplexTypeProvider.nameCTTwoPrim, false)
+ // .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase)
+ .at(0).isType(PropertyProvider.nameString);
+ }
+
+ @Test
+ public void testMemberStartingWithCast() {
+
+ // on EntityType collection
+ testUri.run("ESTwoKeyNav?$filter=com.sap.odata.test1.ETBaseTwoKeyNav/PropertyDate")
+ .goFilter().root().isMember()
+ .isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
+ // .at(0)
+ // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
+ // .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ // .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .at(0).isType(PropertyProvider.nameDate);
+
+ // on Complex collection
+ testUri.run("FICRTCollCTTwoPrimParam(ParameterInt16=1,ParameterString='2')?"
+ + "$filter=com.sap.odata.test1.CTBase/AdditionalPropString")
+ .goFilter().root().isMember()
+ .isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
+ // .at(0)
+ // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
+ // .isType(ComplexTypeProvider.nameCTTwoPrim, true)
+ // .isTypeFilterOnCollection(ComplexTypeProvider.nameCTBase)
+ .at(0).isType(PropertyProvider.nameString);
+
+ }
+
+ @Test
+ public void testComplexTypeCastFollowingAsCollection() {
+ testUri.run("FICRTCollCTTwoPrimParam(ParameterInt16=1,ParameterString='2')/com.sap.odata.test1.CTBase");
+ }
+
+ @Test
+ public void testLambda() {
+ testUri.run("ESTwoKeyNav?$filter=CollPropertyComplex/all( l : true )")
+ .goFilter().is("<CollPropertyComplex/<ALL;<true>>>");
+
+ testUri.run("ESTwoKeyNav?$filter=CollPropertyComplex/any( l : true )")
+ .goFilter().is("<CollPropertyComplex/<ANY;<true>>>");
+ testUri.run("ESTwoKeyNav?$filter=CollPropertyComplex/any( )")
+ .goFilter().is("<CollPropertyComplex/<ANY;>>");
+
+ testUri.run("ESTwoKeyNav?$filter=all( l : true )")
+ .goFilter().is("<<ALL;<true>>>");
+ testUri.run("ESTwoKeyNav?$filter=any( l : true )")
+ .goFilter().is("<<ANY;<true>>>");
+ testUri.run("ESTwoKeyNav?$filter=any( )")
+ .goFilter().is("<<ANY;>>");
+ }
+
+ @Test
+ public void testCustomQueryOption() {
+ testUri.run("ESTwoKeyNav?custom")
+ .isCustomParameter(0, "custom", "");
+ testUri.run("ESTwoKeyNav?custom=ABC")
+ .isCustomParameter(0, "custom", "ABC");
+ }
+
+ @Test
+ public void testGeo() throws UriParserException {
+ // TODO sync
+ testFilter.runOnETAllPrim("geo.distance(PropertySByte,PropertySByte)")
+ .is("<geo.distance(<PropertySByte>,<PropertySByte>)>")
+ .isMethod(MethodKind.GEODISTANCE, 2);
+ testFilter.runOnETAllPrim("geo.length(PropertySByte)")
+ .is("<geo.length(<PropertySByte>)>")
+ .isMethod(MethodKind.GEOLENGTH, 1);
+ testFilter.runOnETAllPrim("geo.intersects(PropertySByte,PropertySByte)")
+ .is("<geo.intersects(<PropertySByte>,<PropertySByte>)>")
+ .isMethod(MethodKind.GEOINTERSECTS, 2);
+ }
+
+ @Test
+ public void testSelect() {
+ testUri.run("ESTwoKeyNav?$select=*")
+ .isSelectItemStar(0);
+
+ testUri.run("ESTwoKeyNav?$select=com.sap.odata.test1.*")
+ .isSelectItemAllOp(0, new FullQualifiedName("com.sap.odata.test1", "*"));
+
+ testUri.run("ESTwoKeyNav?$select=PropertyString")
+ .goSelectItemPath(0).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ testUri.run("ESTwoKeyNav?$select=PropertyComplex")
+ .goSelectItemPath(0).isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false);
+
+ testUri.run("ESTwoKeyNav?$select=PropertyComplex/PropertyInt16")
+ .goSelectItemPath(0)
+ .first()
+ .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false)
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ testUri.run("ESTwoKeyNav?$select=PropertyComplex/PropertyComplex")
+ .goSelectItemPath(0)
+ .first()
+ .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false)
+ .n()
+ .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTAllPrim, false);
+
+ testUri.run("ESTwoKeyNav?$select=com.sap.odata.test1.ETBaseTwoKeyNav")
+ .isSelectStartType(0, EntityTypeProvider.nameETBaseTwoKeyNav);
+
+ testUri.run("ESTwoKeyNav/PropertyComplexNav?$select=com.sap.odata.test1.CTTwoBasePrimCompNav")
+ .isSelectStartType(0, ComplexTypeProvider.nameCTTwoBasePrimCompNav);
+
+ testUri.run("ESTwoKeyNav?$select=PropertyComplexNav/com.sap.odata.test1.CTTwoBasePrimCompNav")
+ .goSelectItemPath(0)
+ .first()
+ .isComplexProperty("PropertyComplexNav", ComplexTypeProvider.nameCTBasePrimCompNav, false)
+ .n()
+ .isTypeFilterOnCollection(ComplexTypeProvider.nameCTTwoBasePrimCompNav);
+ ;
+
+ }
+
+ public static String encode(final String decoded) throws UnsupportedEncodingException {
+
+ return URLEncoder.encode(decoded, "UTF-8");
+
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
new file mode 100644
index 0000000..7dcf5a5
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
@@ -0,0 +1,303 @@
+/*
+ * 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.server.core.uri.queryoption;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.AliasImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.ExpressionImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
+import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
+import org.junit.Test;
+
+//TOOD add getKind check to all
+public class QueryOptionTest {
+
+ Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
+
+ @Test
+ public void testAliasQueryOption() {
+ AliasQueryOptionImpl option = new AliasQueryOptionImpl();
+
+ ExpressionImpl expression = new LiteralImpl();
+
+ option.setAliasValue(expression);
+ assertEquals(expression, option.getValue());
+ }
+
+ @Test
+ public void testExandItemImpl() {
+ ExpandItemImpl option = new ExpandItemImpl();
+
+ // input options
+ ExpandOptionImpl expand = new ExpandOptionImpl();
+ FilterOptionImpl filter = new FilterOptionImpl();
+ CountOptionImpl inlinecount = new CountOptionImpl();
+ OrderByOptionImpl orderby = new OrderByOptionImpl();
+ SearchOptionImpl search = new SearchOptionImpl();
+ SelectOptionImpl select = new SelectOptionImpl();
+ SkipOptionImpl skip = new SkipOptionImpl();
+ TopOptionImpl top = new TopOptionImpl();
+ LevelsOptionImpl levels = new LevelsOptionImpl();
+
+ option.setSystemQueryOption(expand);
+ option.setSystemQueryOption(filter);
+ option.setSystemQueryOption(inlinecount);
+ option.setSystemQueryOption(orderby);
+ option.setSystemQueryOption(search);
+ option.setSystemQueryOption(select);
+ option.setSystemQueryOption(skip);
+ option.setSystemQueryOption(top);
+ option.setSystemQueryOption(levels);
+
+ assertEquals(expand, option.getExpandOption());
+ assertEquals(filter, option.getFilterOption());
+ assertEquals(inlinecount, option.getCountOption());
+ assertEquals(orderby, option.getOrderByOption());
+ assertEquals(search, option.getSearchOption());
+ assertEquals(select, option.getSelectOption());
+ assertEquals(skip, option.getSkipOption());
+ assertEquals(top, option.getTopOption());
+ assertEquals(levels, option.getLevelsOption());
+
+ // just for completeness
+ option = new ExpandItemImpl();
+ option.setSystemQueryOption(new IdOptionImpl());
+
+ option = new ExpandItemImpl();
+ List<SystemQueryOptionImpl> list = new ArrayList<SystemQueryOptionImpl>();
+ list.add(expand);
+ list.add(filter);
+ option.setSystemQueryOptions(list);
+ assertEquals(expand, option.getExpandOption());
+ assertEquals(filter, option.getFilterOption());
+
+ option = new ExpandItemImpl();
+ assertEquals(false, option.isRef());
+ option.setIsRef(true);
+ assertEquals(true, option.isRef());
+
+ option = new ExpandItemImpl();
+ assertEquals(false, option.isStar());
+ option.setIsStar(true);
+ assertEquals(true, option.isStar());
+
+ option = new ExpandItemImpl();
+ UriInfoResource resource = new UriInfoImpl().asUriInfoResource();
+ option.setResourcePath(resource);
+ assertEquals(resource, option.getResourcePath());
+
+ }
+
+ @Test
+ public void testExpandOptionImpl() {
+ ExpandOptionImpl option = new ExpandOptionImpl();
+ assertEquals(SystemQueryOptionKind.EXPAND, option.getKind());
+
+ ExpandItemImpl item1 = new ExpandItemImpl();
+ ExpandItemImpl item2 = new ExpandItemImpl();
+ option.addExpandItem(item1);
+ option.addExpandItem(item2);
+ assertEquals(item1, option.getExpandItems().get(0));
+ assertEquals(item2, option.getExpandItems().get(1));
+ }
+
+ @Test
+ public void testFilterOptionImpl() {
+ FilterOptionImpl option = new FilterOptionImpl();
+ assertEquals(SystemQueryOptionKind.FILTER, option.getKind());
+
+ AliasImpl expression = new AliasImpl();
+
+ option.setExpression(expression);
+ assertEquals(expression, option.getExpression());
+ }
+
+ @Test
+ public void testFormatOptionImpl() {
+ FormatOptionImpl option = new FormatOptionImpl();
+ assertEquals(SystemQueryOptionKind.FORMAT, option.getKind());
+
+ option.setFormat("A");
+
+ assertEquals("A", option.getFormat());
+ }
+
+ @Test
+ public void testIdOptionImpl() {
+ IdOptionImpl option = new IdOptionImpl();
+ assertEquals(SystemQueryOptionKind.ID, option.getKind());
+
+ option.setValue("A");
+
+ assertEquals("A", option.getValue());
+ }
+
+ @Test
+ public void testInlineCountImpl() {
+ CountOptionImpl option = new CountOptionImpl();
+ assertEquals(SystemQueryOptionKind.COUNT, option.getKind());
+
+ assertEquals(false, option.getValue());
+ option.setValue(true);
+ assertEquals(true, option.getValue());
+ }
+
+ @Test
+ public void testLevelsExpandOptionImpl() {
+ LevelsOptionImpl option = new LevelsOptionImpl();
+ assertEquals(SystemQueryOptionKind.LEVELS, option.getKind());
+
+ assertEquals(0, option.getValue());
+ option.setValue(1);
+ assertEquals(1, option.getValue());
+
+ option = new LevelsOptionImpl();
+ option.setMax();
+ assertEquals(true, option.isMax());
+ }
+
+ @Test
+ public void testOrderByItemImpl() {
+ OrderByItemImpl option = new OrderByItemImpl();
+
+ AliasImpl expression = new AliasImpl();
+ option.setExpression(expression);
+ assertEquals(expression, option.getExpression());
+
+ assertEquals(false, option.isDescending());
+ option.setDescending(true);
+ assertEquals(true, option.isDescending());
+ }
+
+ @Test
+ public void testOrderByOptionImpl() {
+ OrderByOptionImpl option = new OrderByOptionImpl();
+
+ OrderByItemImpl order0 = new OrderByItemImpl();
+ OrderByItemImpl order1 = new OrderByItemImpl();
+ option.addOrder(order0);
+ option.addOrder(order1);
+
+ assertEquals(order0, option.getOrders().get(0));
+ assertEquals(order1, option.getOrders().get(1));
+ }
+
+ @Test
+ public void testQueryOptionImpl() {
+ QueryOptionImpl option = new AliasQueryOptionImpl();
+
+ option.setName("A");
+ option.setText("B");
+ assertEquals("A", option.getName());
+ assertEquals("B", option.getText());
+ }
+
+ @Test
+ public void testSearchOptionImpl() {
+ SearchOptionImpl option = new SearchOptionImpl();
+ assertEquals(SystemQueryOptionKind.SEARCH, option.getKind());
+ // TODO $search is not supported yet
+ }
+
+ @Test
+ public void testSelectItemImpl() {
+ SelectItemImpl option = new SelectItemImpl();
+
+ // no typed collection else case ( e.g. if not path is added)
+ option = new SelectItemImpl();
+
+ option = new SelectItemImpl();
+ assertEquals(false, option.isStar());
+ option.setStar(true);
+ assertEquals(true, option.isStar());
+
+ option = new SelectItemImpl();
+ assertEquals(false, option.isAllOperationsInSchema());
+ FullQualifiedName fqName = new FullQualifiedName("Namespace", "Name");
+ option.addAllOperationsInSchema(fqName);
+ assertEquals(true, option.isAllOperationsInSchema());
+ assertEquals(fqName, option.getAllOperationsInSchemaNameSpace());
+
+ }
+
+ @Test
+ public void testSelectOptionImpl() {
+ SelectOptionImpl option = new SelectOptionImpl();
+ assertEquals(SystemQueryOptionKind.SELECT, option.getKind());
+
+ SelectItemImpl item0 = new SelectItemImpl();
+ SelectItemImpl item1 = new SelectItemImpl();
+
+ ArrayList<SelectItemImpl> list = new ArrayList<SelectItemImpl>();
+ list.add(item0);
+ list.add(item1);
+ option.setSelectItems(list);
+
+ assertEquals(item0, option.getSelectItems().get(0));
+ assertEquals(item1, option.getSelectItems().get(1));
+
+ }
+
+ @Test
+ public void testSkipOptionImpl() {
+ SkipOptionImpl option = new SkipOptionImpl();
+ assertEquals(SystemQueryOptionKind.SKIP, option.getKind());
+
+ option.setValue(10);
+ assertEquals(10, option.getValue());
+ }
+
+ @Test
+ public void testSkipTokenOptionImpl() {
+ SkipTokenOptionImpl option = new SkipTokenOptionImpl();
+ assertEquals(SystemQueryOptionKind.SKIPTOKEN, option.getKind());
+
+ option.setValue("A");
+ assertEquals("A", option.getValue());
+ }
+
+ @Test
+ public void testSystemQueryOptionImpl() {
+ SystemQueryOptionImpl option = new SystemQueryOptionImpl();
+
+ option.setKind(SystemQueryOptionKind.EXPAND);
+ assertEquals(SystemQueryOptionKind.EXPAND, option.getKind());
+
+ assertEquals("$expand", option.getName());
+ }
+
+ @Test
+ public void testTopOptionImpl() {
+ TopOptionImpl option = new TopOptionImpl();
+ assertEquals(SystemQueryOptionKind.TOP, option.getKind());
+
+ option.setValue(11);
+ assertEquals(11, option.getValue());
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
new file mode 100644
index 0000000..de63b46
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
@@ -0,0 +1,239 @@
+/*
+ * 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.server.core.uri.queryoption.expression;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.Arrays;
+
+import org.apache.olingo.commons.api.ODataApplicationException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
+import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.UnaryOperatorKind;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.core.uri.UriInfoImpl;
+import org.apache.olingo.server.core.uri.UriResourceActionImpl;
+import org.apache.olingo.server.core.uri.UriResourceFunctionImpl;
+import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
+import org.apache.olingo.server.core.uri.testutil.FilterTreeToText;
+import org.apache.olingo.server.tecsvc.provider.ActionProvider;
+import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.EnumTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.FunctionProvider;
+import org.junit.Test;
+
+public class ExpressionTest {
+ Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
+
+ @Test
+ public void testSupportedOperators() {
+ assertEquals(UnaryOperatorKind.MINUS, UnaryOperatorKind.get("-"));
+ assertEquals(null, UnaryOperatorKind.get("XXX"));
+
+ assertEquals(BinaryOperatorKind.MOD, BinaryOperatorKind.get("mod"));
+ assertEquals(null, BinaryOperatorKind.get("XXX"));
+
+ assertEquals(MethodKind.CONCAT, MethodKind.get("concat"));
+ assertEquals(null, MethodKind.get("XXX"));
+ }
+
+ @Test
+ public void testAliasExpression() throws ExpressionVisitException, ODataApplicationException {
+ AliasImpl expression = new AliasImpl();
+
+ expression.setParameter("Test");
+
+ assertEquals("Test", expression.getParameterName());
+
+ String output = expression.accept(new FilterTreeToText());
+ assertEquals("<Test>", output);
+
+ }
+
+ @Test
+ public void testBinaryExpression() throws ExpressionVisitException, ODataApplicationException {
+ BinaryImpl expression = new BinaryImpl();
+
+ ExpressionImpl expressionLeft = new LiteralImpl().setText("A");
+ ExpressionImpl expressionRight = new LiteralImpl().setText("B");
+
+ expression.setLeftOperand(expressionLeft);
+ expression.setRightOperand(expressionRight);
+ expression.setOperator(BinaryOperatorKind.SUB);
+
+ assertEquals(expressionLeft, expression.getLeftOperand());
+ assertEquals(expressionRight, expression.getRightOperand());
+ assertEquals(BinaryOperatorKind.SUB, expression.getOperator());
+
+ String output = expression.accept(new FilterTreeToText());
+ assertEquals("<<A> sub <B>>", output);
+ }
+
+ @Test
+ public void testEnumerationExpression() throws ExpressionVisitException, ODataApplicationException {
+ EnumerationImpl expression = new EnumerationImpl();
+ EdmEnumType type = (EdmEnumType) edm.getEnumType(EnumTypeProvider.nameENString);
+ assertNotNull(type);
+ expression.setType(type);
+
+ assertEquals(type, expression.getType());
+
+ expression.addValue("A");
+ expression.addValue("B");
+ assertEquals("A", expression.getValues().get(0));
+ assertEquals("B", expression.getValues().get(1));
+ assertEquals("<com.sap.odata.test1.ENString<A,B>>", expression.accept(new FilterTreeToText()));
+ }
+
+ @Test
+ public void testLambdaRefExpression() throws ExpressionVisitException, ODataApplicationException {
+ LambdaRefImpl expression = new LambdaRefImpl();
+ expression.setVariableText("A");
+ assertEquals("A", expression.getVariableName());
+
+ assertEquals("<A>", expression.accept(new FilterTreeToText()));
+
+ }
+
+ @Test
+ public void testLiteralExpresion() throws ExpressionVisitException, ODataApplicationException {
+ LiteralImpl expression = new LiteralImpl();
+ expression.setText("A");
+ assertEquals("A", expression.getText());
+
+ assertEquals("<A>", expression.accept(new FilterTreeToText()));
+ }
+
+ @Test
+ public void testMemberExpression() throws ExpressionVisitException, ODataApplicationException {
+ MemberImpl expression = new MemberImpl();
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
+
+ // UriResourceImplTyped
+ EdmAction action = edm.getUnboundAction(ActionProvider.nameUARTPrimParam);
+ UriInfoResource uriInfo = new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
+ new UriResourceActionImpl().setAction(action)).asUriInfoResource();
+ expression.setResourcePath(uriInfo);
+ assertEquals(action.getReturnType().getType(), expression.getType());
+
+ // check accept and path
+ assertEquals(uriInfo, expression.getResourcePath());
+ assertEquals("<UARTPrimParam>", expression.accept(new FilterTreeToText()));
+
+ // UriResourceImplTyped check collection = false case
+ assertEquals(false, expression.isCollection());
+
+ // UriResourceImplTyped check collection = true case
+ action = edm.getUnboundAction(ActionProvider.nameUARTPrimCollParam);
+ expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
+ new UriResourceActionImpl().setAction(action))
+ .asUriInfoResource());
+ assertEquals(true, expression.isCollection());
+
+ // UriResourceImplTyped with filter
+ action = edm.getUnboundAction(ActionProvider.nameUARTPrimParam);
+ expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
+ new UriResourceActionImpl().setAction(action).setTypeFilter(entityType))
+ .asUriInfoResource());
+ assertEquals(entityType, expression.getType());
+
+ // UriResourceImplKeyPred
+ EdmFunction function = edm.getUnboundFunction(FunctionProvider.nameUFCRTETKeyNav, null);
+ expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
+ new UriResourceFunctionImpl().setFunction(function))
+ .asUriInfoResource());
+ assertEquals(function.getReturnType().getType(), expression.getType());
+
+ // UriResourceImplKeyPred typeFilter on entry
+ EdmEntityType entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
+ function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
+ expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
+ new UriResourceFunctionImpl().setFunction(function).setEntryTypeFilter(entityBaseType))
+ .asUriInfoResource());
+ assertEquals(entityBaseType, expression.getType());
+
+ // UriResourceImplKeyPred typeFilter on entry
+ entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
+ function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
+ expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
+ new UriResourceFunctionImpl().setFunction(function).setCollectionTypeFilter(entityBaseType))
+ .asUriInfoResource());
+ assertEquals(entityBaseType, expression.getType());
+
+ // no typed
+ entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
+ function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
+ expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.all));
+ assertEquals(null, expression.getType());
+
+ // no typed collection else case
+ assertEquals(false, expression.isCollection());
+ }
+
+ @Test
+ public void testMethodCallExpression() throws ExpressionVisitException, ODataApplicationException {
+ MethodImpl expression = new MethodImpl();
+ expression.setMethod(MethodKind.CONCAT);
+
+ ExpressionImpl p0 = new LiteralImpl().setText("A");
+ ExpressionImpl p1 = new LiteralImpl().setText("B");
+ expression.addParameter(p0);
+ expression.addParameter(p1);
+
+ assertEquals(MethodKind.CONCAT, expression.getMethod());
+ assertEquals("<concat(<A>,<B>)>", expression.accept(new FilterTreeToText()));
+
+ assertEquals(p0, expression.getParameters().get(0));
+ assertEquals(p1, expression.getParameters().get(1));
+ }
+
+ @Test
+ public void testTypeLiteralExpression() throws ExpressionVisitException, ODataApplicationException {
+ TypeLiteralImpl expression = new TypeLiteralImpl();
+ EdmEntityType entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
+ expression.setType(entityBaseType);
+
+ assertEquals(entityBaseType, expression.getType());
+ assertEquals("<com.sap.odata.test1.ETBaseTwoKeyNav>", expression.accept(new FilterTreeToText()));
+ }
+
+ @Test
+ public void testUnaryExpression() throws ExpressionVisitException, ODataApplicationException {
+ UnaryImpl expression = new UnaryImpl();
+ expression.setOperator(UnaryOperatorKind.MINUS);
+
+ ExpressionImpl operand = new LiteralImpl().setText("A");
+ expression.setOperand(operand);
+
+ assertEquals(UnaryOperatorKind.MINUS, expression.getOperator());
+ assertEquals(operand, expression.getOperand());
+
+ assertEquals("<- <A>>", expression.accept(new FilterTreeToText()));
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java
new file mode 100644
index 0000000..8f0d507
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java
@@ -0,0 +1,100 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.ComplexType;
+import org.apache.olingo.server.api.edm.provider.EntitySet;
+import org.apache.olingo.server.api.edm.provider.EntityType;
+import org.apache.olingo.server.api.edm.provider.Property;
+import org.apache.olingo.server.api.edm.provider.PropertyRef;
+import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
+
+/**
+ * Implement the EdmTechProvider and
+ * <li>adds a entity type <b>ETabc with</b> properties a,b,c,d,e,f</li>
+ * <li>adds a complex type <b>CTabc</b> with properties a,b,c,d,e,f</li>
+ * <li>adds a <b>abc</b> entity set of type <b>ETabc</b></li>
+ */
+public class EdmTechTestProvider extends EdmTechProvider {
+
+ private static final FullQualifiedName nameInt16 = EdmPrimitiveTypeKind.Int16.getFullQualifiedName();
+ public static final String nameSpace = "com.sap.odata.test1";
+ public static final FullQualifiedName nameContainer = new FullQualifiedName(nameSpace, "Container");
+
+ Property propertyAInt16 = new Property().setName("a").setType(nameInt16);
+ Property propertyBInt16 = new Property().setName("b").setType(nameInt16);
+ Property propertyCInt16 = new Property().setName("c").setType(nameInt16);
+ Property propertyDInt16 = new Property().setName("d").setType(nameInt16);
+ Property propertyEInt16 = new Property().setName("e").setType(nameInt16);
+ Property propertyFInt16 = new Property().setName("f").setType(nameInt16);
+
+ public static final FullQualifiedName nameCTabc = new FullQualifiedName(nameSpace, "CTabc");
+ public static final FullQualifiedName nameETabc = new FullQualifiedName(nameSpace, "ETabc");
+
+ @Override
+ public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
+ if (complexTypeName.equals(nameCTabc)) {
+ return new ComplexType()
+ .setName("CTabc")
+ .setProperties(Arrays.asList(
+ propertyAInt16, propertyBInt16, propertyCInt16,
+ propertyDInt16, propertyEInt16, propertyFInt16
+ ));
+
+ }
+
+ return super.getComplexType(complexTypeName);
+ }
+
+ @Override
+ public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException {
+ if (nameContainer.equals(entityContainer)) {
+ if (name.equals("ESabc")) {
+ return new EntitySet()
+ .setName("ESabc")
+ .setType(nameETabc);
+ }
+ }
+
+ return super.getEntitySet(entityContainer, name);
+ }
+
+ @Override
+ public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
+ List<PropertyRef> oneKeyPropertyInt16 = Arrays.asList(new PropertyRef().setPropertyName("a"));
+
+ if (entityTypeName.equals(nameETabc)) {
+ return new EntityType()
+ .setName("ETabc")
+ .setProperties(Arrays.asList(
+ propertyAInt16, propertyBInt16, propertyCInt16,
+ propertyDInt16, propertyEInt16, propertyFInt16))
+ .setKey(oneKeyPropertyInt16);
+ }
+
+ return super.getEntityType(entityTypeName);
+ }
+
+}
[13/31] git commit: [OLINGO-260] provided create with back navigation
link integration test on proxy
Posted by sk...@apache.org.
[OLINGO-260] provided create with back navigation link integration test on proxy
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/3af2c8ce
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/3af2c8ce
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/3af2c8ce
Branch: refs/heads/olingo-266-ref
Commit: 3af2c8ce4fdfadfe5a3bf180decc81204dd37f2c
Parents: 322a3ef
Author: fmartelli <fa...@gmail.com>
Authored: Mon May 12 17:03:30 2014 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Mon May 12 17:03:30 2014 +0200
----------------------------------------------------------------------
.../olingo/ext/proxy/commons/ContainerImpl.java | 10 +--
.../commons/EntityTypeInvocationHandler.java | 30 ++++----
.../org/apache/olingo/fit/AbstractServices.java | 55 ++++++++------
.../org/apache/olingo/fit/utils/Commons.java | 2 +-
.../org/apache/olingo/fit/utils/FSManager.java | 1 +
.../fit/proxy/v3/EntityCreateTestITCase.java | 3 +-
.../apache/olingo/fit/v3/BatchTestITCase.java | 79 +++++++++++++++++++-
7 files changed, 130 insertions(+), 50 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3af2c8ce/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java
index e89c843..8959351 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/ContainerImpl.java
@@ -139,11 +139,11 @@ class ContainerImpl implements Container {
if (handler != null) {
if (res instanceof ODataEntityCreateResponse) {
- LOG.debug("Upgrade created object '{}'", handler);
handler.setEntity(((ODataEntityCreateResponse) res).getBody());
+ LOG.debug("Upgrade created object '{}'", handler);
} else if (res instanceof ODataEntityUpdateResponse) {
- LOG.debug("Upgrade updated object '{}'", handler);
handler.setEntity(((ODataEntityUpdateResponse) res).getBody());
+ LOG.debug("Upgrade updated object '{}'", handler);
}
}
}
@@ -308,8 +308,7 @@ class ContainerImpl implements Container {
final CommonODataEntity entity = handler.getEntity();
entity.getNavigationLinks().clear();
- final AttachedEntityStatus currentStatus = EntityContainerFactory.getContext().entityContext().
- getStatus(handler);
+ final AttachedEntityStatus currentStatus = EntityContainerFactory.getContext().entityContext().getStatus(handler);
if (AttachedEntityStatus.DELETED != currentStatus) {
entity.getProperties().clear();
@@ -335,8 +334,7 @@ class ContainerImpl implements Container {
final URI editLink = target.getEntity().getEditLink();
- if ((status == AttachedEntityStatus.ATTACHED || status == AttachedEntityStatus.LINKED)
- && !target.isChanged()) {
+ if ((status == AttachedEntityStatus.ATTACHED || status == AttachedEntityStatus.LINKED) && !target.isChanged()) {
entity.addLink(buildNavigationLink(
property.getKey().name(),
URIUtils.getURI(serviceRoot, editLink.toASCIIString()), type));
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3af2c8ce/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
----------------------------------------------------------------------
diff --git a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
index 449a8d1..3a825e8 100644
--- a/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
+++ b/ext/client-proxy/src/main/java/org/apache/olingo/ext/proxy/commons/EntityTypeInvocationHandler.java
@@ -56,8 +56,6 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
private static final long serialVersionUID = 2629912294765040037L;
- private CommonODataEntity entity;
-
protected Map<String, Object> propertyChanges = new HashMap<String, Object>();
protected Map<NavigationProperty, Object> linkChanges = new HashMap<NavigationProperty, Object>();
@@ -103,8 +101,8 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
super(containerHandler.getClient(), typeRef, (ODataLinked) entity, containerHandler);
- this.entity = entity;
- this.entity.setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
+ this.internal = entity;
+ getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
this.uuid = new EntityUUID(
containerHandler.getEntityContainerName(),
@@ -116,8 +114,8 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
}
public void setEntity(final CommonODataEntity entity) {
- this.entity = entity;
- this.entity.setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
+ this.internal = entity;
+ getEntity().setMediaEntity(typeRef.getAnnotation(EntityType.class).hasStream());
this.uuid = new EntityUUID(
getUUID().getContainerName(),
@@ -139,7 +137,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
@Override
public FullQualifiedName getName() {
- return this.entity.getTypeName();
+ return getEntity().getTypeName();
}
public String getEntityContainerName() {
@@ -150,8 +148,8 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
return uuid.getEntitySetName();
}
- public CommonODataEntity getEntity() {
- return entity;
+ public final CommonODataEntity getEntity() {
+ return (CommonODataEntity) internal;
}
/**
@@ -160,7 +158,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
* @return
*/
public String getETag() {
- return this.entity.getETag();
+ return getEntity().getETag();
}
/**
@@ -169,7 +167,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
* @param eTag ETag.
*/
public void setETag(final String eTag) {
- this.entity.setETag(eTag);
+ getEntity().setETag(eTag);
}
public Map<String, Object> getPropertyChanges() {
@@ -196,7 +194,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
protected Object getPropertyValue(final String name, final Type type) {
try {
final Object res;
- final CommonODataProperty property = entity.getProperty(name);
+ final CommonODataProperty property = getEntity().getProperty(name);
if (propertyChanges.containsKey(name)) {
res = propertyChanges.get(name);
@@ -266,7 +264,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
}
}
- for (CommonODataProperty property : entity.getProperties()) {
+ for (CommonODataProperty property : getEntity().getProperties()) {
if (!propertyNames.contains(property.getName())) {
res.add(property.getName());
}
@@ -328,14 +326,14 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
public InputStream getStream() {
- final URI contentSource = entity.getMediaContentSource();
+ final URI contentSource = getEntity().getMediaContentSource();
if (this.stream == null
&& typeRef.getAnnotation(EntityType.class).hasStream()
&& contentSource != null) {
final String contentType =
- StringUtils.isBlank(entity.getMediaContentType()) ? "*/*" : entity.getMediaContentType();
+ StringUtils.isBlank(getEntity().getMediaContentType()) ? "*/*" : getEntity().getMediaContentType();
final ODataMediaRequest retrieveReq = client.getRetrieveRequestFactory().getMediaRequest(contentSource);
retrieveReq.setFormat(ODataMediaFormat.fromFormat(contentType));
@@ -354,7 +352,7 @@ public class EntityTypeInvocationHandler<C extends CommonEdmEnabledODataClient<?
if (res == null) {
final URI link = URIUtils.getURI(
containerHandler.getFactory().getServiceRoot(),
- CoreUtils.getEditMediaLink(property.name(), this.entity).toASCIIString());
+ CoreUtils.getEditMediaLink(property.name(), getEntity()).toASCIIString());
final ODataMediaRequest req = client.getRetrieveRequestFactory().getMediaRequest(link);
res = req.execute().getBody();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3af2c8ce/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
index bdaaf0e..948bcd9 100644
--- a/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
+++ b/fit/src/main/java/org/apache/olingo/fit/AbstractServices.java
@@ -117,6 +117,8 @@ public abstract class AbstractServices {
private static final Pattern BATCH_REQUEST_REF_PATTERN = Pattern.compile("(.*) ([$].*) HTTP/.*");
+ private static final Pattern REF_PATTERN = Pattern.compile("([$]\\d+)");
+
protected static final String BOUNDARY = "batch_243234_25424_ef_892u748";
protected final ODataServiceVersion version;
@@ -231,41 +233,48 @@ public abstract class AbstractServices {
}
final Response res;
+ final String url;
+ final String method;
if (matcher.find()) {
- final String url = matcher.group(2);
+ url = matcher.group(2);
+ method = matcher.group(1);
+ } else if (matcherRef.find()) {
+ url = references.get(matcherRef.group(2));
+ method = matcherRef.group(1);
+ } else {
+ url = null;
+ method = null;
+ }
+
+ if (url == null) {
+ res = null;
+ } else {
final WebClient client = WebClient.create(url);
client.headers(headers);
- final String method = matcher.group(1);
if ("DELETE".equals(method)) {
res = client.delete();
- } else if ("PATCH".equals(method) || "MERGE".equals(method)) {
- client.header("X-HTTP-METHOD", method);
- res = client.invoke("POST", body.getDataHandler().getInputStream());
} else {
- res = client.invoke(method, body.getDataHandler().getInputStream());
- }
+ final InputStream is = body.getDataHandler().getInputStream();
+ String content = IOUtils.toString(is);
+ IOUtils.closeQuietly(is);
- client.close();
- } else if (matcherRef.find()) {
- final String url = matcherRef.group(2);
- final WebClient client = WebClient.create(references.get(url));
- client.headers(headers);
+ final Matcher refs = REF_PATTERN.matcher(content);
- String method = matcherRef.group(1);
- if ("DELETE".equals(method)) {
- res = client.delete();
- } else if ("PATCH".equals(method) || "MERGE".equals(method)) {
- client.header("X-HTTP-METHOD", method);
- res = client.invoke("POST", body.getDataHandler().getInputStream());
- } else {
- res = client.invoke(method, body.getDataHandler().getInputStream());
+ while (refs.find()) {
+ content = content.replace(refs.group(1), references.get(refs.group(1)));
+ }
+
+ if ("PATCH".equals(method) || "MERGE".equals(method)) {
+ client.header("X-HTTP-METHOD", method);
+ res = client.invoke("POST", IOUtils.toInputStream(content));
+ } else {
+ res = client.invoke(method, IOUtils.toInputStream(content));
+ }
}
client.close();
- } else {
- res = null;
}
return res;
@@ -621,7 +630,7 @@ public abstract class AbstractServices {
writer.close();
final InputStream serialization =
- xml.addOrReplaceEntity(null, entitySetName, new ByteArrayInputStream(content.toByteArray()), entry);
+ xml.addOrReplaceEntity(entityKey, entitySetName, new ByteArrayInputStream(content.toByteArray()), entry);
ResWrap<AtomEntityImpl> result = atomDeserializer.read(serialization, AtomEntityImpl.class);
result = new ResWrap<AtomEntityImpl>(
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3af2c8ce/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java b/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
index 74c2284..262ab36 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/Commons.java
@@ -100,7 +100,7 @@ public abstract class Commons {
SEQUENCE.put("People", 1000);
MEDIA_CONTENT.put("CustomerInfo",
- new ImmutablePair<String, EdmPrimitiveTypeKind>("CustomerinfoId", EdmPrimitiveTypeKind.Int32));
+ new ImmutablePair<String, EdmPrimitiveTypeKind>("CustomerInfoId", EdmPrimitiveTypeKind.Int32));
MEDIA_CONTENT.put("Car",
new ImmutablePair<String, EdmPrimitiveTypeKind>("VIN", EdmPrimitiveTypeKind.Int32));
MEDIA_CONTENT.put("Car/Photo", null);
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3af2c8ce/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
----------------------------------------------------------------------
diff --git a/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java b/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
index 4ad3871..2599b8f 100644
--- a/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
+++ b/fit/src/main/java/org/apache/olingo/fit/utils/FSManager.java
@@ -80,6 +80,7 @@ public class FSManager {
}
public FileObject putInMemory(final InputStream is, final String path) throws IOException {
+ LOG.info("Write in memory {}", path);
final FileObject memObject = fsManager.resolveFile(MEM_PREFIX + path);
if (memObject.exists()) {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3af2c8ce/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
index 4118706..a930100 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/EntityCreateTestITCase.java
@@ -18,6 +18,8 @@
*/
package org.apache.olingo.fit.proxy.v3;
+import java.lang.reflect.Proxy;
+import org.apache.olingo.ext.proxy.commons.EntityTypeInvocationHandler;
import static org.apache.olingo.fit.proxy.v3.AbstractTest.container;
import org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.
types.Customer;
@@ -129,7 +131,6 @@ public class EntityCreateTestITCase extends AbstractTest {
}
@Test
- @Ignore
public void createWithBackNavigation() {
final String sampleName = "sample customer from proxy with back navigation";
final Integer id = 102;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/3af2c8ce/fit/src/test/java/org/apache/olingo/fit/v3/BatchTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/v3/BatchTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/v3/BatchTestITCase.java
index 1ed6d22..3b73671 100644
--- a/fit/src/test/java/org/apache/olingo/fit/v3/BatchTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/v3/BatchTestITCase.java
@@ -56,6 +56,7 @@ import org.apache.olingo.client.core.communication.request.retrieve.ODataEntityR
import org.apache.olingo.client.core.uri.URIUtils;
import org.apache.olingo.commons.api.domain.v3.ODataEntity;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.apache.olingo.commons.api.format.ODataPubFormat;
import static org.apache.olingo.fit.v3.AbstractTestITCase.client;
import org.junit.Test;
@@ -230,6 +231,78 @@ public class BatchTestITCase extends AbstractTestITCase {
@Test
@SuppressWarnings("unchecked")
+ public void updateLinkWithReference() throws EdmPrimitiveTypeException {
+ // create your request
+ final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(testStaticServiceRootURL);
+ final BatchStreamManager streamManager = request.execute();
+
+ final ODataChangeset changeset = streamManager.addChangeset();
+
+ final ODataEntity info =
+ client.getObjectFactory().newEntity(
+ new FullQualifiedName("Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo"));
+
+ info.getProperties().add(client.getObjectFactory().newPrimitiveProperty("Information",
+ client.getObjectFactory().newPrimitiveValueBuilder().buildString("Sample information about customer 30")));
+
+ URIBuilder uriBuilder = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("CustomerInfo");
+
+ ODataEntityCreateRequest<ODataEntity> createReq =
+ client.getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), info);
+
+ changeset.addRequest(createReq);
+
+ // retrieve request reference
+ int createRequestRef = changeset.getLastContentId();
+
+ ODataEntity customer = getSampleCustomerProfile(30, "sample customer", false);
+ customer.getNavigationLinks().add(
+ client.getObjectFactory().newEntityNavigationLink("Info", URI.create("$" + createRequestRef)));
+
+ uriBuilder = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer");
+
+ // add create request
+ createReq = client.getCUDRequestFactory().getEntityCreateRequest(uriBuilder.build(), customer);
+
+ changeset.addRequest(createReq);
+
+ final ODataBatchResponse response = streamManager.getResponse();
+ assertEquals(202, response.getStatusCode());
+ assertEquals("Accepted", response.getStatusMessage());
+
+ // verify response payload ...
+ final Iterator<ODataBatchResponseItem> iter = response.getBody();
+
+ final ODataBatchResponseItem item = iter.next();
+ assertTrue(item instanceof ODataChangesetResponseItem);
+
+ ODataChangesetResponseItem chgitem = (ODataChangesetResponseItem) item;
+
+ ODataResponse res = chgitem.next();
+ assertEquals(201, res.getStatusCode());
+ assertTrue(res instanceof ODataEntityCreateResponse);
+
+ final ODataEntity infoEntity = ((ODataEntityCreateResponse<ODataEntity>) res).getBody();
+
+ chgitem = (ODataChangesetResponseItem) item;
+
+ res = chgitem.next();
+ assertEquals(201, res.getStatusCode());
+ assertTrue(res instanceof ODataEntityCreateResponse);
+
+ uriBuilder = client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer").appendKeySegment(30);
+
+ final ODataEntityRequest<ODataEntity> req = client.getRetrieveRequestFactory().getEntityRequest(
+ URIUtils.getURI(testStaticServiceRootURL, uriBuilder.build() + "/Info"));
+
+ final ODataEntity navigatedInfo = req.execute().getBody();
+
+ assertEquals(infoEntity.getProperty("CustomerInfoId").getPrimitiveValue().toCastValue(Integer.class),
+ navigatedInfo.getProperty("CustomerInfoId").getPrimitiveValue().toCastValue(Integer.class));
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
public void batchRequest() throws EdmPrimitiveTypeException {
// create your request
final ODataBatchRequest request = client.getBatchRequestFactory().getBatchRequest(testStaticServiceRootURL);
@@ -284,9 +357,9 @@ public class BatchTestITCase extends AbstractTestITCase {
client.getCUDRequestFactory().getEntityCreateRequest(targetURI.build(), original);
createReq.setFormat(ODataPubFormat.ATOM);
changeset.addRequest(createReq);
-
+
// Delete customer created above
- targetURI =
+ targetURI =
client.getURIBuilder(testStaticServiceRootURL).appendEntitySetSegment("Customer").appendKeySegment(1000);
final ODataDeleteRequest deleteReq = client.getCUDRequestFactory().getDeleteRequest(targetURI.build());
changeset.addRequest(deleteReq);
@@ -350,7 +423,7 @@ public class BatchTestITCase extends AbstractTestITCase {
res = chgitem.next();
assertTrue(res instanceof ODataDeleteResponse);
assertEquals(204, res.getStatusCode());
-
+
// retrive the third item (ODataRetrieve)
item = iter.next();
assertTrue(item instanceof ODataRetrieveResponseItem);
[12/31] git commit: Updating RAT excludes to make the build succeeed
Posted by sk...@apache.org.
Updating RAT excludes to make the build succeeed
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/322a3efd
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/322a3efd
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/322a3efd
Branch: refs/heads/olingo-266-ref
Commit: 322a3efd8dd55a1a625b2515aca36937b83ca033
Parents: feae9d0
Author: Francesco Chicchiriccò <--global>
Authored: Mon May 12 15:58:47 2014 +0200
Committer: Francesco Chicchiriccò <--global>
Committed: Mon May 12 15:58:47 2014 +0200
----------------------------------------------------------------------
pom.xml | 2 ++
1 file changed, 2 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/322a3efd/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index d503470..ac2cbe5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -448,6 +448,8 @@
<exclude>**/nb-configuration.xml</exclude>
<exclude>**/.externalToolBuilders/**</exclude>
<exclude>**/maven-eclipse.xml</exclude>
+ <exclude>**/checkstyle-*</exclude>
+ <exclude>**/.plxarc</exclude>
</excludes>
</configuration>
</execution>
[24/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java
new file mode 100644
index 0000000..da43d5b
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EntityTypeProvider.java
@@ -0,0 +1,408 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import java.util.Arrays;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.EntityType;
+import org.apache.olingo.server.api.edm.provider.NavigationProperty;
+import org.apache.olingo.server.api.edm.provider.Property;
+import org.apache.olingo.server.api.edm.provider.PropertyRef;
+import org.apache.olingo.server.api.edm.provider.ReferentialConstraint;
+
+public class EntityTypeProvider {
+
+ public static final FullQualifiedName nameETAllKey = new FullQualifiedName(SchemaProvider.nameSpace, "ETAllKey");
+ public static final FullQualifiedName nameETAllNullable = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETAllNullable");
+ public static final FullQualifiedName nameETAllPrim = new FullQualifiedName(SchemaProvider.nameSpace, "ETAllPrim");
+ public static final FullQualifiedName nameETBase = new FullQualifiedName(SchemaProvider.nameSpace, "ETBase");
+ public static final FullQualifiedName nameETBaseTwoKeyNav = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETBaseTwoKeyNav");
+ public static final FullQualifiedName nameETBaseTwoKeyTwoPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "ETBaseTwoKeyTwoPrim");
+ public static final FullQualifiedName nameETCollAllPrim = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETCollAllPrim");
+ public static final FullQualifiedName nameETCompAllPrim = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETCompAllPrim");
+ public static final FullQualifiedName nameETCompCollAllPrim = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETCompCollAllPrim");
+ public static final FullQualifiedName nameETCompCollComp = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETCompCollComp");
+ public static final FullQualifiedName nameETCompComp = new FullQualifiedName(SchemaProvider.nameSpace, "ETCompComp");
+ public static final FullQualifiedName nameETCompMixPrimCollComp =
+ new FullQualifiedName(SchemaProvider.nameSpace, "ETCompMixPrimCollComp");
+ public static final FullQualifiedName nameETFourKeyAlias = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETFourKeyAlias");
+ public static final FullQualifiedName nameETKeyNav = new FullQualifiedName(SchemaProvider.nameSpace, "ETKeyNav");
+ public static final FullQualifiedName nameETKeyPrimNav = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETKeyPrimNav");
+ public static final FullQualifiedName nameETKeyTwoKeyComp = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETKeyTwoKeyComp");
+ public static final FullQualifiedName nameETMedia = new FullQualifiedName(SchemaProvider.nameSpace, "ETMedia");
+ public static final FullQualifiedName nameETMixPrimCollComp = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETMixPrimCollComp");
+ public static final FullQualifiedName nameETServerSidePaging =
+ new FullQualifiedName(SchemaProvider.nameSpace, "ETServerSidePaging");
+ public static final FullQualifiedName nameETTwoBase = new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoBase");
+ public static final FullQualifiedName nameETTwoBaseTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoBaseTwoKeyNav");
+ public static final FullQualifiedName nameETTwoBaseTwoKeyTwoPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoBaseTwoKeyTwoPrim");
+ public static final FullQualifiedName nameETTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoKeyNav");
+ public static final FullQualifiedName nameETTwoKeyTwoPrim = new FullQualifiedName(SchemaProvider.nameSpace,
+ "ETTwoKeyTwoPrim");
+ public static final FullQualifiedName nameETTwoPrim = new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoPrim");
+
+ public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
+ if (entityTypeName.equals(nameETAllPrim)) {
+ return new EntityType()
+ .setName("ETAllPrim")
+ .setKey(Arrays.asList(
+ new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString,
+ PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertySByte,
+ PropertyProvider.propertyInt32, PropertyProvider.propertyInt64,
+ PropertyProvider.propertySingle, PropertyProvider.propertyDouble, PropertyProvider.propertyDecimal,
+ PropertyProvider.propertyBinary, PropertyProvider.propertyDate, PropertyProvider.propertyDateTimeOffset,
+ PropertyProvider.propertyDuration, PropertyProvider.propertyGuid, PropertyProvider.propertyTimeOfDay
+ /* TODO add propertyStream */))
+ .setNavigationProperties(Arrays.asList(PropertyProvider.navPropertyETTwoPrimOne_ETTwoPrim,
+ PropertyProvider.collectionNavPropertyETTwoPrimMany_ETTwoPrim));
+
+ } else if (entityTypeName.equals(nameETCollAllPrim)) {
+ return new EntityType()
+ .setName("ETCollAllPrim")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+
+ .setProperties(
+ Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.collPropertyString,
+ PropertyProvider.collPropertyBoolean, PropertyProvider.collPropertyByte,
+ PropertyProvider.collPropertySByte, PropertyProvider.collPropertyInt16,
+ PropertyProvider.collPropertyInt32, PropertyProvider.collPropertyInt64,
+ PropertyProvider.collPropertySingle, PropertyProvider.collPropertyDouble,
+ PropertyProvider.collPropertyDecimal, PropertyProvider.collPropertyBinary,
+ PropertyProvider.collPropertyDate, PropertyProvider.collPropertyDateTimeOffset,
+ PropertyProvider.collPropertyDuration, PropertyProvider.collPropertyGuid,
+ PropertyProvider.collPropertyTimeOfDay /* TODO add propertyStream */));
+
+ } else if (entityTypeName.equals(nameETTwoPrim)) {
+ return new EntityType()
+ .setName("ETTwoPrim")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString))
+ .setNavigationProperties(
+ Arrays.asList(PropertyProvider.navPropertyETAllPrimOne_ETAllPrim,
+ PropertyProvider.collectionNavPropertyETAllPrimMany_ETAllPrim));
+
+ } else if (entityTypeName.equals(nameETMixPrimCollComp)) {
+ return new EntityType()
+ .setName("ETMixPrimCollComp")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.collPropertyString,
+ PropertyProvider.propertyComplex_CTTwoPrim, PropertyProvider.collPropertyComplex_CTTwoPrim));
+
+ } else if (entityTypeName.equals(nameETTwoKeyTwoPrim)) {
+ return new EntityType()
+ .setName("ETTwoKeyTwoPrim")
+ .setKey(Arrays.asList(
+ new PropertyRef().setPropertyName("PropertyInt16"),
+ new PropertyRef().setPropertyName("PropertyString")))
+ .setProperties(Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString));
+
+ } else if (entityTypeName.equals(nameETBaseTwoKeyTwoPrim)) {
+ return new EntityType()
+ .setName("ETBaseTwoKeyTwoPrim")
+ .setBaseType(nameETTwoKeyTwoPrim);
+
+ } else if (entityTypeName.equals(nameETTwoBaseTwoKeyTwoPrim)) {
+ return new EntityType()
+ .setName("ETTwoBaseTwoKeyTwoPrim")
+ .setBaseType(nameETTwoKeyTwoPrim);
+
+ } else if (entityTypeName.equals(nameETBase)) {
+ return new EntityType()
+ .setName("ETBase")
+ .setBaseType(nameETTwoPrim)
+ .setProperties(Arrays.asList(new Property()
+ .setName("AdditionalPropertyString_5")
+ .setType(PropertyProvider.nameString)));
+
+ } else if (entityTypeName.equals(nameETTwoBase)) {
+ return new EntityType()
+ .setName("ETTwoBase")
+ .setBaseType(nameETBase)
+ .setProperties(Arrays.asList(new Property()
+ .setName("AdditionalPropertyString_6")
+ .setType(PropertyProvider.nameString))
+ );
+
+ } else if (entityTypeName.equals(nameETAllKey)) {
+ return new EntityType()
+ .setName("ETAllKey")
+ .setKey(Arrays.asList(
+ new PropertyRef().setPropertyName("PropertyString"),
+ new PropertyRef().setPropertyName("PropertyBoolean"),
+ new PropertyRef().setPropertyName("PropertyByte"),
+ new PropertyRef().setPropertyName("PropertySByte"),
+ new PropertyRef().setPropertyName("PropertyInt16"),
+ new PropertyRef().setPropertyName("PropertyInt32"),
+ new PropertyRef().setPropertyName("PropertyInt64"),
+ new PropertyRef().setPropertyName("PropertyDecimal"),
+ new PropertyRef().setPropertyName("PropertyDate"),
+ new PropertyRef().setPropertyName("PropertyDateTimeOffset"),
+ new PropertyRef().setPropertyName("PropertyDuration"),
+ new PropertyRef().setPropertyName("PropertyGuid"),
+ new PropertyRef().setPropertyName("PropertyTimeOfDay")))
+ .setProperties(
+ Arrays.asList(
+ PropertyProvider.propertyString_NotNullable, PropertyProvider.propertyBoolean_NotNullable,
+ PropertyProvider.propertyByte_NotNullable, PropertyProvider.propertySByte_NotNullable,
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyInt32_NotNullable,
+ PropertyProvider.propertyInt64_NotNullable,
+ PropertyProvider.propertyDecimal_NotNullable, PropertyProvider.propertyDate_NotNullable,
+ PropertyProvider.propertyDateTimeOffset_NotNullable,
+ PropertyProvider.propertyDuration_NotNullable, PropertyProvider.propertyGuid_NotNullable,
+ PropertyProvider.propertyTimeOfDay_NotNullable /* TODO add propertyStream */));
+
+ } else if (entityTypeName.equals(nameETCompAllPrim)) {
+ return new EntityType()
+ .setName("ETCompAllPrim")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(
+ Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTAllPrim));
+
+ } else if (entityTypeName.equals(nameETCompCollAllPrim)) {
+ return new EntityType()
+ .setName("ETCompCollAllPrim")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+
+ .setProperties(
+ Arrays.asList(PropertyProvider.propertyInt16_NotNullable,
+ PropertyProvider.propertyComplex_CTCollAllPrim));
+
+ } else if (entityTypeName.equals(nameETCompComp)) {
+ return new EntityType()
+ .setName("ETCompComp")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(
+ Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTCompComp));
+
+ } else if (entityTypeName.equals(nameETCompCollComp)) {
+ return new EntityType()
+ .setName("ETCompCollComp")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(
+ Arrays
+ .asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTCompCollComp));
+
+ } else if (entityTypeName.equals(nameETMedia)) {
+ return new EntityType()
+ .setName("ETMedia")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(Arrays.asList(PropertyProvider.propertyInt16_NotNullable))
+ .setHasStream(true);
+
+ } else if (entityTypeName.equals(nameETKeyTwoKeyComp)) {
+ return new EntityType()
+ .setName("ETKeyTwoKeyComp")
+ .setKey(Arrays.asList(
+ new PropertyRef()
+ .setPropertyName("PropertyInt16"),
+ new PropertyRef()
+ .setPropertyName("PropertyComplex/PropertyInt16")
+ .setAlias("KeyAlias1"),
+ new PropertyRef()
+ .setPropertyName("PropertyComplex/PropertyString")
+ .setAlias("KeyAlias2"),
+ new PropertyRef()
+ .setPropertyName("PropertyComplexComplex/PropertyComplex/PropertyString")
+ .setAlias("KeyAlias3")))
+ .setProperties(
+ Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTTwoPrim,
+ PropertyProvider.propertyComplexComplex_CTCompComp));
+
+ } else if (entityTypeName.equals(nameETServerSidePaging)) {
+ return new EntityType()
+ .setName(nameETServerSidePaging.getName())
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(Arrays.asList(PropertyProvider.propertyInt16_NotNullable,
+ PropertyProvider.propertyString_NotNullable));
+
+ } else if (entityTypeName.equals(nameETAllNullable)) {
+ return new EntityType()
+ .setName("ETAllNullable")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyKey")))
+ .setProperties(
+ Arrays.asList(
+ new Property()
+ .setName("PropertyKey").setType(PropertyProvider.nameInt16).setNullable(false),
+ PropertyProvider.propertyInt16_ExplicitNullable, PropertyProvider.propertyString_ExplicitNullable,
+ PropertyProvider.propertyBoolean_ExplicitNullable, PropertyProvider.propertyByte_ExplicitNullable,
+ PropertyProvider.propertySByte_ExplicitNullable, PropertyProvider.propertyInt32_ExplicitNullable,
+ PropertyProvider.propertyInt64_ExplicitNullable, PropertyProvider.propertySingle_ExplicitNullable,
+ PropertyProvider.propertyDouble_ExplicitNullable, PropertyProvider.propertyDecimal_ExplicitNullable,
+ PropertyProvider.propertyBinary_ExplicitNullable, PropertyProvider.propertyDate_ExplicitNullable,
+ PropertyProvider.propertyDateTimeOffset_ExplicitNullable,
+ PropertyProvider.propertyDuration_ExplicitNullable, PropertyProvider.propertyGuid_ExplicitNullable,
+ PropertyProvider.propertyTimeOfDay_ExplicitNullable /* TODO add propertyStream */,
+ PropertyProvider.collPropertyString_ExplicitNullable,
+ PropertyProvider.collPropertyBoolean_ExplicitNullable,
+ PropertyProvider.collPropertyByte_ExplicitNullable,
+ PropertyProvider.collPropertySByte_ExplicitNullable,
+ PropertyProvider.collPropertyInt16_ExplicitNullable,
+ PropertyProvider.collPropertyInt32_ExplicitNullable,
+ PropertyProvider.collPropertyInt64_ExplicitNullable,
+ PropertyProvider.collPropertySingle_ExplicitNullable,
+ PropertyProvider.collPropertyDouble_ExplicitNullable,
+ PropertyProvider.collPropertyDecimal_ExplicitNullable,
+ PropertyProvider.collPropertyBinary_ExplicitNullable,
+ PropertyProvider.collPropertyDate_ExplicitNullable,
+ PropertyProvider.collPropertyDateTimeOffset_ExplicitNullable,
+ PropertyProvider.collPropertyDuration_ExplicitNullable,
+ PropertyProvider.collPropertyGuid_ExplicitNullable,
+ PropertyProvider.collPropertyTimeOfDay_ExplicitNullable /* TODO add propertyStream */));
+
+ } else if (entityTypeName.equals(nameETKeyNav)) {
+ return new EntityType()
+ .setName("ETKeyNav")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(
+ Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
+ PropertyProvider.propertyComplex_CTNavFiveProp,
+ PropertyProvider.propertyComplexAllPrim_CTAllPrim, PropertyProvider.propertyComplexTwoPrim_CTTwoPrim,
+ PropertyProvider.collPropertyString, PropertyProvider.collPropertyInt16,
+ PropertyProvider.collPropertyComplex_CTPrimComp,
+ new Property()
+ .setName("PropertyComplexComplex").setType(ComplexTypeProvider.nameCTCompNav)
+ ))
+ .setNavigationProperties(
+ Arrays.asList(
+ PropertyProvider.navPropertyETTwoKeyNavOne_ETTwoKeyNav_NotNullable,
+ PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav,
+ PropertyProvider.navPropertyETKeyNavOne_ETKeyNav,
+ PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav,
+ PropertyProvider.navPropertyETMediaOne_ETMedia,
+ PropertyProvider.collectionNavPropertyETMediaMany_ETMedia
+ ));
+ } else if (entityTypeName.equals(nameETKeyPrimNav)) {
+ return new EntityType()
+ .setName("ETKeyPrimNav")
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_ExplicitNullable))
+ .setNavigationProperties(
+ Arrays.asList(
+ PropertyProvider.navPropertyETKeyPrimNavOne_ETKeyPrimNav));
+
+ } else if (entityTypeName.equals(nameETTwoKeyNav)) {
+ return new EntityType()
+ .setName("ETTwoKeyNav")
+ .setKey(Arrays.asList(
+ new PropertyRef().setPropertyName("PropertyInt16"),
+ new PropertyRef().setPropertyName("PropertyString")))
+ .setProperties(
+ Arrays.asList(
+ PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
+ PropertyProvider.propertyComplex_CTPrimComp_NotNullable,
+ new Property().setName("PropertyComplexNav").setType(ComplexTypeProvider.nameCTBasePrimCompNav)
+ .setNullable(false),
+ PropertyProvider.propertyComplexEnum_CTPrimEnum_NotNullable,
+ PropertyProvider.collPropertyComplex_CTPrimComp,
+ new Property().setName("CollPropertyComplexNav").setType(ComplexTypeProvider.nameCTNavFiveProp)
+ .setCollection(true),
+ PropertyProvider.collPropertyString, PropertyProvider.propertyComplexTwoPrim_CTTwoPrim,
+ PropertyProvider.propertyEnumString_ENString
+ ))
+ .setNavigationProperties(Arrays.asList(
+ new NavigationProperty()
+ .setName("NavPropertyETKeyNavOne")
+ .setType(nameETKeyNav)
+ .setReferentialConstraints(Arrays.asList(
+ new ReferentialConstraint()
+ .setProperty("PropertyInt16")
+ .setReferencedProperty("PropertyInt16"))),
+ PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav,
+ PropertyProvider.navPropertyETTwoKeyNavOne_ETTwoKeyNav,
+ PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav));
+
+ } else if (entityTypeName.equals(nameETBaseTwoKeyNav)) {
+ return new EntityType()
+ .setName("ETBaseTwoKeyNav")
+ .setBaseType(nameETTwoKeyNav)
+ .setProperties(Arrays.asList(PropertyProvider.propertyDate_ExplicitNullable))
+ .setNavigationProperties(Arrays.asList(
+ new NavigationProperty()
+ .setName("NavPropertyETBaseTwoKeyNavOne")
+ .setType(nameETBaseTwoKeyNav),
+ new NavigationProperty()
+ .setName("NavPropertyETTwoBaseTwoKeyNavOne")
+ .setType(nameETTwoBaseTwoKeyNav)));
+
+ } else if (entityTypeName.equals(nameETTwoBaseTwoKeyNav)) {
+ return new EntityType()
+ .setName("ETTwoBaseTwoKeyNav")
+ .setBaseType(nameETBaseTwoKeyNav)
+ .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
+ .setProperties(Arrays.asList(PropertyProvider.propertyGuid_ExplicitNullable))
+ .setNavigationProperties(Arrays.asList(
+ new NavigationProperty()
+ .setName("NavPropertyETBaseTwoKeyNavMany")
+ .setType(nameETBaseTwoKeyNav)
+ .setCollection(true)
+ ));
+
+ } else if (entityTypeName.equals(nameETFourKeyAlias)) {
+ return new EntityType()
+ .setName("ETFourKeyAlias")
+ .setKey(
+ Arrays.asList(
+ new PropertyRef().setPropertyName("PropertyInt16"),
+ new PropertyRef().setPath("PropertyComplex/PropertyInt16").setPropertyName("PropertyInt16").setAlias(
+ "KeyAlias1"),
+ new PropertyRef().setPath("PropertyComplex/PropertyString").setPropertyName("PropertyString")
+ .setAlias("KeyAlias2"),
+ new PropertyRef().setPath("PropertyComplexComplex/PropertyComplex/PropertyString").setPropertyName(
+ "PropertyString").setAlias("KeyAlias3"))).setProperties(
+ Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTTwoPrim,
+ PropertyProvider.propertyComplexComplex_CTCompComp));
+ } else if (entityTypeName.equals(nameETCompMixPrimCollComp)) {
+ return new EntityType()
+ .setName("ETCompMixPrimCollComp")
+ .setKey(Arrays.asList(
+ new PropertyRef()
+ .setPropertyName("PropertyInt16")))
+ .setProperties(
+ Arrays.asList(PropertyProvider.propertyInt16_NotNullable,
+ PropertyProvider.propertyMixedPrimCollComp_CTMixPrimCollComp));
+ }
+
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.java
new file mode 100644
index 0000000..80f9bf3
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/EnumTypeProvider.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.server.tecsvc.provider;
+
+import java.util.Arrays;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.EnumMember;
+import org.apache.olingo.server.api.edm.provider.EnumType;
+
+public class EnumTypeProvider {
+
+ public static final FullQualifiedName nameENString = new FullQualifiedName(SchemaProvider.nameSpace, "ENString");
+
+ public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
+ if (enumTypeName.equals(nameENString)) {
+ return new EnumType()
+ .setName("ENString")
+ .setFlags(true)
+ .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName())
+ .setMembers(Arrays.asList(
+ new EnumMember().setName("String1").setValue("1"),
+ new EnumMember().setName("String2").setValue("2"),
+ new EnumMember().setName("String3").setValue("3")));
+ }
+
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java
new file mode 100644
index 0000000..dc3a1f7
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/FunctionProvider.java
@@ -0,0 +1,852 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.Function;
+import org.apache.olingo.server.api.edm.provider.Parameter;
+import org.apache.olingo.server.api.edm.provider.ReturnType;
+
+public class FunctionProvider {
+
+ // Bound Functions
+ public static final FullQualifiedName nameBFCCollCTPrimCompRTESAllPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCCollCTPrimCompRTESAllPrim");
+
+ public static final FullQualifiedName nameBFCCollStringRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCCollStringRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCCTPrimCompRTESBaseTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCCTPrimCompRTESBaseTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCCTPrimCompRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCCTPrimCompRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCCTPrimCompRTESTwoKeyNavParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCCTPrimCompRTESTwoKeyNavParam");
+
+ public static final FullQualifiedName nameBFCCTPrimCompRTETTwoKeyNavParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCCTPrimCompRTETTwoKeyNavParam");
+
+ public static final FullQualifiedName nameBFCESAllPrimRTCTAllPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESAllPrimRTCTAllPrim");
+
+ public static final FullQualifiedName nameBFCESBaseTwoKeyNavRTESBaseTwoKey =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESBaseTwoKeyNavRTESBaseTwoKey");
+
+ public static final FullQualifiedName nameBFCESKeyNavRTETKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESKeyNavRTETKeyNav");
+
+ public static final FullQualifiedName nameBFCESKeyNavRTETKeyNavParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESKeyNavRTETKeyNavParam");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTTwoPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCollCTTwoPrim");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTCollString =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCollString");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTCTTwoPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCTTwoPrim");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTString =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTString");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTStringParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTStringParam");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCESTwoKeyNavRTTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCETBaseTwoKeyNavRTESBaseTwoKey =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCETBaseTwoKeyNavRTESBaseTwoKey");
+
+ public static final FullQualifiedName nameBFCETBaseTwoKeyNavRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCETBaseTwoKeyNavRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCETBaseTwoKeyNavRTETTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCETBaseTwoKeyNavRTETTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCETKeyNavRTETKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCETKeyNavRTETKeyNav");
+
+ public static final FullQualifiedName nameBFCETTwoKeyNavRTCTTwoPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCETTwoKeyNavRTCTTwoPrim");
+
+ public static final FullQualifiedName nameBFCETTwoKeyNavRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCETTwoKeyNavRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCETTwoKeyNavRTETTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCETTwoKeyNavRTETTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCSINavRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCSINavRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBFCStringRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFCStringRTESTwoKeyNav");
+
+ public static final FullQualifiedName nameBFESTwoKeyNavRTESTwoKeyNav =
+ new FullQualifiedName(SchemaProvider.nameSpace, "BFESTwoKeyNavRTESTwoKeyNav");
+
+ // Unbound Functions
+ public static final FullQualifiedName nameUFCRTCollCTTwoPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCollCTTwoPrim");
+ public static final FullQualifiedName nameUFCRTCollCTTwoPrimParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCollCTTwoPrimParam");
+ public static final FullQualifiedName nameUFCRTCollString = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UFCRTCollString");
+ public static final FullQualifiedName nameUFCRTCollStringTwoParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCollStringTwoParam");
+ public static final FullQualifiedName nameUFCRTCTAllPrimTwoParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCTAllPrimTwoParam");
+ public static final FullQualifiedName nameUFCRTCTTwoPrim = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UFCRTCTTwoPrim");
+ public static final FullQualifiedName nameUFCRTCTTwoPrimParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTCTTwoPrimParam");
+ public static final FullQualifiedName nameUFCRTESMixPrimCollCompTwoParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTESMixPrimCollCompTwoParam");
+ public static final FullQualifiedName nameUFCRTESTwoKeyNavParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTESTwoKeyNavParam");
+ public static final FullQualifiedName nameUFCRTETAllPrimTwoParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTETAllPrimTwoParam");
+ public static final FullQualifiedName nameUFCRTETKeyNav = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UFCRTETKeyNav");
+ public static final FullQualifiedName nameUFCRTETMedia = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UFCRTETMedia");
+
+ public static final FullQualifiedName nameUFCRTETTwoKeyNavParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTETTwoKeyNavParam");
+
+ public static final FullQualifiedName nameUFCRTETTwoKeyNavParamCTTwoPrim =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTETTwoKeyNavParamCTTwoPrim");
+
+ public static final FullQualifiedName nameUFCRTString =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTString");
+
+ public static final FullQualifiedName nameUFCRTStringTwoParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFCRTStringTwoParam");
+
+ public static final FullQualifiedName nameUFNRTESMixPrimCollCompTwoParam =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFNRTESMixPrimCollCompTwoParam");
+ public static final FullQualifiedName nameUFNRTInt16 =
+ new FullQualifiedName(SchemaProvider.nameSpace, "UFNRTInt16");
+
+ public static final FullQualifiedName nameUFNRTCollCTNavFiveProp = new FullQualifiedName(SchemaProvider.nameSpace,
+ "UFNRTCollCTNavFiveProp");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTCTNavFiveProp = new FullQualifiedName(
+ SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCTNavFiveProp");
+
+ public static final FullQualifiedName nameBFCESTwoKeyNavRTCollCTNavFiveProp = new FullQualifiedName(
+ SchemaProvider.nameSpace, "BFCESTwoKeyNavRTCollCTNavFiveProp");
+
+ public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
+
+ if (functionName.equals(nameUFNRTInt16)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFNRTInt16")
+ .setParameters(new ArrayList<Parameter>())
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameInt16))
+ );
+
+ } else if (functionName.equals(nameUFCRTETKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTETKeyNav")
+ .setParameters(new ArrayList<Parameter>())
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTETTwoKeyNavParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTETTwoKeyNavParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)
+ )
+ );
+
+ } else if (functionName.equals(nameUFCRTETTwoKeyNavParamCTTwoPrim)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTETTwoKeyNavParamCTTwoPrim")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterCTTwoPrim").setType(ComplexTypeProvider.nameCTTwoPrim)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)
+ )
+ );
+
+ } else if (functionName.equals(nameUFCRTStringTwoParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTStringTwoParam")
+ .setParameters(Arrays.asList(
+ new Parameter()
+ .setName("ParameterInt16")
+ .setType(PropertyProvider.nameInt16)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameString).setNullable(false)),
+ new Function()
+ .setName("UFCRTStringTwoParam")
+ .setParameters(Arrays.asList(
+ new Parameter()
+ .setName("ParameterString")
+ .setType(PropertyProvider.nameString)
+ .setNullable(false),
+ new Parameter()
+ .setName("ParameterInt16")
+ .setType(PropertyProvider.nameInt16)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(new ReturnType().setType(PropertyProvider.nameString).setNullable(false))
+
+ );
+
+ } else if (functionName.equals(nameUFCRTESTwoKeyNavParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTESTwoKeyNavParam")
+ .setParameters(Arrays.asList(
+ new Parameter()
+ .setName("ParameterInt16")
+ .setType(PropertyProvider.nameInt16)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTString)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTString")
+
+ .setComposable(true)
+ .setParameters(new ArrayList<Parameter>())
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameString).setNullable(false)
+ )
+ );
+
+ } else if (functionName.equals(nameUFCRTCollStringTwoParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTCollStringTwoParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTCollString)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTCollString")
+ .setParameters(new ArrayList<Parameter>())
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTCTAllPrimTwoParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTCTAllPrimTwoParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTCTTwoPrimParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTCTTwoPrimParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false),
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(true)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
+ );
+ } else if (functionName.equals(nameUFCRTCollCTTwoPrimParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTCollCTTwoPrimParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false),
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(true)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTCTTwoPrim)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTCTTwoPrim")
+ .setParameters(new ArrayList<Parameter>())
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTCollCTTwoPrim)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTCollCTTwoPrim")
+ .setComposable(true)
+ .setParameters(new ArrayList<Parameter>())
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTETMedia)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTETMedia")
+ .setParameters(new ArrayList<Parameter>())
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETMedia).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFNRTESMixPrimCollCompTwoParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFNRTESMixPrimCollCompTwoParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
+ .setComposable(false)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETMixPrimCollComp).setCollection(true)
+ .setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTETAllPrimTwoParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTETAllPrimTwoParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFCRTESMixPrimCollCompTwoParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFCRTESMixPrimCollCompTwoParam")
+ .setParameters(Arrays.asList(
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString).setNullable(false),
+ new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16).setNullable(false)
+ ))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETMixPrimCollComp).setCollection(true)
+ .setNullable(false))
+ );
+
+ } else if (functionName.equals(nameUFNRTCollCTNavFiveProp)) {
+ return Arrays.asList(
+ new Function()
+ .setName("UFNRTCollCTNavFiveProp")
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setCollection(true))
+ );
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTESTwoKeyNav)) {
+ return Arrays
+ .asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)
+ .setNullable(false)),
+
+ new Function()
+ .setName("BFCESTwoKeyNavRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false),
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
+ .setCollection(false).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)
+ .setNullable(false)),
+ new Function()
+ .setName("BFCESTwoKeyNavRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)
+ .setNullable(false)),
+ new Function()
+ .setName("BFCESTwoKeyNavRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav)
+ .setCollection(true).setNullable(false),
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
+ .setCollection(false).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true)
+ .setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCStringRTESTwoKeyNav)) {
+ return Arrays.asList(
+ new Function().setName("BFCStringRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(Arrays.asList(
+ new Parameter().setName("BindingParam").setType(PropertyProvider.nameString).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTETTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCETBaseTwoKeyNavRTETTwoKeyNav")
+ .setBound(true)
+ .setParameters(Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)
+ )
+ );
+
+ } else if (functionName.equals(nameBFCESBaseTwoKeyNavRTESBaseTwoKey)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESBaseTwoKeyNavRTESBaseTwoKey")
+ .setBound(true)
+ .setParameters(Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true)
+ .setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCESAllPrimRTCTAllPrim)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESAllPrimRTCTAllPrim")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETAllPrim)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTAllPrim).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTCTTwoPrim)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTCTTwoPrim")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTCollCTTwoPrim)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTCollCTTwoPrim")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTString)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTString")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameString).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTCollString)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTCollString")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameString).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCETTwoKeyNavRTESTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCETTwoKeyNavRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTESTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCETBaseTwoKeyNavRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCSINavRTESTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCSINavRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(
+ false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCETBaseTwoKeyNavRTESBaseTwoKey)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCETBaseTwoKeyNavRTESBaseTwoKey")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true).setNullable(
+ false))
+ );
+
+ } else if (functionName.equals(nameBFCCollStringRTESTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCCollStringRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(PropertyProvider.nameString).setCollection(true)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCCTPrimCompRTESTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCCTPrimCompRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable(
+ false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCCTPrimCompRTESBaseTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCCTPrimCompRTESBaseTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable(
+ false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav).setCollection(true).setNullable(
+ false))
+ );
+
+ } else if (functionName.equals(nameBFCCollCTPrimCompRTESAllPrim)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCCollCTPrimCompRTESAllPrim")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETAllPrim).setCollection(true).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCESKeyNavRTETKeyNav)) {
+ return Arrays
+ .asList(
+ new Function()
+ .setName("BFCESKeyNavRTETKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setCollection(
+ true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCETKeyNavRTETKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCETKeyNavRTETKeyNav")
+ .setBound(true)
+ .setParameters(Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
+ );
+ } else if (functionName.equals(nameBFESTwoKeyNavRTESTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFESTwoKeyNavRTESTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+
+ );
+
+ } else if (functionName.equals(nameBFCETTwoKeyNavRTETTwoKeyNav)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCETTwoKeyNavRTETTwoKeyNav")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(
+ false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCETTwoKeyNavRTCTTwoPrim)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCETTwoKeyNavRTCTTwoPrim")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(
+ false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setNullable(false))
+ );
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTCTNavFiveProp)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTCTNavFiveProp")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setNullable(false))
+ );
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTCollCTNavFiveProp)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTCollCTNavFiveProp")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(ComplexTypeProvider.nameCTNavFiveProp).setCollection(true)
+ .setNullable(false))
+ );
+ } else if (functionName.equals(nameBFCESTwoKeyNavRTStringParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESTwoKeyNavRTStringParam")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true).setNullable(false),
+ new Parameter().setName("ParameterComplex").setType(ComplexTypeProvider.nameCTTwoPrim)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(PropertyProvider.nameString).setNullable(false))
+ );
+
+ } else if (functionName.equals(nameBFCESKeyNavRTETKeyNavParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCESKeyNavRTETKeyNavParam")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(EntityTypeProvider.nameETKeyNav).setCollection(
+ true).setNullable(false),
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setNullable(false))
+ );
+ } else if (functionName.equals(nameBFCCTPrimCompRTETTwoKeyNavParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCCTPrimCompRTETTwoKeyNavParam")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable(
+ false),
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(new ReturnType()
+ .setType(EntityTypeProvider.nameETTwoKeyNav).setNullable(false)
+ )
+ );
+ } else if (functionName.equals(nameBFCCTPrimCompRTESTwoKeyNavParam)) {
+ return Arrays.asList(
+ new Function()
+ .setName("BFCCTPrimCompRTESTwoKeyNavParam")
+ .setBound(true)
+ .setParameters(
+ Arrays.asList(
+ new Parameter().setName("BindingParam").setType(ComplexTypeProvider.nameCTPrimComp).setNullable(
+ false),
+ new Parameter().setName("ParameterString").setType(PropertyProvider.nameString)
+ .setNullable(false)))
+ .setComposable(true)
+ .setReturnType(
+ new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true).setNullable(false))
+ );
+ }
+
+ return null;
+ }
+
+}
[22/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
new file mode 100644
index 0000000..d6beef0
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriResourceImplTest.java
@@ -0,0 +1,508 @@
+/*
+ * 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.server.core.uri;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmAction;
+import org.apache.olingo.commons.api.edm.EdmActionImport;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmFunction;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.commons.api.edm.EdmNavigationProperty;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.EdmProperty;
+import org.apache.olingo.commons.api.edm.EdmType;
+import org.apache.olingo.commons.core.edm.primitivetype.EdmPrimitiveTypeFactory;
+import org.apache.olingo.server.api.uri.UriResourceKind;
+import org.apache.olingo.server.core.edm.provider.EdmComplexTypeImpl;
+import org.apache.olingo.server.core.edm.provider.EdmEntitySetImpl;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.core.edm.provider.EdmSingletonImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.ExpressionImpl;
+import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
+import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
+import org.apache.olingo.server.tecsvc.provider.ActionProvider;
+import org.apache.olingo.server.tecsvc.provider.ComplexTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
+import org.junit.Test;
+
+public class UriResourceImplTest {
+
+ Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
+
+ @Test
+ public void testUriParameterImpl() {
+ UriParameterImpl impl = new UriParameterImpl();
+ ExpressionImpl expression = new LiteralImpl().setText("Expression");
+
+ impl.setText("Text");
+ impl.setName("A");
+ impl.setAlias("@A");
+ impl.setExpression(expression);
+
+ assertEquals("Text", impl.getText());
+ assertEquals("A", impl.getName());
+ assertEquals("@A", impl.getAlias());
+ assertEquals(expression, impl.getExression());
+ }
+
+ @Test
+ public void testUriResourceActionImpl() {
+ UriResourceActionImpl impl = new UriResourceActionImpl();
+ assertEquals(UriResourceKind.action, impl.getKind());
+ assertEquals("", impl.toString());
+
+ // action
+ EdmAction action = edm.getUnboundAction(ActionProvider.nameUARTETParam);
+ impl.setAction(action);
+ assertEquals(action, impl.getAction());
+ assertEquals(ActionProvider.nameUARTETParam.getName(), impl.toString());
+
+ // action import
+ impl = new UriResourceActionImpl();
+ EdmActionImport actionImport = edm.getEntityContainer(null).getActionImport("AIRTPrimParam");
+ impl.setActionImport(actionImport);
+ assertEquals(actionImport, impl.getActionImport());
+ assertEquals(actionImport.getUnboundAction(), impl.getAction());
+ assertEquals(false, impl.isCollection());
+ assertEquals("AIRTPrimParam", impl.toString());
+ assertEquals(actionImport.getUnboundAction().getReturnType().getType(), impl.getType());
+ }
+
+ @Test
+ public void testUriResourceLambdaAllImpl() {
+ UriResourceLambdaAllImpl impl = new UriResourceLambdaAllImpl();
+ assertEquals(UriResourceKind.lambdaAll, impl.getKind());
+
+ ExpressionImpl expression = new LiteralImpl().setText("Expression");
+ impl.setExpression(expression);
+ impl.setLamdaVariable("A");
+
+ assertEquals(false, impl.isCollection());
+ assertEquals(expression, impl.getExpression());
+ assertEquals("A", impl.getLambdaVariable());
+ assertEquals(EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean), impl.getType());
+ assertEquals("all", impl.toString());
+ }
+
+ @Test
+ public void testUriResourceLambdaAnyImpl() {
+ UriResourceLambdaAnyImpl impl = new UriResourceLambdaAnyImpl();
+ assertEquals(UriResourceKind.lambdaAny, impl.getKind());
+
+ ExpressionImpl expression = new LiteralImpl().setText("Expression");
+ impl.setExpression(expression);
+ impl.setLamdaVariable("A");
+
+ assertEquals(false, impl.isCollection());
+ assertEquals(expression, impl.getExpression());
+ assertEquals("A", impl.getLamdaVariable());
+ assertEquals(EdmPrimitiveTypeFactory.getInstance(EdmPrimitiveTypeKind.Boolean), impl.getType());
+ assertEquals("any", impl.toString());
+ }
+
+ @Test
+ public void testUriResourceComplexPropertyImpl() {
+ UriResourceComplexPropertyImpl impl = new UriResourceComplexPropertyImpl();
+ assertEquals(UriResourceKind.complexProperty, impl.getKind());
+
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
+ EdmProperty property = (EdmProperty) entityType.getProperty("PropertyComplex");
+ impl.setProperty(property);
+
+ assertEquals(property, impl.getProperty());
+ assertEquals(property.getName(), impl.toString());
+ assertEquals(false, impl.isCollection());
+ assertEquals(property.getType(), impl.getType());
+ assertEquals(property.getType(), impl.getComplexType());
+ impl.getComplexType();
+
+ EdmComplexTypeImpl complexTypeImplType =
+ (EdmComplexTypeImpl) edm.getComplexType(ComplexTypeProvider.nameCTBasePrimCompNav);
+
+ impl.setTypeFilter(complexTypeImplType);
+ assertEquals(complexTypeImplType, impl.getTypeFilter());
+ assertEquals(complexTypeImplType, impl.getComplexTypeFilter());
+ impl.getComplexTypeFilter();
+
+ }
+
+ @Test
+ public void testUriResourcePrimitivePropertyImpl() {
+ UriResourcePrimitivePropertyImpl impl = new UriResourcePrimitivePropertyImpl();
+ assertEquals(UriResourceKind.primitiveProperty, impl.getKind());
+
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
+ EdmProperty property = (EdmProperty) entityType.getProperty("PropertyInt16");
+ impl.setProperty(property);
+
+ assertEquals(property, impl.getProperty());
+ assertEquals(property.getName(), impl.toString());
+ assertEquals(false, impl.isCollection());
+ assertEquals(property.getType(), impl.getType());
+ }
+
+ @Test
+ public void testUriResourceCountImpl() {
+ UriResourceCountImpl impl = new UriResourceCountImpl();
+ assertEquals(UriResourceKind.count, impl.getKind());
+ assertEquals("$count", impl.toString());
+ }
+
+ @Test
+ public void testUriResourceEntitySetImpl() {
+ UriResourceEntitySetImpl impl = new UriResourceEntitySetImpl();
+ assertEquals(UriResourceKind.entitySet, impl.getKind());
+
+ EdmEntitySetImpl entitySet = (EdmEntitySetImpl) edm.getEntityContainer(null).getEntitySet("ESAllPrim");
+ impl.setEntitSet(entitySet);
+
+ assertEquals("ESAllPrim", impl.toString());
+ assertEquals(entitySet, impl.getEntitySet());
+
+ assertEquals(entitySet.getEntityType(), impl.getType());
+ assertEquals(entitySet.getEntityType(), impl.getEntityType());
+ impl.getEntityType();
+
+ // is Collection
+ assertEquals(true, impl.isCollection());
+ impl.setKeyPredicates(new ArrayList<UriParameterImpl>());
+ assertEquals(false, impl.isCollection());
+ }
+
+ @Test
+ public void testUriResourceFunctionImpl() {
+ UriResourceFunctionImpl impl = new UriResourceFunctionImpl();
+ assertEquals(UriResourceKind.function, impl.getKind());
+ assertEquals("", impl.toString());
+
+ // function
+ EdmFunction function = (EdmFunction) edm.getEntityContainer(null).getFunctionImport("FINRTInt16")
+ .getUnboundFunction(new ArrayList<String>());
+ assertNotNull(function);
+ impl.setFunction(function);
+
+ assertEquals(function, impl.getFunction());
+ assertEquals("UFNRTInt16", impl.toString());
+ assertEquals(function.getReturnType().getType(), impl.getType());
+ assertEquals(false, impl.isParameterListFilled());
+
+ // function import
+ impl = new UriResourceFunctionImpl();
+ EdmFunctionImport functionImport = edm.getEntityContainer(null).getFunctionImport("FINRTInt16");
+ impl.setFunctionImport(functionImport, new ArrayList<UriParameterImpl>());
+ assertEquals(functionImport, impl.getFunctionImport());
+ assertEquals("FINRTInt16", impl.toString());
+
+ // function collection
+ impl = new UriResourceFunctionImpl();
+ functionImport = edm.getEntityContainer(null).getFunctionImport("FICRTESTwoKeyNavParam");
+ assertNotNull(function);
+ UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
+ impl.setFunctionImport(functionImport, Arrays.asList(parameter));
+ assertEquals("FICRTESTwoKeyNavParam", impl.toString());
+
+ impl.setFunction(functionImport.getUnboundFunction(Arrays.asList("ParameterInt16")));
+ assertEquals(true, impl.isCollection());
+ impl.setKeyPredicates(new ArrayList<UriParameterImpl>());
+ assertEquals(false, impl.isCollection());
+
+ assertEquals(parameter, impl.getParameters().get(0));
+ assertEquals(true, impl.isParameterListFilled());
+ }
+
+ @Test
+ public void testUriResourceImplKeyPred() {
+ class Mock extends UriResourceWithKeysImpl {
+
+ EdmType type;
+
+ public Mock() {
+ super(UriResourceKind.action);
+ }
+
+ @Override
+ public EdmType getType() {
+ return type;
+ }
+
+ public Mock setType(final EdmType type) {
+ this.type = type;
+ return this;
+ }
+
+ @Override
+ public boolean isCollection() {
+ return false;
+ }
+
+ @Override
+ public String toString() {
+ return "mock";
+ }
+ }
+
+ Mock impl = new Mock();
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+ EdmEntityType entityTypeBaseColl = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
+ EdmEntityType entityTypeBaseEntry = edm.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+ impl.setType(entityType);
+ assertEquals(entityType, impl.getType());
+ assertEquals("mock", impl.toString(false));
+ assertEquals("mock", impl.toString(true));
+
+ // set both
+ impl.setCollectionTypeFilter(entityTypeBaseColl);
+ assertEquals(entityTypeBaseColl, impl.getTypeFilterOnCollection());
+ assertEquals("mock", impl.toString(false));
+ assertEquals("mock/com.sap.odata.test1.ETBaseTwoKeyNav", impl.toString(true));
+ impl.setEntryTypeFilter(entityTypeBaseEntry);
+ assertEquals(entityTypeBaseEntry, impl.getTypeFilterOnEntry());
+ assertEquals("mock", impl.toString(false));
+ assertEquals("mock/com.sap.odata.test1.ETBaseTwoKeyNav/()com.sap.odata.test1.ETTwoBaseTwoKeyNav",
+ impl.toString(true));
+
+ // set entry
+ impl = new Mock();
+ impl.setType(entityType);
+ impl.setEntryTypeFilter(entityTypeBaseEntry);
+ assertEquals(entityTypeBaseEntry, impl.getTypeFilterOnEntry());
+ assertEquals("mock", impl.toString(false));
+ assertEquals("mock/com.sap.odata.test1.ETTwoBaseTwoKeyNav", impl.toString(true));
+
+ // set collection
+ impl = new Mock();
+ impl.setType(entityType);
+ impl.setCollectionTypeFilter(entityTypeBaseColl);
+ assertEquals(entityTypeBaseColl, impl.getTypeFilterOnCollection());
+ assertEquals("mock", impl.toString(false));
+ assertEquals("mock/com.sap.odata.test1.ETBaseTwoKeyNav", impl.toString(true));
+
+ impl = new Mock();
+ UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
+ List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
+ keyPredicates.add(parameter);
+
+ impl.setKeyPredicates(keyPredicates);
+ assertNotNull(null, impl.getKeyPredicates());
+
+ }
+
+ @Test
+ public void testUriResourceImplTyped() {
+ class Mock extends UriResourceTypedImpl {
+
+ EdmType type;
+
+ public Mock() {
+ super(UriResourceKind.action);
+ }
+
+ @Override
+ public EdmType getType() {
+ return type;
+ }
+
+ @Override
+ public boolean isCollection() {
+ return false;
+ }
+
+ public Mock setType(final EdmType type) {
+ this.type = type;
+ return this;
+ }
+
+ @Override
+ public String toString() {
+ return "mock";
+ }
+
+ }
+
+ Mock impl = new Mock();
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+ EdmEntityType entityTypeBaseColl = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
+ edm.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+ impl.setType(entityType);
+ assertEquals("mock", impl.toString());
+ assertEquals("mock", impl.toString(true));
+ assertEquals("mock", impl.toString(false));
+
+ impl.setTypeFilter(entityTypeBaseColl);
+ assertEquals(entityTypeBaseColl, impl.getTypeFilter());
+ assertEquals("mock", impl.toString());
+ assertEquals("mock/com.sap.odata.test1.ETBaseTwoKeyNav", impl.toString(true));
+ assertEquals("mock", impl.toString(false));
+ //
+ }
+
+ @Test
+ public void testUriResourceItImpl() {
+ UriResourceItImpl impl = new UriResourceItImpl();
+ assertEquals(UriResourceKind.it, impl.getKind());
+
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+ assertEquals("$it", impl.toString());
+
+ impl.setType(entityType);
+ assertEquals(entityType, impl.getType());
+
+ UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
+ List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
+ keyPredicates.add(parameter);
+
+ assertEquals(false, impl.isCollection());
+ impl.setCollection(true);
+ assertEquals(true, impl.isCollection());
+ impl.setKeyPredicates(keyPredicates);
+ assertEquals(false, impl.isCollection());
+ }
+
+ @Test
+ public void testUriResourceNavigationPropertyImpl() {
+ UriResourceNavigationPropertyImpl impl = new UriResourceNavigationPropertyImpl();
+ assertEquals(UriResourceKind.navigationProperty, impl.getKind());
+
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+ EdmNavigationProperty property = (EdmNavigationProperty) entityType.getProperty("NavPropertyETKeyNavMany");
+ assertNotNull(property);
+
+ impl.setNavigationProperty(property);
+ assertEquals(property, impl.getProperty());
+
+ assertEquals("NavPropertyETKeyNavMany", impl.toString());
+ assertEquals(property.getType(), impl.getType());
+
+ UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
+ List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
+ keyPredicates.add(parameter);
+
+ assertEquals(true, impl.isCollection());
+ impl.setKeyPredicates(keyPredicates);
+ assertEquals(false, impl.isCollection());
+ }
+
+ @Test
+ public void testUriResourceRefImpl() {
+ UriResourceRefImpl impl = new UriResourceRefImpl();
+ assertEquals(UriResourceKind.ref, impl.getKind());
+ assertEquals("$ref", impl.toString());
+ }
+
+ @Test
+ public void testUriResourceRootImpl() {
+ UriResourceRootImpl impl = new UriResourceRootImpl();
+ assertEquals(UriResourceKind.root, impl.getKind());
+
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+ assertEquals("$root", impl.toString());
+
+ impl.setType(entityType);
+ assertEquals(entityType, impl.getType());
+
+ UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
+ List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
+ keyPredicates.add(parameter);
+
+ assertEquals(false, impl.isCollection());
+ impl.setCollection(true);
+ assertEquals(true, impl.isCollection());
+ impl.setKeyPredicates(keyPredicates);
+ assertEquals(false, impl.isCollection());
+ }
+
+ @Test
+ public void testUriResourceSingletonImpl() {
+ UriResourceSingletonImpl impl = new UriResourceSingletonImpl();
+ assertEquals(UriResourceKind.singleton, impl.getKind());
+
+ EdmSingletonImpl singleton = (EdmSingletonImpl) edm.getEntityContainer(null).getSingleton("SINav");
+ EdmEntityType entityTypeBaseColl = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
+ impl.setSingleton(singleton);
+
+ assertEquals("SINav", impl.toString());
+ assertEquals(singleton, impl.getSingleton());
+
+ assertEquals(singleton.getEntityType(), impl.getType());
+ assertEquals(singleton.getEntityType(), impl.getEntityType());
+ impl.getEntityType();
+
+ impl.setTypeFilter(entityTypeBaseColl);
+ assertEquals(entityTypeBaseColl, impl.getEntityTypeFilter());
+
+ // is Collection
+ assertEquals(false, impl.isCollection());
+ }
+
+ @Test
+ public void testUriResourceValueImpl() {
+ UriResourceValueImpl impl = new UriResourceValueImpl();
+ assertEquals(UriResourceKind.value, impl.getKind());
+ assertEquals("$value", impl.toString());
+ }
+
+ @Test
+ public void testUriResourceLambdaVarImpl() {
+ UriResourceLambdaVarImpl impl = new UriResourceLambdaVarImpl();
+ assertEquals(UriResourceKind.lambdaVariable, impl.getKind());
+
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+ impl.setType(entityType);
+ impl.setVariableText("A");
+
+ assertEquals("A", impl.toString());
+ assertEquals(entityType, impl.getType());
+ assertEquals("A", impl.getVariableName());
+ assertEquals(false, impl.isCollection());
+ impl.setCollection(true);
+ assertEquals(true, impl.isCollection());
+ }
+
+ @Test
+ public void testUriResourceStartingTypeFilterImpl() {
+ UriResourceStartingTypeFilterImpl impl = new UriResourceStartingTypeFilterImpl();
+
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETTwoKeyNav);
+
+ impl.setType(entityType);
+ assertEquals("com.sap.odata.test1.ETTwoKeyNav", impl.toString());
+ assertEquals(entityType, impl.getType());
+
+ UriParameterImpl parameter = new UriParameterImpl().setName("ParameterInt16");
+ List<UriParameterImpl> keyPredicates = new ArrayList<UriParameterImpl>();
+ keyPredicates.add(parameter);
+
+ assertEquals(false, impl.isCollection());
+ impl.setCollection(true);
+ assertEquals(true, impl.isCollection());
+ impl.setKeyPredicates(keyPredicates);
+ assertEquals(false, impl.isCollection());
+
+ }
+}
[02/31] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/olingo-odata4 into olingo274
Posted by sk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/olingo-odata4 into olingo274
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/c32f4a0b
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/c32f4a0b
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/c32f4a0b
Branch: refs/heads/olingo-266-ref
Commit: c32f4a0bb1bf9fa111bd66b439871f908f327e17
Parents: 6f1f4d0 f1cbc4a
Author: challenh <ch...@apache.org>
Authored: Mon May 12 16:22:10 2014 +0800
Committer: challenh <ch...@apache.org>
Committed: Mon May 12 16:22:10 2014 +0800
----------------------------------------------------------------------
.../ext/proxy/EntityContainerFactory.java | 115 ++
.../olingo/ext/proxy/api/AbstractContainer.java | 32 -
.../apache/olingo/ext/proxy/api/Container.java | 32 +
.../olingo/ext/proxy/api/OperationExecutor.java | 27 +
.../proxy/api/annotations/EntityContainer.java | 2 +
.../ext/proxy/api/annotations/Parameter.java | 5 -
.../commons/AbstractInvocationHandler.java | 242 ++++
.../commons/AbstractTypeInvocationHandler.java | 307 ++++
.../commons/ComplexTypeInvocationHandler.java | 241 +++
.../commons/CompoundKeyElementWrapper.java | 57 +
.../olingo/ext/proxy/commons/ContainerImpl.java | 548 +++++++
.../EntityCollectionInvocationHandler.java | 140 ++
.../EntityContainerInvocationHandler.java | 108 ++
.../commons/EntitySetInvocationHandler.java | 403 +++++
.../ext/proxy/commons/EntitySetIterator.java | 85 ++
.../commons/EntityTypeInvocationHandler.java | 427 ++++++
.../proxy/commons/FactoryInvocationHandler.java | 84 ++
.../commons/OperationInvocationHandler.java | 218 +++
.../olingo/ext/proxy/commons/QueryImpl.java | 173 +++
.../ext/proxy/context/AttachedEntity.java | 41 +
.../ext/proxy/context/AttachedEntityStatus.java | 44 +
.../olingo/ext/proxy/context/Context.java | 37 +
.../olingo/ext/proxy/context/EntityContext.java | 199 +++
.../ext/proxy/context/EntityLinkDesc.java | 104 ++
.../olingo/ext/proxy/context/EntityUUID.java | 102 ++
.../olingo/ext/proxy/utils/ClassUtils.java | 141 ++
.../olingo/ext/proxy/utils/CoreUtils.java | 492 +++++++
ext/pojogen-maven-plugin/pom.xml | 2 +-
.../src/it/actionOverloadingService/pom.xml | 92 --
.../it/actionOverloadingService/verify.groovy | 20 -
.../src/it/defaultService/pom.xml | 92 --
.../src/it/defaultService/verify.groovy | 20 -
.../src/it/keyAsSegmentService/pom.xml | 92 --
.../src/it/keyAsSegmentService/verify.groovy | 20 -
.../src/it/northwind/pom.xml | 92 --
.../src/it/northwind/verify.groovy | 20 -
.../src/it/odataWriterDefaultService/pom.xml | 92 --
.../it/odataWriterDefaultService/verify.groovy | 20 -
.../src/it/openTypeService/pom.xml | 92 --
.../src/it/openTypeService/verify.groovy | 20 -
.../src/it/primitiveKeysService/pom.xml | 92 --
.../src/it/primitiveKeysService/verify.groovy | 20 -
.../src/it/staticServiceV3/pom.xml | 92 --
.../src/it/staticServiceV3/verify.groovy | 20 -
.../src/it/staticServiceV4/pom.xml | 92 --
.../src/it/staticServiceV4/verify.groovy | 20 -
.../ext/pojogen/AbstractMetadataMojo.java | 1 -
.../olingo/ext/pojogen/AbstractUtility.java | 31 +-
.../olingo/ext/pojogen/V3MetadataMojo.java | 244 ++--
.../olingo/ext/pojogen/V4MetadataMojo.java | 260 ++--
.../src/main/resources/complexType.vm | 3 +-
.../src/main/resources/container.vm | 8 +-
.../src/main/resources/entityCollection.vm | 7 +-
.../src/main/resources/entitySet.vm | 6 +-
.../src/main/resources/entityType.vm | 40 +-
.../src/main/resources/entityTypeKey.vm | 3 +-
.../src/main/resources/singleton.vm | 3 +-
.../src/main/resources/v30/complexType.vm | 30 +-
.../src/main/resources/v40/complexType.vm | 29 +-
fit/pom.xml | 6 +
fit/src/it/staticServiceV3/pom.xml | 2 +-
fit/src/it/staticServiceV3/verify.groovy | 2 +-
fit/src/it/staticServiceV4/pom.xml | 2 +-
fit/src/it/staticServiceV4/verify.groovy | 2 +-
.../org/apache/olingo/fit/AbstractServices.java | 98 +-
.../apache/olingo/fit/V3ActionOverloading.java | 2 +-
.../java/org/apache/olingo/fit/V3OpenType.java | 7 +-
.../java/org/apache/olingo/fit/V3Services.java | 7 +-
.../main/java/org/apache/olingo/fit/V4Demo.java | 171 +++
.../java/org/apache/olingo/fit/V4OpenType.java | 9 +-
.../java/org/apache/olingo/fit/V4Services.java | 55 +-
.../org/apache/olingo/fit/V4Vocabularies.java | 8 +-
.../apache/olingo/fit/metadata/EntityType.java | 24 +-
.../apache/olingo/fit/metadata/Metadata.java | 42 +-
.../olingo/fit/utils/AbstractUtilities.java | 76 +-
.../org/apache/olingo/fit/utils/Commons.java | 20 +-
.../org/apache/olingo/fit/utils/Constants.java | 1 +
.../org/apache/olingo/fit/utils/DataBinder.java | 61 +-
.../org/apache/olingo/fit/utils/FSManager.java | 6 +-
.../apache/olingo/fit/utils/JSONUtilities.java | 5 +-
.../apache/olingo/fit/utils/XMLUtilities.java | 7 +-
.../resources/V30/AllGeoTypesSet/-10/entity.xml | 161 ++
.../main/resources/V30/AllGeoTypesSet/feed.xml | 1371 ++++++++++++++++++
fit/src/main/resources/V30/Computer/feed.xml | 207 +++
.../V30/CustomerInfo/16/entity.full.json | 11 +
.../resources/V30/CustomerInfo/16/entity.xml | 37 +
fit/src/main/resources/V30/Message/feed.xml | 277 ++++
.../feed.full.json | 30 +
.../feed.xml | 69 +
fit/src/main/resources/V30/Person/feed.xml | 307 ++++
.../$value.bin | 0
.../entity.full.json | 16 +
.../entity.xml | 40 +
.../resources/V40/Advertisements/feed.full.json | 31 +
.../main/resources/V40/Advertisements/feed.xml | 65 +
.../feed.full.json | 96 ++
.../feed.xml | 103 ++
.../feed.full.json | 159 ++
.../feed.xml | 109 ++
fit/src/main/resources/V40/demoMetadata.xml | 172 +++
fit/src/main/resources/V40/openTypeMetadata.xml | 10 +-
.../main/webapp/WEB-INF/applicationContext.xml | 1 +
.../olingo/fit/proxy/v3/AbstractTest.java | 150 ++
.../proxy/v3/AuthEntityRetrieveTestITCase.java | 50 +
.../fit/proxy/v3/EntityCreateTestITCase.java | 210 +++
.../fit/proxy/v3/EntityRetrieveTestITCase.java | 247 ++++
.../fit/proxy/v3/EntitySetTestITCase.java | 98 ++
.../AllGeoCollectionTypesSet.java | 55 +
.../astoriadefaultservice/AllGeoTypesSet.java | 53 +
.../services/astoriadefaultservice/Car.java | 53 +
.../astoriadefaultservice/Computer.java | 53 +
.../astoriadefaultservice/ComputerDetail.java | 53 +
.../astoriadefaultservice/Customer.java | 53 +
.../astoriadefaultservice/CustomerInfo.java | 53 +
.../astoriadefaultservice/DefaultContainer.java | 160 ++
.../services/astoriadefaultservice/Driver.java | 53 +
.../astoriadefaultservice/LastLogin.java | 53 +
.../services/astoriadefaultservice/License.java | 53 +
.../services/astoriadefaultservice/Login.java | 53 +
.../astoriadefaultservice/MappedEntityType.java | 53 +
.../services/astoriadefaultservice/Message.java | 53 +
.../MessageAttachment.java | 53 +
.../services/astoriadefaultservice/Order.java | 53 +
.../astoriadefaultservice/OrderLine.java | 57 +
.../astoriadefaultservice/PageView.java | 55 +
.../services/astoriadefaultservice/Person.java | 59 +
.../astoriadefaultservice/PersonMetadata.java | 53 +
.../services/astoriadefaultservice/Product.java | 55 +
.../astoriadefaultservice/ProductDetail.java | 53 +
.../astoriadefaultservice/ProductPhoto.java | 53 +
.../astoriadefaultservice/ProductReview.java | 53 +
.../astoriadefaultservice/RSAToken.java | 53 +
.../astoriadefaultservice/package-info.java | 21 +
.../astoriadefaultservice/types/Aliases.java | 59 +
.../types/AllSpatialCollectionTypes.java | 91 ++
.../AllSpatialCollectionTypesCollection.java | 47 +
.../types/AllSpatialCollectionTypes_Simple.java | 230 +++
...SpatialCollectionTypes_SimpleCollection.java | 47 +
.../types/AllSpatialTypes.java | 459 ++++++
.../types/AllSpatialTypesCollection.java | 47 +
.../astoriadefaultservice/types/AuditInfo.java | 81 ++
.../types/BackOrderLine.java | 204 +++
.../types/BackOrderLine2.java | 204 +++
.../types/BackOrderLine2Collection.java | 47 +
.../types/BackOrderLineCollection.java | 47 +
.../astoriadefaultservice/types/Car.java | 163 +++
.../types/CarCollection.java | 47 +
.../types/ComplexToCategory.java | 73 +
.../types/ComplexWithAllPrimitiveTypes.java | 150 ++
.../astoriadefaultservice/types/Computer.java | 135 ++
.../types/ComputerCollection.java | 47 +
.../types/ComputerDetail.java | 259 ++++
.../types/ComputerDetailCollection.java | 47 +
.../types/ConcurrencyInfo.java | 66 +
.../types/ContactDetails.java | 114 ++
.../astoriadefaultservice/types/Contractor.java | 217 +++
.../types/ContractorCollection.java | 47 +
.../astoriadefaultservice/types/Customer.java | 295 ++++
.../types/CustomerCollection.java | 47 +
.../types/CustomerInfo.java | 117 ++
.../types/CustomerInfoCollection.java | 47 +
.../astoriadefaultservice/types/Dimensions.java | 73 +
.../types/DiscontinuedProduct.java | 383 +++++
.../types/DiscontinuedProductCollection.java | 47 +
.../astoriadefaultservice/types/Driver.java | 124 ++
.../types/DriverCollection.java | 47 +
.../astoriadefaultservice/types/Employee.java | 214 +++
.../types/EmployeeCollection.java | 59 +
.../astoriadefaultservice/types/LastLogin.java | 170 +++
.../types/LastLoginCollection.java | 47 +
.../astoriadefaultservice/types/License.java | 193 +++
.../types/LicenseCollection.java | 47 +
.../astoriadefaultservice/types/Login.java | 164 +++
.../types/LoginCollection.java | 47 +
.../types/MappedEntityType.java | 544 +++++++
.../types/MappedEntityTypeCollection.java | 47 +
.../astoriadefaultservice/types/Message.java | 259 ++++
.../types/MessageAttachment.java | 114 ++
.../types/MessageAttachmentCollection.java | 47 +
.../types/MessageCollection.java | 47 +
.../astoriadefaultservice/types/MessageKey.java | 74 +
.../astoriadefaultservice/types/Order.java | 165 +++
.../types/OrderCollection.java | 47 +
.../astoriadefaultservice/types/OrderLine.java | 203 +++
.../types/OrderLineCollection.java | 47 +
.../types/OrderLineKey.java | 74 +
.../astoriadefaultservice/types/PageView.java | 193 +++
.../types/PageViewCollection.java | 47 +
.../astoriadefaultservice/types/Person.java | 124 ++
.../types/PersonCollection.java | 47 +
.../types/PersonMetadata.java | 170 +++
.../types/PersonMetadataCollection.java | 47 +
.../astoriadefaultservice/types/Phone.java | 66 +
.../astoriadefaultservice/types/Product.java | 296 ++++
.../types/ProductCollection.java | 47 +
.../types/ProductDetail.java | 124 ++
.../types/ProductDetailCollection.java | 47 +
.../types/ProductPageView.java | 240 +++
.../types/ProductPageViewCollection.java | 47 +
.../types/ProductPhoto.java | 137 ++
.../types/ProductPhotoCollection.java | 47 +
.../types/ProductPhotoKey.java | 74 +
.../types/ProductReview.java | 170 +++
.../types/ProductReviewCollection.java | 47 +
.../types/ProductReviewKey.java | 85 ++
.../astoriadefaultservice/types/RSAToken.java | 124 ++
.../types/RSATokenCollection.java | 47 +
.../types/SpecialEmployee.java | 283 ++++
.../types/SpecialEmployeeCollection.java | 47 +
.../types/package-info.java | 21 +
.../olingo/fit/proxy/v4/AbstractTest.java | 81 ++
.../proxy/v4/AuthEntityRetrieveTestITCase.java | 49 +
.../fit/proxy/v4/EntityRetrieveTestITCase.java | 163 +++
.../fit/proxy/v4/EntitySetTestITCase.java | 75 +
.../services/odatawcfservice/Accounts.java | 53 +
.../odata/services/odatawcfservice/Boss.java | 54 +
.../odata/services/odatawcfservice/Company.java | 53 +
.../services/odatawcfservice/Customers.java | 53 +
.../odatawcfservice/DefaultStoredPI.java | 52 +
.../services/odatawcfservice/Departments.java | 53 +
.../services/odatawcfservice/Employees.java | 53 +
.../odatawcfservice/InMemoryEntities.java | 165 +++
.../services/odatawcfservice/LabourUnion.java | 52 +
.../services/odatawcfservice/OrderDetails.java | 53 +
.../odata/services/odatawcfservice/Orders.java | 53 +
.../odata/services/odatawcfservice/People.java | 57 +
.../odatawcfservice/ProductDetails.java | 53 +
.../odatawcfservice/ProductReviews.java | 53 +
.../services/odatawcfservice/Products.java | 53 +
.../services/odatawcfservice/PublicCompany.java | 53 +
.../services/odatawcfservice/StoredPIs.java | 53 +
.../odatawcfservice/SubscriptionTemplates.java | 53 +
.../services/odatawcfservice/VipCustomer.java | 52 +
.../services/odatawcfservice/package-info.java | 21 +
.../odatawcfservice/types/AccessLevel.java | 47 +
.../services/odatawcfservice/types/Account.java | 211 +++
.../types/AccountCollection.java | 47 +
.../odatawcfservice/types/AccountInfo.java | 89 ++
.../services/odatawcfservice/types/Address.java | 106 ++
.../services/odatawcfservice/types/Asset.java | 137 ++
.../odatawcfservice/types/AssetCollection.java | 47 +
.../services/odatawcfservice/types/Club.java | 114 ++
.../odatawcfservice/types/ClubCollection.java | 47 +
.../services/odatawcfservice/types/Color.java | 45 +
.../services/odatawcfservice/types/Company.java | 250 ++++
.../odatawcfservice/types/CompanyAddress.java | 134 ++
.../odatawcfservice/types/CompanyCategory.java | 46 +
.../types/CompanyCollection.java | 47 +
.../odatawcfservice/types/CreditCardPI.java | 293 ++++
.../types/CreditCardPICollection.java | 47 +
.../odatawcfservice/types/CreditRecord.java | 160 ++
.../types/CreditRecordCollection.java | 47 +
.../odatawcfservice/types/Customer.java | 361 +++++
.../types/CustomerCollection.java | 47 +
.../odatawcfservice/types/Department.java | 124 ++
.../types/DepartmentCollection.java | 47 +
.../odatawcfservice/types/Employee.java | 328 +++++
.../types/EmployeeCollection.java | 47 +
.../odatawcfservice/types/GiftCard.java | 173 +++
.../types/GiftCardCollection.java | 47 +
.../odatawcfservice/types/HomeAddress.java | 124 ++
.../odatawcfservice/types/LabourUnion.java | 114 ++
.../types/LabourUnionCollection.java | 47 +
.../services/odatawcfservice/types/Order.java | 190 +++
.../odatawcfservice/types/OrderCollection.java | 47 +
.../odatawcfservice/types/OrderDetail.java | 203 +++
.../types/OrderDetailCollection.java | 47 +
.../odatawcfservice/types/OrderDetailKey.java | 74 +
.../types/PaymentInstrument.java | 167 +++
.../types/PaymentInstrumentCollection.java | 47 +
.../services/odatawcfservice/types/Person.java | 290 ++++
.../odatawcfservice/types/PersonCollection.java | 47 +
.../services/odatawcfservice/types/Product.java | 305 ++++
.../types/ProductCollection.java | 60 +
.../odatawcfservice/types/ProductDetail.java | 192 +++
.../types/ProductDetailCollection.java | 47 +
.../odatawcfservice/types/ProductDetailKey.java | 74 +
.../odatawcfservice/types/ProductReview.java | 206 +++
.../types/ProductReviewCollection.java | 47 +
.../odatawcfservice/types/ProductReviewKey.java | 96 ++
.../odatawcfservice/types/PublicCompany.java | 286 ++++
.../types/PublicCompanyCollection.java | 47 +
.../odatawcfservice/types/Statement.java | 160 ++
.../types/StatementCollection.java | 47 +
.../odatawcfservice/types/StoredPI.java | 160 ++
.../types/StoredPICollection.java | 47 +
.../odatawcfservice/types/Subscription.java | 183 +++
.../types/SubscriptionCollection.java | 47 +
.../odatawcfservice/types/package-info.java | 21 +
.../olingo/fit/v3/AbstractTestITCase.java | 2 +-
.../apache/olingo/fit/v3/AsyncTestITCase.java | 2 +-
.../apache/olingo/fit/v3/BatchTestITCase.java | 13 +
.../olingo/fit/v3/EntityRetrieveTestITCase.java | 24 +-
.../olingo/fit/v3/MediaEntityTestITCase.java | 109 +-
.../olingo/fit/v3/QueryOptionsTestITCase.java | 2 +-
.../olingo/fit/v4/AbstractTestITCase.java | 9 +-
.../fit/v4/BoundOperationInvokeTestITCase.java | 20 +-
.../olingo/fit/v4/DerivedTypeTestITCase.java | 145 ++
.../olingo/fit/v4/EntityCreateTestITCase.java | 2 +-
.../olingo/fit/v4/EntityRetrieveTestITCase.java | 32 +-
.../olingo/fit/v4/EntitySetTestITCase.java | 13 +-
.../olingo/fit/v4/KeyAsSegmentTestITCase.java | 9 +-
.../olingo/fit/v4/MediaEntityTestITCase.java | 181 +++
.../olingo/fit/v4/OpenTypeTestITCase.java | 12 +-
.../olingo/fit/v4/PropertyTestITCase.java | 32 +-
.../olingo/fit/v4/PropertyValueTestITCase.java | 4 +-
.../olingo/fit/v4/QueryOptionsTestITCase.java | 53 +-
.../olingo/fit/v4/SingletonTestITCase.java | 102 ++
...che.olingo.ext.proxy.api.AbstractComplexType | 14 +
.../client/api/CommonEdmEnabledODataClient.java | 7 +
.../olingo/client/api/CommonODataClient.java | 4 +-
.../batch/CommonBatchRequestFactory.java | 8 +
.../request/batch/v3/BatchRequestFactory.java | 8 +-
.../request/batch/v4/BatchRequestFactory.java | 8 +-
.../request/cud/v4/CUDRequestFactory.java | 8 +
.../retrieve/v4/RetrieveRequestFactory.java | 5 +-
.../streamed/CommonStreamedRequestFactory.java | 67 -
.../streamed/StreamedRequestFactory.java | 67 +
.../streamed/v3/StreamedRequestFactory.java | 24 -
.../streamed/v4/StreamedRequestFactory.java | 24 -
.../olingo/client/api/op/CommonODataBinder.java | 9 +
.../olingo/client/api/uri/QueryOption.java | 7 +
.../olingo/client/api/uri/v4/SearchFactory.java | 31 +
.../olingo/client/api/uri/v4/URIBuilder.java | 12 +-
.../olingo/client/api/uri/v4/URISearch.java | 32 +
.../olingo/client/api/v3/ODataClient.java | 4 -
.../olingo/client/api/v4/ODataClient.java | 7 +-
.../request/cud/v4/CUDRequestFactoryImpl.java | 17 +
.../request/retrieve/ODataMediaRequestImpl.java | 3 +-
.../retrieve/v4/RetrieveRequestFactoryImpl.java | 6 +
.../AbstractStreamedRequestFactory.java | 77 -
.../streamed/StreamedRequestFactoryImpl.java | 77 +
.../streamed/v3/StreamedRequestFactoryImpl.java | 33 -
.../streamed/v4/StreamedRequestFactoryImpl.java | 33 -
.../olingo/client/core/edm/EdmClientImpl.java | 6 +-
.../olingo/client/core/edm/EdmSchemaImpl.java | 24 +-
.../client/core/edm/v3/EdmOperationProxy.java | 10 +-
.../client/core/op/AbstractODataBinder.java | 85 +-
.../client/core/op/impl/v3/ODataBinderImpl.java | 15 +-
.../client/core/op/impl/v4/ODataBinderImpl.java | 199 ++-
.../client/core/uri/AbstractURIBuilder.java | 15 +-
.../client/core/uri/v3/URIBuilderImpl.java | 5 -
.../client/core/uri/v4/URIBuilderImpl.java | 19 +-
.../core/v3/EdmEnabledODataClientImpl.java | 7 +
.../olingo/client/core/v3/ODataClientImpl.java | 4 +-
.../apache/olingo/client/core/v4/AndSearch.java | 42 +
.../core/v4/EdmEnabledODataClientImpl.java | 10 +-
.../olingo/client/core/v4/LiteralSearch.java | 35 +
.../apache/olingo/client/core/v4/NotSearch.java | 35 +
.../olingo/client/core/v4/ODataClientImpl.java | 12 +-
.../apache/olingo/client/core/v4/OrSearch.java | 42 +
.../client/core/v4/SearchFactoryImpl.java | 46 +
.../client/core/uri/v4/URIBuilderTest.java | 29 +-
.../olingo/client/core/v3/EntityTest.java | 2 +-
.../olingo/client/core/v3/MetadataTest.java | 33 +-
.../client/core/v3/PrimitiveValueTest.java | 2 +-
.../olingo/client/core/v4/EntityTest.java | 79 +-
.../apache/olingo/client/core/v4/JSONTest.java | 1 +
.../olingo/client/core/v4/MetadataTest.java | 10 +-
.../client/core/v3/ComputerDetail_-10.json | 29 +-
.../client/core/v3/PersonDetails_0_Person.json | 2 +-
.../core/v3/Product_-10_Dimensions_Width.json | 5 +-
.../apache/olingo/client/core/v4/annotated.json | 62 +
.../apache/olingo/client/core/v4/annotated.xml | 76 +
.../apache/olingo/commons/api/Constants.java | 2 +
.../olingo/commons/api/data/Annotatable.java | 29 +
.../olingo/commons/api/data/Annotation.java | 29 +
.../olingo/commons/api/data/DeletedEntity.java | 36 +
.../apache/olingo/commons/api/data/Delta.java | 8 +-
.../olingo/commons/api/data/DeltaLink.java | 36 +
.../apache/olingo/commons/api/data/Entity.java | 6 +-
.../olingo/commons/api/data/EntitySet.java | 2 +-
.../apache/olingo/commons/api/data/Link.java | 2 +-
.../apache/olingo/commons/api/data/Linked.java | 16 +
.../commons/api/data/LinkedComplexValue.java | 5 +-
.../olingo/commons/api/data/Property.java | 10 +-
.../olingo/commons/api/data/Valuable.java | 30 +
.../commons/api/domain/CommonODataEntity.java | 10 +-
.../api/domain/CommonODataObjectFactory.java | 4 +
.../olingo/commons/api/domain/ODataItem.java | 9 -
.../olingo/commons/api/domain/ODataLink.java | 20 +-
.../commons/api/domain/ODataPrimitiveValue.java | 4 +
.../api/domain/v4/ODataAnnotatatable.java | 26 +
.../commons/api/domain/v4/ODataAnnotation.java | 30 +
.../commons/api/domain/v4/ODataDeltaLink.java | 2 +-
.../commons/api/domain/v4/ODataEntity.java | 2 +-
.../commons/api/domain/v4/ODataEntitySet.java | 2 +-
.../olingo/commons/api/domain/v4/ODataLink.java | 74 +
.../api/domain/v4/ODataLinkedComplexValue.java | 3 +-
.../api/domain/v4/ODataObjectFactory.java | 14 +
.../commons/api/domain/v4/ODataProperty.java | 39 +-
.../commons/api/domain/v4/ODataValuable.java | 104 ++
.../olingo/commons/api/domain/v4/Singleton.java | 22 +
.../core/data/AbstractAnnotatedObject.java | 37 +
.../commons/core/data/AbstractAtomDealer.java | 4 +
.../commons/core/data/AbstractEntity.java | 32 +-
.../core/data/AbstractJsonDeserializer.java | 101 +-
.../core/data/AbstractJsonSerializer.java | 34 +-
.../commons/core/data/AbstractODataObject.java | 2 +-
.../commons/core/data/AbstractProperty.java | 23 +-
.../commons/core/data/AnnotationImpl.java | 63 +
.../commons/core/data/AtomDeserializer.java | 104 +-
.../core/data/AtomGeoValueDeserializer.java | 5 +
.../commons/core/data/AtomSerializer.java | 47 +-
.../commons/core/data/DeletedEntityImpl.java | 50 +
.../olingo/commons/core/data/DeltaLinkImpl.java | 64 +
.../core/data/JSONDeltaDeserializer.java | 11 +-
.../core/data/JSONEntityDeserializer.java | 59 +-
.../commons/core/data/JSONEntitySerializer.java | 17 +-
.../core/data/JSONEntitySetDeserializer.java | 18 +
.../core/data/JSONEntitySetSerializer.java | 5 +
.../core/data/JSONPropertyDeserializer.java | 19 +
.../core/data/JSONPropertySerializer.java | 11 +-
.../olingo/commons/core/data/LinkImpl.java | 2 +-
.../core/data/LinkedComplexValueImpl.java | 29 +
.../commons/core/data/v4/AbstractDelta.java | 16 +-
.../core/domain/AbstractODataEntity.java | 22 +-
.../core/domain/AbstractODataObjectFactory.java | 14 -
.../domain/AbstractODataPrimitiveValue.java | 12 +-
.../core/domain/AbstractODataProperty.java | 9 -
.../core/domain/v3/ODataObjectFactoryImpl.java | 24 +
.../core/domain/v4/ODataAnnotationImpl.java | 102 ++
.../core/domain/v4/ODataComplexValueImpl.java | 9 +
.../core/domain/v4/ODataDeletedEntityImpl.java | 8 +-
.../core/domain/v4/ODataDeltaLinkImpl.java | 22 +-
.../commons/core/domain/v4/ODataEntityImpl.java | 11 +-
.../core/domain/v4/ODataEntitySetImpl.java | 12 +-
.../core/domain/v4/ODataObjectFactoryImpl.java | 32 +
.../core/domain/v4/ODataPropertyImpl.java | 37 +-
.../core/domain/v4/ODataValuableImpl.java | 120 ++
.../core/edm/primitivetype/EdmDateTime.java | 30 +-
pom.xml | 4 +-
432 files changed, 31220 insertions(+), 2380 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/c32f4a0b/lib/commons-api/src/main/java/org/apache/olingo/commons/api/Constants.java
----------------------------------------------------------------------
[18/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/UriLexerWithTrace.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/UriLexerWithTrace.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/UriLexerWithTrace.java
new file mode 100644
index 0000000..9005080
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/testutil/UriLexerWithTrace.java
@@ -0,0 +1,85 @@
+/*
+ * 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.server.core.uri.testutil;
+
+import org.antlr.v4.runtime.ANTLRInputStream;
+import org.antlr.v4.runtime.Token;
+import org.apache.olingo.server.core.uri.antlr.UriLexer;
+
+public class UriLexerWithTrace extends UriLexer {
+ int logLevel = 0;
+
+ public UriLexerWithTrace(final ANTLRInputStream antlrInputStream, final int logLevel) {
+ super(antlrInputStream);
+ this.logLevel = logLevel;
+ }
+
+ public UriLexerWithTrace(final ANTLRInputStream antlrInputStream, final int logLevel, final int mode) {
+ super(antlrInputStream);
+ super.mode(mode);
+ this.logLevel = logLevel;
+ }
+
+ @Override
+ public void emit(final Token token) {
+ if (logLevel > 1) {
+ String out = String.format("%1$-" + 20 + "s", token.getText());
+
+ int tokenType = token.getType();
+ if (tokenType == -1) {
+ out += "-1/EOF";
+ } else {
+ out += UriLexer.tokenNames[tokenType];
+ }
+ System.out.println("Lexer.emit(...):" + out);
+ }
+
+ super.emit(token);
+ }
+
+ @Override
+ public void pushMode(final int m) {
+
+ String out = UriLexer.modeNames[_mode] + "-->";
+
+ super.pushMode(m);
+
+ out += UriLexer.modeNames[_mode];
+
+ if (logLevel > 1) {
+ System.out.println(out + " ");
+ }
+ }
+
+ @Override
+ public int popMode() {
+
+ String out = UriLexer.modeNames[_mode] + "-->";
+
+ int m = super.popMode();
+
+ out += UriLexer.modeNames[_mode];
+
+ if (logLevel > 1) {
+ System.out.println(out + " ");
+ }
+
+ return m;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
new file mode 100644
index 0000000..9787fab
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/validator/UriValidatorTest.java
@@ -0,0 +1,378 @@
+/*
+ * 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.server.core.uri.validator;
+
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.ArrayList;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.server.api.uri.UriInfo;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.core.uri.parser.Parser;
+import org.apache.olingo.server.core.uri.parser.UriParserException;
+import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class UriValidatorTest {
+
+ private static final String URI_ALL = "$all";
+ private static final String URI_BATCH = "$batch";
+ private static final String URI_CROSSJOIN = "$crossjoin(ESAllPrim)";
+ private static final String URI_ENTITY_ID = "/$entity";
+ private static final String URI_METADATA = "$metadata";
+ private static final String URI_SERVICE = "";
+ private static final String URI_ENTITY_SET = "/ESAllPrim";
+ private static final String URI_ENTITY_SET_COUNT = "/ESAllPrim/$count";
+ private static final String URI_ENTITY = "/ESAllPrim(1)";
+ private static final String URI_MEDIA_STREAM = "/ESMedia(1)/$value";
+ private static final String URI_REFERENCES = "/ESAllPrim/$ref";
+ private static final String URI_REFERENCE = "/ESAllPrim(1)/$ref";
+ private static final String URI_PROPERTY_COMPLEX = "/ESCompComp(1)/PropertyComplex";
+ private static final String URI_PROPERTY_COMPLEX_COLLECTION =
+ "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex";
+ private static final String URI_PROPERTY_COMPLEX_COLLECTION_COUNT =
+ "/ESCompCollComp(1)/PropertyComplex/CollPropertyComplex/$count";
+ private static final String URI_PROPERTY_PRIMITIVE = "/ESAllPrim(1)/PropertyString";
+ private static final String URI_PROPERTY_PRIMITIVE_COLLECTION = "/ESCollAllPrim/CollPropertyString";
+ private static final String URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT =
+ "/ESCollAllPrim/CollPropertyString/$count";
+ private static final String URI_PROPERTY_PRIMITIVE_VALUE = "/ESAllPrim(1)/PropertyString/$value";
+ private static final String URI_SINGLETON = "/SI";
+ private static final String URI_NAV_ENTITY = "/ESKeyNav/NavPropertyETKeyNavOne";
+ private static final String URI_NAV_ENTITY_SET = "/ESKeyNav/NavPropertyETKeyNavMany";
+
+ private static final String QO_FILTER = "$filter='1' eq '1'";
+ private static final String QO_FORMAT = "$format=bla";
+ private static final String QO_EXPAND = "$expand=*";
+ private static final String QO_ID = "$id=Products(0)";
+ private static final String QO_COUNT = "$count";
+ private static final String QO_ORDERBY = "$orderby=true";
+// private static final String QO_SEARCH = "$search='bla'";
+ private static final String QO_SELECT = "$select=*";
+ private static final String QO_SKIP = "$skip=3";
+ private static final String QO_SKIPTOKEN = "$skiptoken=123";
+ private static final String QO_LEVELS = "$expand=*($levels=1)";
+ private static final String QO_TOP = "$top=1";
+
+ private String[][] urisWithValidSystemQueryOptions = {
+ { URI_ALL, QO_FILTER, }, { URI_ALL, QO_FORMAT }, { URI_ALL, QO_EXPAND }, { URI_ALL, QO_COUNT },
+ { URI_ALL, QO_ORDERBY }, /* { URI_ALL, QO_SEARCH }, */{ URI_ALL, QO_SELECT }, { URI_ALL, QO_SKIP },
+ { URI_ALL, QO_SKIPTOKEN }, { URI_ALL, QO_LEVELS },
+
+ { URI_CROSSJOIN, QO_FILTER, }, { URI_CROSSJOIN, QO_FORMAT },
+ { URI_CROSSJOIN, QO_EXPAND }, { URI_CROSSJOIN, QO_COUNT }, { URI_CROSSJOIN, QO_ORDERBY },
+ /* { URI_CROSSJOIN, QO_SEARCH }, */{ URI_CROSSJOIN, QO_SELECT }, { URI_CROSSJOIN, QO_SKIP },
+ { URI_CROSSJOIN, QO_SKIPTOKEN }, { URI_CROSSJOIN, QO_LEVELS }, { URI_CROSSJOIN, QO_TOP },
+
+ { URI_ENTITY_ID, QO_ID, QO_FORMAT }, { URI_ENTITY_ID, QO_ID, }, { URI_ENTITY_ID, QO_ID, QO_EXPAND },
+ { URI_ENTITY_ID, QO_ID, QO_SELECT }, { URI_ENTITY_ID, QO_ID, QO_LEVELS },
+
+ { URI_METADATA, QO_FORMAT },
+
+ { URI_SERVICE, QO_FORMAT },
+
+ { URI_ENTITY_SET, QO_FILTER, }, { URI_ENTITY_SET, QO_FORMAT }, { URI_ENTITY_SET, QO_EXPAND },
+ { URI_ENTITY_SET, QO_COUNT }, { URI_ENTITY_SET, QO_ORDERBY }, /* { URI_ENTITY_SET, QO_SEARCH }, */
+ { URI_ENTITY_SET, QO_SELECT },
+ { URI_ENTITY_SET, QO_SKIP }, { URI_ENTITY_SET, QO_SKIPTOKEN }, { URI_ENTITY_SET, QO_LEVELS },
+ { URI_ENTITY_SET, QO_TOP },
+
+ { URI_ENTITY_SET_COUNT, QO_FILTER }, /* { URI_ENTITY_SET_COUNT, QO_SEARCH }, */
+
+ { URI_ENTITY, QO_FORMAT }, { URI_ENTITY, QO_EXPAND }, { URI_ENTITY, QO_SELECT }, { URI_ENTITY, QO_LEVELS },
+
+ { URI_MEDIA_STREAM, QO_FORMAT },
+
+ { URI_REFERENCES, QO_FILTER }, { URI_REFERENCES, QO_FORMAT }, { URI_REFERENCES, QO_ORDERBY },
+ /* { URI_REFERENCES, QO_SEARCH }, */{ URI_REFERENCES, QO_SKIP }, { URI_REFERENCES, QO_SKIPTOKEN },
+ { URI_REFERENCES, QO_TOP },
+
+ { URI_REFERENCE, QO_FORMAT },
+
+ { URI_PROPERTY_COMPLEX, QO_FORMAT }, { URI_PROPERTY_COMPLEX, QO_SELECT }, { URI_PROPERTY_COMPLEX, QO_EXPAND },
+ { URI_PROPERTY_COMPLEX, QO_LEVELS },
+
+ { URI_PROPERTY_COMPLEX_COLLECTION, QO_FILTER }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_FORMAT },
+ { URI_PROPERTY_COMPLEX_COLLECTION, QO_EXPAND }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_COUNT },
+ { URI_PROPERTY_COMPLEX_COLLECTION, QO_SKIP }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_SKIPTOKEN },
+ { URI_PROPERTY_COMPLEX_COLLECTION, QO_LEVELS }, { URI_PROPERTY_COMPLEX_COLLECTION, QO_TOP },
+ { URI_PROPERTY_COMPLEX_COLLECTION, QO_ORDERBY },
+
+ { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_FILTER }, /* { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SEARCH }, */
+
+ { URI_PROPERTY_PRIMITIVE, QO_FORMAT },
+
+ { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_FILTER }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_FORMAT },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_ORDERBY }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIP },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_TOP },
+
+ { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_FILTER },
+ /* { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SEARCH }, */
+
+ { URI_PROPERTY_PRIMITIVE_VALUE, QO_FORMAT },
+
+ { URI_SINGLETON, QO_FORMAT }, { URI_SINGLETON, QO_EXPAND }, { URI_SINGLETON, QO_SELECT },
+ { URI_SINGLETON, QO_LEVELS },
+
+ { URI_NAV_ENTITY, QO_FORMAT }, { URI_NAV_ENTITY, QO_EXPAND }, { URI_NAV_ENTITY, QO_SELECT },
+ { URI_NAV_ENTITY, QO_LEVELS },
+
+ { URI_NAV_ENTITY_SET, QO_FILTER, }, { URI_NAV_ENTITY_SET, QO_FORMAT }, { URI_NAV_ENTITY_SET, QO_EXPAND },
+ { URI_NAV_ENTITY_SET, QO_COUNT }, { URI_NAV_ENTITY_SET, QO_ORDERBY },
+ /* { URI_NAV_ENTITY_SET, QO_SEARCH }, */{ URI_NAV_ENTITY_SET, QO_SELECT }, { URI_NAV_ENTITY_SET, QO_SKIP },
+ { URI_NAV_ENTITY_SET, QO_SKIPTOKEN }, { URI_NAV_ENTITY_SET, QO_LEVELS }, { URI_NAV_ENTITY_SET, QO_TOP },
+
+ { "FINRTInt16()" },
+ { "FICRTETKeyNav()" },
+ { "FICRTESTwoKeyNavParam(ParameterInt16=1)" },
+ { "FICRTCollString()" },
+ { "FICRTCTTwoPrim()" },
+ { "FICRTCollCTTwoPrim()" },
+ { "FICRTETMedia()" },
+
+ { "ESTwoKeyNav/com.sap.odata.test1.BAESTwoKeyNavRTESTwoKeyNav" },
+ { "ESAllPrim/com.sap.odata.test1.BAESAllPrimRTETAllPrim" },
+ { "AIRTPrimCollParam" },
+ { "AIRTETParam" },
+ { "AIRTPrimParam" },
+
+ };
+
+ private String[][] urisWithNonValidSystemQueryOptions = {
+ { URI_ALL, QO_ID, }, { URI_ALL, QO_TOP },
+
+ { URI_BATCH, QO_FILTER, }, { URI_BATCH, QO_FORMAT }, { URI_BATCH, QO_ID, }, { URI_BATCH, QO_EXPAND },
+ { URI_BATCH, QO_COUNT }, { URI_BATCH, QO_ORDERBY }, /* { URI_BATCH, QO_SEARCH }, */{ URI_BATCH, QO_SELECT },
+ { URI_BATCH, QO_SKIP }, { URI_BATCH, QO_SKIPTOKEN }, { URI_BATCH, QO_LEVELS }, { URI_BATCH, QO_TOP },
+
+ { URI_CROSSJOIN, QO_ID, },
+
+ { URI_ENTITY_ID, QO_ID, QO_FILTER, },
+ { URI_ENTITY_ID, QO_ID, QO_COUNT }, { URI_ENTITY_ID, QO_ORDERBY }, /* { URI_ENTITY_ID, QO_SEARCH }, */
+
+ { URI_ENTITY_ID, QO_ID, QO_SKIP }, { URI_ENTITY_ID, QO_ID, QO_SKIPTOKEN }, { URI_ENTITY_ID, QO_ID, QO_TOP },
+
+ { URI_METADATA, QO_FILTER, }, { URI_METADATA, QO_ID, }, { URI_METADATA, QO_EXPAND },
+ { URI_METADATA, QO_COUNT }, { URI_METADATA, QO_ORDERBY }, /* { URI_METADATA, QO_SEARCH }, */
+ { URI_METADATA, QO_SELECT }, { URI_METADATA, QO_SKIP }, { URI_METADATA, QO_SKIPTOKEN },
+ { URI_METADATA, QO_LEVELS }, { URI_METADATA, QO_TOP },
+
+ { URI_SERVICE, QO_FILTER }, { URI_SERVICE, QO_ID }, { URI_SERVICE, QO_EXPAND }, { URI_SERVICE, QO_COUNT },
+ { URI_SERVICE, QO_ORDERBY }, /* { URI_SERVICE, QO_SEARCH }, */{ URI_SERVICE, QO_SELECT },
+ { URI_SERVICE, QO_SKIP }, { URI_SERVICE, QO_SKIPTOKEN }, { URI_SERVICE, QO_LEVELS }, { URI_SERVICE, QO_TOP },
+
+ { URI_ENTITY_SET, QO_ID },
+
+ { URI_ENTITY_SET_COUNT, QO_FORMAT }, { URI_ENTITY_SET_COUNT, QO_ID },
+ { URI_ENTITY_SET_COUNT, QO_EXPAND }, { URI_ENTITY_SET_COUNT, QO_COUNT },
+ { URI_ENTITY_SET_COUNT, QO_ORDERBY },
+ { URI_ENTITY_SET_COUNT, QO_SELECT }, { URI_ENTITY_SET_COUNT, QO_SKIP }, { URI_ENTITY_SET_COUNT, QO_SKIPTOKEN },
+ { URI_ENTITY_SET_COUNT, QO_LEVELS }, { URI_ENTITY_SET_COUNT, QO_TOP },
+
+ { URI_ENTITY, QO_FILTER }, { URI_ENTITY, QO_ID }, { URI_ENTITY, QO_COUNT }, /* { URI_ENTITY, QO_ORDERBY }, */
+ /* { URI_ENTITY, QO_SEARCH }, */{ URI_ENTITY, QO_SKIP }, { URI_ENTITY, QO_SKIPTOKEN }, { URI_ENTITY, QO_TOP },
+
+ { URI_MEDIA_STREAM, QO_FILTER }, { URI_MEDIA_STREAM, QO_ID, }, { URI_MEDIA_STREAM, QO_EXPAND },
+ { URI_MEDIA_STREAM, QO_COUNT }, { URI_MEDIA_STREAM, QO_ORDERBY }, /* { URI_MEDIA_STREAM, QO_SEARCH }, */
+ { URI_MEDIA_STREAM, QO_SELECT }, { URI_MEDIA_STREAM, QO_SKIP }, { URI_MEDIA_STREAM, QO_SKIPTOKEN },
+ { URI_MEDIA_STREAM, QO_LEVELS }, { URI_MEDIA_STREAM, QO_TOP },
+
+ { URI_REFERENCES, QO_ID, }, { URI_REFERENCES, QO_EXPAND }, { URI_REFERENCES, QO_COUNT },
+ { URI_REFERENCES, QO_SELECT }, { URI_REFERENCES, QO_LEVELS },
+
+ { URI_REFERENCE, QO_FILTER }, { URI_REFERENCE, QO_ID, }, { URI_REFERENCE, QO_EXPAND },
+ { URI_REFERENCE, QO_COUNT }, { URI_REFERENCE, QO_ORDERBY }, /* { URI_REFERENCE, QO_SEARCH }, */
+ { URI_REFERENCE, QO_SELECT }, { URI_REFERENCE, QO_SKIP }, { URI_REFERENCE, QO_SKIPTOKEN },
+ { URI_REFERENCE, QO_LEVELS }, { URI_REFERENCE, QO_TOP },
+
+ { URI_PROPERTY_COMPLEX, QO_FILTER }, { URI_PROPERTY_COMPLEX, QO_ID, }, { URI_PROPERTY_COMPLEX, QO_COUNT },
+ { URI_PROPERTY_COMPLEX, QO_ORDERBY }, /* { URI_PROPERTY_COMPLEX, QO_SEARCH }, */
+ { URI_PROPERTY_COMPLEX, QO_SKIP }, { URI_PROPERTY_COMPLEX, QO_SKIPTOKEN }, { URI_PROPERTY_COMPLEX, QO_TOP },
+
+ { URI_PROPERTY_COMPLEX_COLLECTION, QO_ID, },
+ /* { URI_PROPERTY_COMPLEX_COLLECTION, QO_SEARCH }, */{ URI_PROPERTY_COMPLEX_COLLECTION, QO_SELECT },
+
+ { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_FORMAT },
+ { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_ID, }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_EXPAND },
+ { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_COUNT }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_ORDERBY },
+ { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SELECT },
+ { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SKIP }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_SKIPTOKEN },
+ { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_LEVELS }, { URI_PROPERTY_COMPLEX_COLLECTION_COUNT, QO_TOP },
+
+ { URI_PROPERTY_PRIMITIVE, QO_FILTER }, { URI_PROPERTY_PRIMITIVE, QO_ID, }, { URI_PROPERTY_PRIMITIVE, QO_EXPAND },
+ { URI_PROPERTY_PRIMITIVE, QO_COUNT }, { URI_PROPERTY_PRIMITIVE, QO_ORDERBY },
+ /* { URI_PROPERTY_PRIMITIVE, QO_SEARCH }, */{ URI_PROPERTY_PRIMITIVE, QO_SELECT },
+ { URI_PROPERTY_PRIMITIVE, QO_SKIP }, { URI_PROPERTY_PRIMITIVE, QO_SKIPTOKEN },
+ { URI_PROPERTY_PRIMITIVE, QO_LEVELS }, { URI_PROPERTY_PRIMITIVE, QO_TOP },
+
+ { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_ID, }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_EXPAND },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_COUNT }, /* { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SEARCH }, */
+ { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_LEVELS },
+
+ { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_FORMAT },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_ID, }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_EXPAND },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_COUNT },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_ORDERBY },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SKIP },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_SKIPTOKEN },
+ { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_LEVELS }, { URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT, QO_TOP },
+
+ { URI_PROPERTY_PRIMITIVE_VALUE, QO_FILTER }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_ID, },
+ { URI_PROPERTY_PRIMITIVE_VALUE, QO_EXPAND }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_COUNT },
+ { URI_PROPERTY_PRIMITIVE_VALUE, QO_ORDERBY },/* { URI_PROPERTY_PRIMITIVE_VALUE, QO_SEARCH }, */
+ { URI_PROPERTY_PRIMITIVE_VALUE, QO_SELECT }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIP },
+ { URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_LEVELS },
+ { URI_PROPERTY_PRIMITIVE_VALUE, QO_TOP },
+
+ { URI_SINGLETON, QO_FILTER }, { URI_SINGLETON, QO_ID }, { URI_SINGLETON, QO_COUNT },
+ { URI_SINGLETON, QO_ORDERBY }, /* { URI_SINGLETON, QO_SEARCH }, */{ URI_SINGLETON, QO_SKIP },
+ { URI_SINGLETON, QO_SKIPTOKEN }, { URI_SINGLETON, QO_TOP },
+
+ { URI_NAV_ENTITY, QO_FILTER }, { URI_NAV_ENTITY, QO_ID }, { URI_NAV_ENTITY, QO_COUNT },
+ { URI_NAV_ENTITY, QO_ORDERBY }, /* { URI_NAV_ENTITY, QO_SEARCH }, */{ URI_NAV_ENTITY, QO_SKIP },
+ { URI_NAV_ENTITY, QO_SKIPTOKEN }, { URI_SINGLETON, QO_TOP },
+
+ { URI_NAV_ENTITY_SET, QO_ID },
+
+ };
+
+ private Parser parser;
+ private Edm edm;
+
+ @Before
+ public void before() {
+ parser = new Parser();
+ edm = new EdmProviderImpl(new EdmTechProvider());
+ }
+
+ @Test
+ public void validateSelect() throws Exception {
+ String[] uris = { "/ESAllPrim(1)?$select=PropertyString" };
+ for (String uri : uris) {
+ parseAndValidate(uri, "GET");
+ }
+ }
+
+ @Test(expected = UriValidationException.class)
+ public void validateForHttpMethodsFail() throws Exception {
+ String uri = URI_ENTITY;
+ parseAndValidate(uri, "xyz");
+ }
+
+ @Test
+ public void validateForHttpMethods() throws Exception {
+ String uri = URI_ENTITY;
+ parseAndValidate(uri, "GET");
+ parseAndValidate(uri, "POST");
+ parseAndValidate(uri, "PUT");
+ parseAndValidate(uri, "DELETE");
+ parseAndValidate(uri, "PATCH");
+ parseAndValidate(uri, "MERGE");
+ }
+
+ @Test
+ public void validateOrderBy() throws Exception {
+ String[] uris = { "/ESAllPrim?$orderby=PropertyString" };
+ for (String uri : uris) {
+ parseAndValidate(uri, "GET");
+ }
+ }
+
+ @Test(expected = UriValidationException.class)
+ @Ignore("uri parser doen't support orderby yet")
+ public void validateOrderByInvalid() throws Exception {
+ String uri = "/ESAllPrim(1)?$orderBy=XXXX";
+ parseAndValidate(uri, "GET");
+ }
+
+ @Test(expected = UriValidationException.class)
+ public void validateKeyPredicatesWrongKey() throws Exception {
+ String uri = "ESTwoKeyNav(xxx=1, yyy='abc')";
+ parseAndValidate(uri, "GET");
+ }
+
+ @Test
+ public void validateKeyPredicates() throws Exception {
+ String uri = "ESTwoKeyNav(PropertyInt16=1, PropertyString='abc')";
+ parseAndValidate(uri, "GET");
+ }
+
+ @Test(expected = UriValidationException.class)
+ public void validateKeyPredicatesWrongValueType() throws Exception {
+ String uri = "ESTwoKeyNav(PropertyInt16='abc', PropertyString=1)";
+ parseAndValidate(uri, "GET");
+ }
+
+ @Test
+ public void checkValidSystemQueryOption() throws Exception {
+ String[] uris = constructUri(urisWithValidSystemQueryOptions);
+
+ for (String uri : uris) {
+ try {
+ parseAndValidate(uri, "GET");
+ } catch (Exception e) {
+ throw new Exception("Faild for uri: " + uri, e);
+ }
+ }
+ }
+
+ @Test
+ public void checkNonValidSystemQueryOption() throws Exception {
+ String[] uris = constructUri(urisWithNonValidSystemQueryOptions);
+
+ for (String uri : uris) {
+ try {
+ parseAndValidate(uri, "GET");
+ fail("Validation Exception not thrown: " + uri);
+ } catch (UriValidationException e) {
+ assertTrue(e instanceof UriValidationException);
+ }
+ }
+ }
+
+ private String[] constructUri(final String[][] uriParameterMatrix) {
+ ArrayList<String> uris = new ArrayList<String>();
+ for (String[] uriParameter : uriParameterMatrix) {
+ String uri = uriParameter[0];
+ if (uriParameter.length > 1) {
+ uri += "?";
+ }
+ for (int i = 1; i < uriParameter.length; i++) {
+ uri += uriParameter[i];
+ if (i < (uriParameter.length - 1)) {
+ uri += "&";
+ }
+ }
+ uris.add(uri);
+ }
+ return uris.toArray(new String[0]);
+ }
+
+ private void parseAndValidate(final String uri, String method) throws UriParserException, UriValidationException {
+ UriInfo uriInfo = parser.parseUri(uri.trim(), edm);
+ UriValidator validator = new UriValidator();
+
+ validator.validate(uriInfo, method);
+ }
+
+}
[04/31] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/olingo-odata4
Posted by sk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/olingo-odata4
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/8bd9e0ca
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/8bd9e0ca
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/8bd9e0ca
Branch: refs/heads/olingo-266-ref
Commit: 8bd9e0ca9776b56b55b58fcc66883b21bc5f4c02
Parents: fc42d2a c32f4a0
Author: fmartelli <fa...@gmail.com>
Authored: Mon May 12 11:55:39 2014 +0200
Committer: fmartelli <fa...@gmail.com>
Committed: Mon May 12 11:55:39 2014 +0200
----------------------------------------------------------------------
fit/src/main/resources/V40/badRequest.json | 50 ++++++++-----
fit/src/main/resources/V40/notFound.json | 44 +++++++++---
.../olingo/fit/v4/ErrorResponseTestITCase.java | 76 ++++++++++++++++++++
.../apache/olingo/commons/api/Constants.java | 4 ++
.../olingo/commons/api/domain/ODataError.java | 17 +++++
.../commons/api/domain/ODataErrorDetail.java | 48 +++++++++++++
.../commons/core/data/AbstractODataError.java | 32 +++++++--
.../core/data/JSONODataErrorDeserializer.java | 34 ++++++++-
.../data/JSONODataErrorDetailDeserializer.java | 66 +++++++++++++++++
.../core/data/JSONODataErrorDetailImpl.java | 62 ++++++++++++++++
10 files changed, 402 insertions(+), 31 deletions(-)
----------------------------------------------------------------------
[05/31] Various small improvements,
added test for instance annotations
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java
index 50fa1f9..36818a9 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDeserializer.java
@@ -24,17 +24,12 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
-
import java.io.IOException;
import java.net.URI;
import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
-
import org.apache.olingo.commons.api.Constants;
-import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.ResWrap;
import org.apache.olingo.commons.api.domain.ODataErrorDetail;
@@ -65,29 +60,25 @@ public class JSONODataErrorDeserializer extends AbstractJsonDeserializer<JSONODa
error.setTarget(errorNode.get(Constants.ERROR_TARGET).textValue());
}
if (errorNode.hasNonNull(Constants.ERROR_DETAILS)) {
- List<ODataErrorDetail> details = new ArrayList<ODataErrorDetail>();
- for (final Iterator<JsonNode> itor = errorNode.get(Constants.ERROR_DETAILS).iterator(); itor.hasNext();) {
- details.add(
- itor.next().traverse(parser.getCodec()).<ResWrap<JSONODataErrorDetailImpl>>readValueAs(
- new TypeReference<JSONODataErrorDetailImpl>() {
- }).getPayload());
- }
-
- error.setDetails(details);
+ final List<ODataErrorDetail> details = new ArrayList<ODataErrorDetail>();
+ for (final Iterator<JsonNode> itor = errorNode.get(Constants.ERROR_DETAILS).iterator(); itor.hasNext();) {
+ details.add(itor.next().traverse(parser.getCodec()).<ResWrap<JSONODataErrorDetailImpl>>readValueAs(
+ new TypeReference<JSONODataErrorDetailImpl>() {
+ }).getPayload());
+ }
+
+ error.setDetails(details);
}
if (errorNode.hasNonNull(Constants.ERROR_INNERERROR)) {
- JsonNode innerError = errorNode.get(Constants.ERROR_INNERERROR);
- Dictionary<String, Object> innerErr = new Hashtable<String, Object>();
- for (final Iterator<String> itor = innerError.fieldNames(); itor.hasNext();) {
- String keyTmp = itor.next();
- String val = innerError.get(keyTmp).toString();
- innerErr.put(keyTmp,val);
- }
-
- error.setInnerError(innerErr);
+ final JsonNode innerError = errorNode.get(Constants.ERROR_INNERERROR);
+ for (final Iterator<String> itor = innerError.fieldNames(); itor.hasNext();) {
+ final String keyTmp = itor.next();
+ final String val = innerError.get(keyTmp).toString();
+ error.getInnerError().put(keyTmp, val);
+ }
}
}
-
+
return new ResWrap<JSONODataErrorImpl>((URI) null, null, error);
}
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java
index 9c2ce7b..38ea043 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailDeserializer.java
@@ -20,47 +20,37 @@ package org.apache.olingo.commons.core.data;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonProcessingException;
-import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
import java.io.IOException;
import java.net.URI;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
import org.apache.olingo.commons.api.Constants;
-import org.apache.olingo.commons.api.data.Entity;
import org.apache.olingo.commons.api.data.ResWrap;
-import org.apache.olingo.commons.api.domain.ODataErrorDetail;
-public class JSONODataErrorDetailDeserializer extends
- AbstractJsonDeserializer<JSONODataErrorDetailImpl> {
+public class JSONODataErrorDetailDeserializer extends AbstractJsonDeserializer<JSONODataErrorDetailImpl> {
- @Override
- protected ResWrap<JSONODataErrorDetailImpl> doDeserialize(
- final JsonParser parser, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
+ @Override
+ protected ResWrap<JSONODataErrorDetailImpl> doDeserialize(
+ final JsonParser parser, final DeserializationContext ctxt)
+ throws IOException, JsonProcessingException {
- final JSONODataErrorDetailImpl error = new JSONODataErrorDetailImpl();
- final JsonNode errorNode = parser.getCodec().readTree(parser);
- if (errorNode.has(Constants.ERROR_CODE)) {
- error.setCode(errorNode.get(Constants.ERROR_CODE).textValue());
- }
- if (errorNode.has(Constants.ERROR_MESSAGE)) {
- final JsonNode message = errorNode.get(Constants.ERROR_MESSAGE);
- if (message.isValueNode()) {
- error.setMessage(message.textValue());
- } else if (message.isObject()) {
- error.setMessage(message.get(Constants.VALUE).asText());
- }
- }
- if (errorNode.has(Constants.ERROR_TARGET)) {
- error.setTarget(errorNode.get(Constants.ERROR_TARGET).textValue());
- }
+ final JSONODataErrorDetailImpl error = new JSONODataErrorDetailImpl();
+ final JsonNode errorNode = parser.getCodec().readTree(parser);
+ if (errorNode.has(Constants.ERROR_CODE)) {
+ error.setCode(errorNode.get(Constants.ERROR_CODE).textValue());
+ }
+ if (errorNode.has(Constants.ERROR_MESSAGE)) {
+ final JsonNode message = errorNode.get(Constants.ERROR_MESSAGE);
+ if (message.isValueNode()) {
+ error.setMessage(message.textValue());
+ } else if (message.isObject()) {
+ error.setMessage(message.get(Constants.VALUE).asText());
+ }
+ }
+ if (errorNode.has(Constants.ERROR_TARGET)) {
+ error.setTarget(errorNode.get(Constants.ERROR_TARGET).textValue());
+ }
- return new ResWrap<JSONODataErrorDetailImpl>((URI) null, null, error);
- }
+ return new ResWrap<JSONODataErrorDetailImpl>((URI) null, null, error);
+ }
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/8720a30e/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java
index 2f4585a..49f3159 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/data/JSONODataErrorDetailImpl.java
@@ -27,36 +27,36 @@ import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
@JsonDeserialize(using = JSONODataErrorDetailDeserializer.class)
public class JSONODataErrorDetailImpl implements ODataErrorDetail {
- private String code;
+ private String code;
- private String message;
+ private String message;
- private String target;
+ private String target;
- @Override
- public String getCode() {
- return code;
- }
+ @Override
+ public String getCode() {
+ return code;
+ }
- public void setCode(final String code) {
- this.code = code;
- }
+ public void setCode(final String code) {
+ this.code = code;
+ }
- @Override
- public String getMessage() {
- return message;
- }
+ @Override
+ public String getMessage() {
+ return message;
+ }
- public void setMessage(final String message) {
- this.message = message;
- }
+ public void setMessage(final String message) {
+ this.message = message;
+ }
- @Override
- public String getTarget() {
- return target;
- }
+ @Override
+ public String getTarget() {
+ return target;
+ }
- public void setTarget(final String target) {
- this.target = target;
- }
-}
\ No newline at end of file
+ public void setTarget(final String target) {
+ this.target = target;
+ }
+}
[27/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
deleted file mode 100644
index e8aa9ce..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestLexer.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.antlr;
-
-import org.antlr.v4.runtime.Lexer;
-import org.apache.olingo.server.core.uri.testutil.TokenValidator;
-import org.junit.Test;
-
-public class TestLexer {
-
- private TokenValidator test = null;
-
- private static final String cPCT_ENCODED = "%45%46%47" + "%22" + "%5C";// last two chars are not in
- // cPCT_ENCODED_UNESCAPED
- private static final String cUNRESERVED = "ABCabc123-._~";
- private static final String cOTHER_DELIMS = "!()*+,;";
- private static final String cSUB_DELIMS = "$&'=" + cOTHER_DELIMS;
-
- private static final String cPCHAR = cUNRESERVED + cPCT_ENCODED + cSUB_DELIMS + ":@";
-
- public TestLexer() {
- test = new TokenValidator();
- }
-
- @Test
- public void test() {
-
- // test.log(1).run("ESAllPrim?$orderby=PropertyDouble eq 3.5E+38");
- }
-
- // ;------------------------------------------------------------------------------
- // ; 0. URI
- // ;------------------------------------------------------------------------------
-
- @Test
- public void testUriTokens() {
- test.globalMode(UriLexer.MODE_QUERY);
- test.run("#").isText("#").isType(UriLexer.FRAGMENT);
- test.run("$count").isText("$count").isType(UriLexer.COUNT);
- test.run("$ref").isText("$ref").isType(UriLexer.REF);
- test.run("$value").isText("$value").isType(UriLexer.VALUE);
- }
-
- // ;------------------------------------------------------------------------------
- // ; 2. Query Options
- // ;------------------------------------------------------------------------------
- @Test
- public void testQueryOptionsTokens() {
-
- test.globalMode(UriLexer.MODE_QUERY);
- test.run("$skip=1").isAllText("$skip=1").isType(UriLexer.SKIP);
- test.run("$skip=2").isAllText("$skip=2").isType(UriLexer.SKIP);
- test.run("$skip=123").isAllText("$skip=123").isType(UriLexer.SKIP);
-
- test.run("$top=1").isAllText("$top=1").isType(UriLexer.TOP);
- test.run("$top=2").isAllText("$top=2").isType(UriLexer.TOP);
- test.run("$top=123").isAllText("$top=123").isType(UriLexer.TOP);
-
- test.run("$levels=1").isAllText("$levels=1").isType(UriLexer.LEVELS);
- test.run("$levels=2").isAllText("$levels=2").isType(UriLexer.LEVELS);
- test.run("$levels=123").isAllText("$levels=123").isType(UriLexer.LEVELS);
- test.run("$levels=max").isAllText("$levels=max").isType(UriLexer.LEVELS);
-
- test.run("$format=atom").isAllText("$format=atom").isType(UriLexer.FORMAT);
- test.run("$format=json").isAllText("$format=json").isType(UriLexer.FORMAT);
- test.run("$format=xml").isAllText("$format=xml").isType(UriLexer.FORMAT);
- test.run("$format=abc/def").isAllText("$format=abc/def").isType(UriLexer.FORMAT);
-
- test.run("$id=123").isAllText("$id=123").isType(UriLexer.ID);
- test.run("$id=ABC").isAllText("$id=ABC").isType(UriLexer.ID);
-
- test.run("$skiptoken=ABC").isAllText("$skiptoken=ABC").isType(UriLexer.SKIPTOKEN);
- test.run("$skiptoken=ABC").isAllText("$skiptoken=ABC").isType(UriLexer.SKIPTOKEN);
-
- test.run("$search=\"ABC\"").isAllText("$search=\"ABC\"").isType(UriLexer.SEARCH);
- test.run("$search=ABC").isAllText("$search=ABC").isType(UriLexer.SEARCH);
- test.run("$search=\"A%20B%20C\"").isAllText("$search=\"A%20B%20C\"").isType(UriLexer.SEARCH);
- }
-
- // ;------------------------------------------------------------------------------
- // ; 4. Expressions
- // ;------------------------------------------------------------------------------
- @Test
- public void testQueryExpressions() {
- test.globalMode(Lexer.DEFAULT_MODE);
-
- test.run("$it").isText("$it").isType(UriLexer.IT);
-
- test.run("$filter=contains(").at(2).isText("contains(").isType(UriLexer.CONTAINS_WORD);
-
- test.run("$filter=containsabc").at(2).isText("containsabc")
- .isType(UriLexer.ODATAIDENTIFIER); // test that this is a ODI
-
- test.run("$filter=startswith(").at(2).isText("startswith(").isType(UriLexer.STARTSWITH_WORD);
- test.run("$filter=endswith(").at(2).isText("endswith(").isType(UriLexer.ENDSWITH_WORD);
- test.run("$filter=length(").at(2).isText("length(").isType(UriLexer.LENGTH_WORD);
- test.run("$filter=indexof(").at(2).isText("indexof(").isType(UriLexer.INDEXOF_WORD);
- test.run("$filter=substring(").at(2).isText("substring(").isType(UriLexer.SUBSTRING_WORD);
- test.run("$filter=tolower(").at(2).isText("tolower(").isType(UriLexer.TOLOWER_WORD);
- test.run("$filter=toupper(").at(2).isText("toupper(").isType(UriLexer.TOUPPER_WORD);
- test.run("$filter=trim(").at(2).isText("trim(").isType(UriLexer.TRIM_WORD);
- test.run("$filter=concat(").at(2).isText("concat(").isType(UriLexer.CONCAT_WORD);
-
- }
-
- // ;------------------------------------------------------------------------------
- // ; 7. Literal Data Values
- // ;------------------------------------------------------------------------------
-
- @Test
- public void testLiteralDataValues() {
- test.globalMode(Lexer.DEFAULT_MODE);
- // null
- test.run("null").isInput().isType(UriLexer.NULLVALUE);
-
- // binary
- test.run("binary'ABCD'").isInput().isType(UriLexer.BINARY);
- test.run("BiNaRy'ABCD'").isInput().isType(UriLexer.BINARY);
-
- // boolean
- test.run("true").isInput().isType(UriLexer.TRUE);
- test.run("false").isInput().isType(UriLexer.FALSE);
- test.run("TrUe").isInput().isType(UriLexer.BOOLEAN);
- test.run("FaLsE").isInput().isType(UriLexer.BOOLEAN);
-
- // Lexer rule INT
- test.run("123").isInput().isType(UriLexer.INT);
- test.run("123456789").isInput().isType(UriLexer.INT);
- test.run("+123").isInput().isType(UriLexer.INT);
- test.run("+123456789").isInput().isType(UriLexer.INT);
- test.run("-123").isInput().isType(UriLexer.INT);
- test.run("-123456789").isInput().isType(UriLexer.INT);
-
- // Lexer rule DECIMAL
- test.run("0.1").isInput().isType(UriLexer.DECIMAL);
- test.run("1.1").isInput().isType(UriLexer.DECIMAL);
- test.run("+0.1").isInput().isType(UriLexer.DECIMAL);
- test.run("+1.1").isInput().isType(UriLexer.DECIMAL);
- test.run("-0.1").isInput().isType(UriLexer.DECIMAL);
- test.run("-1.1").isInput().isType(UriLexer.DECIMAL);
-
- // Lexer rule EXP
- test.run("1.1e+1").isInput().isType(UriLexer.DECIMAL);
- test.run("1.1e-1").isInput().isType(UriLexer.DECIMAL);
-
- test.run("NaN").isInput().isType(UriLexer.NANINFINITY);
- test.run("-INF").isInput().isType(UriLexer.NANINFINITY);
- test.run("INF").isInput().isType(UriLexer.NANINFINITY);
-
- // Lexer rule GUID
- test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").isInput().isType(UriLexer.GUID);
- test.run("1234ABCD-12AB-23CD-45EF-123456780ABC").isInput().isType(UriLexer.GUID);
-
- // Lexer rule DATE
- test.run("2013-11-15").isInput().isType(UriLexer.DATE);
-
- // Lexer rule DATETIMEOFFSET
- test.run("2013-11-15T13:35Z").isInput().isType(UriLexer.DATETIMEOFFSET);
- test.run("2013-11-15T13:35:10Z").isInput().isType(UriLexer.DATETIMEOFFSET);
- test.run("2013-11-15T13:35:10.1234Z").isInput().isType(UriLexer.DATETIMEOFFSET);
-
- test.run("2013-11-15T13:35:10.1234+01:30").isInput().isType(UriLexer.DATETIMEOFFSET);
- test.run("2013-11-15T13:35:10.1234-01:12").isInput().isType(UriLexer.DATETIMEOFFSET);
-
- test.run("2013-11-15T13:35Z").isInput().isType(UriLexer.DATETIMEOFFSET);
-
- // Lexer rule DURATION
- test.run("duration'PT67S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'PT67.89S'").isInput().isType(UriLexer.DURATION);
-
- test.run("duration'PT5M'").isInput().isType(UriLexer.DURATION);
- test.run("duration'PT5M67S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'PT5M67.89S'").isInput().isType(UriLexer.DURATION);
-
- test.run("duration'PT4H'").isInput().isType(UriLexer.DURATION);
- test.run("duration'PT4H67S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'PT4H67.89S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'PT4H5M'").isInput().isType(UriLexer.DURATION);
- test.run("duration'PT4H5M67S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'PT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
-
- test.run("duration'P3D'");
- test.run("duration'P3DT67S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT67.89S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT5M'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT5M67S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT5M67.89S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT4H'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT4H67S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT4H67.89S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT4H5M'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT4H5M67S'").isInput().isType(UriLexer.DURATION);
- test.run("duration'P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
-
- test.run("DuRaTiOn'P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
- test.run("DuRaTiOn'-P3DT4H5M67.89S'").isInput().isType(UriLexer.DURATION);
-
- test.run("20:00").isInput().isType(UriLexer.TIMEOFDAY);
- test.run("20:15:01").isInput().isType(UriLexer.TIMEOFDAY);
- test.run("20:15:01.02").isInput().isType(UriLexer.TIMEOFDAY);
-
- test.run("20:15:01.02").isInput().isType(UriLexer.TIMEOFDAY);
-
- // String
- test.run("'ABC'").isText("'ABC'").isType(UriLexer.STRING);
- test.run("'A%20C'").isInput().isType(UriLexer.STRING);
- test.run("'%20%20%20ABC'").isInput().isType(UriLexer.STRING);
-
- }
-
- @Test
- public void testDelims() {
- String reserved = "/";
- test.globalMode(UriLexer.MODE_QUERY);
- // Test lexer rule UNRESERVED
- test.run("$format=A/" + cUNRESERVED).isAllInput().isType(UriLexer.FORMAT);
- test.run("$format=A/" + cUNRESERVED + reserved).isType(UriLexer.FORMAT).at(4).isText(cUNRESERVED);
- // Test lexer rule PCT_ENCODED
- test.run("$format=A/" + cPCT_ENCODED).isAllInput().isType(UriLexer.FORMAT);
- test.run("$format=A/" + cPCT_ENCODED + reserved).isType(UriLexer.FORMAT).at(4).isText(cPCT_ENCODED);
- // Test lexer rule SUB_DELIMS
- test.run("$format=A/" + cSUB_DELIMS).isAllInput().isType(UriLexer.FORMAT);
- test.run("$format=A/" + cSUB_DELIMS + reserved).isType(UriLexer.FORMAT).at(4).isText("$");
- // Test lexer rule PCHAR rest
- test.run("$format=A/:@").isAllText("$format=A/:@").isType(UriLexer.FORMAT);
- test.run("$format=A/:@" + reserved).isType(UriLexer.FORMAT).at(4).isText(":@");
- // Test lexer rule PCHAR all
- test.run("$format=" + cPCHAR + "/" + cPCHAR).isAllInput().isType(UriLexer.FORMAT);
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
deleted file mode 100644
index 4e5acf8..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestUriParserImpl.java
+++ /dev/null
@@ -1,1144 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.antlr;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.Arrays;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.UriResourceKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
-import org.apache.olingo.server.core.uri.parser.UriParserException;
-import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
-import org.apache.olingo.server.core.uri.testutil.FilterValidator;
-import org.apache.olingo.server.core.uri.testutil.ResourceValidator;
-import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
-import org.apache.olingo.server.ref.provider.ComplexTypeProvider;
-import org.apache.olingo.server.ref.provider.EntityTypeProvider;
-import org.apache.olingo.server.ref.provider.PropertyProvider;
-import org.junit.Test;
-
-public class TestUriParserImpl {
- Edm edm = null;
- private final String PropertyBoolean = "PropertyBoolean=true";
- private final String PropertyByte = "PropertyByte=1";
-
- private final String PropertyDate = "PropertyDate=2013-09-25";
- private final String PropertyDateTimeOffset = "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00";
- private final String PropertyDecimal = "PropertyDecimal=12";
- private final String PropertyDuration = "PropertyDuration=duration'P10DT5H34M21.123456789012S'";
- private final String PropertyGuid = "PropertyGuid=12345678-1234-1234-1234-123456789012";
- private final String PropertyInt16 = "PropertyInt16=1";
- private final String PropertyInt32 = "PropertyInt32=12";
- private final String PropertyInt64 = "PropertyInt64=64";
- private final String PropertySByte = "PropertySByte=1";
- private final String PropertyString = "PropertyString='ABC'";
- private final String PropertyTimeOfDay = "PropertyTimeOfDay=12:34:55.123456789012";
-
- private final String allKeys = PropertyString + "," + PropertyInt16 + "," + PropertyBoolean + "," + PropertyByte
- + "," + PropertySByte + "," + PropertyInt32 + "," + PropertyInt64 + "," + PropertyDecimal + "," + PropertyDate
- + "," + PropertyDateTimeOffset + "," + PropertyDuration + "," + PropertyGuid + "," + PropertyTimeOfDay;
-
- TestUriValidator testUri = null;
- ResourceValidator testRes = null;
- FilterValidator testFilter = null;
-
- public TestUriParserImpl() {
- edm = new EdmProviderImpl(new EdmTechTestProvider());
- testUri = new TestUriValidator().setEdm(edm);
- testRes = new ResourceValidator().setEdm(edm);
- testFilter = new FilterValidator().setEdm(edm);
- }
-
- @Test
- public void test() throws UriParserException, UnsupportedEncodingException {
-
- }
-
- @Test
- public void testBoundFunctionImport_VarParameters() {
-
- // no input
- testRes.run("ESKeyNav(1)/com.sap.odata.test1.BFCETKeyNavRTETKeyNav()")
- .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
- .at(1).isUriPathInfoKind(UriResourceKind.function);
-
- // one input
- testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')")
- .at(0).isUriPathInfoKind(UriResourceKind.entitySet)
- .at(1).isUriPathInfoKind(UriResourceKind.function)
- .isParameter(0, "ParameterString", "'ABC'");
-
- // two input
- testRes.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
- .at(0)
- .isUriPathInfoKind(UriResourceKind.function)
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'2'");
- }
-
- @Test
- public void testFunctionBound_varReturnType() {
-
- String esTwoKeyNav = "ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')";
-
- // returning primitive
- testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTString()")
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(PropertyProvider.nameString, false);
-
- // returning collection of primitive
- testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollString()")
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(PropertyProvider.nameString, true);
-
- // returning single complex
- testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()")
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(ComplexTypeProvider.nameCTTwoPrim, false);
-
- // returning collection of complex
- testRes.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
- // returning single entity
- testRes.run(
- esTwoKeyNav + "/com.sap.odata.test1.ETBaseTwoKeyNav/com.sap.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav, false);
-
- // returning collection of entity (aka entitySet)
- testRes.run(esTwoKeyNav + "/com.sap.odata.test1.BFCSINavRTESTwoKeyNav()")
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true);
- }
-
- @Test
- public void runActionImport_VarReturnType() {
-
- testRes.run("AIRTPrimParam").isKind(UriInfoKind.resource)
- .first()
- .isActionImport("AIRTPrimParam")
- .isAction("UARTPrimParam")
- .isType(PropertyProvider.nameString, false);
-
- testRes.run("AIRTPrimCollParam").isKind(UriInfoKind.resource)
- .first()
- .isActionImport("AIRTPrimCollParam")
- .isAction("UARTPrimCollParam")
- .isType(PropertyProvider.nameString, true);
-
- testRes.run("AIRTCompParam").isKind(UriInfoKind.resource)
- .first()
- .isActionImport("AIRTCompParam")
- .isAction("UARTCompParam")
- .isType(ComplexTypeProvider.nameCTTwoPrim, false);
-
- testRes.run("AIRTCompCollParam").isKind(UriInfoKind.resource)
- .first()
- .isActionImport("AIRTCompCollParam")
- .isAction("UARTCompCollParam")
- .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
- testRes.run("AIRTETParam").isKind(UriInfoKind.resource)
- .first()
- .isActionImport("AIRTETParam")
- .isAction("UARTETParam")
- .isType(EntityTypeProvider.nameETTwoKeyTwoPrim, false);
-
- testUri.runEx("AIRTPrimParam/invalidElement").isExSemantic(0);
- }
-
- @Test
- public void runCount() {
-
- // count entity set
- testRes.run("ESAllPrim/$count")
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETAllPrim, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.count);
-
- // count on collection of complex
- testRes.run("ESKeyNav(1)/CollPropertyComplex/$count")
- .at(0)
- .isType(EntityTypeProvider.nameETKeyNav)
- .at(1)
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .at(2)
- .isUriPathInfoKind(UriResourceKind.count);
-
- // count on collection of primitive
- testRes.run("ESCollAllPrim(1)/CollPropertyString/$count")
- .at(1)
- .isType(PropertyProvider.nameString, true)
- .at(2)
- .isUriPathInfoKind(UriResourceKind.count);
- }
-
- @Test
- public void runCrossJoin() {
- testUri.run("$crossjoin(ESAllKey)")
- .isKind(UriInfoKind.crossjoin)
- .isCrossJoinEntityList(Arrays.asList("ESAllKey"));
-
- testUri.run("$crossjoin(ESAllKey,ESTwoPrim)")
- .isKind(UriInfoKind.crossjoin)
- .isCrossJoinEntityList(Arrays.asList("ESAllKey", "ESTwoPrim"));
- }
-
- @Test(expected = Exception.class)
- public void testEntityFailOnValidation1() {
- // simple entity set; with qualifiedentityTypeName; with filter
- testUri.run("$entity/com.sap.odata.test1.ETTwoPrim?$filter=PropertyInt16 eq 123&$id=ESAllKey")
- .isIdText("ESAllKey")
- .goFilter().is("<<PropertyInt16> eq <123>>");
- }
-
- @Test(expected = Exception.class)
- public void testEntityFailOnValidation2() {
- // simple entity set; with qualifiedentityTypeName; with 2xformat(before and after), expand, filter
- testUri.run("$entity/com.sap.odata.test1.ETTwoPrim?"
- + "$format=xml&$expand=*&abc=123&$id=ESBase&xyz=987&$filter=PropertyInt16 eq 123&$format=atom&$select=*")
- .isFormatText("atom")
- .isCustomParameter(0, "abc", "123")
- .isIdText("ESBase")
- .isCustomParameter(1, "xyz", "987")
- .isSelectItemStar(0);
- }
-
- @Test
- public void testEntity() {
-
- // simple entity set
- testUri.run("$entity?$id=ESAllPrim").isKind(UriInfoKind.entityId)
- .isKind(UriInfoKind.entityId)
- .isIdText("ESAllPrim");
-
- // simple entity set; $format before $id
- testUri.run("$entity?$format=xml&$id=ETAllPrim").isKind(UriInfoKind.entityId)
- .isFormatText("xml")
- .isIdText("ETAllPrim");
-
- testUri.run("$entity?$format=xml&abc=123&$id=ESAllKey").isKind(UriInfoKind.entityId)
- .isFormatText("xml")
- .isCustomParameter(0, "abc", "123")
- .isIdText("ESAllKey");
-
- // simple entity set; $format after $id
- testUri.run("$entity?$id=ETAllPrim&$format=xml").isKind(UriInfoKind.entityId)
- .isIdText("ETAllPrim")
- .isFormatText("xml");
-
- // simple entity set; $format and custom parameter after $id
- testUri.run("$entity?$id=ETAllPrim&$format=xml&abc=123").isKind(UriInfoKind.entityId)
- .isIdText("ETAllPrim")
- .isFormatText("xml")
- .isCustomParameter(0, "abc", "123");
-
- // simple entity set; $format before $id and custom parameter after $id
- testUri.run("$entity?$format=xml&$id=ETAllPrim&abc=123").isKind(UriInfoKind.entityId)
- .isFormatText("xml")
- .isIdText("ETAllPrim")
- .isCustomParameter(0, "abc", "123");
-
- // simple entity set; with qualifiedentityTypeName
- testUri.run("$entity/com.sap.odata.test1.ETTwoPrim?$id=ESBase")
- .isEntityType(EntityTypeProvider.nameETTwoPrim)
- .isIdText("ESBase");
-
- // simple entity set; with qualifiedentityTypeName;
- testUri.run("$entity/com.sap.odata.test1.ETBase?$id=ESTwoPrim")
- .isEntityType(EntityTypeProvider.nameETBase)
- .isKind(UriInfoKind.entityId)
- .isIdText("ESTwoPrim");
-
- // simple entity set; with qualifiedentityTypeName; with format
- testUri.run("$entity/com.sap.odata.test1.ETBase?$id=ESTwoPrim&$format=atom")
- .isKind(UriInfoKind.entityId)
- .isEntityType(EntityTypeProvider.nameETBase)
- .isIdText("ESTwoPrim")
- .isFormatText("atom");
-
- // simple entity set; with qualifiedentityTypeName; with select
- testUri.run("$entity/com.sap.odata.test1.ETBase?$id=ESTwoPrim&$select=*")
- .isKind(UriInfoKind.entityId)
- .isEntityType(EntityTypeProvider.nameETBase)
- .isIdText("ESTwoPrim")
- .isSelectItemStar(0);
-
- // simple entity set; with qualifiedentityTypeName; with expand
- testUri.run("$entity/com.sap.odata.test1.ETBase?$id=ESTwoPrim&$expand=*")
- .isKind(UriInfoKind.entityId)
- .isEntityType(EntityTypeProvider.nameETBase)
- .isIdText("ESTwoPrim")
- .isExpandText("*")
- .goExpand().first().isSegmentStar(0);
-
- }
-
- @Test
- public void testEntitySet() throws UnsupportedEncodingException {
-
- // plain entity set
- testRes.run("ESAllPrim")
- .isEntitySet("ESAllPrim")
- .isType(EntityTypeProvider.nameETAllPrim);
-
- // with one key; simple key notation
- testRes.run("ESAllPrim(1)")
- .isEntitySet("ESAllPrim")
- .isType(EntityTypeProvider.nameETAllPrim)
- .isKeyPredicate(0, "PropertyInt16", "1");
-
- // with one key; name value key notation
- testRes.run("ESAllPrim(PropertyInt16=1)")
- .isEntitySet("ESAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1");
-
- // with two keys
- testRes.run("ESTwoKeyTwoPrim(PropertyInt16=1, PropertyString='ABC')")
- .isEntitySet("ESTwoKeyTwoPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'ABC'");
-
- // with all keys
- testRes.run("ESAllKey(" + encode(allKeys) + ")")
- .isEntitySet("ESAllKey")
- .isKeyPredicate(0, "PropertyString", "'ABC'")
- .isKeyPredicate(1, "PropertyInt16", "1")
- .isKeyPredicate(2, "PropertyBoolean", "true")
- .isKeyPredicate(3, "PropertyByte", "1")
- .isKeyPredicate(4, "PropertySByte", "1")
- .isKeyPredicate(5, "PropertyInt32", "12")
- .isKeyPredicate(6, "PropertyInt64", "64")
- .isKeyPredicate(7, "PropertyDecimal", "12")
- .isKeyPredicate(8, "PropertyDate", "2013-09-25")
- .isKeyPredicate(9, "PropertyDateTimeOffset", "2002-10-10T12:00:00-05:00")
- .isKeyPredicate(10, "PropertyDuration", "duration'P10DT5H34M21.123456789012S'")
- .isKeyPredicate(11, "PropertyGuid", "12345678-1234-1234-1234-123456789012")
- .isKeyPredicate(12, "PropertyTimeOfDay", "12:34:55.123456789012");
- }
-
- @Test
- public void testEntitySet_NavigationPropperty() {
-
- // plain entity set ...
-
- // with navigation property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
- .at(0)
- .isEntitySet("ESKeyNav")
- .isType(EntityTypeProvider.nameETKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(1)
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- // with navigation property -> property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/PropertyString")
- .at(0)
- .isEntitySet("ESKeyNav")
- .isType(EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(1)
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .at(2)
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- // with navigation property -> navigation property -> navigation property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
- .at(0)
- .isEntitySet("ESKeyNav")
- .isType(EntityTypeProvider.nameETKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(1)
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .at(2)
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .isType(EntityTypeProvider.nameETKeyNav);
-
- // with navigation property(key)
- testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)")
- .at(0)
- .isEntitySet("ESKeyNav")
- .at(1)
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1");
-
- // with navigation property(key) -> property
- testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/PropertyString").at(0)
- .at(0)
- .isEntitySet("ESKeyNav")
- .at(1)
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(2)
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- // with navigation property(key) -> navigation property
- testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavOne")
- .isEntitySet("ESKeyNav")
- .at(1)
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(2)
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
- // with navigation property(key) -> navigation property(key)
- testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavMany(1)")
- .isEntitySet("ESKeyNav")
- .isType(EntityTypeProvider.nameETKeyNav)
- .at(1)
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(2)
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1");
-
- // with navigation property(key) -> navigation property -> property
- testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavOne/PropertyString")
- .at(0)
- .isEntitySet("ESKeyNav")
- .isType(EntityTypeProvider.nameETKeyNav)
- .at(1)
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(2)
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .isType(EntityTypeProvider.nameETKeyNav)
- .at(3)
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- // with navigation property(key) -> navigation property(key) -> property
- testRes.run("ESKeyNav(1)/NavPropertyETKeyNavMany(1)/NavPropertyETKeyNavMany(1)/PropertyString")
- .at(0)
- .isEntitySet("ESKeyNav")
- .isType(EntityTypeProvider.nameETKeyNav)
- .at(1)
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(2)
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(3)
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- }
-
- @Test
- public void testEntitySet_Property() {
-
- // plain entity set ...
-
- // with property
- testRes.run("ESAllPrim(1)/PropertyString")
- .at(0)
- .isEntitySet("ESAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(1)
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- // with complex property
- testRes.run("ESCompAllPrim(1)/PropertyComplex")
- .at(0)
- .isEntitySet("ESCompAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(1)
- .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTAllPrim, false);
-
- // with two properties
- testRes.run("ESCompAllPrim(1)/PropertyComplex/PropertyString")
- .at(0)
- .isEntitySet("ESCompAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(1)
- .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTAllPrim, false)
- .at(2)
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
- }
-
- @Test
- public void testEntitySet_TypeFilter() {
-
- // filter
- testRes.run("ESTwoPrim/com.sap.odata.test1.ETBase")
- .at(0)
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, true)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
- .isTypeFilterOnEntry(null);
-
- // filter before key predicate
- testRes.run("ESTwoPrim/com.sap.odata.test1.ETBase(PropertyInt16=1)")
- .at(0)
- .isEntitySet("ESTwoPrim")
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
- .isTypeFilterOnEntry(null)
- .at(0)
- .isType(EntityTypeProvider.nameETTwoPrim, false)
- .isKeyPredicate(0, "PropertyInt16", "1");
-
- // filter before key predicate; property of sub type
- testRes.run("ESTwoPrim/com.sap.odata.test1.ETBase(PropertyInt16=1)/AdditionalPropertyString_5")
- .at(0)
- .isEntitySet("ESTwoPrim")
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
- .isTypeFilterOnEntry(null)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(1)
- .isType(PropertyProvider.nameString)
- .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false);
-
- // filter after key predicate
- testRes.run("ESTwoPrim(PropertyInt16=1)/com.sap.odata.test1.ETBase")
- .at(0)
- .isEntitySet("ESTwoPrim")
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoPrim, false)
- .isTypeFilterOnCollection(null)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBase)
- .isKeyPredicate(0, "PropertyInt16", "1");
-
- // filter after key predicate; property of sub type
- testRes.run("ESTwoPrim(PropertyInt16=1)/com.sap.odata.test1.ETBase/AdditionalPropertyString_5")
- .at(0)
- .isEntitySet("ESTwoPrim")
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isTypeFilterOnCollection(null)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBase)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(1)
- .isPrimitiveProperty("AdditionalPropertyString_5", PropertyProvider.nameString, false)
- .isType(PropertyProvider.nameString);
-
- }
-
- @Test
- public void testFilterComplexMixedPriority() throws UriParserException {
- testFilter.runESabc("a or c and e ").isCompr("< <a> or < <c> and <e> >>");
- testFilter.runESabc("a or c and e eq f").isCompr("< <a> or < <c> and <<e> eq <f>>>>");
- testFilter.runESabc("a or c eq d and e ").isCompr("< <a> or <<<c> eq <d>> and <e> >>");
- testFilter.runESabc("a or c eq d and e eq f").isCompr("< <a> or <<<c> eq <d>> and <<e> eq <f>>>>");
- testFilter.runESabc("a eq b or c and e ").isCompr("<<<a> eq <b>> or < <c> and <e> >>");
- testFilter.runESabc("a eq b or c and e eq f").isCompr("<<<a> eq <b>> or < <c> and <<e> eq <f>>>>");
- testFilter.runESabc("a eq b or c eq d and e ").isCompr("<<<a> eq <b>> or <<<c> eq <d>> and <e> >>");
- testFilter.runESabc("a eq b or c eq d and e eq f").isCompr("<<<a> eq <b>> or <<<c> eq <d>> and <<e> eq <f>>>>");
- }
-
- @Test
- public void testFilterSimpleSameBinaryBinaryBinaryPriority() throws UriParserException {
-
- testFilter.runESabc("1 add 2 add 3 add 4").isCompr("<<< <1> add <2>> add <3>> add <4>>");
- testFilter.runESabc("1 add 2 add 3 div 4").isCompr("<< <1> add <2>> add <<3> div <4>>>");
- testFilter.runESabc("1 add 2 div 3 add 4").isCompr("<< <1> add <<2> div <3>>> add <4>>");
- testFilter.runESabc("1 add 2 div 3 div 4").isCompr("< <1> add <<<2> div <3>> div <4>>>");
- testFilter.runESabc("1 div 2 add 3 add 4").isCompr("<<< <1> div <2>> add <3>> add <4>>");
- testFilter.runESabc("1 div 2 add 3 div 4").isCompr("<< <1> div <2>> add <<3> div <4>>>");
- testFilter.runESabc("1 div 2 div 3 add 4").isCompr("<<< <1> div <2>> div <3>> add <4>>");
- testFilter.runESabc("1 div 2 div 3 div 4").isCompr("<<< <1> div <2>> div <3>> div <4>>");
-
- }
-
- @Test
- public void testFunctionImport_VarParameters() {
-
- // no input
- testRes.run("FINRTInt16()")
- .isFunctionImport("FINRTInt16")
- .isFunction("UFNRTInt16")
- .isType(PropertyProvider.nameInt16);
-
- // one input
- testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isFunction("UFCRTETTwoKeyNavParam")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- // two input
- testRes.run("FICRTStringTwoParam(ParameterString='ABC',ParameterInt16=1)")
- .isFunctionImport("FICRTStringTwoParam")
- .isFunction("UFCRTStringTwoParam")
- .isType(PropertyProvider.nameString);
- }
-
- @Test
- public void testFunctionImport_VarRetruning() {
- // returning primitive
- testRes.run("FINRTInt16()")
- .isFunctionImport("FINRTInt16")
- .isFunction("UFNRTInt16")
- .isType(PropertyProvider.nameInt16, false);
-
- // returning collection of primitive
- testRes.run("FICRTCollStringTwoParam(ParameterString='ABC',ParameterInt16=1)")
- .isFunctionImport("FICRTCollStringTwoParam")
- .isFunction("UFCRTCollStringTwoParam")
- .isType(PropertyProvider.nameString, true);
-
- // returning single complex
- testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)")
- .isFunctionImport("FICRTCTAllPrimTwoParam")
- .isFunction("UFCRTCTAllPrimTwoParam")
- .isType(ComplexTypeProvider.nameCTAllPrim, false);
-
- // returning collection of complex
- testRes.run("FICRTCollCTTwoPrim()")
- .isFunctionImport("FICRTCollCTTwoPrim")
- .isFunction("UFCRTCollCTTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
- // returning single entity
- testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)")
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isFunction("UFCRTETTwoKeyNavParam")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false);
-
- // returning collection of entity (aka entitySet)
- testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)")
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true);
- }
-
- @Test
- public void testFunctionImportChain() {
-
- // test chain; returning single complex
- testRes.run("FICRTCTAllPrimTwoParam(ParameterString='ABC',ParameterInt16=1)/PropertyInt16")
- .at(0)
- .isFunctionImport("FICRTCTAllPrimTwoParam")
- .isFunction("UFCRTCTAllPrimTwoParam")
- .isType(ComplexTypeProvider.nameCTAllPrim, false)
- .isParameter(0, "ParameterString", "'ABC'")
- .isParameter(1, "ParameterInt16", "1")
- .at(1)
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- // test chains; returning single entity
- testRes.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/PropertyInt16")
- .at(0)
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isFunction("UFCRTETTwoKeyNavParam")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isParameter(0, "ParameterInt16", "1")
- .at(1)
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- // test chains; returning collection of entity (aka entitySet)
- testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')")
- .at(0)
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isParameter(0, "ParameterInt16", "1")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'ABC'");
-
- // test chains; returning collection of entity (aka entitySet)
- testRes.run("FICRTESTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=1,PropertyString='ABC')/PropertyInt16")
- .at(0)
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isParameter(0, "ParameterInt16", "1")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'ABC'")
- .at(1)
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- }
-
- @Test
- public void testMetaData() {
-
- // Parsing the fragment may be used if a uri has to be parsed on the consumer side.
- // On the producer side this feature is currently not supported, so the context fragment
- // part is only available as text.
-
- testUri.run("$metadata")
- .isKind(UriInfoKind.metadata);
-
- testUri.run("$metadata?$format=atom")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom");
-
- // with context (client usage)
-
- testUri.run("$metadata#$ref")
- .isKind(UriInfoKind.metadata)
- .isFragmentText("$ref");
-
- testUri.run("$metadata?$format=atom#$ref")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("$ref");
-
- testUri.run("$metadata?$format=atom#Collection($ref)")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("Collection($ref)");
-
- testUri.run("$metadata?$format=atom#Collection(Edm.EntityType)")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("Collection(Edm.EntityType)");
-
- testUri.run("$metadata?$format=atom#Collection(Edm.ComplexType)")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("Collection(Edm.ComplexType)");
-
- testUri.run("$metadata?$format=atom#SINav")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("SINav");
-
- testUri.run("$metadata?$format=atom#SINav/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("SINav/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#SINav/NavPropertyETKeyNavOne")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("SINav/NavPropertyETKeyNavOne");
-
- testUri.run("$metadata?$format=atom#SINav/NavPropertyETKeyNavMany(1)")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("SINav/NavPropertyETKeyNavMany(1)");
-
- testUri.run("$metadata?$format=atom#SINav/NavPropertyETKeyNavOne/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("SINav/NavPropertyETKeyNavOne/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#SINav/NavPropertyETKeyNavMany(1)/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("SINav/NavPropertyETKeyNavMany(1)/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#SINav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("SINav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#SINav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("SINav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#com.sap.odata.test1.ETAllKey")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("com.sap.odata.test1.ETAllKey");
-
- testUri.run("$metadata?$format=atom#ESTwoPrim/$deletedEntity")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESTwoPrim/$deletedEntity");
-
- testUri.run("$metadata?$format=atom#ESTwoPrim/$link")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESTwoPrim/$link");
-
- testUri.run("$metadata?$format=atom#ESTwoPrim/$deletedLink")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESTwoPrim/$deletedLink");
-
- testUri.run("$metadata?$format=atom#ESKeyNav")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/NavPropertyETKeyNavOne")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/NavPropertyETKeyNavOne");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/NavPropertyETKeyNavMany(1)")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/NavPropertyETKeyNavMany(1)");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/NavPropertyETKeyNavOne/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/NavPropertyETKeyNavOne/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/NavPropertyETKeyNavMany(1)/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/NavPropertyETKeyNavMany(1)/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavOne/PropertyInt16");
-
- testUri.run(
- "$metadata?$format=atom#ESKeyNav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/com.sap.odata.test1.ETTwoPrim/NavPropertyETKeyNavMany(1)/PropertyInt16");
-
- testUri.run("$metadata?$format=atom#ESKeyNav(PropertyInt16,PropertyString)")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav(PropertyInt16,PropertyString)");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/$entity")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/$entity");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/$delta")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/$delta");
-
- testUri.run("$metadata?$format=atom#ESKeyNav/(PropertyInt16,PropertyString)/$delta")
- .isKind(UriInfoKind.metadata)
- .isFormatText("atom")
- .isFragmentText("ESKeyNav/(PropertyInt16,PropertyString)/$delta");
-
- }
-
- @Test
- public void testRef() {
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/$ref");
- }
-
- @Test
- public void testSingleton() {
- // plain singleton
- testRes.run("SINav")
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
- }
-
- @Test
- public void testNavigationProperty() {
-
- // plain entity set ...
-
- // with navigation property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
-
- // with navigation property -> property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/PropertyString")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .at(2).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- // with navigation property -> navigation property -> navigation property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
- // with navigation property(key)
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'1'");
-
- // with navigation property(key) -> property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')/PropertyString")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'1'")
- .at(2).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- // with navigation property(key) -> navigation property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')/NavPropertyETKeyNavOne")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'1'")
- .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
- // with navigation property(key) -> navigation property(key)
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
- + "/NavPropertyETKeyNavMany(1)")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'1'")
- .at(2).isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1");
-
- // with navigation property(key) -> navigation property -> property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
- + "/NavPropertyETKeyNavOne/PropertyString")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'1'")
- .at(2).isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .at(3).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- // with navigation property(key) -> navigation property(key) -> property
- testRes.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='1')"
- + "/NavPropertyETKeyNavMany(1)/PropertyString")
- .at(0).isEntitySet("ESKeyNav")
- .at(1).isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'1'")
- .at(2).isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .at(3).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
- }
-
- @Test
- public void testSingleton_Property() {
-
- // plain singleton ...
-
- // with property
- testRes.run("SINav/PropertyInt16")
- .at(0)
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .at(1)
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- // with complex property
- testRes.run("SINav/PropertyComplex")
- .at(0)
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .at(1)
- .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false);
-
- // with two properties
- testRes.run("SINav/PropertyComplex/PropertyInt16")
- .at(0)
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .at(1)
- .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false)
- .at(2)
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- }
-
- @Test
- public void testValue() {
- testUri.run("ESAllPrim(1)/PropertyString/$value");
- }
-
- @Test(expected = Exception.class)
- public void testMemberStartingWithCastFailOnValidation1() {
- // on EntityType entry
- testUri.run("ESTwoKeyNav(ParameterInt16=1,PropertyString='ABC')?"
- + "$filter=com.sap.odata.test1.ETBaseTwoKeyNav/PropertyDate")
- .goFilter().root().isMember()
- .isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
- // .at(0)
- // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
- // .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- // .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .at(0).isType(PropertyProvider.nameDate);
- }
-
- @Test(expected = Exception.class)
- public void testMemberStartingWithCastFailOnValidation2() {
- testUri.run("FICRTCTTwoPrimParam(ParameterInt16=1,ParameterString='2')?"
- + "$filter=com.sap.odata.test1.CTBase/AdditionalPropString")
- .goFilter().root().isMember()
- .isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
- // .at(0)
- // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
- // .isType(ComplexTypeProvider.nameCTTwoPrim, false)
- // .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase)
- .at(0).isType(PropertyProvider.nameString);
- }
-
- @Test
- public void testMemberStartingWithCast() {
-
- // on EntityType collection
- testUri.run("ESTwoKeyNav?$filter=com.sap.odata.test1.ETBaseTwoKeyNav/PropertyDate")
- .goFilter().root().isMember()
- .isMemberStartType(EntityTypeProvider.nameETBaseTwoKeyNav).goPath()
- // .at(0)
- // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
- // .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- // .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .at(0).isType(PropertyProvider.nameDate);
-
- // on Complex collection
- testUri.run("FICRTCollCTTwoPrimParam(ParameterInt16=1,ParameterString='2')?"
- + "$filter=com.sap.odata.test1.CTBase/AdditionalPropString")
- .goFilter().root().isMember()
- .isMemberStartType(ComplexTypeProvider.nameCTBase).goPath()
- // .at(0)
- // .isUriPathInfoKind(UriResourceKind.startingTypeFilter)
- // .isType(ComplexTypeProvider.nameCTTwoPrim, true)
- // .isTypeFilterOnCollection(ComplexTypeProvider.nameCTBase)
- .at(0).isType(PropertyProvider.nameString);
-
- }
-
- @Test
- public void testComplexTypeCastFollowingAsCollection() {
- testUri.run("FICRTCollCTTwoPrimParam(ParameterInt16=1,ParameterString='2')/com.sap.odata.test1.CTBase");
- }
-
- @Test
- public void testLambda() {
- testUri.run("ESTwoKeyNav?$filter=CollPropertyComplex/all( l : true )")
- .goFilter().is("<CollPropertyComplex/<ALL;<true>>>");
-
- testUri.run("ESTwoKeyNav?$filter=CollPropertyComplex/any( l : true )")
- .goFilter().is("<CollPropertyComplex/<ANY;<true>>>");
- testUri.run("ESTwoKeyNav?$filter=CollPropertyComplex/any( )")
- .goFilter().is("<CollPropertyComplex/<ANY;>>");
-
- testUri.run("ESTwoKeyNav?$filter=all( l : true )")
- .goFilter().is("<<ALL;<true>>>");
- testUri.run("ESTwoKeyNav?$filter=any( l : true )")
- .goFilter().is("<<ANY;<true>>>");
- testUri.run("ESTwoKeyNav?$filter=any( )")
- .goFilter().is("<<ANY;>>");
- }
-
- @Test
- public void testCustomQueryOption() {
- testUri.run("ESTwoKeyNav?custom")
- .isCustomParameter(0, "custom", "");
- testUri.run("ESTwoKeyNav?custom=ABC")
- .isCustomParameter(0, "custom", "ABC");
- }
-
- @Test
- public void testGeo() throws UriParserException {
- // TODO sync
- testFilter.runOnETAllPrim("geo.distance(PropertySByte,PropertySByte)")
- .is("<geo.distance(<PropertySByte>,<PropertySByte>)>")
- .isMethod(MethodKind.GEODISTANCE, 2);
- testFilter.runOnETAllPrim("geo.length(PropertySByte)")
- .is("<geo.length(<PropertySByte>)>")
- .isMethod(MethodKind.GEOLENGTH, 1);
- testFilter.runOnETAllPrim("geo.intersects(PropertySByte,PropertySByte)")
- .is("<geo.intersects(<PropertySByte>,<PropertySByte>)>")
- .isMethod(MethodKind.GEOINTERSECTS, 2);
- }
-
- @Test
- public void testSelect() {
- testUri.run("ESTwoKeyNav?$select=*")
- .isSelectItemStar(0);
-
- testUri.run("ESTwoKeyNav?$select=com.sap.odata.test1.*")
- .isSelectItemAllOp(0, new FullQualifiedName("com.sap.odata.test1", "*"));
-
- testUri.run("ESTwoKeyNav?$select=PropertyString")
- .goSelectItemPath(0).isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- testUri.run("ESTwoKeyNav?$select=PropertyComplex")
- .goSelectItemPath(0).isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false);
-
- testUri.run("ESTwoKeyNav?$select=PropertyComplex/PropertyInt16")
- .goSelectItemPath(0)
- .first()
- .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false)
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- testUri.run("ESTwoKeyNav?$select=PropertyComplex/PropertyComplex")
- .goSelectItemPath(0)
- .first()
- .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTPrimComp, false)
- .n()
- .isComplexProperty("PropertyComplex", ComplexTypeProvider.nameCTAllPrim, false);
-
- testUri.run("ESTwoKeyNav?$select=com.sap.odata.test1.ETBaseTwoKeyNav")
- .isSelectStartType(0, EntityTypeProvider.nameETBaseTwoKeyNav);
-
- testUri.run("ESTwoKeyNav/PropertyComplexNav?$select=com.sap.odata.test1.CTTwoBasePrimCompNav")
- .isSelectStartType(0, ComplexTypeProvider.nameCTTwoBasePrimCompNav);
-
- testUri.run("ESTwoKeyNav?$select=PropertyComplexNav/com.sap.odata.test1.CTTwoBasePrimCompNav")
- .goSelectItemPath(0)
- .first()
- .isComplexProperty("PropertyComplexNav", ComplexTypeProvider.nameCTBasePrimCompNav, false)
- .n()
- .isTypeFilterOnCollection(ComplexTypeProvider.nameCTTwoBasePrimCompNav);
- ;
-
- }
-
- public static String encode(final String decoded) throws UnsupportedEncodingException {
-
- return URLEncoder.encode(decoded, "UTF-8");
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
deleted file mode 100644
index 7dcf5a5..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/queryoption/QueryOptionTest.java
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.queryoption;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.uri.UriInfoResource;
-import org.apache.olingo.server.api.uri.queryoption.SystemQueryOptionKind;
-import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.AliasImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.ExpressionImpl;
-import org.apache.olingo.server.core.uri.queryoption.expression.LiteralImpl;
-import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
-import org.junit.Test;
-
-//TOOD add getKind check to all
-public class QueryOptionTest {
-
- Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
-
- @Test
- public void testAliasQueryOption() {
- AliasQueryOptionImpl option = new AliasQueryOptionImpl();
-
- ExpressionImpl expression = new LiteralImpl();
-
- option.setAliasValue(expression);
- assertEquals(expression, option.getValue());
- }
-
- @Test
- public void testExandItemImpl() {
- ExpandItemImpl option = new ExpandItemImpl();
-
- // input options
- ExpandOptionImpl expand = new ExpandOptionImpl();
- FilterOptionImpl filter = new FilterOptionImpl();
- CountOptionImpl inlinecount = new CountOptionImpl();
- OrderByOptionImpl orderby = new OrderByOptionImpl();
- SearchOptionImpl search = new SearchOptionImpl();
- SelectOptionImpl select = new SelectOptionImpl();
- SkipOptionImpl skip = new SkipOptionImpl();
- TopOptionImpl top = new TopOptionImpl();
- LevelsOptionImpl levels = new LevelsOptionImpl();
-
- option.setSystemQueryOption(expand);
- option.setSystemQueryOption(filter);
- option.setSystemQueryOption(inlinecount);
- option.setSystemQueryOption(orderby);
- option.setSystemQueryOption(search);
- option.setSystemQueryOption(select);
- option.setSystemQueryOption(skip);
- option.setSystemQueryOption(top);
- option.setSystemQueryOption(levels);
-
- assertEquals(expand, option.getExpandOption());
- assertEquals(filter, option.getFilterOption());
- assertEquals(inlinecount, option.getCountOption());
- assertEquals(orderby, option.getOrderByOption());
- assertEquals(search, option.getSearchOption());
- assertEquals(select, option.getSelectOption());
- assertEquals(skip, option.getSkipOption());
- assertEquals(top, option.getTopOption());
- assertEquals(levels, option.getLevelsOption());
-
- // just for completeness
- option = new ExpandItemImpl();
- option.setSystemQueryOption(new IdOptionImpl());
-
- option = new ExpandItemImpl();
- List<SystemQueryOptionImpl> list = new ArrayList<SystemQueryOptionImpl>();
- list.add(expand);
- list.add(filter);
- option.setSystemQueryOptions(list);
- assertEquals(expand, option.getExpandOption());
- assertEquals(filter, option.getFilterOption());
-
- option = new ExpandItemImpl();
- assertEquals(false, option.isRef());
- option.setIsRef(true);
- assertEquals(true, option.isRef());
-
- option = new ExpandItemImpl();
- assertEquals(false, option.isStar());
- option.setIsStar(true);
- assertEquals(true, option.isStar());
-
- option = new ExpandItemImpl();
- UriInfoResource resource = new UriInfoImpl().asUriInfoResource();
- option.setResourcePath(resource);
- assertEquals(resource, option.getResourcePath());
-
- }
-
- @Test
- public void testExpandOptionImpl() {
- ExpandOptionImpl option = new ExpandOptionImpl();
- assertEquals(SystemQueryOptionKind.EXPAND, option.getKind());
-
- ExpandItemImpl item1 = new ExpandItemImpl();
- ExpandItemImpl item2 = new ExpandItemImpl();
- option.addExpandItem(item1);
- option.addExpandItem(item2);
- assertEquals(item1, option.getExpandItems().get(0));
- assertEquals(item2, option.getExpandItems().get(1));
- }
-
- @Test
- public void testFilterOptionImpl() {
- FilterOptionImpl option = new FilterOptionImpl();
- assertEquals(SystemQueryOptionKind.FILTER, option.getKind());
-
- AliasImpl expression = new AliasImpl();
-
- option.setExpression(expression);
- assertEquals(expression, option.getExpression());
- }
-
- @Test
- public void testFormatOptionImpl() {
- FormatOptionImpl option = new FormatOptionImpl();
- assertEquals(SystemQueryOptionKind.FORMAT, option.getKind());
-
- option.setFormat("A");
-
- assertEquals("A", option.getFormat());
- }
-
- @Test
- public void testIdOptionImpl() {
- IdOptionImpl option = new IdOptionImpl();
- assertEquals(SystemQueryOptionKind.ID, option.getKind());
-
- option.setValue("A");
-
- assertEquals("A", option.getValue());
- }
-
- @Test
- public void testInlineCountImpl() {
- CountOptionImpl option = new CountOptionImpl();
- assertEquals(SystemQueryOptionKind.COUNT, option.getKind());
-
- assertEquals(false, option.getValue());
- option.setValue(true);
- assertEquals(true, option.getValue());
- }
-
- @Test
- public void testLevelsExpandOptionImpl() {
- LevelsOptionImpl option = new LevelsOptionImpl();
- assertEquals(SystemQueryOptionKind.LEVELS, option.getKind());
-
- assertEquals(0, option.getValue());
- option.setValue(1);
- assertEquals(1, option.getValue());
-
- option = new LevelsOptionImpl();
- option.setMax();
- assertEquals(true, option.isMax());
- }
-
- @Test
- public void testOrderByItemImpl() {
- OrderByItemImpl option = new OrderByItemImpl();
-
- AliasImpl expression = new AliasImpl();
- option.setExpression(expression);
- assertEquals(expression, option.getExpression());
-
- assertEquals(false, option.isDescending());
- option.setDescending(true);
- assertEquals(true, option.isDescending());
- }
-
- @Test
- public void testOrderByOptionImpl() {
- OrderByOptionImpl option = new OrderByOptionImpl();
-
- OrderByItemImpl order0 = new OrderByItemImpl();
- OrderByItemImpl order1 = new OrderByItemImpl();
- option.addOrder(order0);
- option.addOrder(order1);
-
- assertEquals(order0, option.getOrders().get(0));
- assertEquals(order1, option.getOrders().get(1));
- }
-
- @Test
- public void testQueryOptionImpl() {
- QueryOptionImpl option = new AliasQueryOptionImpl();
-
- option.setName("A");
- option.setText("B");
- assertEquals("A", option.getName());
- assertEquals("B", option.getText());
- }
-
- @Test
- public void testSearchOptionImpl() {
- SearchOptionImpl option = new SearchOptionImpl();
- assertEquals(SystemQueryOptionKind.SEARCH, option.getKind());
- // TODO $search is not supported yet
- }
-
- @Test
- public void testSelectItemImpl() {
- SelectItemImpl option = new SelectItemImpl();
-
- // no typed collection else case ( e.g. if not path is added)
- option = new SelectItemImpl();
-
- option = new SelectItemImpl();
- assertEquals(false, option.isStar());
- option.setStar(true);
- assertEquals(true, option.isStar());
-
- option = new SelectItemImpl();
- assertEquals(false, option.isAllOperationsInSchema());
- FullQualifiedName fqName = new FullQualifiedName("Namespace", "Name");
- option.addAllOperationsInSchema(fqName);
- assertEquals(true, option.isAllOperationsInSchema());
- assertEquals(fqName, option.getAllOperationsInSchemaNameSpace());
-
- }
-
- @Test
- public void testSelectOptionImpl() {
- SelectOptionImpl option = new SelectOptionImpl();
- assertEquals(SystemQueryOptionKind.SELECT, option.getKind());
-
- SelectItemImpl item0 = new SelectItemImpl();
- SelectItemImpl item1 = new SelectItemImpl();
-
- ArrayList<SelectItemImpl> list = new ArrayList<SelectItemImpl>();
- list.add(item0);
- list.add(item1);
- option.setSelectItems(list);
-
- assertEquals(item0, option.getSelectItems().get(0));
- assertEquals(item1, option.getSelectItems().get(1));
-
- }
-
- @Test
- public void testSkipOptionImpl() {
- SkipOptionImpl option = new SkipOptionImpl();
- assertEquals(SystemQueryOptionKind.SKIP, option.getKind());
-
- option.setValue(10);
- assertEquals(10, option.getValue());
- }
-
- @Test
- public void testSkipTokenOptionImpl() {
- SkipTokenOptionImpl option = new SkipTokenOptionImpl();
- assertEquals(SystemQueryOptionKind.SKIPTOKEN, option.getKind());
-
- option.setValue("A");
- assertEquals("A", option.getValue());
- }
-
- @Test
- public void testSystemQueryOptionImpl() {
- SystemQueryOptionImpl option = new SystemQueryOptionImpl();
-
- option.setKind(SystemQueryOptionKind.EXPAND);
- assertEquals(SystemQueryOptionKind.EXPAND, option.getKind());
-
- assertEquals("$expand", option.getName());
- }
-
- @Test
- public void testTopOptionImpl() {
- TopOptionImpl option = new TopOptionImpl();
- assertEquals(SystemQueryOptionKind.TOP, option.getKind());
-
- option.setValue(11);
- assertEquals(11, option.getValue());
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
deleted file mode 100644
index c4d9926..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/queryoption/expression/ExpressionTest.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.queryoption.expression;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.util.Arrays;
-
-import org.apache.olingo.commons.api.ODataApplicationException;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmAction;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmEnumType;
-import org.apache.olingo.commons.api.edm.EdmFunction;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.UriInfoResource;
-import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
-import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.UnaryOperatorKind;
-import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
-import org.apache.olingo.server.core.uri.UriInfoImpl;
-import org.apache.olingo.server.core.uri.UriResourceActionImpl;
-import org.apache.olingo.server.core.uri.UriResourceFunctionImpl;
-import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
-import org.apache.olingo.server.core.uri.testutil.FilterTreeToText;
-import org.apache.olingo.server.ref.provider.ActionProvider;
-import org.apache.olingo.server.ref.provider.EntityTypeProvider;
-import org.apache.olingo.server.ref.provider.EnumTypeProvider;
-import org.apache.olingo.server.ref.provider.FunctionProvider;
-import org.junit.Test;
-
-public class ExpressionTest {
- Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
-
- @Test
- public void testSupportedOperators() {
- assertEquals(UnaryOperatorKind.MINUS, UnaryOperatorKind.get("-"));
- assertEquals(null, UnaryOperatorKind.get("XXX"));
-
- assertEquals(BinaryOperatorKind.MOD, BinaryOperatorKind.get("mod"));
- assertEquals(null, BinaryOperatorKind.get("XXX"));
-
- assertEquals(MethodKind.CONCAT, MethodKind.get("concat"));
- assertEquals(null, MethodKind.get("XXX"));
- }
-
- @Test
- public void testAliasExpression() throws ExpressionVisitException, ODataApplicationException {
- AliasImpl expression = new AliasImpl();
-
- expression.setParameter("Test");
-
- assertEquals("Test", expression.getParameterName());
-
- String output = expression.accept(new FilterTreeToText());
- assertEquals("<Test>", output);
-
- }
-
- @Test
- public void testBinaryExpression() throws ExpressionVisitException, ODataApplicationException {
- BinaryImpl expression = new BinaryImpl();
-
- ExpressionImpl expressionLeft = new LiteralImpl().setText("A");
- ExpressionImpl expressionRight = new LiteralImpl().setText("B");
-
- expression.setLeftOperand(expressionLeft);
- expression.setRightOperand(expressionRight);
- expression.setOperator(BinaryOperatorKind.SUB);
-
- assertEquals(expressionLeft, expression.getLeftOperand());
- assertEquals(expressionRight, expression.getRightOperand());
- assertEquals(BinaryOperatorKind.SUB, expression.getOperator());
-
- String output = expression.accept(new FilterTreeToText());
- assertEquals("<<A> sub <B>>", output);
- }
-
- @Test
- public void testEnumerationExpression() throws ExpressionVisitException, ODataApplicationException {
- EnumerationImpl expression = new EnumerationImpl();
- EdmEnumType type = (EdmEnumType) edm.getEnumType(EnumTypeProvider.nameENString);
- assertNotNull(type);
- expression.setType(type);
-
- assertEquals(type, expression.getType());
-
- expression.addValue("A");
- expression.addValue("B");
- assertEquals("A", expression.getValues().get(0));
- assertEquals("B", expression.getValues().get(1));
- assertEquals("<com.sap.odata.test1.ENString<A,B>>", expression.accept(new FilterTreeToText()));
- }
-
- @Test
- public void testLambdaRefExpression() throws ExpressionVisitException, ODataApplicationException {
- LambdaRefImpl expression = new LambdaRefImpl();
- expression.setVariableText("A");
- assertEquals("A", expression.getVariableName());
-
- assertEquals("<A>", expression.accept(new FilterTreeToText()));
-
- }
-
- @Test
- public void testLiteralExpresion() throws ExpressionVisitException, ODataApplicationException {
- LiteralImpl expression = new LiteralImpl();
- expression.setText("A");
- assertEquals("A", expression.getText());
-
- assertEquals("<A>", expression.accept(new FilterTreeToText()));
- }
-
- @Test
- public void testMemberExpression() throws ExpressionVisitException, ODataApplicationException {
- MemberImpl expression = new MemberImpl();
- EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
-
- // UriResourceImplTyped
- EdmAction action = edm.getUnboundAction(ActionProvider.nameUARTPrimParam);
- UriInfoResource uriInfo = new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
- new UriResourceActionImpl().setAction(action)).asUriInfoResource();
- expression.setResourcePath(uriInfo);
- assertEquals(action.getReturnType().getType(), expression.getType());
-
- // check accept and path
- assertEquals(uriInfo, expression.getResourcePath());
- assertEquals("<UARTPrimParam>", expression.accept(new FilterTreeToText()));
-
- // UriResourceImplTyped check collection = false case
- assertEquals(false, expression.isCollection());
-
- // UriResourceImplTyped check collection = true case
- action = edm.getUnboundAction(ActionProvider.nameUARTPrimCollParam);
- expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
- new UriResourceActionImpl().setAction(action))
- .asUriInfoResource());
- assertEquals(true, expression.isCollection());
-
- // UriResourceImplTyped with filter
- action = edm.getUnboundAction(ActionProvider.nameUARTPrimParam);
- expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
- new UriResourceActionImpl().setAction(action).setTypeFilter(entityType))
- .asUriInfoResource());
- assertEquals(entityType, expression.getType());
-
- // UriResourceImplKeyPred
- EdmFunction function = edm.getUnboundFunction(FunctionProvider.nameUFCRTETKeyNav, null);
- expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
- new UriResourceFunctionImpl().setFunction(function))
- .asUriInfoResource());
- assertEquals(function.getReturnType().getType(), expression.getType());
-
- // UriResourceImplKeyPred typeFilter on entry
- EdmEntityType entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
- function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
- expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
- new UriResourceFunctionImpl().setFunction(function).setEntryTypeFilter(entityBaseType))
- .asUriInfoResource());
- assertEquals(entityBaseType, expression.getType());
-
- // UriResourceImplKeyPred typeFilter on entry
- entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
- function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
- expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.resource).addResourcePart(
- new UriResourceFunctionImpl().setFunction(function).setCollectionTypeFilter(entityBaseType))
- .asUriInfoResource());
- assertEquals(entityBaseType, expression.getType());
-
- // no typed
- entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
- function = edm.getUnboundFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam, Arrays.asList("ParameterInt16"));
- expression.setResourcePath(new UriInfoImpl().setKind(UriInfoKind.all));
- assertEquals(null, expression.getType());
-
- // no typed collection else case
- assertEquals(false, expression.isCollection());
- }
-
- @Test
- public void testMethodCallExpression() throws ExpressionVisitException, ODataApplicationException {
- MethodImpl expression = new MethodImpl();
- expression.setMethod(MethodKind.CONCAT);
-
- ExpressionImpl p0 = new LiteralImpl().setText("A");
- ExpressionImpl p1 = new LiteralImpl().setText("B");
- expression.addParameter(p0);
- expression.addParameter(p1);
-
- assertEquals(MethodKind.CONCAT, expression.getMethod());
- assertEquals("<concat(<A>,<B>)>", expression.accept(new FilterTreeToText()));
-
- assertEquals(p0, expression.getParameters().get(0));
- assertEquals(p1, expression.getParameters().get(1));
- }
-
- @Test
- public void testTypeLiteralExpression() throws ExpressionVisitException, ODataApplicationException {
- TypeLiteralImpl expression = new TypeLiteralImpl();
- EdmEntityType entityBaseType = edm.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav);
- expression.setType(entityBaseType);
-
- assertEquals(entityBaseType, expression.getType());
- assertEquals("<com.sap.odata.test1.ETBaseTwoKeyNav>", expression.accept(new FilterTreeToText()));
- }
-
- @Test
- public void testUnaryExpression() throws ExpressionVisitException, ODataApplicationException {
- UnaryImpl expression = new UnaryImpl();
- expression.setOperator(UnaryOperatorKind.MINUS);
-
- ExpressionImpl operand = new LiteralImpl().setText("A");
- expression.setOperand(operand);
-
- assertEquals(UnaryOperatorKind.MINUS, expression.getOperator());
- assertEquals(operand, expression.getOperand());
-
- assertEquals("<- <A>>", expression.accept(new FilterTreeToText()));
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java
deleted file mode 100644
index 9a4b5fb..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/testutil/EdmTechTestProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.testutil;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.ComplexType;
-import org.apache.olingo.server.api.edm.provider.EntitySet;
-import org.apache.olingo.server.api.edm.provider.EntityType;
-import org.apache.olingo.server.api.edm.provider.Property;
-import org.apache.olingo.server.api.edm.provider.PropertyRef;
-import org.apache.olingo.server.ref.provider.EdmTechProvider;
-
-/**
- * Implement the EdmTechProvider and
- * <li>adds a entity type <b>ETabc with</b> properties a,b,c,d,e,f</li>
- * <li>adds a complex type <b>CTabc</b> with properties a,b,c,d,e,f</li>
- * <li>adds a <b>abc</b> entity set of type <b>ETabc</b></li>
- */
-public class EdmTechTestProvider extends EdmTechProvider {
-
- private static final FullQualifiedName nameInt16 = EdmPrimitiveTypeKind.Int16.getFullQualifiedName();
- public static final String nameSpace = "com.sap.odata.test1";
- public static final FullQualifiedName nameContainer = new FullQualifiedName(nameSpace, "Container");
-
- Property propertyAInt16 = new Property().setName("a").setType(nameInt16);
- Property propertyBInt16 = new Property().setName("b").setType(nameInt16);
- Property propertyCInt16 = new Property().setName("c").setType(nameInt16);
- Property propertyDInt16 = new Property().setName("d").setType(nameInt16);
- Property propertyEInt16 = new Property().setName("e").setType(nameInt16);
- Property propertyFInt16 = new Property().setName("f").setType(nameInt16);
-
- public static final FullQualifiedName nameCTabc = new FullQualifiedName(nameSpace, "CTabc");
- public static final FullQualifiedName nameETabc = new FullQualifiedName(nameSpace, "ETabc");
-
- @Override
- public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
- if (complexTypeName.equals(nameCTabc)) {
- return new ComplexType()
- .setName("CTabc")
- .setProperties(Arrays.asList(
- propertyAInt16, propertyBInt16, propertyCInt16,
- propertyDInt16, propertyEInt16, propertyFInt16
- ));
-
- }
-
- return super.getComplexType(complexTypeName);
- }
-
- @Override
- public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException {
- if (nameContainer.equals(entityContainer)) {
- if (name.equals("ESabc")) {
- return new EntitySet()
- .setName("ESabc")
- .setType(nameETabc);
- }
- }
-
- return super.getEntitySet(entityContainer, name);
- }
-
- @Override
- public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
- List<PropertyRef> oneKeyPropertyInt16 = Arrays.asList(new PropertyRef().setPropertyName("a"));
-
- if (entityTypeName.equals(nameETabc)) {
- return new EntityType()
- .setName("ETabc")
- .setProperties(Arrays.asList(
- propertyAInt16, propertyBInt16, propertyCInt16,
- propertyDInt16, propertyEInt16, propertyFInt16))
- .setKey(oneKeyPropertyInt16);
- }
-
- return super.getEntityType(entityTypeName);
- }
-
-}
[15/31] [OLINGO-260] V3 proxy invoke
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageViewCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageViewCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageViewCollection.java
index 7dda48d..a88b641 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageViewCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPageViewCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhoto.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhoto.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhoto.java
index 1d24889..b05c4b3 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhoto.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhoto.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoCollection.java
index 479be7f..7271057 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoKey.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoKey.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoKey.java
index 0a90db3..5be493f 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoKey.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductPhotoKey.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReview.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReview.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReview.java
index f58bf44..bcefd82 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReview.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReview.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewCollection.java
index e529765..7fa44e2 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewKey.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewKey.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewKey.java
index 5803023..2a4d312 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewKey.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/ProductReviewKey.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.ext.proxy.api.annotations.EntityType;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSAToken.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSAToken.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSAToken.java
index 5d14033..d46f5ad 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSAToken.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSAToken.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSATokenCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSATokenCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSATokenCollection.java
index 31f67ed..f130e6a 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSATokenCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/RSATokenCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployee.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployee.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployee.java
index 7b2b0c5..0b5a8e8 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployee.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployee.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -279,5 +278,11 @@ public interface SpecialEmployee
+ @Override
+ Operations operations();
+
+ interface Operations extends org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types.Employee.Operations{
+
+ }
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployeeCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployeeCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployeeCollection.java
index 7217701..03765df 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployeeCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/SpecialEmployeeCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/package-info.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/package-info.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/package-info.java
index c6af535..ba1c676 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/package-info.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v3/staticservice/microsoft/test/odata/services/astoriadefaultservice/types/package-info.java
@@ -16,6 +16,5 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v3.staticservice.microsoft.test.odata.services.astoriadefaultservice.types;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTest.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTest.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTest.java
deleted file mode 100644
index 19eb996..0000000
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTest.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.fit.proxy.v4;
-
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertEquals;
-
-import java.io.IOException;
-import org.apache.olingo.ext.proxy.EntityContainerFactory;
-import org.apache.olingo.ext.proxy.context.EntityContext;
-import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.InMemoryEntities;
-import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer;
-import org.junit.BeforeClass;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class AbstractTest {
-
- /**
- * Logger.
- */
- protected static final Logger LOG = LoggerFactory.getLogger(AbstractTest.class);
-
- protected static final String TEST_PRODUCT_TYPE = "Microsoft.Test.OData.Services.AstoriaDefaultService.Product";
-
- protected static String testStaticServiceRootURL;
-
- protected static String testKeyAsSegmentServiceRootURL;
-
- protected static String testActionOverloadingServiceRootURL;
-
- protected static String testOpenTypeServiceRootURL;
-
- protected static String testLargeModelServiceRootURL;
-
- protected static String testAuthServiceRootURL;
-
- protected final EntityContext entityContext = EntityContainerFactory.getContext().entityContext();
-
- protected static EntityContainerFactory containerFactory;
-
- protected static InMemoryEntities container;
-
- @BeforeClass
- public static void setUpODataServiceRoot() throws IOException {
- testStaticServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Static.svc";
- testKeyAsSegmentServiceRootURL = "http://localhost:9080/stub/StaticService/V40/KeyAsSegment.svc";
- testActionOverloadingServiceRootURL = "http://localhost:9080/stub/StaticService/V40/ActionOverloading.svc";
- testOpenTypeServiceRootURL = "http://localhost:9080/stub/StaticService/V40/OpenType.svc";
- testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Static.svc/large";
- testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc";
-
- containerFactory = EntityContainerFactory.getV4(testStaticServiceRootURL);
- container = containerFactory.getEntityContainer(InMemoryEntities.class);
- assertNotNull(container);
- }
-
- protected Customer readCustomer(final InMemoryEntities container, int id) {
- final Customer customer = container.getCustomers().get(id);
- assertNotNull(customer);
- assertEquals(id, customer.getPersonID(), 0);
-
- return customer;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java
new file mode 100644
index 0000000..daf72f0
--- /dev/null
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/AbstractTestITCase.java
@@ -0,0 +1,81 @@
+/*
+ * 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.fit.proxy.v4;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import org.apache.olingo.ext.proxy.EntityContainerFactory;
+import org.apache.olingo.ext.proxy.context.EntityContext;
+import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.InMemoryEntities;
+import org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Customer;
+import org.junit.BeforeClass;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class AbstractTestITCase {
+
+ /**
+ * Logger.
+ */
+ protected static final Logger LOG = LoggerFactory.getLogger(AbstractTestITCase.class);
+
+ protected static final String TEST_PRODUCT_TYPE = "Microsoft.Test.OData.Services.AstoriaDefaultService.Product";
+
+ protected static String testStaticServiceRootURL;
+
+ protected static String testKeyAsSegmentServiceRootURL;
+
+ protected static String testActionOverloadingServiceRootURL;
+
+ protected static String testOpenTypeServiceRootURL;
+
+ protected static String testLargeModelServiceRootURL;
+
+ protected static String testAuthServiceRootURL;
+
+ protected final EntityContext entityContext = EntityContainerFactory.getContext().entityContext();
+
+ protected static EntityContainerFactory containerFactory;
+
+ protected static InMemoryEntities container;
+
+ @BeforeClass
+ public static void setUpODataServiceRoot() throws IOException {
+ testStaticServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Static.svc";
+ testKeyAsSegmentServiceRootURL = "http://localhost:9080/stub/StaticService/V40/KeyAsSegment.svc";
+ testActionOverloadingServiceRootURL = "http://localhost:9080/stub/StaticService/V40/ActionOverloading.svc";
+ testOpenTypeServiceRootURL = "http://localhost:9080/stub/StaticService/V40/OpenType.svc";
+ testLargeModelServiceRootURL = "http://localhost:9080/stub/StaticService/V40/Static.svc/large";
+ testAuthServiceRootURL = "http://localhost:9080/stub/DefaultService.svc";
+
+ containerFactory = EntityContainerFactory.getV4(testStaticServiceRootURL);
+ container = containerFactory.getEntityContainer(InMemoryEntities.class);
+ assertNotNull(container);
+ }
+
+ protected Customer readCustomer(final InMemoryEntities container, int id) {
+ final Customer customer = container.getCustomers().get(id);
+ assertNotNull(customer);
+ assertEquals(id, customer.getPersonID(), 0);
+
+ return customer;
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java
index 3f4517f..89f084e 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntityRetrieveTestITCase.java
@@ -52,7 +52,7 @@ import org.junit.Test;
/**
* This is the unit test class to check entity retrieve operations.
*/
-public class EntityRetrieveTestITCase extends AbstractTest {
+public class EntityRetrieveTestITCase extends AbstractTestITCase {
protected InMemoryEntities getContainer() {
return container;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntitySetTestITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntitySetTestITCase.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntitySetTestITCase.java
index 85812fc..da32cfe 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntitySetTestITCase.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/EntitySetTestITCase.java
@@ -28,7 +28,7 @@ import org.junit.Test;
/**
* This is the unit test class to check basic feed operations.
*/
-public class EntitySetTestITCase extends AbstractTest {
+public class EntitySetTestITCase extends AbstractTestITCase {
@Test
public void count() {
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Accounts.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Accounts.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Accounts.java
index e503d05..ad343c1 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Accounts.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Accounts.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Boss.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Boss.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Boss.java
index bc79d5e..f73247c 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Boss.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Boss.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Company.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Company.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Company.java
index c8d42be..0b985c5 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Company.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Company.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Customers.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Customers.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Customers.java
index 93057f4..4146de7 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Customers.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Customers.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/DefaultStoredPI.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/DefaultStoredPI.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/DefaultStoredPI.java
index c24ecee..85c7818 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/DefaultStoredPI.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/DefaultStoredPI.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Departments.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Departments.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Departments.java
index b0b217a..68295bf 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Departments.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Departments.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Employees.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Employees.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Employees.java
index 5c1c3af..e4b8b22 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Employees.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Employees.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java
index c1f4c42..9353f98 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/InMemoryEntities.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -49,7 +48,7 @@ import javax.xml.datatype.Duration;
@EntityContainer(name = "InMemoryEntities",
namespace = "Microsoft.Test.OData.Services.ODataWCFService",
isDefaultEntityContainer = true)
-public interface InMemoryEntities extends Container {
+public interface InMemoryEntities extends EntityContainer {
Accounts getAccounts();
@@ -130,7 +129,7 @@ public interface InMemoryEntities extends Container {
isComposable = false,
returnType = "Collection(Edm.String)")
Collection<String> getProductsByAccessLevel(
- @Parameter(name = "accessLevel", type = "Microsoft.Test.OData.Services.ODataWCFService.AccessLevel", nullable = true) org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.AccessLevel accessLevel
+ @Parameter(name = "accessLevel", type = "Microsoft.Test.OData.Services.ODataWCFService.AccessLevel", nullable = false) org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.AccessLevel accessLevel
);
@Operation(name = "GetAllProducts",
@@ -148,6 +147,11 @@ public interface InMemoryEntities extends Container {
@Parameter(name = "address", type = "Microsoft.Test.OData.Services.ODataWCFService.Address", nullable = false) org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Address address
);
+ @Operation(name = "ResetDataSource",
+ type = OperationType.ACTION)
+ void resetDataSource(
+ );
+
@Operation(name = "Discount",
type = OperationType.ACTION)
void discount(
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/LabourUnion.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/LabourUnion.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/LabourUnion.java
index 0e13ff8..ff9be59 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/LabourUnion.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/LabourUnion.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/OrderDetails.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/OrderDetails.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/OrderDetails.java
index 352e5fc..c9e160a 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/OrderDetails.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/OrderDetails.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Orders.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Orders.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Orders.java
index 046ac80..d5b79cb 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Orders.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Orders.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/People.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/People.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/People.java
index 4a14f90..17fe0fa 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/People.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/People.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductDetails.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductDetails.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductDetails.java
index 390100b..9671d6c 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductDetails.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductDetails.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductReviews.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductReviews.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductReviews.java
index 9939b47..bddeb74 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductReviews.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/ProductReviews.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Products.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Products.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Products.java
index d3cdde3..d86d4f5 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Products.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/Products.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/PublicCompany.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/PublicCompany.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/PublicCompany.java
index 054a897..e75abd6 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/PublicCompany.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/PublicCompany.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/StoredPIs.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/StoredPIs.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/StoredPIs.java
index 0d0d066..35b43bb 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/StoredPIs.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/StoredPIs.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/SubscriptionTemplates.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/SubscriptionTemplates.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/SubscriptionTemplates.java
index 31341d6..2c81494 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/SubscriptionTemplates.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/SubscriptionTemplates.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/VipCustomer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/VipCustomer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/VipCustomer.java
index f2e68af..04808c4 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/VipCustomer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/VipCustomer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
import org.apache.olingo.ext.proxy.api.AbstractEntitySet;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/package-info.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/package-info.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/package-info.java
index abf2d52..e7fb1fc 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/package-info.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/package-info.java
@@ -16,6 +16,5 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccessLevel.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccessLevel.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccessLevel.java
index 4b3c723..5055bde 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccessLevel.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccessLevel.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java
index fe5b427..c62fd59 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Account.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java
index c915986..00ec845 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountInfo.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountInfo.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountInfo.java
index 9f5d34a..f1c94a5 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountInfo.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AccountInfo.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Address.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Address.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Address.java
index 1aaed33..f686547 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Address.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Address.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java
index 9ae476a..e2e8987 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Asset.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java
index be1c602..12b8ef1 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/AssetCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java
index b66b1a2..711cf73 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Club.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java
index 2cf2128..4647fed 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/ClubCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Color.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Color.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Color.java
index 5432f9e..17a0a7d 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Color.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Color.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java
index f910d58..d4df4a7 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Company.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -54,11 +53,11 @@ import javax.xml.datatype.Duration;
@Namespace("Microsoft.Test.OData.Services.ODataWCFService")
@EntityType(name = "Company",
- openType = false,
+ openType = true,
hasStream = false,
isAbstract = false)
public interface Company
- extends Serializable {
+ extends AbstractOpenType {
@Key
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyAddress.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyAddress.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyAddress.java
index 2a23fb7..d109068 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyAddress.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyAddress.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
@@ -121,14 +120,4 @@ public interface CompanyAddress
- @NavigationProperty(name = "Contact",
- type = "Microsoft.Test.OData.Services.ODataWCFService.Person",
- targetSchema = "Microsoft.Test.OData.Services.ODataWCFService",
- targetContainer = "InMemoryEntities",
- targetEntitySet = "People")
- org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person getContact();
-
- void setContact(final org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person _contact);
-
-
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCategory.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCategory.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCategory.java
index 361f912..47aa8eb 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCategory.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCategory.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java
index 27c7951..7eb03e4 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CompanyCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java
index 81e61cd..5b03fbf 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPI.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java
index 9f528e3..d673c51 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditCardPICollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java
index 4a3900a..346d5fd 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecord.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java
index 1c53c8d..2454201 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CreditRecordCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java
index 1a5f393..f907fd9 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Customer.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -348,6 +347,12 @@ public interface Customer
+ @Override
+ Operations operations();
+
+ interface Operations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person.Operations{
+
+ }
@Override
ComplexFactory factory();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java
index e73f8bf..2b0ce94 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/CustomerCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java
index 0c10067..793997b 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Department.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -108,6 +107,29 @@ public interface Department
void setName(final String _name);
+ @Property(name = "DepartmentNO",
+ type = "Edm.String",
+ nullable = true,
+ defaultValue = "",
+ maxLenght = Integer.MAX_VALUE,
+ fixedLenght = false,
+ precision = 0,
+ scale = 0,
+ unicode = true,
+ collation = "",
+ srid = "",
+ concurrencyMode = ConcurrencyMode.None,
+ fcSourcePath = "",
+ fcTargetPath = "",
+ fcContentKind = EdmContentKind.text,
+ fcNSPrefix = "",
+ fcNSURI = "",
+ fcKeepInContent = false)
+ String getDepartmentNO();
+
+ void setDepartmentNO(final String _departmentNO);
+
+
@NavigationProperty(name = "Company",
type = "Microsoft.Test.OData.Services.ODataWCFService.Company",
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java
index 47cd2f2..27b40de 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/DepartmentCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java
index c9ebc57..4331620 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Employee.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -315,6 +314,12 @@ public interface Employee
+ @Override
+ Operations operations();
+
+ interface Operations extends org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types.Person.Operations{
+
+ }
@Override
ComplexFactory factory();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java
index 4cf82d5..9ed9987 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/EmployeeCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java
index 649ff83..c6a0004 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCard.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
@@ -154,6 +153,29 @@ public interface GiftCard
void setExperationDate(final Calendar _experationDate);
+ @Property(name = "OwnerName",
+ type = "Edm.String",
+ nullable = true,
+ defaultValue = "",
+ maxLenght = Integer.MAX_VALUE,
+ fixedLenght = false,
+ precision = 0,
+ scale = 0,
+ unicode = true,
+ collation = "",
+ srid = "",
+ concurrencyMode = ConcurrencyMode.None,
+ fcSourcePath = "",
+ fcTargetPath = "",
+ fcContentKind = EdmContentKind.text,
+ fcNSPrefix = "",
+ fcNSURI = "",
+ fcKeepInContent = false)
+ String getOwnerName();
+
+ void setOwnerName(final String _ownerName);
+
+
Operations operations();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java
index 6ce3ce3..5ca4350 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/GiftCardCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/HomeAddress.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/HomeAddress.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/HomeAddress.java
index 75b73c9..6de6cf6 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/HomeAddress.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/HomeAddress.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.ext.proxy.api.annotations.Namespace;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java
index 6602aaa..3bae151 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnion.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java
index c6ab1e7..644f6d8 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/LabourUnionCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java
index 671a504..f76980d 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/Order.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java
index 694eab5..3e3712c 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java
index c412a87..e74df1e 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetail.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/389b554c/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java
index 474af08..a0d2058 100644
--- a/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java
+++ b/fit/src/test/java/org/apache/olingo/fit/proxy/v4/staticservice/microsoft/test/odata/services/odatawcfservice/types/OrderDetailCollection.java
@@ -16,7 +16,6 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.olingo.fit.proxy.v4.staticservice.microsoft.test.odata.services.odatawcfservice.types;
import org.apache.olingo.client.api.http.HttpMethod;
[07/31] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/olingo-odata4
Posted by sk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/olingo-odata4
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/ed8e0e3c
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/ed8e0e3c
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/ed8e0e3c
Branch: refs/heads/olingo-266-ref
Commit: ed8e0e3cc112e377e16226d8017341d51816bbd7
Parents: 8720a30 8bd9e0c
Author: Francesco Chicchiriccò <--global>
Authored: Mon May 12 12:41:30 2014 +0200
Committer: Francesco Chicchiriccò <--global>
Committed: Mon May 12 12:41:30 2014 +0200
----------------------------------------------------------------------
ext/pojogen-maven-plugin/pom.xml | 7 -
.../proxy/v3/AuthEntityRetrieveTestITCase.java | 14 +-
.../fit/proxy/v3/EntityCreateTestITCase.java | 253 +++++++++----------
.../proxy/v4/AuthEntityRetrieveTestITCase.java | 20 +-
.../olingo/fit/v3/EntityCreateTestITCase.java | 2 +-
.../apache/olingo/client/core/uri/URIUtils.java | 14 +-
6 files changed, 155 insertions(+), 155 deletions(-)
----------------------------------------------------------------------
[09/31] [OLINGO-280] pojogen off-line generation implemented
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/it/v4Sample/src/test/resources/metadata.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/it/v4Sample/src/test/resources/metadata.xml b/ext/pojogen-maven-plugin/src/it/v4Sample/src/test/resources/metadata.xml
new file mode 100644
index 0000000..4bb360c
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/it/v4Sample/src/test/resources/metadata.xml
@@ -0,0 +1,462 @@
+<?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.
+
+-->
+<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
+ <edmx:DataServices>
+ <Schema Namespace="Microsoft.Test.OData.Services.ODataWCFService" xmlns="http://docs.oasis-open.org/odata/ns/edm">
+ <Term Name="IsBoss" Type="Edm.Boolean"/>
+ <ComplexType Name="Address">
+ <Property Name="Street" Type="Edm.String" Nullable="false"/>
+ <Property Name="City" Type="Edm.String" Nullable="false"/>
+ <Property Name="PostalCode" Type="Edm.String" Nullable="false"/>
+ </ComplexType>
+ <ComplexType Name="HomeAddress" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Address">
+ <Property Name="FamilyName" Type="Edm.String"/>
+ </ComplexType>
+ <ComplexType Name="CompanyAddress" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Address">
+ <Property Name="CompanyName" Type="Edm.String" Nullable="false"/>
+ </ComplexType>
+ <EnumType Name="AccessLevel" IsFlags="true">
+ <Member Name="None" Value="0"/>
+ <Member Name="Read" Value="1"/>
+ <Member Name="Write" Value="2"/>
+ <Member Name="Execute" Value="4"/>
+ <Member Name="ReadWrite" Value="3"/>
+ </EnumType>
+ <EnumType Name="Color">
+ <Member Name="Red" Value="1"/>
+ <Member Name="Green" Value="2"/>
+ <Member Name="Blue" Value="4"/>
+ </EnumType>
+ <EnumType Name="CompanyCategory">
+ <Member Name="IT" Value="0"/>
+ <Member Name="Communication" Value="1"/>
+ <Member Name="Electronics" Value="2"/>
+ <Member Name="Others" Value="4"/>
+ </EnumType>
+ <EntityType Name="Person">
+ <Key>
+ <PropertyRef Name="PersonID"/>
+ </Key>
+ <Property Name="PersonID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="FirstName" Type="Edm.String" Nullable="false"/>
+ <Property Name="LastName" Type="Edm.String" Nullable="false"/>
+ <Property Name="MiddleName" Type="Edm.String"/>
+ <Property Name="HomeAddress" Type="Microsoft.Test.OData.Services.ODataWCFService.Address"/>
+ <Property Name="Home" Type="Edm.GeographyPoint" SRID="4326"/>
+ <Property Name="Numbers" Type="Collection(Edm.String)" Nullable="false"/>
+ <Property Name="Emails" Type="Collection(Edm.String)"/>
+ <NavigationProperty Name="Parent" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="Customer" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Person">
+ <Property Name="City" Type="Edm.String" Nullable="false"/>
+ <Property Name="Birthday" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="TimeBetweenLastTwoOrders" Type="Edm.Duration" Nullable="false"/>
+ <NavigationProperty Name="Orders" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Order)"/>
+ <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="VipCustomer"/>
+ </EntityType>
+ <EntityType Name="Employee" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Person">
+ <Property Name="DateHired" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="Office" Type="Edm.GeographyPoint" SRID="4326"/>
+ <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="Employees"/>
+ </EntityType>
+ <EntityType Name="Product">
+ <Key>
+ <PropertyRef Name="ProductID"/>
+ </Key>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String" Nullable="false"/>
+ <Property Name="QuantityPerUnit" Type="Edm.String" Nullable="false"/>
+ <Property Name="UnitPrice" Type="Edm.Single" Nullable="false"/>
+ <Property Name="QuantityInStock" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Discontinued" Type="Edm.Boolean" Nullable="false"/>
+ <Property Name="UserAccess" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel"/>
+ <Property Name="SkinColor" Type="Microsoft.Test.OData.Services.ODataWCFService.Color"/>
+ <Property Name="CoverColors" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Color)" Nullable="false"/>
+ <NavigationProperty Name="Details" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.ProductDetail)">
+ <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID"/>
+ </NavigationProperty>
+ </EntityType>
+ <EntityType Name="ProductDetail">
+ <Key>
+ <PropertyRef Name="ProductID"/>
+ <PropertyRef Name="ProductDetailID"/>
+ </Key>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ProductDetailID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ProductName" Type="Edm.String" Nullable="false"/>
+ <Property Name="Description" Type="Edm.String" Nullable="false"/>
+ <NavigationProperty Name="RelatedProduct" Type="Microsoft.Test.OData.Services.ODataWCFService.Product"/>
+ <NavigationProperty Name="Reviews" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.ProductReview)">
+ <ReferentialConstraint Property="ProductID" ReferencedProperty="ProductID"/>
+ <ReferentialConstraint Property="ProductDetailID" ReferencedProperty="ProductDetailID"/>
+ </NavigationProperty>
+ </EntityType>
+ <EntityType Name="ProductReview">
+ <Key>
+ <PropertyRef Name="ProductID"/>
+ <PropertyRef Name="ProductDetailID"/>
+ <PropertyRef Name="ReviewTitle"/>
+ <PropertyRef Name="RevisionID"/>
+ </Key>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ProductDetailID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ReviewTitle" Type="Edm.String" Nullable="false"/>
+ <Property Name="RevisionID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Comment" Type="Edm.String" Nullable="false"/>
+ <Property Name="Author" Type="Edm.String" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="Order">
+ <Key>
+ <PropertyRef Name="OrderID"/>
+ </Key>
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="OrderDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="ShelfLife" Type="Edm.Duration"/>
+ <Property Name="OrderShelfLifes" Type="Collection(Edm.Duration)"/>
+ <NavigationProperty Name="LoggedInEmployee" Type="Microsoft.Test.OData.Services.ODataWCFService.Employee" Nullable="false"/>
+ <NavigationProperty Name="CustomerForOrder" Type="Microsoft.Test.OData.Services.ODataWCFService.Customer" Nullable="false"/>
+ <NavigationProperty Name="OrderDetails" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.OrderDetail)"/>
+ </EntityType>
+ <EntityType Name="OrderDetail">
+ <Key>
+ <PropertyRef Name="OrderID"/>
+ <PropertyRef Name="ProductID"/>
+ </Key>
+ <Property Name="OrderID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="ProductID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="OrderPlaced" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="Quantity" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="UnitPrice" Type="Edm.Single" Nullable="false"/>
+ <NavigationProperty Name="ProductOrdered" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)"/>
+ <NavigationProperty Name="AssociatedOrder" Type="Microsoft.Test.OData.Services.ODataWCFService.Order" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="Department">
+ <Key>
+ <PropertyRef Name="DepartmentID"/>
+ </Key>
+ <Property Name="DepartmentID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String" Nullable="false"/>
+ <Property Name="DepartmentNO" Type="Edm.String"/>
+ <NavigationProperty Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false" Partner="Departments"/>
+ </EntityType>
+ <EntityType Name="Company" OpenType="true">
+ <Key>
+ <PropertyRef Name="CompanyID"/>
+ </Key>
+ <Property Name="CompanyID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="CompanyCategory" Type="Microsoft.Test.OData.Services.ODataWCFService.CompanyCategory"/>
+ <Property Name="Revenue" Type="Edm.Int64" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
+ <Property Name="Address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address"/>
+ <NavigationProperty Name="Employees" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Employee)" Partner="Company"/>
+ <NavigationProperty Name="VipCustomer" Type="Microsoft.Test.OData.Services.ODataWCFService.Customer" Nullable="false" Partner="Company"/>
+ <NavigationProperty Name="Departments" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Department)" Partner="Company"/>
+ <NavigationProperty Name="CoreDepartment" Type="Microsoft.Test.OData.Services.ODataWCFService.Department" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="PublicCompany" BaseType="Microsoft.Test.OData.Services.ODataWCFService.Company" OpenType="true">
+ <Property Name="StockExchange" Type="Edm.String"/>
+ <NavigationProperty Name="Assets" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Asset)" ContainsTarget="true"/>
+ <NavigationProperty Name="Club" Type="Microsoft.Test.OData.Services.ODataWCFService.Club" Nullable="false" ContainsTarget="true"/>
+ <NavigationProperty Name="LabourUnion" Type="Microsoft.Test.OData.Services.ODataWCFService.LabourUnion" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="Asset">
+ <Key>
+ <PropertyRef Name="AssetID"/>
+ </Key>
+ <Property Name="AssetID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
+ <Property Name="Number" Type="Edm.Int32" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="Club">
+ <Key>
+ <PropertyRef Name="ClubID"/>
+ </Key>
+ <Property Name="ClubID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
+ </EntityType>
+ <EntityType Name="LabourUnion">
+ <Key>
+ <PropertyRef Name="LabourUnionID"/>
+ </Key>
+ <Property Name="LabourUnionID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Name" Type="Edm.String"/>
+ </EntityType>
+ <Action Name="AddAccessRight" IsBound="true">
+ <Parameter Name="product" Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false"/>
+ <Parameter Name="accessRight" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel"/>
+ </Action>
+ <Action Name="IncreaseRevenue" IsBound="true">
+ <Parameter Name="p" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false"/>
+ <Parameter Name="IncreaseValue" Type="Edm.Int64"/>
+ <ReturnType Type="Edm.Int64" Nullable="false"/>
+ </Action>
+ <Action Name="ResetAddress" IsBound="true" EntitySetPath="person">
+ <Parameter Name="person" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
+ <Parameter Name="addresses" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Address)" Nullable="false"/>
+ <Parameter Name="index" Type="Edm.Int32" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
+ </Action>
+ <Action Name="Discount" IsBound="true" EntitySetPath="products">
+ <Parameter Name="products" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false"/>
+ <Parameter Name="percentage" Type="Edm.Int32" Nullable="false"/>
+ <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false"/>
+ </Action>
+ <Action Name="Discount">
+ <Parameter Name="percentage" Type="Edm.Int32" Nullable="false"/>
+ </Action>
+ <Action Name="ResetBossEmail">
+ <Parameter Name="emails" Type="Collection(Edm.String)" Nullable="false"/>
+ <ReturnType Type="Collection(Edm.String)" Nullable="false"/>
+ </Action>
+ <Action Name="ResetBossAddress">
+ <Parameter Name="address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false"/>
+ </Action>
+ <Action Name="ResetDataSource"/>
+ <Function Name="GetEmployeesCount" IsBound="true">
+ <Parameter Name="p" Type="Microsoft.Test.OData.Services.ODataWCFService.Company" Nullable="false"/>
+ <ReturnType Type="Edm.Int32" Nullable="false"/>
+ </Function>
+ <Function Name="GetProductDetails" IsBound="true" EntitySetPath="product/Details" IsComposable="true">
+ <Parameter Name="product" Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false"/>
+ <Parameter Name="count" Type="Edm.Int32"/>
+ <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.ProductDetail)" Nullable="false"/>
+ </Function>
+ <Function Name="GetRelatedProduct" IsBound="true" EntitySetPath="productDetail/RelatedProduct" IsComposable="true">
+ <Parameter Name="productDetail" Type="Microsoft.Test.OData.Services.ODataWCFService.ProductDetail" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Product" Nullable="false"/>
+ </Function>
+ <Function Name="GetDefaultColor" IsComposable="true">
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Color"/>
+ </Function>
+ <Function Name="GetPerson" IsComposable="true">
+ <Parameter Name="address" Type="Microsoft.Test.OData.Services.ODataWCFService.Address" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
+ </Function>
+ <Function Name="GetPerson2" IsComposable="true">
+ <Parameter Name="city" Type="Edm.String" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
+ </Function>
+ <Function Name="GetAllProducts" IsComposable="true">
+ <ReturnType Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Product)" Nullable="false"/>
+ </Function>
+ <Function Name="GetBossEmails">
+ <Parameter Name="start" Type="Edm.Int32" Nullable="false"/>
+ <Parameter Name="count" Type="Edm.Int32" Nullable="false"/>
+ <ReturnType Type="Collection(Edm.String)" Nullable="false"/>
+ </Function>
+ <Function Name="GetProductsByAccessLevel">
+ <Parameter Name="accessLevel" Type="Microsoft.Test.OData.Services.ODataWCFService.AccessLevel" Nullable="false"/>
+ <ReturnType Type="Collection(Edm.String)" Nullable="false"/>
+ </Function>
+ <Function Name="GetActualAmount" IsBound="true">
+ <Parameter Name="giftcard" Type="Microsoft.Test.OData.Services.ODataWCFService.GiftCard" Nullable="false"/>
+ <Parameter Name="bonusRate" Type="Edm.Double"/>
+ <ReturnType Type="Edm.Double" Nullable="false"/>
+ </Function>
+ <Function Name="GetDefaultPI" IsBound="true" EntitySetPath="account/MyPaymentInstruments">
+ <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument"/>
+ </Function>
+ <Action Name="RefreshDefaultPI" IsBound="true" EntitySetPath="account/MyPaymentInstruments">
+ <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false"/>
+ <Parameter Name="newDate" Type="Edm.DateTimeOffset"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument"/>
+ </Action>
+ <Function Name="GetHomeAddress" IsBound="true" IsComposable="true">
+ <Parameter Name="person" Type="Microsoft.Test.OData.Services.ODataWCFService.Person" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.HomeAddress" Nullable="false"/>
+ </Function>
+ <Function Name="GetAccountInfo" IsBound="true" IsComposable="true">
+ <Parameter Name="account" Type="Microsoft.Test.OData.Services.ODataWCFService.Account" Nullable="false"/>
+ <ReturnType Type="Microsoft.Test.OData.Services.ODataWCFService.AccountInfo" Nullable="false"/>
+ </Function>
+ <ComplexType Name="AccountInfo" OpenType="true">
+ <Property Name="FirstName" Type="Edm.String" Nullable="false"/>
+ <Property Name="LastName" Type="Edm.String" Nullable="false"/>
+ </ComplexType>
+ <EntityType Name="Account">
+ <Key>
+ <PropertyRef Name="AccountID"/>
+ </Key>
+ <Property Name="AccountID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="Country" Type="Edm.String" Nullable="false"/>
+ <Property Name="AccountInfo" Type="Microsoft.Test.OData.Services.ODataWCFService.AccountInfo"/>
+ <NavigationProperty Name="MyGiftCard" Type="Microsoft.Test.OData.Services.ODataWCFService.GiftCard" ContainsTarget="true"/>
+ <NavigationProperty Name="MyPaymentInstruments" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument)" ContainsTarget="true"/>
+ <NavigationProperty Name="ActiveSubscriptions" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Subscription)" ContainsTarget="true"/>
+ <NavigationProperty Name="AvailableSubscriptionTemplatess" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Subscription)"/>
+ </EntityType>
+ <EntityType Name="GiftCard">
+ <Key>
+ <PropertyRef Name="GiftCardID"/>
+ </Key>
+ <Property Name="GiftCardID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="GiftCardNO" Type="Edm.String" Nullable="false"/>
+ <Property Name="Amount" Type="Edm.Double" Nullable="false"/>
+ <Property Name="ExperationDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <Property Name="OwnerName" Type="Edm.String"/>
+ </EntityType>
+ <EntityType Name="PaymentInstrument">
+ <Key>
+ <PropertyRef Name="PaymentInstrumentID"/>
+ </Key>
+ <Property Name="PaymentInstrumentID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="FriendlyName" Type="Edm.String" Nullable="false"/>
+ <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <NavigationProperty Name="TheStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI" Nullable="false"/>
+ <NavigationProperty Name="BillingStatements" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.Statement)" ContainsTarget="true"/>
+ <NavigationProperty Name="BackupStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="CreditCardPI" BaseType="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument">
+ <Property Name="CardNumber" Type="Edm.String" Nullable="false"/>
+ <Property Name="CVV" Type="Edm.String" Nullable="false"/>
+ <Property Name="HolderName" Type="Edm.String" Nullable="false"/>
+ <Property Name="Balance" Type="Edm.Double" Nullable="false"/>
+ <Property Name="ExperationDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ <NavigationProperty Name="CreditRecords" Type="Collection(Microsoft.Test.OData.Services.ODataWCFService.CreditRecord)" ContainsTarget="true"/>
+ </EntityType>
+ <EntityType Name="StoredPI">
+ <Key>
+ <PropertyRef Name="StoredPIID"/>
+ </Key>
+ <Property Name="StoredPIID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="PIName" Type="Edm.String" Nullable="false"/>
+ <Property Name="PIType" Type="Edm.String" Nullable="false"/>
+ <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="Statement">
+ <Key>
+ <PropertyRef Name="StatementID"/>
+ </Key>
+ <Property Name="StatementID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="TransactionType" Type="Edm.String" Nullable="false"/>
+ <Property Name="TransactionDescription" Type="Edm.String" Nullable="false"/>
+ <Property Name="Amount" Type="Edm.Double" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="CreditRecord">
+ <Key>
+ <PropertyRef Name="CreditRecordID"/>
+ </Key>
+ <Property Name="CreditRecordID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="IsGood" Type="Edm.Boolean" Nullable="false"/>
+ <Property Name="Reason" Type="Edm.String" Nullable="false"/>
+ <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ </EntityType>
+ <EntityType Name="Subscription">
+ <Key>
+ <PropertyRef Name="SubscriptionID"/>
+ </Key>
+ <Property Name="SubscriptionID" Type="Edm.Int32" Nullable="false"/>
+ <Property Name="TemplateGuid" Type="Edm.String" Nullable="false"/>
+ <Property Name="Title" Type="Edm.String" Nullable="false"/>
+ <Property Name="Category" Type="Edm.String" Nullable="false"/>
+ <Property Name="CreatedDate" Type="Edm.DateTimeOffset" Nullable="false"/>
+ </EntityType>
+ <EntityContainer Name="InMemoryEntities">
+ <EntitySet Name="People" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Person">
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
+ </EntitySet>
+ <Singleton Name="Boss" Type="Microsoft.Test.OData.Services.ODataWCFService.Person">
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
+ </Singleton>
+ <EntitySet Name="Customers" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Customer">
+ <NavigationPropertyBinding Path="Orders" Target="Orders"/>
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
+ </EntitySet>
+ <Singleton Name="VipCustomer" Type="Microsoft.Test.OData.Services.ODataWCFService.Customer">
+ <NavigationPropertyBinding Path="Orders" Target="Orders"/>
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
+ <NavigationPropertyBinding Path="Company" Target="Company"/>
+ </Singleton>
+ <EntitySet Name="Employees" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Employee">
+ <NavigationPropertyBinding Path="Parent" Target="People"/>
+ <NavigationPropertyBinding Path="Company" Target="Company"/>
+ </EntitySet>
+ <EntitySet Name="Products" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Product">
+ <NavigationPropertyBinding Path="Details" Target="ProductDetails"/>
+ </EntitySet>
+ <EntitySet Name="ProductDetails" EntityType="Microsoft.Test.OData.Services.ODataWCFService.ProductDetail">
+ <NavigationPropertyBinding Path="RelatedProduct" Target="Products"/>
+ <NavigationPropertyBinding Path="Reviews" Target="ProductReviews"/>
+ </EntitySet>
+ <EntitySet Name="ProductReviews" EntityType="Microsoft.Test.OData.Services.ODataWCFService.ProductReview"/>
+ <EntitySet Name="Orders" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Order">
+ <NavigationPropertyBinding Path="LoggedInEmployee" Target="Employees"/>
+ <NavigationPropertyBinding Path="CustomerForOrder" Target="Customers"/>
+ <NavigationPropertyBinding Path="OrderDetails" Target="OrderDetails"/>
+ <Annotation Term="Core.ChangeTracking">
+ <Record>
+ <PropertyValue Property="Supported" Bool="true"/>
+ <PropertyValue Property="FilterableProperties">
+ <Collection>
+ <PropertyPath>OrderID</PropertyPath>
+ </Collection>
+ </PropertyValue>
+ <PropertyValue Property="ExpandableProperties">
+ <Collection>
+ <PropertyPath>OrderDetails</PropertyPath>
+ </Collection>
+ </PropertyValue>
+ </Record>
+ </Annotation>
+ </EntitySet>
+ <EntitySet Name="OrderDetails" EntityType="Microsoft.Test.OData.Services.ODataWCFService.OrderDetail">
+ <NavigationPropertyBinding Path="AssociatedOrder" Target="Orders"/>
+ <NavigationPropertyBinding Path="ProductOrdered" Target="Products"/>
+ </EntitySet>
+ <EntitySet Name="Departments" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Department">
+ <NavigationPropertyBinding Path="Company" Target="Company"/>
+ </EntitySet>
+ <Singleton Name="Company" Type="Microsoft.Test.OData.Services.ODataWCFService.Company">
+ <NavigationPropertyBinding Path="Employees" Target="Employees"/>
+ <NavigationPropertyBinding Path="VipCustomer" Target="VipCustomer"/>
+ <NavigationPropertyBinding Path="Departments" Target="Departments"/>
+ <NavigationPropertyBinding Path="CoreDepartment" Target="Departments"/>
+ </Singleton>
+ <Singleton Name="PublicCompany" Type="Microsoft.Test.OData.Services.ODataWCFService.Company">
+ <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PublicCompany/LabourUnion" Target="LabourUnion"/>
+ </Singleton>
+ <Singleton Name="LabourUnion" Type="Microsoft.Test.OData.Services.ODataWCFService.LabourUnion"/>
+ <ActionImport Name="Discount" Action="Microsoft.Test.OData.Services.ODataWCFService.Discount"/>
+ <ActionImport Name="ResetBossEmail" Action="Microsoft.Test.OData.Services.ODataWCFService.ResetBossEmail"/>
+ <ActionImport Name="ResetBossAddress" Action="Microsoft.Test.OData.Services.ODataWCFService.ResetBossAddress"/>
+ <ActionImport Name="ResetDataSource" Action="Microsoft.Test.OData.Services.ODataWCFService.ResetDataSource"/>
+ <FunctionImport Name="GetDefaultColor" Function="Microsoft.Test.OData.Services.ODataWCFService.GetDefaultColor" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetPerson" Function="Microsoft.Test.OData.Services.ODataWCFService.GetPerson" EntitySet="People" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetPerson2" Function="Microsoft.Test.OData.Services.ODataWCFService.GetPerson2" EntitySet="People" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetAllProducts" Function="Microsoft.Test.OData.Services.ODataWCFService.GetAllProducts" EntitySet="Products" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetBossEmails" Function="Microsoft.Test.OData.Services.ODataWCFService.GetBossEmails" IncludeInServiceDocument="true"/>
+ <FunctionImport Name="GetProductsByAccessLevel" Function="Microsoft.Test.OData.Services.ODataWCFService.GetProductsByAccessLevel" IncludeInServiceDocument="true"/>
+ <EntitySet Name="Accounts" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Account">
+ <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument/TheStoredPI" Target="StoredPIs"/>
+ <NavigationPropertyBinding Path="AvailableSubscriptionTemplatess" Target="SubscriptionTemplates"/>
+ <NavigationPropertyBinding Path="Microsoft.Test.OData.Services.ODataWCFService.PaymentInstrument/BackupStoredPI" Target="DefaultStoredPI"/>
+ </EntitySet>
+ <EntitySet Name="StoredPIs" EntityType="Microsoft.Test.OData.Services.ODataWCFService.StoredPI"/>
+ <EntitySet Name="SubscriptionTemplates" EntityType="Microsoft.Test.OData.Services.ODataWCFService.Subscription"/>
+ <Singleton Name="DefaultStoredPI" Type="Microsoft.Test.OData.Services.ODataWCFService.StoredPI"/>
+ </EntityContainer>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/it/v4Sample/verify.groovy
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/it/v4Sample/verify.groovy b/ext/pojogen-maven-plugin/src/it/v4Sample/verify.groovy
new file mode 100644
index 0000000..02f0407
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/it/v4Sample/verify.groovy
@@ -0,0 +1,20 @@
+/**
+ * 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.
+ */
+File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/org/apache/olingo/fit/proxy/v4" );
+assert basepkg.isDirectory() && basepkg.listFiles().length>0;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractMetadataMojo.java
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractMetadataMojo.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractMetadataMojo.java
deleted file mode 100644
index 065e172..0000000
--- a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractMetadataMojo.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.ext.pojogen;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.Parameter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
-import org.apache.velocity.Template;
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.Velocity;
-
-public abstract class AbstractMetadataMojo extends AbstractMojo {
-
- /**
- * Generated files base root.
- */
- @Parameter(property = "outputDirectory", required = true)
- protected String outputDirectory;
-
- /**
- * OData service root URL.
- */
- @Parameter(property = "serviceRootURL", required = true)
- protected String serviceRootURL;
-
- /**
- * Base package.
- */
- @Parameter(property = "basePackage", required = true)
- protected String basePackage;
-
- protected final Set<String> namespaces = new HashSet<String>();
-
- protected static String TOOL_DIR = "ojc-plugin";
-
- protected AbstractUtility utility;
-
- protected abstract AbstractUtility getUtility();
-
- protected abstract String getVersion();
-
- protected File mkdir(final String path) {
- final File dir = new File(outputDirectory + File.separator + TOOL_DIR + File.separator + path);
-
- if (dir.exists()) {
- if (!dir.isDirectory()) {
- throw new IllegalArgumentException("Invalid path '" + path + "': it is not a directory");
- }
- } else {
- dir.mkdirs();
- }
-
- return dir;
- }
-
- protected File mkPkgDir(final String path) {
- return mkdir(basePackage.replace('.', File.separatorChar) + File.separator + path);
- }
-
- protected void writeFile(final String name, final File path, final VelocityContext ctx, final Template template,
- final boolean append) throws MojoExecutionException {
-
- if (!path.exists()) {
- throw new IllegalArgumentException("Invalid base path '" + path.getAbsolutePath() + "'");
- }
-
- FileWriter writer = null;
- try {
- final File toBeWritten = new File(path, name);
- if (!append && toBeWritten.exists()) {
- throw new IllegalStateException("File '" + toBeWritten.getAbsolutePath() + "' already exists");
- }
- writer = new FileWriter(toBeWritten, append);
- template.merge(ctx, writer);
- } catch (IOException e) {
- throw new MojoExecutionException("Error creating file '" + name + "'", e);
- } finally {
- IOUtils.closeQuietly(writer);
- }
- }
-
- protected VelocityContext newContext() {
- final VelocityContext ctx = new VelocityContext();
-
- ctx.put("utility", getUtility());
- ctx.put("basePackage", basePackage);
- ctx.put("schemaName", getUtility().getSchemaName());
- ctx.put("namespace", getUtility().getNamespace());
- ctx.put("namespaces", namespaces);
- ctx.put("odataVersion", getVersion());
-
- return ctx;
- }
-
- protected void parseObj(final File base, final String pkg, final String name, final String out)
- throws MojoExecutionException {
-
- parseObj(base, false, pkg, name, out, Collections.<String, Object>emptyMap());
- }
-
- protected void parseObj(
- final File base,
- final String pkg,
- final String name,
- final String out,
- final Map<String, Object> objs)
- throws MojoExecutionException {
-
- parseObj(base, false, pkg, name, out, objs);
- }
-
- protected void parseObj(
- final File base,
- final boolean append,
- final String pkg,
- final String name,
- final String out,
- final Map<String, Object> objs)
- throws MojoExecutionException {
-
- final VelocityContext ctx = newContext();
- ctx.put("package", pkg);
-
- if (objs != null) {
- for (Map.Entry<String, Object> obj : objs.entrySet()) {
- if (StringUtils.isNotBlank(obj.getKey()) && obj.getValue() != null) {
- ctx.put(obj.getKey(), obj.getValue());
- }
- }
- }
-
- final Template template = Velocity.getTemplate(name + ".vm");
- writeFile(out, base, ctx, template, append);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java
new file mode 100644
index 0000000..b2023a7
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractPOJOGenMojo.java
@@ -0,0 +1,340 @@
+/*
+ * 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.ext.pojogen;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugins.annotations.Parameter;
+import org.apache.olingo.client.api.CommonODataClient;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmComplexType;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.commons.api.edm.EdmEnumType;
+import org.apache.olingo.commons.api.edm.EdmSchema;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+import org.apache.velocity.Template;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
+import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
+import org.codehaus.plexus.util.FileUtils;
+
+public abstract class AbstractPOJOGenMojo extends AbstractMojo {
+
+ /**
+ * Generated files base root.
+ */
+ @Parameter(property = "outputDirectory", required = true)
+ protected String outputDirectory;
+
+ /**
+ * OData service root URL.
+ */
+ @Parameter(property = "serviceRootURL", required = false)
+ protected String serviceRootURL;
+
+ /**
+ * Local file from which Edm information can be loaded.
+ */
+ @Parameter(property = "localEdm", required = false)
+ protected String localEdm;
+
+ /**
+ * Base package.
+ */
+ @Parameter(property = "basePackage", required = true)
+ protected String basePackage;
+
+ protected final Set<String> namespaces = new HashSet<String>();
+
+ protected static String TOOL_DIR = "ojc-plugin";
+
+ protected AbstractUtility utility;
+
+ protected abstract String getVersion();
+
+ protected File mkdir(final String path) {
+ final File dir = new File(outputDirectory + File.separator + TOOL_DIR + File.separator + path);
+
+ if (dir.exists()) {
+ if (!dir.isDirectory()) {
+ throw new IllegalArgumentException("Invalid path '" + path + "': it is not a directory");
+ }
+ } else {
+ dir.mkdirs();
+ }
+
+ return dir;
+ }
+
+ protected File mkPkgDir(final String path) {
+ return mkdir(basePackage.replace('.', File.separatorChar) + File.separator + path);
+ }
+
+ protected void writeFile(final String name, final File path, final VelocityContext ctx, final Template template,
+ final boolean append) throws MojoExecutionException {
+
+ if (!path.exists()) {
+ throw new IllegalArgumentException("Invalid base path '" + path.getAbsolutePath() + "'");
+ }
+
+ FileWriter writer = null;
+ try {
+ final File toBeWritten = new File(path, name);
+ if (!append && toBeWritten.exists()) {
+ throw new IllegalStateException("File '" + toBeWritten.getAbsolutePath() + "' already exists");
+ }
+ writer = new FileWriter(toBeWritten, append);
+ template.merge(ctx, writer);
+ } catch (IOException e) {
+ throw new MojoExecutionException("Error creating file '" + name + "'", e);
+ } finally {
+ IOUtils.closeQuietly(writer);
+ }
+ }
+
+ protected VelocityContext newContext() {
+ final VelocityContext ctx = new VelocityContext();
+
+ ctx.put("utility", getUtility());
+ ctx.put("basePackage", basePackage);
+ ctx.put("schemaName", getUtility().getSchemaName());
+ ctx.put("namespace", getUtility().getNamespace());
+ ctx.put("namespaces", namespaces);
+ ctx.put("odataVersion", getVersion());
+
+ return ctx;
+ }
+
+ protected void parseObj(final File base, final String pkg, final String name, final String out)
+ throws MojoExecutionException {
+
+ parseObj(base, false, pkg, name, out, Collections.<String, Object>emptyMap());
+ }
+
+ protected void parseObj(
+ final File base,
+ final String pkg,
+ final String name,
+ final String out,
+ final Map<String, Object> objs)
+ throws MojoExecutionException {
+
+ parseObj(base, false, pkg, name, out, objs);
+ }
+
+ protected void parseObj(
+ final File base,
+ final boolean append,
+ final String pkg,
+ final String name,
+ final String out,
+ final Map<String, Object> objs)
+ throws MojoExecutionException {
+
+ final VelocityContext ctx = newContext();
+ ctx.put("package", pkg);
+
+ if (objs != null) {
+ for (Map.Entry<String, Object> obj : objs.entrySet()) {
+ if (StringUtils.isNotBlank(obj.getKey()) && obj.getValue() != null) {
+ ctx.put(obj.getKey(), obj.getValue());
+ }
+ }
+ }
+
+ final Template template = Velocity.getTemplate(name + ".vm");
+ writeFile(out, base, ctx, template, append);
+ }
+
+ protected abstract void createUtility(Edm edm, EdmSchema schema, String basePackage);
+
+ protected abstract AbstractUtility getUtility();
+
+ protected abstract CommonODataClient<?> getClient();
+
+ private Edm getEdm() throws FileNotFoundException {
+ if (StringUtils.isEmpty(serviceRootURL) && StringUtils.isEmpty(localEdm)) {
+ throw new IllegalArgumentException("Must provide either serviceRootURL or localEdm");
+ }
+ if (StringUtils.isNotEmpty(serviceRootURL) && StringUtils.isNotEmpty(localEdm)) {
+ throw new IllegalArgumentException("Must provide either serviceRootURL or localEdm, not both");
+ }
+
+ Edm edm = null;
+ if (StringUtils.isNotEmpty(serviceRootURL)) {
+ edm = getClient().getRetrieveRequestFactory().getMetadataRequest(serviceRootURL).execute().getBody();
+ } else if (StringUtils.isNotEmpty(localEdm)) {
+ final FileInputStream fis = new FileInputStream(FileUtils.getFile(localEdm));
+ try {
+ edm = getClient().getReader().readMetadata(fis);
+ } finally {
+ IOUtils.closeQuietly(fis);
+ }
+ }
+
+ if (edm == null) {
+ throw new IllegalStateException("Metadata not found");
+ }
+ return edm;
+ }
+
+ @Override
+ public void execute() throws MojoExecutionException, MojoFailureException {
+ if (new File(outputDirectory + File.separator + TOOL_DIR).exists()) {
+ getLog().info("Nothing to do because " + TOOL_DIR + " directory already exists. Clean to update.");
+ return;
+ }
+
+ Velocity.addProperty(Velocity.RESOURCE_LOADER, "class");
+ Velocity.addProperty("class.resource.loader.class", ClasspathResourceLoader.class.getName());
+
+ try {
+ final Edm edm = getEdm();
+
+ for (EdmSchema schema : edm.getSchemas()) {
+ namespaces.add(schema.getNamespace().toLowerCase());
+ }
+
+ final Set<String> complexTypeNames = new HashSet<String>();
+ final File services = mkdir("META-INF/services");
+
+ for (EdmSchema schema : edm.getSchemas()) {
+ createUtility(edm, schema, basePackage);
+
+ // write package-info for the base package
+ final String schemaPath = utility.getNamespace().toLowerCase().replace('.', File.separatorChar);
+ final File base = mkPkgDir(schemaPath);
+ final String pkg = basePackage + "." + utility.getNamespace().toLowerCase();
+ parseObj(base, pkg, "package-info", "package-info.java");
+
+ // write package-info for types package
+ final File typesBaseDir = mkPkgDir(schemaPath + "/types");
+ final String typesPkg = pkg + ".types";
+ parseObj(typesBaseDir, typesPkg, "package-info", "package-info.java");
+
+ final Map<String, Object> objs = new HashMap<String, Object>();
+
+ // write types into types package
+ for (EdmEnumType enumType : schema.getEnumTypes()) {
+ final String className = utility.capitalize(enumType.getName());
+ objs.clear();
+ objs.put("enumType", enumType);
+ parseObj(typesBaseDir, typesPkg, "enumType", className + ".java", objs);
+ }
+
+ for (EdmComplexType complex : schema.getComplexTypes()) {
+ final String className = utility.capitalize(complex.getName());
+ complexTypeNames.add(typesPkg + "." + className);
+ objs.clear();
+ objs.put("complexType", complex);
+ parseObj(typesBaseDir, typesPkg, "complexType", className + ".java", objs);
+ }
+
+ for (EdmEntityType entity : schema.getEntityTypes()) {
+ objs.clear();
+ objs.put("entityType", entity);
+
+ final Map<String, String> keys;
+
+ EdmEntityType baseType = null;
+ if (entity.getBaseType() == null) {
+ keys = getUtility().getEntityKeyType(entity);
+ } else {
+ baseType = entity.getBaseType();
+ objs.put("baseType", getUtility().getJavaType(baseType.getFullQualifiedName().toString()));
+ while (baseType.getBaseType() != null) {
+ baseType = baseType.getBaseType();
+ }
+ keys = getUtility().getEntityKeyType(baseType);
+ }
+
+ if (keys.size() > 1) {
+ // create compound key class
+ final String keyClassName = utility.capitalize(baseType == null
+ ? entity.getName()
+ : baseType.getName()) + "Key";
+ objs.put("keyRef", keyClassName);
+
+ if (entity.getBaseType() == null) {
+ objs.put("keys", keys);
+ parseObj(typesBaseDir, typesPkg, "entityTypeKey", keyClassName + ".java", objs);
+ }
+ }
+
+ parseObj(typesBaseDir, typesPkg, "entityType",
+ utility.capitalize(entity.getName()) + ".java", objs);
+ parseObj(typesBaseDir, typesPkg, "entityCollection",
+ utility.capitalize(entity.getName()) + "Collection.java", objs);
+ }
+
+ // write container and top entity sets into the base package
+ for (EdmEntityContainer container : schema.getEntityContainers()) {
+ objs.clear();
+ objs.put("container", container);
+ objs.put("namespace", schema.getNamespace());
+
+ parseObj(base, pkg, "container",
+ utility.capitalize(container.getName()) + ".java", objs);
+
+ for (EdmEntitySet entitySet : container.getEntitySets()) {
+ objs.clear();
+ objs.put("entitySet", entitySet);
+ parseObj(base, pkg, "entitySet",
+ utility.capitalize(entitySet.getName()) + ".java", objs);
+ }
+
+ if (ODataServiceVersion.valueOf(getVersion().toUpperCase()).compareTo(ODataServiceVersion.V40) >= 0) {
+ for (EdmSingleton singleton : container.getSingletons()) {
+ objs.clear();
+ objs.put("singleton", singleton);
+ parseObj(base, pkg, "singleton",
+ utility.capitalize(singleton.getName()) + ".java", objs);
+ }
+ }
+ }
+
+ parseObj(services, true, null, "services", "org.apache.olingo.ext.proxy.api.AbstractComplexType",
+ Collections.singletonMap("services", (Object) complexTypeNames));
+ }
+ } catch (Exception t) {
+ getLog().error(t);
+
+ throw (t instanceof MojoExecutionException)
+ ? (MojoExecutionException) t
+ : new MojoExecutionException("While executin mojo", t);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java
index 2930ace..32bfc6b 100644
--- a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java
+++ b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/AbstractUtility.java
@@ -206,15 +206,15 @@ public abstract class AbstractUtility {
return result;
}
-
- public List<EdmOperation> justInheritedOperationsBoundTo(final EdmEntityType entity){
+
+ public List<EdmOperation> justInheritedOperationsBoundTo(final EdmEntityType entity) {
final List<EdmOperation> result = new ArrayList<EdmOperation>();
- if(entity.getBaseType()!=null){
+ if (entity.getBaseType() != null) {
result.addAll(getFunctionsBoundTo(entity.getBaseType().getName(), false));
result.addAll(getActionsBoundTo(entity.getBaseType().getName(), false));
result.addAll(justInheritedOperationsBoundTo(entity.getBaseType()));
}
-
+
return result;
}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V3MetadataMojo.java
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V3MetadataMojo.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V3MetadataMojo.java
deleted file mode 100644
index 9ab6f48..0000000
--- a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V3MetadataMojo.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.ext.pojogen;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.apache.olingo.client.core.ODataClientFactory;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmComplexType;
-import org.apache.olingo.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmEnumType;
-import org.apache.olingo.commons.api.edm.EdmSchema;
-import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
-
-/**
- * POJOs generator.
- */
-@Mojo(name = "pojosV3", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
-public class V3MetadataMojo extends AbstractMetadataMojo {
-
- @Override
- protected V3Utility getUtility() {
- return (V3Utility) utility;
- }
-
- @Override
- protected String getVersion() {
- return ODataServiceVersion.V30.name().toLowerCase();
- }
-
- @Override
- public void execute() throws MojoExecutionException {
- if (new File(outputDirectory + File.separator + TOOL_DIR).exists()) {
- getLog().info("Nothing to do because " + TOOL_DIR + " directory already exists. Clean to update.");
- return;
- }
-
- try {
- Velocity.addProperty(Velocity.RESOURCE_LOADER, "class");
- Velocity.addProperty("class.resource.loader.class", ClasspathResourceLoader.class.getName());
-
- final Edm metadata = ODataClientFactory.getV3().getRetrieveRequestFactory().
- getMetadataRequest(serviceRootURL).execute().getBody();
-
- if (metadata == null) {
- throw new IllegalStateException("Metadata not found");
- }
-
- for (EdmSchema schema : metadata.getSchemas()) {
- namespaces.add(schema.getNamespace().toLowerCase());
- }
-
- final Set<String> complexTypeNames = new HashSet<String>();
- final File services = mkdir("META-INF/services");
-
- for (EdmSchema schema : metadata.getSchemas()) {
- utility = new V3Utility(metadata, schema, basePackage);
-
- // write package-info for the base package
- final String schemaPath = utility.getNamespace().toLowerCase().replace('.', File.separatorChar);
- final File base = mkPkgDir(schemaPath);
- final String pkg = basePackage + "." + utility.getNamespace().toLowerCase();
- parseObj(base, pkg, "package-info", "package-info.java");
-
- // write package-info for types package
- final File typesBaseDir = mkPkgDir(schemaPath + "/types");
- final String typesPkg = pkg + ".types";
- parseObj(typesBaseDir, typesPkg, "package-info", "package-info.java");
-
- final Map<String, Object> objs = new HashMap<String, Object>();
-
- // write types into types package
- for (EdmEnumType enumType : schema.getEnumTypes()) {
- final String className = utility.capitalize(enumType.getName());
- objs.clear();
- objs.put("enumType", enumType);
- parseObj(typesBaseDir, typesPkg, "enumType", className + ".java", objs);
- }
-
- for (EdmComplexType complex : schema.getComplexTypes()) {
- final String className = utility.capitalize(complex.getName());
- complexTypeNames.add(typesPkg + "." + className);
- objs.clear();
- objs.put("complexType", complex);
- parseObj(typesBaseDir, typesPkg, "complexType", className + ".java", objs);
- }
-
- for (EdmEntityType entity : schema.getEntityTypes()) {
- objs.clear();
- objs.put("entityType", entity);
-
- final Map<String, String> keys;
-
- EdmEntityType baseType = null;
- if (entity.getBaseType() == null) {
- keys = getUtility().getEntityKeyType(entity);
- } else {
- baseType = entity.getBaseType();
- objs.put("baseType", getUtility().getJavaType(baseType.getFullQualifiedName().toString()));
- while (baseType.getBaseType() != null) {
- baseType = baseType.getBaseType();
- }
- keys = getUtility().getEntityKeyType(baseType);
- }
-
- if (keys.size() > 1) {
- // create compound key class
- final String keyClassName = utility.capitalize(baseType == null
- ? entity.getName()
- : baseType.getName()) + "Key";
- objs.put("keyRef", keyClassName);
-
- if (entity.getBaseType() == null) {
- objs.put("keys", keys);
- parseObj(typesBaseDir, typesPkg, "entityTypeKey", keyClassName + ".java", objs);
- }
- }
-
- parseObj(typesBaseDir, typesPkg, "entityType",
- utility.capitalize(entity.getName()) + ".java", objs);
- parseObj(typesBaseDir, typesPkg, "entityCollection",
- utility.capitalize(entity.getName()) + "Collection.java", objs);
- }
-
- // write container and top entity sets into the base package
- for (EdmEntityContainer container : schema.getEntityContainers()) {
- objs.clear();
- objs.put("container", container);
- objs.put("namespace", schema.getNamespace());
- parseObj(base, pkg, "container",
- utility.capitalize(container.getName()) + ".java", objs);
-
- for (EdmEntitySet entitySet : container.getEntitySets()) {
- objs.clear();
- objs.put("entitySet", entitySet);
- parseObj(base, pkg, "entitySet",
- utility.capitalize(entitySet.getName()) + ".java", objs);
- }
- }
-
- parseObj(services, true, null, "services", "org.apache.olingo.ext.proxy.api.AbstractComplexType",
- Collections.singletonMap("services", (Object) complexTypeNames));
- }
- } catch (Exception t) {
- final StringWriter stringWriter = new StringWriter();
- final PrintWriter printWriter = new PrintWriter(stringWriter);
- t.printStackTrace(printWriter);
- getLog().error(stringWriter.toString());
-
- throw (t instanceof MojoExecutionException)
- ? (MojoExecutionException) t
- : new MojoExecutionException("While executing mojo", t);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V3POJOGenMojo.java
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V3POJOGenMojo.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V3POJOGenMojo.java
new file mode 100644
index 0000000..ead9a7c
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V3POJOGenMojo.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.ext.pojogen;
+
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.olingo.client.api.CommonODataClient;
+import org.apache.olingo.client.core.ODataClientFactory;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmSchema;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+/**
+ * POJOs generator.
+ */
+@Mojo(name = "v3pojoGen", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
+public class V3POJOGenMojo extends AbstractPOJOGenMojo {
+
+ @Override
+ protected void createUtility(final Edm edm, final EdmSchema schema, final String basePackage) {
+ utility = new V3Utility(edm, schema, basePackage);
+ }
+
+ @Override
+ protected V3Utility getUtility() {
+ return (V3Utility) utility;
+ }
+
+ @Override
+ protected String getVersion() {
+ return ODataServiceVersion.V30.name().toLowerCase();
+ }
+
+ @Override
+ protected CommonODataClient<?> getClient() {
+ return ODataClientFactory.getV3();
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V4MetadataMojo.java
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V4MetadataMojo.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V4MetadataMojo.java
deleted file mode 100644
index 2751726..0000000
--- a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V4MetadataMojo.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.ext.pojogen;
-
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugins.annotations.LifecyclePhase;
-import org.apache.maven.plugins.annotations.Mojo;
-import java.io.File;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-import org.apache.olingo.client.core.ODataClientFactory;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.api.edm.EdmComplexType;
-import org.apache.olingo.commons.api.edm.EdmEntityContainer;
-import org.apache.olingo.commons.api.edm.EdmEntitySet;
-import org.apache.olingo.commons.api.edm.EdmEntityType;
-import org.apache.olingo.commons.api.edm.EdmEnumType;
-import org.apache.olingo.commons.api.edm.EdmSchema;
-import org.apache.olingo.commons.api.edm.EdmSingleton;
-import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
-import org.apache.velocity.app.Velocity;
-import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
-
-/**
- * POJOs generator.
- */
-@Mojo(name = "pojosV4", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
-public class V4MetadataMojo extends AbstractMetadataMojo {
-
- @Override
- protected V4Utility getUtility() {
- return (V4Utility) utility;
- }
-
- @Override
- protected String getVersion() {
- return ODataServiceVersion.V40.name().toLowerCase();
- }
-
- @Override
- public void execute() throws MojoExecutionException {
- if (new File(outputDirectory + File.separator + TOOL_DIR).exists()) {
- getLog().info("Nothing to do because " + TOOL_DIR + " directory already exists. Clean to update.");
- return;
- }
-
- try {
- Velocity.addProperty(Velocity.RESOURCE_LOADER, "class");
- Velocity.addProperty("class.resource.loader.class", ClasspathResourceLoader.class.getName());
-
- final Edm metadata =
- ODataClientFactory.getV4().getRetrieveRequestFactory().getMetadataRequest(serviceRootURL).execute().
- getBody();
-
- if (metadata == null) {
- throw new IllegalStateException("Metadata not found");
- }
-
- for (EdmSchema schema : metadata.getSchemas()) {
- namespaces.add(schema.getNamespace().toLowerCase());
- }
-
- final Set<String> complexTypeNames = new HashSet<String>();
- final File services = mkdir("META-INF/services");
-
- for (EdmSchema schema : metadata.getSchemas()) {
- utility = new V4Utility(metadata, schema, basePackage);
-
- // write package-info for the base package
- final String schemaPath = utility.getNamespace().toLowerCase().replace('.', File.separatorChar);
- final File base = mkPkgDir(schemaPath);
- final String pkg = basePackage + "." + utility.getNamespace().toLowerCase();
- parseObj(base, pkg, "package-info", "package-info.java");
-
- // write package-info for types package
- final File typesBaseDir = mkPkgDir(schemaPath + "/types");
- final String typesPkg = pkg + ".types";
- parseObj(typesBaseDir, typesPkg, "package-info", "package-info.java");
-
- final Map<String, Object> objs = new HashMap<String, Object>();
-
- // write types into types package
- for (EdmEnumType enumType : schema.getEnumTypes()) {
- final String className = utility.capitalize(enumType.getName());
- objs.clear();
- objs.put("enumType", enumType);
- parseObj(typesBaseDir, typesPkg, "enumType", className + ".java", objs);
- }
-
- for (EdmComplexType complex : schema.getComplexTypes()) {
- final String className = utility.capitalize(complex.getName());
- complexTypeNames.add(typesPkg + "." + className);
- objs.clear();
- objs.put("complexType", complex);
- parseObj(typesBaseDir, typesPkg, "complexType", className + ".java", objs);
- }
-
- for (EdmEntityType entity : schema.getEntityTypes()) {
- objs.clear();
- objs.put("entityType", entity);
-
- final Map<String, String> keys;
-
- EdmEntityType baseType = null;
- if (entity.getBaseType() == null) {
- keys = getUtility().getEntityKeyType(entity);
- } else {
- baseType = entity.getBaseType();
- objs.put("baseType", getUtility().getJavaType(baseType.getFullQualifiedName().toString()));
- while (baseType.getBaseType() != null) {
- baseType = baseType.getBaseType();
- }
- keys = getUtility().getEntityKeyType(baseType);
- }
-
- if (keys.size() > 1) {
- // create compound key class
- final String keyClassName = utility.capitalize(baseType == null
- ? entity.getName()
- : baseType.getName()) + "Key";
- objs.put("keyRef", keyClassName);
-
- if (entity.getBaseType() == null) {
- objs.put("keys", keys);
- parseObj(typesBaseDir, typesPkg, "entityTypeKey", keyClassName + ".java", objs);
- }
- }
-
- parseObj(typesBaseDir, typesPkg, "entityType",
- utility.capitalize(entity.getName()) + ".java", objs);
- parseObj(typesBaseDir, typesPkg, "entityCollection",
- utility.capitalize(entity.getName()) + "Collection.java", objs);
- }
-
- // write container and top entity sets into the base package
- for (EdmEntityContainer container : schema.getEntityContainers()) {
- objs.clear();
- objs.put("container", container);
- objs.put("namespace", schema.getNamespace());
-
- parseObj(base, pkg, "container",
- utility.capitalize(container.getName()) + ".java", objs);
-
- for (EdmEntitySet entitySet : container.getEntitySets()) {
- objs.clear();
- objs.put("entitySet", entitySet);
- parseObj(base, pkg, "entitySet",
- utility.capitalize(entitySet.getName()) + ".java", objs);
- }
-
- for (EdmSingleton singleton : container.getSingletons()) {
- objs.clear();
- objs.put("singleton", singleton);
- parseObj(base, pkg, "singleton",
- utility.capitalize(singleton.getName()) + ".java", objs);
- }
- }
-
- parseObj(services, true, null, "services", "org.apache.olingo.ext.proxy.api.AbstractComplexType",
- Collections.singletonMap("services", (Object) complexTypeNames));
- }
- } catch (Exception t) {
- final StringWriter stringWriter = new StringWriter();
- final PrintWriter printWriter = new PrintWriter(stringWriter);
- t.printStackTrace(printWriter);
- getLog().error(stringWriter.toString());
-
- throw (t instanceof MojoExecutionException)
- ? (MojoExecutionException) t
- : new MojoExecutionException("While executin mojo", t);
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V4POJOGenMojo.java
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V4POJOGenMojo.java b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V4POJOGenMojo.java
new file mode 100644
index 0000000..13d97b7
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/main/java/org/apache/olingo/ext/pojogen/V4POJOGenMojo.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.ext.pojogen;
+
+import org.apache.maven.plugins.annotations.LifecyclePhase;
+import org.apache.maven.plugins.annotations.Mojo;
+import org.apache.olingo.client.api.v4.ODataClient;
+import org.apache.olingo.client.core.ODataClientFactory;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmSchema;
+import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
+
+/**
+ * POJOs generator.
+ */
+@Mojo(name = "v4pojoGen", defaultPhase = LifecyclePhase.PROCESS_SOURCES)
+public class V4POJOGenMojo extends AbstractPOJOGenMojo {
+
+ @Override
+ protected void createUtility(final Edm edm, final EdmSchema schema, final String basePackage) {
+ utility = new V4Utility(edm, schema, basePackage);
+ }
+
+ @Override
+ protected V4Utility getUtility() {
+ return (V4Utility) utility;
+ }
+
+ @Override
+ protected String getVersion() {
+ return ODataServiceVersion.V40.name().toLowerCase();
+ }
+
+ @Override
+ protected ODataClient getClient() {
+ return ODataClientFactory.getV4();
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/main/resources/entityType.vm
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm b/ext/pojogen-maven-plugin/src/main/resources/entityType.vm
index 82ef821..1114445 100644
--- a/ext/pojogen-maven-plugin/src/main/resources/entityType.vm
+++ b/ext/pojogen-maven-plugin/src/main/resources/entityType.vm
@@ -126,10 +126,10 @@ public interface $utility.capitalize($entityType.Name)
#set( $functions = $utility.getFunctionsBoundTo($entityType.Name, false) )
#set( $actions = $utility.getActionsBoundTo($entityType.Name, false) )
-#set( $inherited = $utility.justInheritedOperationsBoundTo($entityType).size())
+#set( $inherited = $utility.justInheritedOperationsBoundTo($entityType) )
#if( $inherited.size() > 0 || $functions.size() > 0 || $actions.size() > 0 )
#if($inherited.size() > 0)
- @Overide
+ @Override
#end
Operations operations();
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/fit/pom.xml
----------------------------------------------------------------------
diff --git a/fit/pom.xml b/fit/pom.xml
index 905f1cf..20081de 100644
--- a/fit/pom.xml
+++ b/fit/pom.xml
@@ -34,11 +34,6 @@
<relativePath>..</relativePath>
</parent>
- <properties>
- <war.maven.plugin.version>2.4</war.maven.plugin.version>
- <invoker.maven.plugin.version>1.8</invoker.maven.plugin.version>
- </properties>
-
<dependencies>
<dependency>
<groupId>org.apache.olingo</groupId>
@@ -48,7 +43,7 @@
<dependency>
<groupId>org.apache.olingo</groupId>
- <artifactId>client-proxy</artifactId>
+ <artifactId>olingo-client-proxy</artifactId>
<version>${project.version}</version>
</dependency>
@@ -115,7 +110,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
- <version>${invoker.maven.plugin.version}</version>
<inherited>true</inherited>
<configuration>
<debug>true</debug>
@@ -143,7 +137,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
- <version>${war.maven.plugin.version}</version>
+ <inherited>true</inherited>
<configuration>
<webResources>
<resource>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/fit/src/it/staticServiceV3/pom.xml
----------------------------------------------------------------------
diff --git a/fit/src/it/staticServiceV3/pom.xml b/fit/src/it/staticServiceV3/pom.xml
index 8e8c38b..cd27520 100644
--- a/fit/src/it/staticServiceV3/pom.xml
+++ b/fit/src/it/staticServiceV3/pom.xml
@@ -42,7 +42,7 @@
</dependency>
<dependency>
- <artifactId>client-proxy</artifactId>
+ <artifactId>olingo-client-proxy</artifactId>
<groupId>org.apache.olingo</groupId>
<version>@project.version@</version>
</dependency>
@@ -80,10 +80,10 @@
<serviceRootURL>http://localhost:9080/stub/StaticService/V30/Static.svc</serviceRootURL>
<basePackage>org.apache.olingo.fit.proxy.v3.staticservice</basePackage>
</configuration>
- <id>pojosV3</id>
+ <id>v3pojoGen</id>
<phase>generate-sources</phase>
<goals>
- <goal>pojosV3</goal>
+ <goal>v3pojoGen</goal>
</goals>
</execution>
</executions>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/fit/src/it/staticServiceV4/pom.xml
----------------------------------------------------------------------
diff --git a/fit/src/it/staticServiceV4/pom.xml b/fit/src/it/staticServiceV4/pom.xml
index 31a7ae2..5917364 100644
--- a/fit/src/it/staticServiceV4/pom.xml
+++ b/fit/src/it/staticServiceV4/pom.xml
@@ -42,7 +42,7 @@
</dependency>
<dependency>
- <artifactId>client-proxy</artifactId>
+ <artifactId>olingo-client-proxy</artifactId>
<groupId>org.apache.olingo</groupId>
<version>@project.version@</version>
</dependency>
@@ -80,10 +80,10 @@
<serviceRootURL>http://localhost:9080/stub/StaticService/V40/Static.svc</serviceRootURL>
<basePackage>org.apache.olingo.fit.proxy.v4.staticservice</basePackage>
</configuration>
- <id>pojosV4</id>
+ <id>v4pojoGen</id>
<phase>generate-sources</phase>
<goals>
- <goal>pojosV4</goal>
+ <goal>v4pojoGen</goal>
</goals>
</execution>
</executions>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 761127a..97615c8 100644
--- a/pom.xml
+++ b/pom.xml
@@ -351,6 +351,18 @@
<artifactId>jarjar-maven-plugin</artifactId>
<version>1.8</version>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>1.8</version>
+ </plugin>
</plugins>
</pluginManagement>
[10/31] git commit: [OLINGO-280] pojogen off-line generation
implemented
Posted by sk...@apache.org.
[OLINGO-280] pojogen off-line generation implemented
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/288bbb72
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/288bbb72
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/288bbb72
Branch: refs/heads/olingo-266-ref
Commit: 288bbb7242ffbe0ccc4e5c2e924c1569842ce7a6
Parents: ed8e0e3
Author: Francesco Chicchiriccò <--global>
Authored: Mon May 12 15:52:17 2014 +0200
Committer: Francesco Chicchiriccò <--global>
Committed: Mon May 12 15:52:17 2014 +0200
----------------------------------------------------------------------
ext/client-proxy/pom.xml | 2 +-
ext/pojogen-maven-plugin/pom.xml | 30 +-
.../src/it/v3Sample/pom.xml | 93 +++
.../it/v3Sample/src/test/resources/metadata.xml | 719 +++++++++++++++++++
.../src/it/v3Sample/verify.groovy | 20 +
.../src/it/v4Sample/pom.xml | 93 +++
.../it/v4Sample/src/test/resources/metadata.xml | 462 ++++++++++++
.../src/it/v4Sample/verify.groovy | 20 +
.../ext/pojogen/AbstractMetadataMojo.java | 160 -----
.../olingo/ext/pojogen/AbstractPOJOGenMojo.java | 340 +++++++++
.../olingo/ext/pojogen/AbstractUtility.java | 8 +-
.../olingo/ext/pojogen/V3MetadataMojo.java | 184 -----
.../olingo/ext/pojogen/V3POJOGenMojo.java | 54 ++
.../olingo/ext/pojogen/V4MetadataMojo.java | 194 -----
.../olingo/ext/pojogen/V4POJOGenMojo.java | 54 ++
.../src/main/resources/entityType.vm | 4 +-
fit/pom.xml | 10 +-
fit/src/it/staticServiceV3/pom.xml | 6 +-
fit/src/it/staticServiceV4/pom.xml | 6 +-
pom.xml | 12 +
20 files changed, 1911 insertions(+), 560 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/client-proxy/pom.xml
----------------------------------------------------------------------
diff --git a/ext/client-proxy/pom.xml b/ext/client-proxy/pom.xml
index 39e742b..827e7e9 100644
--- a/ext/client-proxy/pom.xml
+++ b/ext/client-proxy/pom.xml
@@ -23,7 +23,7 @@
<modelVersion>4.0.0</modelVersion>
- <artifactId>client-proxy</artifactId>
+ <artifactId>olingo-client-proxy</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>Java client API for OData services: Proxy.</description>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/pom.xml b/ext/pojogen-maven-plugin/pom.xml
index 3a77451..b84944f 100644
--- a/ext/pojogen-maven-plugin/pom.xml
+++ b/ext/pojogen-maven-plugin/pom.xml
@@ -43,7 +43,7 @@
<dependencies>
<dependency>
<groupId>org.apache.olingo</groupId>
- <artifactId>olingo-client-core</artifactId>
+ <artifactId>olingo-client-proxy</artifactId>
<version>${project.version}</version>
</dependency>
@@ -103,6 +103,34 @@
</execution>
</executions>
</plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <inherited>true</inherited>
+ <configuration>
+ <debug>true</debug>
+ <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
+ <pomIncludes>
+ <pomInclude>*/pom.xml</pomInclude>
+ </pomIncludes>
+ <postBuildHookScript>verify</postBuildHookScript>
+ <goals>
+ <goal>clean</goal>
+ <goal>test-compile</goal>
+ </goals>
+ </configuration>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>install</goal>
+ <goal>integration-test</goal>
+ <goal>verify</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
<resources>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/it/v3Sample/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/it/v3Sample/pom.xml b/ext/pojogen-maven-plugin/src/it/v3Sample/pom.xml
new file mode 100644
index 0000000..bd6b698
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/it/v3Sample/pom.xml
@@ -0,0 +1,93 @@
+<?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.
+
+-->
+<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>pojogen-maven-plugin-v3test</artifactId>
+ <groupId>org.apache.olingo</groupId>
+ <version>@project.version@</version>
+ <name>${project.artifactId}</name>
+ <description>A simple IT verifying the basic use case of pojogen-man-plugin.</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <artifactId>pojogen-maven-plugin</artifactId>
+ <groupId>org.apache.olingo</groupId>
+ <version>@project.version@</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <artifactId>olingo-client-proxy</artifactId>
+ <groupId>org.apache.olingo</groupId>
+ <version>@project.version@</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>pojogen-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <configuration>
+ <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+ <localEdm>${project.basedir}/src/test/resources/metadata.xml</localEdm>
+ <basePackage>org.apache.olingo.fit.proxy.v3.staticservice</basePackage>
+ </configuration>
+ <id>v3pojoGen</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>v3pojoGen</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/it/v3Sample/src/test/resources/metadata.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/it/v3Sample/src/test/resources/metadata.xml b/ext/pojogen-maven-plugin/src/it/v3Sample/src/test/resources/metadata.xml
new file mode 100644
index 0000000..3c9a5ad
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/it/v3Sample/src/test/resources/metadata.xml
@@ -0,0 +1,719 @@
+<?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.
+
+-->
+<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">
+ <edmx:DataServices m:DataServiceVersion="3.0" m:MaxDataServiceVersion="3.0" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
+ <Schema Namespace="Microsoft.Test.OData.Services.AstoriaDefaultService" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
+ <EntityType Name="AllSpatialTypes">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Geog" Type="Edm.Geography" SRID="Variable" />
+ <Property Name="GeogPoint" Type="Edm.GeographyPoint" SRID="Variable" />
+ <Property Name="GeogLine" Type="Edm.GeographyLineString" SRID="Variable" />
+ <Property Name="GeogPolygon" Type="Edm.GeographyPolygon" SRID="Variable" />
+ <Property Name="GeogCollection" Type="Edm.GeographyCollection" SRID="Variable" />
+ <Property Name="GeogMultiPoint" Type="Edm.GeographyMultiPoint" SRID="Variable" />
+ <Property Name="GeogMultiLine" Type="Edm.GeographyMultiLineString" SRID="Variable" />
+ <Property Name="GeogMultiPolygon" Type="Edm.GeographyMultiPolygon" SRID="Variable" />
+ <Property Name="Geom" Type="Edm.Geometry" SRID="Variable" />
+ <Property Name="GeomPoint" Type="Edm.GeometryPoint" SRID="Variable" />
+ <Property Name="GeomLine" Type="Edm.GeometryLineString" SRID="Variable" />
+ <Property Name="GeomPolygon" Type="Edm.GeometryPolygon" SRID="Variable" />
+ <Property Name="GeomCollection" Type="Edm.GeometryCollection" SRID="Variable" />
+ <Property Name="GeomMultiPoint" Type="Edm.GeometryMultiPoint" SRID="Variable" />
+ <Property Name="GeomMultiLine" Type="Edm.GeometryMultiLineString" SRID="Variable" />
+ <Property Name="GeomMultiPolygon" Type="Edm.GeometryMultiPolygon" SRID="Variable" />
+ </EntityType>
+ <EntityType Name="AllSpatialCollectionTypes" Abstract="true">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="Edm.Int32" Nullable="false" />
+ </EntityType>
+ <EntityType Name="Customer">
+ <Key>
+ <PropertyRef Name="CustomerId" />
+ </Key>
+ <Property Name="Thumbnail" Type="Edm.Stream" Nullable="false" />
+ <Property Name="Video" Type="Edm.Stream" Nullable="false" />
+ <Property Name="CustomerId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" m:FC_TargetPath="SyndicationSummary" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
+ <Property Name="PrimaryContactInfo" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails" />
+ <Property Name="BackupContactInfo" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails)" Nullable="false" />
+ <Property Name="Auditing" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo" />
+ <NavigationProperty Name="Orders" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Orders" ToRole="Orders" FromRole="Customer" />
+ <NavigationProperty Name="Logins" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Logins" ToRole="Logins" FromRole="Customer" />
+ <NavigationProperty Name="Husband" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Husband" ToRole="Husband" FromRole="Customer" />
+ <NavigationProperty Name="Wife" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Wife" ToRole="Wife" FromRole="Customer" />
+ <NavigationProperty Name="Info" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Info" ToRole="Info" FromRole="Customer" />
+ </EntityType>
+ <EntityType Name="Login">
+ <Key>
+ <PropertyRef Name="Username" />
+ </Key>
+ <Property Name="Username" Type="Edm.String" Nullable="false" />
+ <Property Name="CustomerId" Type="Edm.Int32" Nullable="false" />
+ <NavigationProperty Name="Customer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Customer" ToRole="Customer" FromRole="Login" />
+ <NavigationProperty Name="LastLogin" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_LastLogin" ToRole="LastLogin" FromRole="Login" />
+ <NavigationProperty Name="SentMessages" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_SentMessages" ToRole="SentMessages" FromRole="Login" />
+ <NavigationProperty Name="ReceivedMessages" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_ReceivedMessages" ToRole="ReceivedMessages" FromRole="Login" />
+ <NavigationProperty Name="Orders" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Orders" ToRole="Orders" FromRole="Login" />
+ </EntityType>
+ <EntityType Name="RSAToken">
+ <Key>
+ <PropertyRef Name="Serial" />
+ </Key>
+ <Property Name="Serial" Type="Edm.String" Nullable="false" />
+ <Property Name="Issued" Type="Edm.DateTime" Nullable="false" />
+ <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken_Login" ToRole="Login" FromRole="RSAToken" />
+ </EntityType>
+ <EntityType Name="PageView">
+ <Key>
+ <PropertyRef Name="PageViewId" />
+ </Key>
+ <Property Name="PageViewId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Username" Type="Edm.String" />
+ <Property Name="Viewed" Type="Edm.DateTimeOffset" Nullable="false" />
+ <Property Name="TimeSpentOnPage" Type="Edm.Time" Nullable="false" />
+ <Property Name="PageUrl" Type="Edm.String" />
+ <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView_Login" ToRole="Login" FromRole="PageView" />
+ </EntityType>
+ <EntityType Name="LastLogin">
+ <Key>
+ <PropertyRef Name="Username" />
+ </Key>
+ <Property Name="Username" Type="Edm.String" Nullable="false" />
+ <Property Name="LoggedIn" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="LoggedOut" Type="Edm.DateTime" />
+ <Property Name="Duration" Type="Edm.Time" Nullable="false" />
+ <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin_Login" ToRole="Login" FromRole="LastLogin" />
+ </EntityType>
+ <EntityType Name="Message">
+ <Key>
+ <PropertyRef Name="FromUsername" />
+ <PropertyRef Name="MessageId" />
+ </Key>
+ <Property Name="MessageId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="FromUsername" Type="Edm.String" Nullable="false" />
+ <Property Name="ToUsername" Type="Edm.String" />
+ <Property Name="Sent" Type="Edm.DateTimeOffset" Nullable="false" m:FC_TargetPath="SyndicationPublished" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
+ <Property Name="Subject" Type="Edm.String" m:FC_TargetPath="SyndicationTitle" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
+ <Property Name="Body" Type="Edm.String" />
+ <Property Name="IsRead" Type="Edm.Boolean" Nullable="false" />
+ <NavigationProperty Name="Sender" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Sender" ToRole="Sender" FromRole="Message" />
+ <NavigationProperty Name="Recipient" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Recipient" ToRole="Recipient" FromRole="Message" />
+ <NavigationProperty Name="Attachments" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Attachments" ToRole="Attachments" FromRole="Message" />
+ </EntityType>
+ <EntityType Name="MessageAttachment">
+ <Key>
+ <PropertyRef Name="AttachmentId" />
+ </Key>
+ <Property Name="AttachmentId" Type="Edm.Guid" Nullable="false" />
+ <Property Name="Attachment" Type="Edm.Binary" />
+ </EntityType>
+ <EntityType Name="Order">
+ <Key>
+ <PropertyRef Name="OrderId" />
+ </Key>
+ <Property Name="OrderId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="CustomerId" Type="Edm.Int32" />
+ <Property Name="Concurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
+ <NavigationProperty Name="Login" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Login" ToRole="Login" FromRole="Order" />
+ <NavigationProperty Name="Customer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Customer" ToRole="Customer" FromRole="Order" />
+ </EntityType>
+ <EntityType Name="OrderLine">
+ <Key>
+ <PropertyRef Name="OrderId" />
+ <PropertyRef Name="ProductId" />
+ </Key>
+ <Property Name="OrderLineStream" Type="Edm.Stream" Nullable="false" />
+ <Property Name="OrderId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Quantity" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
+ <NavigationProperty Name="Order" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Order" ToRole="Order" FromRole="OrderLine" />
+ <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Product" ToRole="Product" FromRole="OrderLine" />
+ </EntityType>
+ <EntityType Name="Product">
+ <Key>
+ <PropertyRef Name="ProductId" />
+ </Key>
+ <Property Name="Picture" Type="Edm.Stream" Nullable="false" />
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Description" Type="Edm.String" />
+ <Property Name="Dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
+ <Property Name="BaseConcurrency" Type="Edm.String" ConcurrencyMode="Fixed" />
+ <Property Name="ComplexConcurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
+ <Property Name="NestedComplexConcurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.AuditInfo" />
+ <NavigationProperty Name="RelatedProducts" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_RelatedProducts" ToRole="RelatedProducts" FromRole="Product" />
+ <NavigationProperty Name="Detail" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Detail" ToRole="Detail" FromRole="Product" />
+ <NavigationProperty Name="Reviews" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Reviews" ToRole="Reviews" FromRole="Product" />
+ <NavigationProperty Name="Photos" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Photos" ToRole="Photos" FromRole="Product" />
+ </EntityType>
+ <EntityType Name="ProductDetail">
+ <Key>
+ <PropertyRef Name="ProductId" />
+ </Key>
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Details" Type="Edm.String" />
+ <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail_Product" ToRole="Product" FromRole="ProductDetail" />
+ </EntityType>
+ <EntityType Name="ProductReview">
+ <Key>
+ <PropertyRef Name="ProductId" />
+ <PropertyRef Name="ReviewId" />
+ <PropertyRef Name="RevisionId" />
+ </Key>
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ReviewId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Review" Type="Edm.String" />
+ <Property Name="RevisionId" Type="Edm.String" Nullable="false" />
+ <NavigationProperty Name="Product" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview_Product" ToRole="Product" FromRole="ProductReview" />
+ </EntityType>
+ <EntityType Name="ProductPhoto">
+ <Key>
+ <PropertyRef Name="PhotoId" />
+ <PropertyRef Name="ProductId" />
+ </Key>
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="PhotoId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Photo" Type="Edm.Binary" />
+ </EntityType>
+ <EntityType Name="CustomerInfo" m:HasStream="true">
+ <Key>
+ <PropertyRef Name="CustomerInfoId" />
+ </Key>
+ <Property Name="CustomerInfoId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Information" Type="Edm.String" />
+ </EntityType>
+ <EntityType Name="Computer">
+ <Key>
+ <PropertyRef Name="ComputerId" />
+ </Key>
+ <Property Name="ComputerId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <NavigationProperty Name="ComputerDetail" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer_ComputerDetail" ToRole="ComputerDetail" FromRole="Computer" />
+ </EntityType>
+ <EntityType Name="ComputerDetail">
+ <Key>
+ <PropertyRef Name="ComputerDetailId" />
+ </Key>
+ <Property Name="ComputerDetailId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Manufacturer" Type="Edm.String" m:FC_TargetPath="SyndicationAuthorEmail" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
+ <Property Name="Model" Type="Edm.String" m:FC_TargetPath="SyndicationAuthorUri" m:FC_ContentKind="text" m:FC_KeepInContent="true" />
+ <Property Name="Serial" Type="Edm.String" />
+ <Property Name="SpecificationsBag" Type="Collection(Edm.String)" Nullable="false" />
+ <Property Name="PurchaseDate" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="Dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
+ <NavigationProperty Name="Computer" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail_Computer" ToRole="Computer" FromRole="ComputerDetail" />
+ </EntityType>
+ <EntityType Name="Driver">
+ <Key>
+ <PropertyRef Name="Name" />
+ </Key>
+ <Property Name="Name" Type="Edm.String" Nullable="false" />
+ <Property Name="BirthDate" Type="Edm.DateTime" Nullable="false" />
+ <NavigationProperty Name="License" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver_License" ToRole="License" FromRole="Driver" />
+ </EntityType>
+ <EntityType Name="License">
+ <Key>
+ <PropertyRef Name="Name" />
+ </Key>
+ <Property Name="Name" Type="Edm.String" Nullable="false" />
+ <Property Name="LicenseNumber" Type="Edm.String" />
+ <Property Name="LicenseClass" Type="Edm.String" m:FC_TargetPath="SyndicationContributorEmail" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
+ <Property Name="Restrictions" Type="Edm.String" m:FC_TargetPath="SyndicationContributorUri" m:FC_ContentKind="text" m:FC_KeepInContent="false" />
+ <Property Name="ExpirationDate" Type="Edm.DateTime" Nullable="false" />
+ <NavigationProperty Name="Driver" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.License_Driver" ToRole="Driver" FromRole="License" />
+ </EntityType>
+ <EntityType Name="MappedEntityType">
+ <Key>
+ <PropertyRef Name="Id" />
+ </Key>
+ <Property Name="Id" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Href" Type="Edm.String" />
+ <Property Name="Title" Type="Edm.String" />
+ <Property Name="HrefLang" Type="Edm.String" />
+ <Property Name="Type" Type="Edm.String" />
+ <Property Name="Length" Type="Edm.Int32" Nullable="false" />
+ <Property Name="BagOfPrimitiveToLinks" Type="Collection(Edm.String)" Nullable="false" />
+ <Property Name="Logo" Type="Edm.Binary" />
+ <Property Name="BagOfDecimals" Type="Collection(Edm.Decimal)" Nullable="false" />
+ <Property Name="BagOfDoubles" Type="Collection(Edm.Double)" Nullable="false" />
+ <Property Name="BagOfSingles" Type="Collection(Edm.Single)" Nullable="false" />
+ <Property Name="BagOfBytes" Type="Collection(Edm.Byte)" Nullable="false" />
+ <Property Name="BagOfInt16s" Type="Collection(Edm.Int16)" Nullable="false" />
+ <Property Name="BagOfInt32s" Type="Collection(Edm.Int32)" Nullable="false" />
+ <Property Name="BagOfInt64s" Type="Collection(Edm.Int64)" Nullable="false" />
+ <Property Name="BagOfGuids" Type="Collection(Edm.Guid)" Nullable="false" />
+ <Property Name="BagOfDateTime" Type="Collection(Edm.DateTime)" Nullable="false" />
+ <Property Name="BagOfComplexToCategories" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ComplexToCategory)" Nullable="false" />
+ <Property Name="ComplexPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" m:FC_TargetPath="SyndicationRights" m:FC_ContentKind="text" m:FC_SourcePath="PhoneNumber" m:FC_KeepInContent="true" />
+ <Property Name="ComplexContactDetails" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails" m:FC_TargetPath="SyndicationSummary" m:FC_ContentKind="text" m:FC_SourcePath="WorkPhone/Extension" m:FC_KeepInContent="true" />
+ </EntityType>
+ <EntityType Name="Car" m:HasStream="true">
+ <Key>
+ <PropertyRef Name="VIN" />
+ </Key>
+ <Property Name="Photo" Type="Edm.Stream" Nullable="false" />
+ <Property Name="Video" Type="Edm.Stream" Nullable="false" />
+ <Property Name="VIN" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Description" Type="Edm.String" />
+ </EntityType>
+ <EntityType Name="Person">
+ <Key>
+ <PropertyRef Name="PersonId" />
+ </Key>
+ <Property Name="PersonId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Name" Type="Edm.String" />
+ <NavigationProperty Name="PersonMetadata" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Person_PersonMetadata" ToRole="PersonMetadata" FromRole="Person" />
+ </EntityType>
+ <EntityType Name="PersonMetadata">
+ <Key>
+ <PropertyRef Name="PersonMetadataId" />
+ </Key>
+ <Property Name="PersonMetadataId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="PersonId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="PropertyName" Type="Edm.String" />
+ <Property Name="PropertyValue" Type="Edm.String" />
+ <NavigationProperty Name="Person" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata_Person" ToRole="Person" FromRole="PersonMetadata" />
+ </EntityType>
+ <ComplexType Name="ContactDetails">
+ <Property Name="EmailBag" Type="Collection(Edm.String)" Nullable="false" />
+ <Property Name="AlternativeNames" Type="Collection(Edm.String)" Nullable="false" />
+ <Property Name="ContactAlias" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Aliases" />
+ <Property Name="HomePhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
+ <Property Name="WorkPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
+ <Property Name="MobilePhoneBag" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Phone)" Nullable="false" />
+ </ComplexType>
+ <ComplexType Name="AuditInfo">
+ <Property Name="ModifiedDate" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="ModifiedBy" Type="Edm.String" />
+ <Property Name="Concurrency" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ConcurrencyInfo" />
+ </ComplexType>
+ <ComplexType Name="ConcurrencyInfo">
+ <Property Name="Token" Type="Edm.String" />
+ <Property Name="QueriedDateTime" Type="Edm.DateTime" />
+ </ComplexType>
+ <ComplexType Name="Dimensions">
+ <Property Name="Width" Type="Edm.Decimal" Nullable="false" />
+ <Property Name="Height" Type="Edm.Decimal" Nullable="false" />
+ <Property Name="Depth" Type="Edm.Decimal" Nullable="false" />
+ </ComplexType>
+ <ComplexType Name="ComplexToCategory">
+ <Property Name="Term" Type="Edm.String" />
+ <Property Name="Scheme" Type="Edm.String" />
+ <Property Name="Label" Type="Edm.String" />
+ </ComplexType>
+ <ComplexType Name="Phone">
+ <Property Name="PhoneNumber" Type="Edm.String" />
+ <Property Name="Extension" Type="Edm.String" />
+ </ComplexType>
+ <ComplexType Name="Aliases">
+ <Property Name="AlternativeNames" Type="Collection(Edm.String)" Nullable="false" />
+ </ComplexType>
+ <EntityType Name="AllSpatialCollectionTypes_Simple" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes">
+ <Property Name="ManyGeogPoint" Type="Collection(Edm.GeographyPoint)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeogLine" Type="Collection(Edm.GeographyLineString)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeogPolygon" Type="Collection(Edm.GeographyPolygon)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeomPoint" Type="Collection(Edm.GeometryPoint)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeomLine" Type="Collection(Edm.GeometryLineString)" Nullable="false" SRID="Variable" />
+ <Property Name="ManyGeomPolygon" Type="Collection(Edm.GeometryPolygon)" Nullable="false" SRID="Variable" />
+ </EntityType>
+ <EntityType Name="ProductPageView" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView">
+ <Property Name="ProductId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="ConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
+ </EntityType>
+ <EntityType Name="BackOrderLine" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" />
+ <EntityType Name="BackOrderLine2" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.BackOrderLine" />
+ <EntityType Name="DiscontinuedProduct" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Product">
+ <Property Name="Discontinued" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="ReplacementProductId" Type="Edm.Int32" />
+ <Property Name="DiscontinuedPhone" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Phone" />
+ <Property Name="ChildConcurrencyToken" Type="Edm.String" ConcurrencyMode="Fixed" />
+ </EntityType>
+ <EntityType Name="Contractor" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person">
+ <Property Name="ContratorCompanyId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="BillingRate" Type="Edm.Int32" Nullable="false" />
+ <Property Name="TeamContactPersonId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="JobDescription" Type="Edm.String" />
+ </EntityType>
+ <EntityType Name="Employee" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person">
+ <Property Name="ManagersPersonId" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Salary" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Title" Type="Edm.String" />
+ <NavigationProperty Name="Manager" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee_Manager" ToRole="Manager" FromRole="Employee" />
+ </EntityType>
+ <EntityType Name="SpecialEmployee" BaseType="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee">
+ <Property Name="CarsVIN" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Bonus" Type="Edm.Int32" Nullable="false" />
+ <Property Name="IsFullyVested" Type="Edm.Boolean" Nullable="false" />
+ <NavigationProperty Name="Car" Relationship="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee_Car" ToRole="Car" FromRole="SpecialEmployee" />
+ </EntityType>
+ <ComplexType Name="ComplexWithAllPrimitiveTypes">
+ <Property Name="Binary" Type="Edm.Binary" />
+ <Property Name="Boolean" Type="Edm.Boolean" Nullable="false" />
+ <Property Name="Byte" Type="Edm.Byte" Nullable="false" />
+ <Property Name="DateTime" Type="Edm.DateTime" Nullable="false" />
+ <Property Name="Decimal" Type="Edm.Decimal" Nullable="false" />
+ <Property Name="Double" Type="Edm.Double" Nullable="false" />
+ <Property Name="Int16" Type="Edm.Int16" Nullable="false" />
+ <Property Name="Int32" Type="Edm.Int32" Nullable="false" />
+ <Property Name="Int64" Type="Edm.Int64" Nullable="false" />
+ <Property Name="SByte" Type="Edm.SByte" Nullable="false" />
+ <Property Name="String" Type="Edm.String" />
+ <Property Name="Single" Type="Edm.Single" Nullable="false" />
+ <Property Name="GeographyPoint" Type="Edm.GeographyPoint" SRID="Variable" />
+ <Property Name="GeometryPoint" Type="Edm.GeometryPoint" SRID="Variable" />
+ </ComplexType>
+ <Association Name="Customer_Orders">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Orders" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Customer_Logins">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Logins" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Customer_Husband">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Husband" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Customer_Wife">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Wife" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Customer_Info">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo" Role="Info" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="*" />
+ </Association>
+ <Association Name="Login_Customer">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Login_LastLogin">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" Role="LastLogin" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Login_SentMessages">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="SentMessages" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ </Association>
+ <Association Name="Login_ReceivedMessages">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="ReceivedMessages" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ </Association>
+ <Association Name="Login_Orders">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Orders" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="*" />
+ </Association>
+ <Association Name="RSAToken_Login">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken" Role="RSAToken" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
+ </Association>
+ <Association Name="PageView_Login">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView" Role="PageView" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
+ </Association>
+ <Association Name="LastLogin_Login">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" Role="LastLogin" Multiplicity="*" />
+ </Association>
+ <Association Name="Message_Sender">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Sender" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Message_Recipient">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Recipient" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Message_Attachments">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.MessageAttachment" Role="Attachments" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" Role="Message" Multiplicity="*" />
+ </Association>
+ <Association Name="Order_Login">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" Role="Login" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Order_Customer">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" Role="Customer" Multiplicity="0..1" />
+ </Association>
+ <Association Name="OrderLine_Order">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" Role="OrderLine" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" Role="Order" Multiplicity="0..1" />
+ </Association>
+ <Association Name="OrderLine_Product">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" Role="OrderLine" Multiplicity="*" />
+ </Association>
+ <Association Name="Product_RelatedProducts">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="RelatedProducts" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
+ </Association>
+ <Association Name="Product_Detail">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" Role="Detail" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
+ </Association>
+ <Association Name="Product_Reviews">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" Role="Reviews" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
+ </Association>
+ <Association Name="Product_Photos">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPhoto" Role="Photos" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="*" />
+ </Association>
+ <Association Name="ProductDetail_Product">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" Role="ProductDetail" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
+ </Association>
+ <Association Name="ProductReview_Product">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" Role="ProductReview" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" Role="Product" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Computer_ComputerDetail">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" Role="ComputerDetail" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" Role="Computer" Multiplicity="*" />
+ </Association>
+ <Association Name="ComputerDetail_Computer">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" Role="ComputerDetail" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" Role="Computer" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Driver_License">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.License" Role="License" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" Role="Driver" Multiplicity="*" />
+ </Association>
+ <Association Name="License_Driver">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.License" Role="License" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" Role="Driver" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Person_PersonMetadata">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" Role="PersonMetadata" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" Role="Person" Multiplicity="*" />
+ </Association>
+ <Association Name="PersonMetadata_Person">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" Role="PersonMetadata" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" Role="Person" Multiplicity="0..1" />
+ </Association>
+ <Association Name="Employee_Manager">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" Role="Manager" Multiplicity="0..1" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" Role="Employee" Multiplicity="*" />
+ </Association>
+ <Association Name="SpecialEmployee_Car">
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee" Role="SpecialEmployee" Multiplicity="*" />
+ <End Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" Role="Car" Multiplicity="0..1" />
+ </Association>
+ <EntityContainer Name="DefaultContainer" m:IsDefaultEntityContainer="true">
+ <EntitySet Name="AllGeoTypesSet" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialTypes" />
+ <EntitySet Name="AllGeoCollectionTypesSet" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.AllSpatialCollectionTypes" />
+ <EntitySet Name="Customer" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer" />
+ <EntitySet Name="Login" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Login" />
+ <EntitySet Name="RSAToken" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken" />
+ <EntitySet Name="PageView" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView" />
+ <EntitySet Name="LastLogin" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin" />
+ <EntitySet Name="Message" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Message" />
+ <EntitySet Name="MessageAttachment" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.MessageAttachment" />
+ <EntitySet Name="Order" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Order" />
+ <EntitySet Name="OrderLine" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine" />
+ <EntitySet Name="Product" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" />
+ <EntitySet Name="ProductDetail" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail" />
+ <EntitySet Name="ProductReview" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview" />
+ <EntitySet Name="ProductPhoto" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductPhoto" />
+ <EntitySet Name="CustomerInfo" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.CustomerInfo" />
+ <EntitySet Name="Computer" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" />
+ <EntitySet Name="ComputerDetail" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" />
+ <EntitySet Name="Driver" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver" />
+ <EntitySet Name="License" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.License" />
+ <EntitySet Name="MappedEntityType" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.MappedEntityType" />
+ <EntitySet Name="Car" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Car" />
+ <EntitySet Name="Person" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.Person" />
+ <EntitySet Name="PersonMetadata" EntityType="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata" />
+ <FunctionImport Name="GetPrimitiveString" ReturnType="Edm.String" m:HttpMethod="GET" />
+ <FunctionImport Name="GetSpecificCustomer" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Customer)" EntitySet="Customer" m:HttpMethod="GET">
+ <Parameter Name="Name" Type="Edm.String" />
+ </FunctionImport>
+ <FunctionImport Name="GetCustomerCount" ReturnType="Edm.Int32" m:HttpMethod="GET" />
+ <FunctionImport Name="GetArgumentPlusOne" ReturnType="Edm.Int32" m:HttpMethod="GET">
+ <Parameter Name="arg1" Type="Edm.Int32" Nullable="false" />
+ </FunctionImport>
+ <FunctionImport Name="EntityProjectionReturnsCollectionOfComplexTypes" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.ContactDetails)" m:HttpMethod="GET" />
+ <FunctionImport Name="ResetDataSource" m:HttpMethod="POST" />
+ <FunctionImport Name="InStreamErrorGetCustomer" ReturnType="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Customer)" EntitySet="Customer" m:HttpMethod="GET" />
+ <FunctionImport Name="IncreaseSalaries" IsBindable="true" m:IsAlwaysBindable="true">
+ <Parameter Name="employees" Type="Collection(Microsoft.Test.OData.Services.AstoriaDefaultService.Employee)" />
+ <Parameter Name="n" Type="Edm.Int32" Nullable="false" />
+ </FunctionImport>
+ <FunctionImport Name="Sack" IsBindable="true" m:IsAlwaysBindable="true">
+ <Parameter Name="employee" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee" />
+ </FunctionImport>
+ <FunctionImport Name="GetComputer" ReturnType="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" IsBindable="true" EntitySet="Computer" m:IsAlwaysBindable="true">
+ <Parameter Name="computer" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer" />
+ </FunctionImport>
+ <FunctionImport Name="ChangeProductDimensions" IsBindable="true" m:IsAlwaysBindable="true">
+ <Parameter Name="product" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Product" />
+ <Parameter Name="dimensions" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.Dimensions" />
+ </FunctionImport>
+ <FunctionImport Name="ResetComputerDetailsSpecifications" IsBindable="true" m:IsAlwaysBindable="true">
+ <Parameter Name="computerDetail" Type="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail" />
+ <Parameter Name="specifications" Type="Collection(Edm.String)" Nullable="false" />
+ <Parameter Name="purchaseTime" Type="Edm.DateTime" Nullable="false" />
+ </FunctionImport>
+ <AssociationSet Name="Customer_Orders" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Orders">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Orders" EntitySet="Order" />
+ </AssociationSet>
+ <AssociationSet Name="Customer_Logins" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Logins">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Logins" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Customer_Husband" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Husband">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Husband" EntitySet="Customer" />
+ </AssociationSet>
+ <AssociationSet Name="Customer_Wife" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Wife">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Wife" EntitySet="Customer" />
+ </AssociationSet>
+ <AssociationSet Name="Customer_Info" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Customer_Info">
+ <End Role="Customer" EntitySet="Customer" />
+ <End Role="Info" EntitySet="CustomerInfo" />
+ </AssociationSet>
+ <AssociationSet Name="Login_Customer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Customer">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="Customer" EntitySet="Customer" />
+ </AssociationSet>
+ <AssociationSet Name="Login_LastLogin" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_LastLogin">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="LastLogin" EntitySet="LastLogin" />
+ </AssociationSet>
+ <AssociationSet Name="Login_SentMessages" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_SentMessages">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="SentMessages" EntitySet="Message" />
+ </AssociationSet>
+ <AssociationSet Name="Login_ReceivedMessages" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_ReceivedMessages">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="ReceivedMessages" EntitySet="Message" />
+ </AssociationSet>
+ <AssociationSet Name="Login_Orders" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Login_Orders">
+ <End Role="Login" EntitySet="Login" />
+ <End Role="Orders" EntitySet="Order" />
+ </AssociationSet>
+ <AssociationSet Name="RSAToken_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.RSAToken_Login">
+ <End Role="RSAToken" EntitySet="RSAToken" />
+ <End Role="Login" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="PageView_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.PageView_Login">
+ <End Role="PageView" EntitySet="PageView" />
+ <End Role="Login" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="LastLogin_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.LastLogin_Login">
+ <End Role="LastLogin" EntitySet="LastLogin" />
+ <End Role="Login" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Message_Sender" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Sender">
+ <End Role="Message" EntitySet="Message" />
+ <End Role="Sender" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Message_Recipient" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Recipient">
+ <End Role="Message" EntitySet="Message" />
+ <End Role="Recipient" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Message_Attachments" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Message_Attachments">
+ <End Role="Message" EntitySet="Message" />
+ <End Role="Attachments" EntitySet="MessageAttachment" />
+ </AssociationSet>
+ <AssociationSet Name="Order_Login" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Login">
+ <End Role="Order" EntitySet="Order" />
+ <End Role="Login" EntitySet="Login" />
+ </AssociationSet>
+ <AssociationSet Name="Order_Customer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Order_Customer">
+ <End Role="Order" EntitySet="Order" />
+ <End Role="Customer" EntitySet="Customer" />
+ </AssociationSet>
+ <AssociationSet Name="OrderLine_Order" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Order">
+ <End Role="OrderLine" EntitySet="OrderLine" />
+ <End Role="Order" EntitySet="Order" />
+ </AssociationSet>
+ <AssociationSet Name="OrderLine_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.OrderLine_Product">
+ <End Role="OrderLine" EntitySet="OrderLine" />
+ <End Role="Product" EntitySet="Product" />
+ </AssociationSet>
+ <AssociationSet Name="Product_RelatedProducts" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_RelatedProducts">
+ <End Role="Product" EntitySet="Product" />
+ <End Role="RelatedProducts" EntitySet="Product" />
+ </AssociationSet>
+ <AssociationSet Name="Product_Detail" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Detail">
+ <End Role="Product" EntitySet="Product" />
+ <End Role="Detail" EntitySet="ProductDetail" />
+ </AssociationSet>
+ <AssociationSet Name="Product_Reviews" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Reviews">
+ <End Role="Product" EntitySet="Product" />
+ <End Role="Reviews" EntitySet="ProductReview" />
+ </AssociationSet>
+ <AssociationSet Name="Product_Photos" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Product_Photos">
+ <End Role="Product" EntitySet="Product" />
+ <End Role="Photos" EntitySet="ProductPhoto" />
+ </AssociationSet>
+ <AssociationSet Name="ProductDetail_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductDetail_Product">
+ <End Role="ProductDetail" EntitySet="ProductDetail" />
+ <End Role="Product" EntitySet="Product" />
+ </AssociationSet>
+ <AssociationSet Name="ProductReview_Product" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ProductReview_Product">
+ <End Role="ProductReview" EntitySet="ProductReview" />
+ <End Role="Product" EntitySet="Product" />
+ </AssociationSet>
+ <AssociationSet Name="Computer_ComputerDetail" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Computer_ComputerDetail">
+ <End Role="Computer" EntitySet="Computer" />
+ <End Role="ComputerDetail" EntitySet="ComputerDetail" />
+ </AssociationSet>
+ <AssociationSet Name="ComputerDetail_Computer" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.ComputerDetail_Computer">
+ <End Role="ComputerDetail" EntitySet="ComputerDetail" />
+ <End Role="Computer" EntitySet="Computer" />
+ </AssociationSet>
+ <AssociationSet Name="Driver_License" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Driver_License">
+ <End Role="Driver" EntitySet="Driver" />
+ <End Role="License" EntitySet="License" />
+ </AssociationSet>
+ <AssociationSet Name="License_Driver" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.License_Driver">
+ <End Role="License" EntitySet="License" />
+ <End Role="Driver" EntitySet="Driver" />
+ </AssociationSet>
+ <AssociationSet Name="Employee_Manager" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Employee_Manager">
+ <End Role="Employee" EntitySet="Person" />
+ <End Role="Manager" EntitySet="Person" />
+ </AssociationSet>
+ <AssociationSet Name="SpecialEmployee_Car" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.SpecialEmployee_Car">
+ <End Role="SpecialEmployee" EntitySet="Person" />
+ <End Role="Car" EntitySet="Car" />
+ </AssociationSet>
+ <AssociationSet Name="Person_PersonMetadata" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.Person_PersonMetadata">
+ <End Role="Person" EntitySet="Person" />
+ <End Role="PersonMetadata" EntitySet="PersonMetadata" />
+ </AssociationSet>
+ <AssociationSet Name="PersonMetadata_Person" Association="Microsoft.Test.OData.Services.AstoriaDefaultService.PersonMetadata_Person">
+ <End Role="PersonMetadata" EntitySet="PersonMetadata" />
+ <End Role="Person" EntitySet="Person" />
+ </AssociationSet>
+ </EntityContainer>
+ </Schema>
+ </edmx:DataServices>
+</edmx:Edmx>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/it/v3Sample/verify.groovy
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/it/v3Sample/verify.groovy b/ext/pojogen-maven-plugin/src/it/v3Sample/verify.groovy
new file mode 100644
index 0000000..9b74ad2
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/it/v3Sample/verify.groovy
@@ -0,0 +1,20 @@
+/**
+ * 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.
+ */
+File basepkg = new File( basedir, "target/generated-sources/ojc-plugin/org/apache/olingo/fit/proxy/v3" );
+assert basepkg.isDirectory() && basepkg.listFiles().length>0;
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/288bbb72/ext/pojogen-maven-plugin/src/it/v4Sample/pom.xml
----------------------------------------------------------------------
diff --git a/ext/pojogen-maven-plugin/src/it/v4Sample/pom.xml b/ext/pojogen-maven-plugin/src/it/v4Sample/pom.xml
new file mode 100644
index 0000000..b918061
--- /dev/null
+++ b/ext/pojogen-maven-plugin/src/it/v4Sample/pom.xml
@@ -0,0 +1,93 @@
+<?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.
+
+-->
+<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>pojogen-maven-plugin-v4test</artifactId>
+ <groupId>org.apache.olingo</groupId>
+ <version>@project.version@</version>
+ <name>${project.artifactId}</name>
+ <description>A simple IT verifying the basic use case of pojogen-man-plugin.</description>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <artifactId>pojogen-maven-plugin</artifactId>
+ <groupId>org.apache.olingo</groupId>
+ <version>@project.version@</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <artifactId>olingo-client-proxy</artifactId>
+ <groupId>org.apache.olingo</groupId>
+ <version>@project.version@</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <phase>process-sources</phase>
+ <goals>
+ <goal>add-source</goal>
+ </goals>
+ <configuration>
+ <sources>
+ <source>${project.build.directory}/generated-sources</source>
+ </sources>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>@project.groupId@</groupId>
+ <artifactId>pojogen-maven-plugin</artifactId>
+ <version>@project.version@</version>
+ <executions>
+ <execution>
+ <configuration>
+ <outputDirectory>${project.build.directory}/generated-sources</outputDirectory>
+ <localEdm>${project.basedir}/src/test/resources/metadata.xml</localEdm>
+ <basePackage>org.apache.olingo.fit.proxy.v4.staticservice</basePackage>
+ </configuration>
+ <id>v4pojoGen</id>
+ <phase>generate-sources</phase>
+ <goals>
+ <goal>v4pojoGen</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
[11/31] git commit: Merge branch 'master' of
https://git-wip-us.apache.org/repos/asf/olingo-odata4
Posted by sk...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/olingo-odata4
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/feae9d02
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/feae9d02
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/feae9d02
Branch: refs/heads/olingo-266-ref
Commit: feae9d022b7680a4158a2a36572a26b844941288
Parents: 288bbb7 330c556
Author: Francesco Chicchiriccò <--global>
Authored: Mon May 12 15:52:32 2014 +0200
Committer: Francesco Chicchiriccò <--global>
Committed: Mon May 12 15:52:32 2014 +0200
----------------------------------------------------------------------
fit/pom.xml | 53 +-
.../org/apache/olingo/fit/ref/PingITCase.java | 44 +
lib/pom.xml | 10 +-
lib/ref/pom.xml | 50 -
lib/server-api/pom.xml | 44 +-
.../apache/olingo/server/api/ODataHandler.java | 28 +
.../apache/olingo/server/api/ODataServer.java | 4 +
lib/server-core/pom.xml | 45 +-
.../olingo/server/core/ODataHandlerImpl.java | 81 +
.../olingo/server/core/ODataServerImpl.java | 9 +
.../server/core/servlet/ODataServlet.java | 86 -
.../serializer/json/ServiceDocumentTest.java | 133 -
.../serializer/xml/MetadataDocumentTest.java | 252 -
.../server/core/testutil/EdmTechProvider.java | 1976 -------
.../core/testutil/EdmTechTestProvider.java | 100 -
.../server/core/testutil/StringUtils.java | 52 -
.../testutil/techprovider/ActionProvider.java | 191 -
.../techprovider/ComplexTypeProvider.java | 175 -
.../techprovider/ContainerProvider.java | 361 --
.../testutil/techprovider/EdmTechProvider.java | 147 -
.../techprovider/EntityTypeProvider.java | 408 --
.../testutil/techprovider/EnumTypeProvider.java | 47 -
.../testutil/techprovider/FunctionProvider.java | 852 ---
.../testutil/techprovider/PropertyProvider.java | 590 --
.../testutil/techprovider/SchemaProvider.java | 250 -
.../techprovider/TypeDefinitionProvider.java | 30 -
.../olingo/server/core/uri/RawUriTest.java | 151 -
.../olingo/server/core/uri/UriInfoImplTest.java | 201 -
.../server/core/uri/UriResourceImplTest.java | 508 --
.../core/uri/antlr/TestFullResourcePath.java | 5110 ------------------
.../olingo/server/core/uri/antlr/TestLexer.java | 248 -
.../core/uri/antlr/TestUriParserImpl.java | 1144 ----
.../core/uri/queryoption/QueryOptionTest.java | 303 --
.../queryoption/expression/ExpressionTest.java | 239 -
.../core/uri/testutil/ExpandValidator.java | 230 -
.../core/uri/testutil/FilterTreeToText.java | 154 -
.../core/uri/testutil/FilterValidator.java | 534 --
.../core/uri/testutil/ParseTreeToText.java | 82 -
.../core/uri/testutil/ParserValidator.java | 162 -
.../core/uri/testutil/ParserWithLogging.java | 56 -
.../core/uri/testutil/ResourceValidator.java | 599 --
.../core/uri/testutil/TestErrorLogger.java | 105 -
.../core/uri/testutil/TestUriValidator.java | 258 -
.../server/core/uri/testutil/TestValidator.java | 23 -
.../core/uri/testutil/TokenValidator.java | 194 -
.../core/uri/testutil/UriLexerWithTrace.java | 85 -
.../core/uri/validator/UriValidatorTest.java | 378 --
.../src/test/resources/simplelogger.properties | 20 +
lib/server-ref/pom.xml | 83 +
.../olingo/server/ref/ReferenceServlet.java | 51 +
.../server/ref/provider/ActionProvider.java | 191 +
.../ref/provider/ComplexTypeProvider.java | 175 +
.../server/ref/provider/ContainerProvider.java | 361 ++
.../server/ref/provider/EdmTechProvider.java | 147 +
.../server/ref/provider/EntityTypeProvider.java | 408 ++
.../server/ref/provider/EnumTypeProvider.java | 47 +
.../server/ref/provider/FunctionProvider.java | 852 +++
.../server/ref/provider/PropertyProvider.java | 590 ++
.../server/ref/provider/SchemaProvider.java | 250 +
.../ref/provider/TypeDefinitionProvider.java | 30 +
.../src/main/resources/simplelogger.properties | 20 +
lib/server-ref/src/main/webapp/WEB-INF/web.xml | 42 +
lib/server-ref/src/main/webapp/index.html | 32 +
.../serializer/json/ServiceDocumentTest.java | 133 +
.../serializer/xml/MetadataDocumentTest.java | 254 +
.../olingo/server/core/uri/RawUriTest.java | 151 +
.../olingo/server/core/uri/UriInfoImplTest.java | 201 +
.../server/core/uri/UriResourceImplTest.java | 508 ++
.../core/uri/antlr/TestFullResourcePath.java | 5110 ++++++++++++++++++
.../olingo/server/core/uri/antlr/TestLexer.java | 248 +
.../core/uri/antlr/TestUriParserImpl.java | 1144 ++++
.../core/uri/queryoption/QueryOptionTest.java | 303 ++
.../queryoption/expression/ExpressionTest.java | 239 +
.../core/uri/testutil/EdmTechTestProvider.java | 100 +
.../core/uri/testutil/ExpandValidator.java | 230 +
.../core/uri/testutil/FilterTreeToText.java | 154 +
.../core/uri/testutil/FilterValidator.java | 534 ++
.../core/uri/testutil/ParseTreeToText.java | 82 +
.../core/uri/testutil/ParserValidator.java | 162 +
.../core/uri/testutil/ParserWithLogging.java | 56 +
.../core/uri/testutil/ResourceValidator.java | 599 ++
.../core/uri/testutil/TestErrorLogger.java | 105 +
.../core/uri/testutil/TestUriValidator.java | 258 +
.../server/core/uri/testutil/TestValidator.java | 23 +
.../core/uri/testutil/TokenValidator.java | 194 +
.../core/uri/testutil/UriLexerWithTrace.java | 85 +
.../core/uri/validator/UriValidatorTest.java | 378 ++
pom.xml | 2 +-
88 files changed, 14806 insertions(+), 16528 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/feae9d02/fit/pom.xml
----------------------------------------------------------------------
diff --cc fit/pom.xml
index 20081de,9947dd1..d03d970
--- a/fit/pom.xml
+++ b/fit/pom.xml
@@@ -40,10 -45,10 +40,10 @@@
<artifactId>olingo-commons-core</artifactId>
<version>${project.version}</version>
</dependency>
-
+
<dependency>
<groupId>org.apache.olingo</groupId>
- <artifactId>client-proxy</artifactId>
+ <artifactId>olingo-client-proxy</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/feae9d02/pom.xml
----------------------------------------------------------------------
[21/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
new file mode 100644
index 0000000..00772a5
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
@@ -0,0 +1,5110 @@
+/*
+ * 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.server.core.uri.antlr;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+
+import org.apache.olingo.commons.api.ODataApplicationException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.core.Encoder;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriResourceKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
+import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
+import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.core.uri.parser.UriParserException;
+import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
+import org.apache.olingo.server.core.uri.testutil.FilterValidator;
+import org.apache.olingo.server.core.uri.testutil.ResourceValidator;
+import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
+import org.apache.olingo.server.tecsvc.provider.ComplexTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.EnumTypeProvider;
+import org.apache.olingo.server.tecsvc.provider.PropertyProvider;
+import org.junit.Test;
+
+public class TestFullResourcePath {
+ Edm edm = null;
+ TestUriValidator testUri = null;
+ ResourceValidator testRes = null;
+ FilterValidator testFilter = null;
+
+ public TestFullResourcePath() {
+ edm = new EdmProviderImpl(new EdmTechTestProvider());
+ testUri = new TestUriValidator().setEdm(edm);
+ testRes = new ResourceValidator().setEdm(edm);
+ testFilter = new FilterValidator().setEdm(edm);
+ }
+
+ @Test
+ public void test() throws UriParserException {
+
+ }
+
+ @Test
+ public void testFunctionBound_varOverloading() {
+ // on ESTwoKeyNav
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ // with string parameter
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')").goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ // with string parameter
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+ }
+
+ @Test
+ public void runBfuncBnCpropCastRtEs() {
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESBaseTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, false)
+ .n()
+ .isFunction("BFCCTPrimCompRTESBaseTwoKeyNav");
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESBaseTwoKeyNav()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, false)
+ .n()
+ .isFunction("BFCCTPrimCompRTESBaseTwoKeyNav")
+ .isType(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isUriPathInfoKind(UriResourceKind.count);
+
+ }
+
+ @Test
+ public void runBfuncBnCpropCollRtEs() {
+ testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComplex/com.sap.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isUriPathInfoKind(UriResourceKind.complexProperty)
+ .isComplex("CollPropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .n()
+ .isFunction("BFCCollCTPrimCompRTESAllPrim");
+
+ testUri
+ .run("ESKeyNav(PropertyInt16=1)/CollPropertyComplex/com.sap.odata.test1.BFCCollCTPrimCompRTESAllPrim()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isUriPathInfoKind(UriResourceKind.complexProperty)
+ .isComplex("CollPropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .n()
+ .isFunction("BFCCollCTPrimCompRTESAllPrim")
+ .isType(EntityTypeProvider.nameETAllPrim, true)
+ .n()
+ .isUriPathInfoKind(UriResourceKind.count);
+ }
+
+ @Test
+ public void runBfuncBnCpropRtEs() {
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')"
+ + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isUriPathInfoKind(UriResourceKind.complexProperty)
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, false)
+ .n()
+ .isFunction("BFCCTPrimCompRTESTwoKeyNav");
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')"
+ + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESTwoKeyNav()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isUriPathInfoKind(UriResourceKind.complexProperty)
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, false)
+ .n()
+ .isFunction("BFCCTPrimCompRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .n()
+ .isUriPathInfoKind(UriResourceKind.count);
+
+ }
+
+ @Test
+ public void runBfuncBnEntityRtEs() {
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isFunction("BFCETTwoKeyNavRTESTwoKeyNav");
+ }
+
+ @Test
+ public void runBfuncBnEntityCastRtEs() {
+ testUri
+ .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/com.sap.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
+
+ testUri
+ .run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='(''2'')')"
+ + "/com.sap.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'(''2'')'")
+ .n()
+ .isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
+ }
+
+ @Test
+ public void runBfuncBnEsCastRtEs() {
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/com.sap.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey");
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/com.sap.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()"
+ + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey")
+ .isType(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+ testUri.run("ESTwoKeyNav"
+ + "/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()"
+ + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')"
+ + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+ }
+
+ @Test
+ public void runBfuncBnEsRtCprop() {
+ testUri.run("ESAllPrim/com.sap.odata.test1.BFCESAllPrimRTCTAllPrim()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .n()
+ .isFunction("BFCESAllPrimRTCTAllPrim")
+ .isType(ComplexTypeProvider.nameCTAllPrim);
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()/com.sap.odata.test1.CTBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCTTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, false)
+ .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase);
+ }
+
+ @Test
+ public void runBfuncBnEsRtCpropColl() {
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true)
+ .n()
+ .isUriPathInfoKind(UriResourceKind.count);
+ }
+
+ @Test
+ public void runBfuncBnEsRtEntityPpNp() {
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .n()
+ .isUriPathInfoKind(UriResourceKind.ref);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/NavPropertyETMediaOne/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
+ .n()
+ .isValue();
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+ + "/NavPropertyETTwoKeyNavOne")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNavParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+ + "/NavPropertyETTwoKeyNavOne/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNavParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+ + "/NavPropertyETTwoKeyNavOne/PropertyComplex/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNavParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp)
+ .n()
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTAllPrim);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+ + "/NavPropertyETTwoKeyNavOne/PropertyString")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNavParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+ + "/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/PropertyString")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNavParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+ }
+
+ @Test
+ public void runBfuncBnEsRtEntyPpNpCast() {
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()"
+ + "/NavPropertyETTwoKeyNavOne/com.sap.odata.test1.ETBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+ testUri
+ .run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')"
+ + "/NavPropertyETTwoKeyNavOne/com.sap.odata.test1.ETTwoBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+ }
+
+ @Test
+ public void runBfuncBnEsRtEntityPpCp() {
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTNavFiveProp);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComplex/PropertyInt16")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTNavFiveProp)
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComplex/PropertyInt16/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isComplex("PropertyComplex")
+ .isType(ComplexTypeProvider.nameCTNavFiveProp)
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+ .n()
+ .isValue();
+
+ }
+
+ @Test
+ public void runBfuncBnEsRtEntyPpCpCast() {
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+ + "/PropertyComplexTwoPrim/com.sap.odata.test1.CTTwoBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNavParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .n()
+ .isComplex("PropertyComplexTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim)
+ .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
+ + "/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+ + "/PropertyComplexTwoPrim/com.sap.odata.test1.CTTwoBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNavParam")
+ .isParameter(0, "ParameterString", "'1'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isComplex("PropertyComplexTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim)
+ .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
+ }
+
+ @Test
+ public void runBfuncBnEsRtEntityPpSp() {
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESKeyNavRTETKeyNav")
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
+ .n()
+ .isValue();
+
+ }
+
+ @Test
+ public void runBfuncBnEsRtEs() {
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='2')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isParameter(0, "ParameterString", "'2'")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ testUri.run("ESKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='3')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isParameter(0, "ParameterString", "'3'")
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .n()
+ .isCount();
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'");
+
+ }
+
+ @Test
+ public void runBfuncBnEsRtEsBa() {
+
+ testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComplex"
+ + "/com.sap.odata.test1.BFCCollCTPrimCompRTESAllPrim()/com.sap.odata.test1.BAESAllPrimRTETAllPrim")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isComplex("CollPropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp)
+ .n()
+ .isFunction("BFCCollCTPrimCompRTESAllPrim")
+ .n()
+ .isAction("BAESAllPrimRTETAllPrim");
+
+ }
+
+ @Test
+ public void runBfuncBnEsRtPrim() {
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTString()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTString");
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTString()/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTString")
+ .isType(PropertyProvider.nameString)
+ .n()
+ .isValue();
+ }
+
+ @Test
+ public void runbfuncBnEsRtPrimColl() {
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollString()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCollString")
+ .isType(PropertyProvider.nameString, true);
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollString()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isFunction("BFCESTwoKeyNavRTCollString")
+ .isType(PropertyProvider.nameString, true)
+ .n()
+ .isCount();
+ }
+
+ @Test
+ public void runBfuncBnPpropCollRtEs() {
+ testUri.run("ESKeyNav(1)/CollPropertyString/com.sap.odata.test1.BFCCollStringRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+ .n()
+ .isFunction("BFCCollStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+
+ testUri.run("ESKeyNav(1)/CollPropertyString/com.sap.odata.test1.BFCCollStringRTESTwoKeyNav()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+ .n()
+ .isFunction("BFCCollStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .n()
+ .isCount();
+ }
+
+ @Test
+ public void runBfuncBnPpropRtEs() {
+
+ testUri.run("ESKeyNav(1)/PropertyString/com.sap.odata.test1.BFCStringRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+ .n()
+ .isFunction("BFCStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true);
+
+ testUri.run("ESKeyNav(1)/PropertyString/com.sap.odata.test1.BFCStringRTESTwoKeyNav()/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+ .n()
+ .isFunction("BFCStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .n()
+ .isCount();
+
+ testUri.run("ESKeyNav(1)/PropertyString/com.sap.odata.test1.BFCStringRTESTwoKeyNav()/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
+ .n()
+ .isFunction("BFCStringRTESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .n()
+ .isRef();
+ }
+
+ @Test
+ public void runBfuncBnSingleRtEs() {
+
+ testUri.run("SINav/com.sap.odata.test1.BFCSINavRTESTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isFunction("BFCSINavRTESTwoKeyNav");
+ }
+
+ @Test
+ public void runBfuncBnSingleCastRtEs() {
+ testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/com.sap.odata.test1.BFCETBaseTwoKeyNavRTESBaseTwoKey()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isFunction("BFCETBaseTwoKeyNavRTESBaseTwoKey");
+ }
+
+ @Test
+ public void runActionBound_on_EntityEntry() {
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isAction("BAETTwoKeyNavRTETTwoKeyNav");
+
+ testUri.run("ESKeyNav(PropertyInt16=1)/com.sap.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isAction("BAETTwoKeyNavRTETTwoKeyNav");
+ }
+
+ @Test
+ public void runActionBound_on_EntityCollection() {
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BAESTwoKeyNavRTESTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .n()
+ .isAction("BAESTwoKeyNavRTESTwoKeyNav");
+ }
+
+ @Test
+ public void runFunctionBound_on_var_Types() {
+
+ // on primitive
+ testUri.run("ESAllPrim(1)/PropertyString/com.sap.odata.test1.BFCStringRTESTwoKeyNav()")
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETAllPrim, false)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.primitiveProperty)
+ .isType(PropertyProvider.nameString);
+
+ // on collection of primitive
+ testUri.run("ESCollAllPrim(1)/CollPropertyString/com.sap.odata.test1.BFCCollStringRTESTwoKeyNav()")
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETCollAllPrim, false)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.primitiveProperty)
+ .isType(PropertyProvider.nameString);
+
+ // on complex
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
+ + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.complexProperty)
+ .at(2)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ // on collection of complex
+ testUri.run("ESKeyNav(1)/CollPropertyComplex/com.sap.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .at(1)
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .at(2)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETAllPrim);
+
+ // on entity
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
+ + "/com.sap.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .at(1)
+ .isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+
+ // on collection of entity
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
+ .goPath()
+ .at(0)
+ .isUriPathInfoKind(UriResourceKind.entitySet)
+ .isType(EntityTypeProvider.nameETTwoKeyNav, true)
+ .at(1).isUriPathInfoKind(UriResourceKind.function)
+ .isType(EntityTypeProvider.nameETTwoKeyNav);
+ }
+
+ @Test
+ public void runActionBound_on_EntityCast() {
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/com.sap.odata.test1.BAETBaseTwoKeyNavRTETBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isAction("BAETBaseTwoKeyNavRTETBaseTwoKeyNav");
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')"
+ + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav/com.sap.odata.test1.BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
+ .n()
+ .isAction("BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav");
+ }
+
+ @Test
+ public void runCrossjoin() {
+ testUri.run("$crossjoin(ESKeyNav)")
+ .isKind(UriInfoKind.crossjoin)
+ .isCrossJoinEntityList(Arrays.asList("ESKeyNav"));
+
+ testUri.run("$crossjoin(ESKeyNav, ESTwoKeyNav)")
+ .isKind(UriInfoKind.crossjoin)
+ .isCrossJoinEntityList(Arrays.asList("ESKeyNav", "ESTwoKeyNav"));
+ }
+
+ @Test
+ public void runCrossjoinError() {
+ testUri.runEx("$crossjoin").isExSyntax(0);
+ testUri.runEx("$crossjoin/error").isExSyntax(0);
+ testUri.runEx("$crossjoin()").isExSyntax(0);
+ // testUri.runEx("$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid").isExSyntax(0);
+ }
+
+ @Test
+ public void runEntityId() {
+ testUri.run("$entity?$id=ESKeyNav(1)")
+ .isKind(UriInfoKind.entityId)
+ .isIdText("ESKeyNav(1)");
+ testUri.run("$entity/com.sap.odata.test1.ETKeyNav?$id=ESKeyNav(1)")
+ .isKind(UriInfoKind.entityId)
+ .isEntityType(EntityTypeProvider.nameETKeyNav)
+ .isIdText("ESKeyNav(1)");
+ }
+
+ @Test
+ public void runEntityIdError() {
+ // TODO planned: move to validator
+ // testUri.runEx("$entity").isExSyntax(0);
+ // testUri.runEx("$entity?$idfalse=ESKeyNav(1)").isExSyntax(0);
+ // testUri.runEx("$entity/com.sap.odata.test1.invalidType?$id=ESKeyNav(1)").isExSemantic(0);
+ // testUri.runEx("$entity/invalid?$id=ESKeyNav(1)").isExSyntax(0);
+ }
+
+ @Test
+ public void runEsName() {
+ testUri.run("ESAllPrim")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isType(EntityTypeProvider.nameETAllPrim, true);
+
+ testUri.run("ESAllPrim/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isType(EntityTypeProvider.nameETAllPrim, true)
+ .n()
+ .isCount();
+ }
+
+ @Test
+ public void runEsNameError() {
+
+ testUri.runEx("ESAllPrim/$count/$ref").isExSemantic(0);
+ testUri.runEx("ESAllPrim/$ref/$count").isExSemantic(0);
+ testUri.runEx("ESAllPrim/$ref/invalid").isExSemantic(0);
+ testUri.runEx("ESAllPrim/$count/invalid").isExSemantic(0);
+ testUri.runEx("ESAllPrim(1)/whatever").isExSemantic(0);
+ // testUri.runEx("ESAllPrim(PropertyInt16='1')").isExSemantic(0);
+ testUri.runEx("ESAllPrim(PropertyInt16)").isExSemantic(0);
+ testUri.runEx("ESAllPrim(PropertyInt16=)").isExSyntax(0);
+ testUri.runEx("ESAllPrim(PropertyInt16=1,Invalid='1')").isExSemantic(0);
+
+ testUri.runEx("ETBaseTwoKeyTwoPrim/com.sap.odata.test1.ETBaseTwoKeyTwoPrim"
+ + "/com.sap.odata.test1.ETTwoBaseTwoKeyTwoPrim").isExSemantic(0);
+
+ testUri.runEx("ETBaseTwoKeyTwoPrim/com.sap.odata.test1.ETBaseTwoKeyTwoPrim(1)/com.sap.odata.test1.ETAllKey")
+ .isExSemantic(0);
+
+ testUri.runEx("ETBaseTwoKeyTwoPrim(1)/com.sap.odata.test1.ETBaseTwoKeyTwoPrim('1')/com.sap.odata.test1.ETAllKey")
+ .isExSemantic(0);
+
+ testUri.runEx("ETBaseTwoKeyTwoPrim(1)/com.sap.odata.test1.ETBaseTwoKeyTwoPrim"
+ + "/com.sap.odata.test1.ETTwoBaseTwoKeyTwoPrim")
+ .isExSemantic(0);
+
+ testUri.runEx("ETBaseTwoKeyTwoPrim/com.sap.odata.test1.ETBaseTwoKeyTwoPrim"
+ + "/com.sap.odata.test1.ETTwoBaseTwoKeyTwoPrim(1)")
+ .isExSemantic(0);
+
+ testUri.runEx("ETBaseTwoKeyTwoPrim/com.sap.odata.test1.ETAllKey")
+ .isExSemantic(0);
+
+ testUri.runEx("ETBaseTwoKeyTwoPrim()")
+ .isExSemantic(0);
+
+ testUri.runEx("ESAllNullable(1)/CollPropertyString/$value")
+ .isExSemantic(0);
+
+ testUri.runEx("ETMixPrimCollComp(1)/ComplexProperty/$value").isExSemantic(0);
+ }
+
+ @Test
+ public void runEsNameCast() {
+ testUri.run("ESTwoPrim/com.sap.odata.test1.ETBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, true)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+
+ testUri.run("ESTwoPrim/com.sap.odata.test1.ETBase(-32768)/com.sap.odata.test1.ETTwoBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, false)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
+ .isKeyPredicate(0, "PropertyInt16", "-32768")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
+
+ testUri.run("ESTwoPrim/com.sap.odata.test1.ETTwoBase(-32768)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, false)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
+ .isKeyPredicate(0, "PropertyInt16", "-32768");
+
+ testUri.run("ESTwoPrim/Namespace1_Alias.ETTwoBase(-32768)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim, false)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
+ .isKeyPredicate(0, "PropertyInt16", "-32768");
+
+ }
+
+ @Test
+ public void runEsNamePpSpCast() {
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyDate")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyComplex/PropertyInt16")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+ }
+
+ @Test
+ public void runEsNameKey() {
+ testUri.run("ESCollAllPrim(1)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESCollAllPrim");
+
+ testUri.run("ESCollAllPrim(PropertyInt16=1)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESCollAllPrim");
+
+ testUri.run("ESFourKeyAlias(PropertyInt16=1,KeyAlias1=2,KeyAlias2='3',KeyAlias3='4')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESFourKeyAlias")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "KeyAlias1", "2")
+ .isKeyPredicate(2, "KeyAlias2", "'3'")
+ .isKeyPredicate(3, "KeyAlias3", "'4'");
+
+ testUri.run("ESCollAllPrim(null)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESCollAllPrim");
+ }
+
+ @Test
+ public void runEsNameParaKeys() throws UnsupportedEncodingException {
+ testUri.run(encode("ESAllKey(PropertyString='O''Neil',PropertyBoolean=true,PropertyByte=255,"
+ + "PropertySByte=-128,PropertyInt16=-32768,PropertyInt32=-2147483648,"
+ + "PropertyInt64=-9223372036854775808,PropertyDecimal=0.1,PropertyDate=2013-09-25,"
+ + "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00,"
+ + "PropertyDuration=duration'P10DT5H34M21.123456789012S',"
+ + "PropertyGuid=12345678-1234-1234-1234-123456789012,"
+ + "PropertyTimeOfDay=12:34:55.123456789012)"))
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllKey")
+ .isKeyPredicate(0, "PropertyString", "'O''Neil'")
+ .isKeyPredicate(1, "PropertyBoolean", "true")
+ .isKeyPredicate(2, "PropertyByte", "255")
+ .isKeyPredicate(3, "PropertySByte", "-128")
+ .isKeyPredicate(4, "PropertyInt16", "-32768")
+ .isKeyPredicate(5, "PropertyInt32", "-2147483648")
+ .isKeyPredicate(6, "PropertyInt64", "-9223372036854775808")
+ .isKeyPredicate(7, "PropertyDecimal", "0.1")
+ .isKeyPredicate(8, "PropertyDate", "2013-09-25")
+ .isKeyPredicate(9, "PropertyDateTimeOffset", "2002-10-10T12:00:00-05:00")
+ .isKeyPredicate(10, "PropertyDuration", "duration'P10DT5H34M21.123456789012S'")
+ .isKeyPredicate(11, "PropertyGuid", "12345678-1234-1234-1234-123456789012")
+ .isKeyPredicate(12, "PropertyTimeOfDay", "12:34:55.123456789012");
+ }
+
+ @Test
+ public void runEsNameKeyCast() {
+ /*
+ * testUri.runEx("ESTwoPrim(1)/com.sap.odata.test1.ETBase(1)")
+ * .isExSemantic(0);
+ *
+ * testUri.runEx("ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)")
+ * .isExSemantic(0);
+ *
+ * testUri.runEx("ESBase/com.sap.odata.test1.ETTwoPrim(1)")
+ * .isExSemantic(0);
+ */
+
+ testUri.run("ESTwoPrim(1)/com.sap.odata.test1.ETBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBase);
+
+ testUri.run("ESTwoPrim(1)/com.sap.odata.test1.ETTwoBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
+
+ testUri.run("ESTwoPrim/com.sap.odata.test1.ETBase(1)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+
+ testUri.run("ESTwoPrim/com.sap.odata.test1.ETTwoBase(1)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
+
+ testUri.run("ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
+
+ testUri.run("ESTwoPrim/com.sap.odata.test1.ETTwoBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoPrim")
+ .isType(EntityTypeProvider.nameETTwoPrim)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
+ }
+
+ @Test
+ public void runEsNameParaKeysCast() {
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+ testUri.run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'");
+ }
+
+ @Test
+ public void run_EsNamePpCp() {
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isComplex("PropertyComplex");
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComplex/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isComplex("PropertyComplex");
+ }
+
+ @Test
+ public void runEsNamePpCpColl() {
+ testUri.run("ESMixPrimCollComp(5)/CollPropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESMixPrimCollComp")
+ .isKeyPredicate(0, "PropertyInt16", "5")
+ .n()
+ .isComplex("CollPropertyComplex")
+ .isType(ComplexTypeProvider.nameCTTwoPrim, true);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isComplex("CollPropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComplex/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isComplex("CollPropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .n()
+ .isCount();
+ }
+
+ @Test
+ public void runEsNamePpCpCast() {
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplex");
+
+ testUri
+ .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyComplex/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isComplex("PropertyComplex");
+
+ testUri
+ .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyComplexTwoPrim/com.sap.odata.test1.CTBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplexTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim)
+ .isTypeFilter(ComplexTypeProvider.nameCTBase);
+
+ testUri
+ .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/PropertyComplexTwoPrim/com.sap.odata.test1.CTTwoBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplexTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim)
+ .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
+ }
+
+ @Test
+ public void runNsNamePpNp() {
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2");
+
+ testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETKeyNavMany(PropertyInt16=2)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2");
+
+ testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyInt16")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .n()
+ .isComplex("PropertyComplex");
+
+ testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/NavPropertyETKeyNavOne")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+ + "/NavPropertyETKeyNavMany(4)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "4");
+
+ testUri.run("ESKeyNav(1)/PropertyComplex/NavPropertyETTwoKeyNavOne")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='(3)')"
+ + "/PropertyComplex/PropertyComplex/PropertyInt16")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'(3)'")
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETMediaMany(2)/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETMediaMany", EntityTypeProvider.nameETMedia, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .n()
+ .isValue();
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+ + "/NavPropertyETKeyNavOne/NavPropertyETMediaOne/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .n()
+ .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
+ .n()
+ .isValue();
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+ + "/NavPropertyETKeyNavOne/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .n()
+ .isRef();
+ }
+
+ @Test
+ public void runEsNamePpNpCast() {
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/NavPropertyETKeyNavMany")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/NavPropertyETKeyNavMany(3)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "3");
+
+ testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/NavPropertyETTwoKeyNavMany/com.sap.odata.test1.ETTwoBaseTwoKeyNav(PropertyInt16=3,PropertyString='4')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESTwoKeyNav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "3")
+ .isKeyPredicate(1, "PropertyString", "'4'")
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
+ + "/NavPropertyETTwoKeyNavMany/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=4,PropertyString='5')"
+ + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav/NavPropertyETBaseTwoKeyNavMany")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "4")
+ .isKeyPredicate(1, "PropertyString", "'5'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
+ .n()
+ .isNavProperty("NavPropertyETBaseTwoKeyNavMany", EntityTypeProvider.nameETBaseTwoKeyNav, true);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/"
+ + "NavPropertyETTwoKeyNavMany/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=4,PropertyString='5')/"
+ + "NavPropertyETKeyNavMany")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "4")
+ .isKeyPredicate(1, "PropertyString", "'5'")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
+ }
+
+ @Test
+ public void runEsNamePpNpRc() {
+ // checks for using referential constrains to fill missing keys
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany('2')").goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
+ .isKeyPredicate(1, "PropertyString", "'2'");
+
+ testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETTwoKeyNavMany(PropertyString='2')").goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
+ .isKeyPredicate(1, "PropertyString", "'2'");
+
+ }
+
+ @Test
+ public void runEsNamePpSp() {
+ testUri.run("ESAllPrim(1)/PropertyByte")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false);
+
+ testUri.run("ESAllPrim(1)/PropertyByte/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false)
+ .n()
+ .isValue();
+
+ testUri.run("ESMixPrimCollComp(1)/PropertyComplex/PropertyString")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESMixPrimCollComp")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+ }
+
+ @Test
+ public void runEsNamePpSpColl() {
+ testUri.run("ESCollAllPrim(1)/CollPropertyString")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESCollAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
+
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+ .n()
+ .isCount();
+
+ }
+
+ @Test
+ public void runEsNameRef() {
+ testUri.run("ESAllPrim/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .n()
+ .isRef();
+
+ testUri.run("ESAllPrim(-32768)/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESAllPrim")
+ .isKeyPredicate(0, "PropertyInt16", "-32768")
+ .n()
+ .isRef();
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
+ .n()
+ .isRef();
+ testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='2')/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isEntitySet("ESKeyNav")
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'")
+ .n()
+ .isRef();
+ }
+
+ @Test
+ public void runFunctionImpBf() {
+
+ testUri.run("FICRTString()/com.sap.odata.test1.BFCStringRTESTwoKeyNav()");
+ }
+
+ @Test
+ public void runFunctionImpCastBf() {
+
+ testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/com.sap.odata.test1.ETBaseTwoKeyNav"
+ + "/com.sap.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isFunction("UFCRTETTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
+
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
+ + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
+ + "/com.sap.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .n()
+ .isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
+ }
+
+ @Test
+ public void runFunctionImpEntity() {
+
+ testUri.run("FICRTETKeyNav()")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETKeyNav")
+ .isFunction("UFCRTETKeyNav")
+ .isType(EntityTypeProvider.nameETKeyNav);
+
+ testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=2,PropertyString='3')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'");
+
+ testUri.run("FICRTETMedia()/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETMedia")
+ .isFunction("UFCRTETMedia")
+ .n()
+ .isValue();
+
+ testUri.run("FICRTETKeyNav()/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETKeyNav")
+ .isFunction("UFCRTETKeyNav")
+ .n()
+ .isRef();
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/$ref")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .n()
+ .isRef();
+
+ testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/com.sap.odata.test1.ETBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isFunction("UFCRTETTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+ testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=2,PropertyString='3')"
+ + "/com.sap.odata.test1.ETBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTETTwoKeyNavParam")
+ .isFunction("UFCRTETTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
+ + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'");
+ }
+
+ @Test
+ public void runFunctionImpEs() {
+ /**/
+ testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
+ .isFunction("UFCRTESMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'2'")
+ .isType(EntityTypeProvider.nameETMixPrimCollComp);
+
+ testUri.run("FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FINRTESMixPrimCollCompTwoParam")
+ .isFunction("UFNRTESMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'2'")
+ .isType(EntityTypeProvider.nameETMixPrimCollComp);
+
+ testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
+ .isFunction("UFCRTESMixPrimCollCompTwoParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isParameter(1, "ParameterString", "'2'")
+ .isType(EntityTypeProvider.nameETMixPrimCollComp)
+ .n()
+ .isCount();
+ }
+
+ @Test
+ public void runFunctionImpError() {
+ testUri.runEx("FICRTCollCTTwoPrimParam()").isExSemantic(0);
+ testUri.runEx("FICRTCollCTTwoPrimParam(invalidParam=2)").isExSemantic(0);
+ }
+
+ @Test
+ public void runFunctionImpEsAlias() {
+
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@parameterAlias)?@parameterAlias=1");
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@parameterAlias)/$count?@parameterAlias=1");
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@invalidAlias)?@validAlias=1");
+ }
+
+ @Test
+ public void runFunctionImpEsCast() {
+
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/com.sap.odata.test1.ETBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav);
+
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/com.sap.odata.test1.ETBaseTwoKeyNav/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isCount();
+
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
+ + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'");
+
+ testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
+ + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
+ + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isFunctionImport("FICRTESTwoKeyNavParam")
+ .isFunction("UFCRTESTwoKeyNavParam")
+ .isParameter(0, "ParameterInt16", "1")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .isKeyPredicate(0, "PropertyInt16", "2")
+ .isKeyPredicate(1, "PropertyString", "'3'")
+ .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
+
+ }
+
+ @Test
+ public void runSingletonEntityValue() {
+ testUri.run("SIMedia/$value")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SIMedia")
+ .n().isValue();
+ }
+
+ @Test
+ public void runSingletonPpNpCast() {
+ testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/NavPropertyETKeyNavMany")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
+
+ testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/NavPropertyETKeyNavMany(1)")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1");
+
+ }
+
+ @Test
+ public void runSingletonPpCpCast() {
+ testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplex");
+
+ testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyComplex/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isComplex("PropertyComplex");
+
+ testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyComplexTwoPrim/com.sap.odata.test1.CTBase")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isComplex("PropertyComplexTwoPrim")
+ .isType(ComplexTypeProvider.nameCTTwoPrim)
+ .isTypeFilter(ComplexTypeProvider.nameCTBase);
+
+ }
+
+ @Test
+ public void runSingletonPpSpCast() {
+ testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyInt16")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/CollPropertyString")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .isType(EntityTypeProvider.nameETTwoKeyNav)
+ .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+ .isType(PropertyProvider.nameString, true);
+
+ }
+
+ @Test
+ public void runSingletonEntityPpNp() {
+ testUri.run("SINav/NavPropertyETKeyNavMany")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
+
+ testUri.run("SINav/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='2')")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
+ .isKeyPredicate(0, "PropertyInt16", "1")
+ .isKeyPredicate(1, "PropertyString", "'2'");
+
+ }
+
+ @Test
+ public void runSingletonEntityPpCp() {
+ testUri.run("SINav/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isComplex("PropertyComplex");
+
+ testUri.run("SINav/PropertyComplex/PropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isComplex("PropertyComplex")
+ .n()
+ .isComplex("PropertyComplex");
+
+ }
+
+ @Test
+ public void runSingletonEntityPpCpColl() {
+ testUri.run("SINav/CollPropertyComplex")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isComplex("CollPropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true);
+
+ testUri.run("SINav/CollPropertyComplex/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isComplex("CollPropertyComplex")
+ .isType(ComplexTypeProvider.nameCTPrimComp, true)
+ .n()
+ .isCount();
+ }
+
+ @Test
+ public void runSingletonEntityPpSp() {
+ testUri.run("SINav/PropertyString")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
+ }
+
+ @Test
+ public void runSingletonEntityPpSpColl() {
+ testUri.run("SINav/CollPropertyString")
+
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
+ testUri.run("SINav/CollPropertyString/$count")
+ .isKind(UriInfoKind.resource).goPath()
+ .first()
+ .isSingleton("SINav")
+ .n()
+ .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
+ .n()
+ .isCount();
+ }
+
+ @Test
+ public void runExpand() {
+
+ testUri.run("ESKeyNav(1)?$expand=*")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .isSegmentStar(0);
+
+ testUri.run("ESKeyNav(1)?$expand=*/$ref")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .isSegmentStar(0)
+ .isSegmentRef(1);
+
+ testUri.run("ESKeyNav(1)?$expand=*/$ref,NavPropertyETKeyNavMany")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .isSegmentStar(0).isSegmentRef(1)
+ .next()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
+
+ testUri.run("ESKeyNav(1)?$expand=*($levels=3)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .isSegmentStar(0)
+ .isLevelText("3");
+
+ testUri.run("ESKeyNav(1)?$expand=*($levels=max)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .isSegmentStar(0)
+ .isLevelText("max");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isRef();
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .isType(EntityTypeProvider.nameETKeyNav, false)
+ .n().isRef();
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($filter=PropertyInt16 eq 1)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isRef()
+ .goUpExpandValidator().isFilterSerialized("<<PropertyInt16> eq <1>>");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($orderby=PropertyInt16)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isRef()
+ .goUpExpandValidator()
+ .isSortOrder(0, false)
+ .goOrder(0).goPath().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($skip=1)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isRef()
+ .goUpExpandValidator()
+ .isSkipText("1");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($top=2)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isRef()
+ .goUpExpandValidator()
+ .isTopText("2");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($count=true)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isRef()
+ .goUpExpandValidator()
+ .isInlineCountText("true");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($skip=1;$top=3)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isRef()
+ .goUpExpandValidator()
+ .isSkipText("1")
+ .isTopText("3");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($skip=1%3b$top=3)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isRef()
+ .goUpExpandValidator()
+ .isSkipText("1")
+ .isTopText("3");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$count")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isCount();
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
+ .isType(EntityTypeProvider.nameETKeyNav, false)
+ .n().isCount();
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$count($filter=PropertyInt16 gt 1)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .n().isCount()
+ .goUpExpandValidator()
+ .isFilterSerialized("<<PropertyInt16> gt <1>>");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany($filter=PropertyInt16 eq 1)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .goUpExpandValidator()
+ .isFilterSerialized("<<PropertyInt16> eq <1>>");
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany($orderby=PropertyInt16)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
+ .isType(EntityTypeProvider.nameETKeyNav, true)
+ .goUpExpandValidator()
+ .isSortOrder(0, false)
+ .goOrder(0).goPath().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
+
+ testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany($skip=1)")
+ .isKind(UriInfoKind.resource).goPath().goExpand()
+ .first()
+ .goPath().first()
+ .isNavProperty("NavPropertyET
<TRUNCATED>
[31/31] git commit: [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
[OLINGO-266] refactor ref - tecsvc
Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/a98d3b4a
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/a98d3b4a
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/a98d3b4a
Branch: refs/heads/olingo-266-ref
Commit: a98d3b4ab7363c5a790daa42d4d22dd721925433
Parents: 389b554
Author: Stephan Klevenz <st...@sap.com>
Authored: Tue May 13 13:36:50 2014 +0200
Committer: Stephan Klevenz <st...@sap.com>
Committed: Tue May 13 13:41:59 2014 +0200
----------------------------------------------------------------------
fit/pom.xml | 6 +-
.../org/apache/olingo/fit/ref/PingITCase.java | 44 -
.../apache/olingo/fit/tecsvc/PingITCase.java | 44 +
lib/pom.xml | 2 +-
lib/server-ref/pom.xml | 83 -
.../olingo/server/ref/ReferenceServlet.java | 51 -
.../server/ref/provider/ActionProvider.java | 191 -
.../ref/provider/ComplexTypeProvider.java | 175 -
.../server/ref/provider/ContainerProvider.java | 361 --
.../server/ref/provider/EdmTechProvider.java | 147 -
.../server/ref/provider/EntityTypeProvider.java | 408 --
.../server/ref/provider/EnumTypeProvider.java | 47 -
.../server/ref/provider/FunctionProvider.java | 852 ---
.../server/ref/provider/PropertyProvider.java | 590 --
.../server/ref/provider/SchemaProvider.java | 250 -
.../ref/provider/TypeDefinitionProvider.java | 30 -
.../src/main/resources/simplelogger.properties | 20 -
lib/server-ref/src/main/webapp/WEB-INF/web.xml | 42 -
lib/server-ref/src/main/webapp/index.html | 32 -
.../serializer/json/ServiceDocumentTest.java | 133 -
.../serializer/xml/MetadataDocumentTest.java | 254 -
.../olingo/server/core/uri/RawUriTest.java | 151 -
.../olingo/server/core/uri/UriInfoImplTest.java | 201 -
.../server/core/uri/UriResourceImplTest.java | 508 --
.../core/uri/antlr/TestFullResourcePath.java | 5110 ------------------
.../olingo/server/core/uri/antlr/TestLexer.java | 248 -
.../core/uri/antlr/TestUriParserImpl.java | 1144 ----
.../core/uri/queryoption/QueryOptionTest.java | 303 --
.../queryoption/expression/ExpressionTest.java | 239 -
.../core/uri/testutil/EdmTechTestProvider.java | 100 -
.../core/uri/testutil/ExpandValidator.java | 230 -
.../core/uri/testutil/FilterTreeToText.java | 154 -
.../core/uri/testutil/FilterValidator.java | 534 --
.../core/uri/testutil/ParseTreeToText.java | 82 -
.../core/uri/testutil/ParserValidator.java | 162 -
.../core/uri/testutil/ParserWithLogging.java | 56 -
.../core/uri/testutil/ResourceValidator.java | 599 --
.../core/uri/testutil/TestErrorLogger.java | 105 -
.../core/uri/testutil/TestUriValidator.java | 258 -
.../server/core/uri/testutil/TestValidator.java | 23 -
.../core/uri/testutil/TokenValidator.java | 194 -
.../core/uri/testutil/UriLexerWithTrace.java | 85 -
.../core/uri/validator/UriValidatorTest.java | 378 --
lib/server-tecsvc/pom.xml | 83 +
.../olingo/server/tecsvc/TechnicalServlet.java | 51 +
.../server/tecsvc/provider/ActionProvider.java | 191 +
.../tecsvc/provider/ComplexTypeProvider.java | 175 +
.../tecsvc/provider/ContainerProvider.java | 361 ++
.../server/tecsvc/provider/EdmTechProvider.java | 147 +
.../tecsvc/provider/EntityTypeProvider.java | 408 ++
.../tecsvc/provider/EnumTypeProvider.java | 47 +
.../tecsvc/provider/FunctionProvider.java | 852 +++
.../tecsvc/provider/PropertyProvider.java | 590 ++
.../server/tecsvc/provider/SchemaProvider.java | 250 +
.../tecsvc/provider/TypeDefinitionProvider.java | 30 +
.../src/main/resources/simplelogger.properties | 20 +
.../src/main/webapp/WEB-INF/web.xml | 42 +
lib/server-tecsvc/src/main/webapp/index.html | 32 +
.../serializer/json/ServiceDocumentTest.java | 133 +
.../serializer/xml/MetadataDocumentTest.java | 254 +
.../olingo/server/core/uri/RawUriTest.java | 151 +
.../olingo/server/core/uri/UriInfoImplTest.java | 201 +
.../server/core/uri/UriResourceImplTest.java | 508 ++
.../core/uri/antlr/TestFullResourcePath.java | 5110 ++++++++++++++++++
.../olingo/server/core/uri/antlr/TestLexer.java | 248 +
.../core/uri/antlr/TestUriParserImpl.java | 1144 ++++
.../core/uri/queryoption/QueryOptionTest.java | 303 ++
.../queryoption/expression/ExpressionTest.java | 239 +
.../core/uri/testutil/EdmTechTestProvider.java | 100 +
.../core/uri/testutil/ExpandValidator.java | 230 +
.../core/uri/testutil/FilterTreeToText.java | 154 +
.../core/uri/testutil/FilterValidator.java | 534 ++
.../core/uri/testutil/ParseTreeToText.java | 82 +
.../core/uri/testutil/ParserValidator.java | 162 +
.../core/uri/testutil/ParserWithLogging.java | 56 +
.../core/uri/testutil/ResourceValidator.java | 599 ++
.../core/uri/testutil/TestErrorLogger.java | 105 +
.../core/uri/testutil/TestUriValidator.java | 258 +
.../server/core/uri/testutil/TestValidator.java | 23 +
.../core/uri/testutil/TokenValidator.java | 194 +
.../core/uri/testutil/UriLexerWithTrace.java | 85 +
.../core/uri/validator/UriValidatorTest.java | 378 ++
82 files changed, 14578 insertions(+), 14578 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/fit/pom.xml
----------------------------------------------------------------------
diff --git a/fit/pom.xml b/fit/pom.xml
index d03d970..41f990a 100644
--- a/fit/pom.xml
+++ b/fit/pom.xml
@@ -101,7 +101,7 @@
</dependency>
<dependency>
<groupId>org.apache.olingo</groupId>
- <artifactId>olingo-server-ref</artifactId>
+ <artifactId>olingo-server-tecsvc</artifactId>
<version>${project.version}</version>
<type>war</type>
<scope>test</scope>
@@ -206,10 +206,10 @@
<deployables>
<deployable>
<groupId>org.apache.olingo</groupId>
- <artifactId>olingo-server-ref</artifactId>
+ <artifactId>olingo-server-tecsvc</artifactId>
<type>war</type>
<properties>
- <context>ref</context>
+ <context>tecsvc</context>
</properties>
</deployable>
<deployable>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/fit/src/test/java/org/apache/olingo/fit/ref/PingITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/ref/PingITCase.java b/fit/src/test/java/org/apache/olingo/fit/ref/PingITCase.java
deleted file mode 100644
index bdc033c..0000000
--- a/fit/src/test/java/org/apache/olingo/fit/ref/PingITCase.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.fit.ref;
-
-import static org.junit.Assert.assertEquals;
-
-import java.net.HttpURLConnection;
-import java.net.URL;
-
-import org.junit.Test;
-
-public class PingITCase {
-
- private static final String REF_SERVICE = "http://localhost:9080/ref/odata.svc/";
-
- @Test
- public void ping() throws Exception {
- URL url = new URL(REF_SERVICE);
-
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setRequestMethod("GET");
- connection.connect();
-
- int code = connection.getResponseCode();
- assertEquals(200, code);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/fit/src/test/java/org/apache/olingo/fit/tecsvc/PingITCase.java
----------------------------------------------------------------------
diff --git a/fit/src/test/java/org/apache/olingo/fit/tecsvc/PingITCase.java b/fit/src/test/java/org/apache/olingo/fit/tecsvc/PingITCase.java
new file mode 100644
index 0000000..755e087
--- /dev/null
+++ b/fit/src/test/java/org/apache/olingo/fit/tecsvc/PingITCase.java
@@ -0,0 +1,44 @@
+/*
+ * 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.fit.tecsvc;
+
+import static org.junit.Assert.assertEquals;
+
+import java.net.HttpURLConnection;
+import java.net.URL;
+
+import org.junit.Test;
+
+public class PingITCase {
+
+ private static final String REF_SERVICE = "http://localhost:9080/tecsvc/odata.svc/";
+
+ @Test
+ public void ping() throws Exception {
+ URL url = new URL(REF_SERVICE);
+
+ HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ connection.setRequestMethod("GET");
+ connection.connect();
+
+ int code = connection.getResponseCode();
+ assertEquals(200, code);
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/pom.xml
----------------------------------------------------------------------
diff --git a/lib/pom.xml b/lib/pom.xml
index ed0cdd7..2cea272 100644
--- a/lib/pom.xml
+++ b/lib/pom.xml
@@ -42,6 +42,6 @@
<module>client-core</module>
<module>server-api</module>
<module>server-core</module>
- <module>server-ref</module>
+ <module>server-tecsvc</module>
</modules>
</project>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/pom.xml
----------------------------------------------------------------------
diff --git a/lib/server-ref/pom.xml b/lib/server-ref/pom.xml
deleted file mode 100644
index ce5e30d..0000000
--- a/lib/server-ref/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?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.
-
--->
-<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-server-ref</artifactId>
- <packaging>war</packaging>
- <name>${project.artifactId}</name>
-
- <parent>
- <groupId>org.apache.olingo</groupId>
- <artifactId>olingo-lib</artifactId>
- <version>0.1.0-SNAPSHOT</version>
- <relativePath>..</relativePath>
- </parent>
-
- <dependencies>
- <dependency>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- <version>2.5</version>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.olingo</groupId>
- <artifactId>olingo-server-api</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.olingo</groupId>
- <artifactId>olingo-server-core</artifactId>
- <version>${project.version}</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-</project>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/ReferenceServlet.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/ReferenceServlet.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/ReferenceServlet.java
deleted file mode 100644
index 93b766e..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/ReferenceServlet.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.olingo.server.api.ODataHandler;
-import org.apache.olingo.server.api.ODataServer;
-import org.apache.olingo.server.ref.provider.EdmTechProvider;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ReferenceServlet extends HttpServlet {
-
- private static final long serialVersionUID = 1L;
-
- private static final Logger LOG = LoggerFactory.getLogger(ReferenceServlet.class);
-
- @Override
- protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
- LOG.debug("ReferenceServlet:service() called");
-
-
- ODataHandler handler = ODataServer.newInstance().getHandler(new EdmTechProvider());
-
- handler.process(req, resp);
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ActionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ActionProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ActionProvider.java
deleted file mode 100644
index d5c5296..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ActionProvider.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.Action;
-import org.apache.olingo.server.api.edm.provider.Parameter;
-import org.apache.olingo.server.api.edm.provider.ReturnType;
-
-public class ActionProvider {
-
- // Bound Actions
- public static final FullQualifiedName nameBAESAllPrimRTETAllPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "BAESAllPrimRTETAllPrim");
-
- public static final FullQualifiedName nameBAESTwoKeyNavRTESTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BAESTwoKeyNavRTESTwoKeyNav");
-
- public static final FullQualifiedName nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BAETBaseTwoKeyNavRTETBaseTwoKeyNav");
-
- public static final FullQualifiedName nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav");
-
- public static final FullQualifiedName nameBAETTwoKeyNavRTETTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "BAETTwoKeyNavRTETTwoKeyNav");
-
- // Unbound Actions
- public static final FullQualifiedName nameUARTCompCollParam = new FullQualifiedName(SchemaProvider.nameSpace,
- "UARTCompCollParam");
- public static final FullQualifiedName nameUARTCompParam = new FullQualifiedName(SchemaProvider.nameSpace,
- "UARTCompParam");
- public static final FullQualifiedName nameUARTESParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UARTESParam");
-
- public static final FullQualifiedName nameUARTETParam =
- new FullQualifiedName(SchemaProvider.nameSpace, "UARTETParam");
-
- public static final FullQualifiedName nameUARTPrimParam = new FullQualifiedName(SchemaProvider.nameSpace,
- "UARTPrimParam");
- public static final FullQualifiedName nameUARTPrimCollParam = new FullQualifiedName(SchemaProvider.nameSpace,
- "UARTPrimCollParam");
-
- public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
- if (actionName.equals(nameUARTPrimParam)) {
- return Arrays.asList(
- new Action().setName("UARTPrimParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
-
- .setReturnType(new ReturnType().setType(PropertyProvider.nameString))
- );
-
- } else if (actionName.equals(nameUARTPrimCollParam)) {
- return Arrays.asList(
- new Action().setName("UARTPrimCollParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
-
- .setReturnType(
- new ReturnType().setType(PropertyProvider.nameString).setCollection(true))
- );
-
- } else if (actionName.equals(nameUARTCompParam)) {
- return Arrays.asList(
- new Action().setName("UARTCompParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
-
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim))
- );
-
- } else if (actionName.equals(nameUARTCompCollParam)) {
- return Arrays.asList(
- new Action().setName("UARTCompCollParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
-
- .setReturnType(
- new ReturnType().setType(ComplexTypeProvider.nameCTTwoPrim).setCollection(true))
- );
-
- } else if (actionName.equals(nameUARTETParam)) {
- return Arrays.asList(
- new Action().setName("UARTETParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyTwoPrim))
- );
-
- } else if (actionName.equals(nameUARTESParam)) {
- return Arrays.asList(
- new Action().setName("UARTESParam")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterInt16").setType(PropertyProvider.nameInt16)))
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETKeyNav).setCollection(true))
- );
-
- } else if (actionName.equals(nameBAETTwoKeyNavRTETTwoKeyNav)) {
- return Arrays.asList(
- new Action().setName("BAETTwoKeyNavRTETTwoKeyNav")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setNullable(false)))
- .setBound(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav))
- ,
- new Action().setName("BAETTwoKeyNavRTETTwoKeyNav")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterETKeyNav").setType(EntityTypeProvider.nameETKeyNav)
- .setNullable(false)))
- .setBound(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav))
- );
-
- } else if (actionName.equals(nameBAESAllPrimRTETAllPrim)) {
- return Arrays.asList(
- new Action().setName("BAESAllPrimRTETAllPrim")
- .setParameters(
- Arrays.asList(
- new Parameter().setName("ParameterESAllPrim").setType(EntityTypeProvider.nameETAllPrim)
- .setCollection(true).setNullable(false)))
- .setBound(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETAllPrim))
- );
-
- } else if (actionName.equals(nameBAESTwoKeyNavRTESTwoKeyNav)) {
- return Arrays.asList(
- new Action().setName("BAESTwoKeyNavRTESTwoKeyNav")
- .setParameters(
- Arrays.asList(
- new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETTwoKeyNav)
- .setCollection(true).setNullable(false)))
- .setBound(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav).setCollection(true))
- );
-
- } else if (actionName.equals(nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav)) {
- return Arrays.asList(
- new Action().setName("BAETBaseTwoKeyNavRTETBaseTwoKeyNav")
- .setParameters(Arrays.asList(
- new Parameter().setName("ParameterETTwoKeyNav").setType(EntityTypeProvider.nameETBaseTwoKeyNav)
- .setNullable(false)))
- .setBound(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETTwoKeyNav))
- );
-
- } else if (actionName.equals(nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav)) {
- return Arrays.asList(
- new Action().setName("BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav")
- .setParameters(
- Arrays.asList(
- new Parameter().setName("ParameterETTwoBaseTwoKeyNav").setType(
- EntityTypeProvider.nameETTwoBaseTwoKeyNav).setNullable(false)))
- .setBound(true)
- .setReturnType(
- new ReturnType().setType(EntityTypeProvider.nameETBaseTwoKeyNav))
- );
- }
-
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ComplexTypeProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ComplexTypeProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ComplexTypeProvider.java
deleted file mode 100644
index f14d22f..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ComplexTypeProvider.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import java.util.Arrays;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.ComplexType;
-import org.apache.olingo.server.api.edm.provider.NavigationProperty;
-import org.apache.olingo.server.api.edm.provider.Property;
-
-public class ComplexTypeProvider {
-
- public static final FullQualifiedName nameCTAllPrim = new FullQualifiedName(SchemaProvider.nameSpace, "CTAllPrim");
- public static final FullQualifiedName nameCTBase = new FullQualifiedName(SchemaProvider.nameSpace, "CTBase");
- public static final FullQualifiedName nameCTBasePrimCompNav = new FullQualifiedName(SchemaProvider.nameSpace,
- "CTBasePrimCompNav");
- public static final FullQualifiedName nameCTCollAllPrim = new FullQualifiedName(SchemaProvider.nameSpace,
- "CTCollAllPrim");
- public static final FullQualifiedName nameCTCompCollComp = new FullQualifiedName(SchemaProvider.nameSpace,
- "CTCompCollComp");
- public static final FullQualifiedName nameCTCompComp = new FullQualifiedName(SchemaProvider.nameSpace, "CTCompComp");
- public static final FullQualifiedName nameCTCompNav = new FullQualifiedName(SchemaProvider.nameSpace, "CTCompNav");
-
- public static final FullQualifiedName nameCTMixPrimCollComp = new FullQualifiedName(SchemaProvider.nameSpace,
- "CTMixPrimCollComp");
- public static final FullQualifiedName nameCTNavFiveProp = new FullQualifiedName(SchemaProvider.nameSpace,
- "CTNavFiveProp");
- public static final FullQualifiedName nameCTPrim = new FullQualifiedName(SchemaProvider.nameSpace, "CTPrim");
- public static final FullQualifiedName nameCTPrimComp = new FullQualifiedName(SchemaProvider.nameSpace, "CTPrimComp");
- public static final FullQualifiedName nameCTPrimEnum = new FullQualifiedName(SchemaProvider.nameSpace, "CTPrimEnum");
- public static final FullQualifiedName nameCTTwoBase = new FullQualifiedName(SchemaProvider.nameSpace, "CTTwoBase");
- public static final FullQualifiedName nameCTTwoBasePrimCompNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "CTTwoBasePrimCompNav");
- public static final FullQualifiedName nameCTTwoPrim = new FullQualifiedName(SchemaProvider.nameSpace, "CTTwoPrim");
-
- public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
-
- if (complexTypeName.equals(nameCTPrim)) {
- return new ComplexType()
- .setName("CTPrim")
- .setProperties(Arrays.asList(PropertyProvider.propertyInt16));
-
- } else if (complexTypeName.equals(nameCTAllPrim)) {
- return new ComplexType()
- .setName("CTAllPrim")
- .setProperties(
- Arrays.asList(PropertyProvider.propertyString, PropertyProvider.propertyBinary,
- PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertyDate,
- PropertyProvider.propertyDateTimeOffset, PropertyProvider.propertyDecimal,
- PropertyProvider.propertySingle, PropertyProvider.propertyDouble, PropertyProvider.propertyDuration,
- PropertyProvider.propertyGuid, PropertyProvider.propertyInt16, PropertyProvider.propertyInt32,
- PropertyProvider.propertyInt64, PropertyProvider.propertySByte, PropertyProvider.propertyTimeOfDay
- /* TODO add propertyStream */));
-
- } else if (complexTypeName.equals(nameCTCollAllPrim)) {
- return new ComplexType()
- .setName("CTCollAllPrim")
- .setProperties(
- Arrays.asList(
- PropertyProvider.collPropertyString, PropertyProvider.collPropertyBoolean,
- PropertyProvider.collPropertyByte, PropertyProvider.collPropertySByte,
- PropertyProvider.collPropertyInt16, PropertyProvider.collPropertyInt32,
- PropertyProvider.collPropertyInt64, PropertyProvider.collPropertySingle,
- PropertyProvider.collPropertyDouble, PropertyProvider.collPropertyDecimal,
- PropertyProvider.collPropertyBinary, PropertyProvider.collPropertyDate,
- PropertyProvider.collPropertyDateTimeOffset, PropertyProvider.collPropertyDuration,
- PropertyProvider.collPropertyGuid, PropertyProvider.collPropertyTimeOfDay
- /* TODO add collectionPropertyStream */));
-
- } else if (complexTypeName.equals(nameCTTwoPrim)) {
- return new ComplexType()
- .setName("CTTwoPrim")
- .setProperties(Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.propertyString));
-
- } else if (complexTypeName.equals(nameCTCompNav)) {
- return new ComplexType()
- .setName("CTCompNav")
- .setProperties(Arrays.asList(PropertyProvider.propertyString,
- PropertyProvider.propertyComplex_CTNavFiveProp));
-
- } else if (complexTypeName.equals(nameCTMixPrimCollComp)) {
- return new ComplexType()
- .setName("CTMixPrimCollComp")
- .setProperties(
- Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.collPropertyString,
- PropertyProvider.propertyComplex_CTTwoPrim, PropertyProvider.collPropertyComplex_CTTwoPrim));
-
- } else if (complexTypeName.equals(nameCTBase)) {
- return new ComplexType()
- .setName("CTBase")
- .setBaseType(nameCTTwoPrim)
- .setProperties(Arrays.asList(
- new Property()
- .setName("AdditionalPropString")
- .setType(new FullQualifiedName("Edm", "String"))));
-
- } else if (complexTypeName.equals(nameCTTwoBase)) {
- return new ComplexType()
- .setName("CTTwoBase")
- .setBaseType(nameCTBase);
-
- } else if (complexTypeName.equals(nameCTCompComp)) {
- return new ComplexType()
- .setName("CTCompComp")
- .setProperties(Arrays.asList(PropertyProvider.propertyComplex_CTTwoPrim));
-
- } else if (complexTypeName.equals(nameCTCompCollComp)) {
- return new ComplexType()
- .setName("CTCompCollComp")
- .setProperties(Arrays.asList(PropertyProvider.collPropertyComplex_CTTwoPrim));
-
- } else if (complexTypeName.equals(nameCTPrimComp)) {
- return new ComplexType()
- .setName("CTPrimComp")
- .setProperties(Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.propertyComplex_CTAllPrim));
-
- } else if (complexTypeName.equals(nameCTNavFiveProp)) {
- return new ComplexType()
- .setName("CTNavFiveProp")
- .setProperties(Arrays.asList(PropertyProvider.propertyInt16))
- .setNavigationProperties((Arrays.asList(
- PropertyProvider.collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav,
- PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav,
- new NavigationProperty()
- .setName("NavPropertyETMediaOne")
- .setType(EntityTypeProvider.nameETMedia),
- new NavigationProperty()
- .setName("NavPropertyETMediaMany")
- .setType(EntityTypeProvider.nameETMedia).setCollection(true)
- )));
-
- } else if (complexTypeName.equals(nameCTBasePrimCompNav)) {
- return new ComplexType()
- .setName("CTBasePrimCompNav")
- .setBaseType(nameCTPrimComp)
- .setNavigationProperties(Arrays.asList(
- PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav,
- PropertyProvider.collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav,
- PropertyProvider.navPropertyETKeyNavOne_ETKeyNav,
- PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav));
-
- } else if (complexTypeName.equals(nameCTPrimEnum)) {
- return new ComplexType()
- .setName("CTPrimEnum")
- .setProperties(Arrays.asList(PropertyProvider.propertyInt16, PropertyProvider.propertyEnumString_ENString));
-
- } else if (complexTypeName.equals(nameCTTwoBasePrimCompNav)) {
- return new ComplexType()
- .setName("CTTwoBasePrimCompNav")
- .setBaseType(nameCTBasePrimCompNav);
-
- }
-
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ContainerProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ContainerProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ContainerProvider.java
deleted file mode 100644
index 2790db4..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/ContainerProvider.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import java.util.Arrays;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.commons.api.edm.Target;
-import org.apache.olingo.server.api.edm.provider.ActionImport;
-import org.apache.olingo.server.api.edm.provider.EntityContainer;
-import org.apache.olingo.server.api.edm.provider.EntityContainerInfo;
-import org.apache.olingo.server.api.edm.provider.EntitySet;
-import org.apache.olingo.server.api.edm.provider.FunctionImport;
-import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding;
-import org.apache.olingo.server.api.edm.provider.Singleton;
-
-public class ContainerProvider {
-
- public static final FullQualifiedName nameContainer = new FullQualifiedName(SchemaProvider.nameSpace, "Container");
-
- EntityContainerInfo entityContainerInfoTest1 =
- new EntityContainerInfo().setContainerName(nameContainer);
-
- public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException {
- if (entityContainerName == null) {
- return entityContainerInfoTest1;
- } else if (entityContainerName.equals(nameContainer)) {
- return entityContainerInfoTest1;
- }
-
- return null;
- }
-
- public EntityContainer getEntityContainer() throws ODataException {
- return null;
- }
-
- public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String name) throws ODataException {
- if (entityContainer == nameContainer) {
- if (name.equals("ESAllPrim")) {
- return new EntitySet()
- .setName("ESAllPrim")
- .setType(EntityTypeProvider.nameETAllPrim);
-
- } else if (name.equals("ESCollAllPrim")) {
- return new EntitySet()
- .setName("ESCollAllPrim")
- .setType(EntityTypeProvider.nameETCollAllPrim);
-
- } else if (name.equals("ESTwoPrim")) {
- return new EntitySet()
- .setName("ESTwoPrim")
- .setType(EntityTypeProvider.nameETTwoPrim);
-
- } else if (name.equals("ESMixPrimCollComp")) {
- return new EntitySet()
- .setName("ESMixPrimCollComp")
- .setType(EntityTypeProvider.nameETMixPrimCollComp);
-
- } else if (name.equals("ESBase")) {
- return new EntitySet()
- .setName("ESBase")
- .setType(EntityTypeProvider.nameETBase);
-
- } else if (name.equals("ESTwoBase")) {
- return new EntitySet()
- .setName("ESTwoBase")
- .setType(EntityTypeProvider.nameETTwoBase);
-
- } else if (name.equals("ESTwoKeyTwoPrim")) {
- return new EntitySet()
- .setName("ESTwoKeyTwoPrim")
- .setType(EntityTypeProvider.nameETTwoKeyTwoPrim);
-
- } else if (name.equals("ESBaseTwoKeyTwoPrim")) {
- return new EntitySet()
- .setName("ESBaseTwoKeyTwoPrim")
- .setType(EntityTypeProvider.nameETBaseTwoKeyTwoPrim);
-
- } else if (name.equals("ESTwoBaseTwoKeyTwoPrim")) {
- return new EntitySet()
- .setName("ESTwoBaseTwoKeyTwoPrim")
- .setType(EntityTypeProvider.nameETTwoBaseTwoKeyTwoPrim);
-
- } else if (name.equals("ESAllKey")) {
- return new EntitySet()
- .setName("ESAllKey")
- .setType(EntityTypeProvider.nameETAllKey);
-
- } else if (name.equals("ESCompAllPrim")) {
- return new EntitySet()
- .setName("ESCompAllPrim")
- .setType(EntityTypeProvider.nameETCompAllPrim);
-
- } else if (name.equals("ESCompCollAllPrim")) {
- return new EntitySet()
- .setName("ESCompCollAllPrim")
- .setType(EntityTypeProvider.nameETCompCollAllPrim);
-
- } else if (name.equals("ESCompComp")) {
- return new EntitySet()
- .setName("ESCompComp")
- .setType(EntityTypeProvider.nameETCompComp);
-
- } else if (name.equals("ESCompCollComp")) {
- return new EntitySet()
- .setName("ESCompCollComp")
- .setType(EntityTypeProvider.nameETCompCollComp);
-
- } else if (name.equals("ESMedia")) {
- return new EntitySet()
- .setName("ESMedia")
- .setType(EntityTypeProvider.nameETMedia)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("ESKeyTwoKeyComp")) {
- return new EntitySet()
- .setName("ESKeyTwoKeyComp")
- .setType(EntityTypeProvider.nameETKeyTwoKeyComp);
-
- } else if (name.equals("ESInvisible")) {
- return new EntitySet()
- .setName("ESInvisible")
- .setType(EntityTypeProvider.nameETAllPrim);
-
- } else if (name.equals("ESServerSidePaging")) {
- return new EntitySet()
- .setName("ESServerSidePaging")
- .setType(EntityTypeProvider.nameETServerSidePaging);
-
- } else if (name.equals("ESAllNullable")) {
- return new EntitySet()
- .setName("ESAllNullable")
- .setType(EntityTypeProvider.nameETAllNullable);
-
- } else if (name.equals("ESKeyNav")) {
- return new EntitySet()
- .setName("ESKeyNav")
- .setType(EntityTypeProvider.nameETKeyNav);
-
- } else if (name.equals("ESTwoKeyNav")) {
- return new EntitySet()
- .setName("ESTwoKeyNav")
- .setType(EntityTypeProvider.nameETTwoKeyNav);
-
- } else if (name.equals("ESBaseTwoKeyNav")) {
- return new EntitySet()
- .setName("ESBaseTwoKeyNav")
- .setType(EntityTypeProvider.nameETBaseTwoKeyNav);
-
- } else if (name.equals("ESCompMixPrimCollComp")) {
- return new EntitySet()
- .setName("ESCompMixPrimCollComp")
- .setType(EntityTypeProvider.nameETCompMixPrimCollComp);
-
- } else if (name.equals("ESFourKeyAlias")) {
- return new EntitySet()
- .setName("ESFourKeyAlias")
- .setType(EntityTypeProvider.nameETFourKeyAlias);
- }
- }
-
- return null;
- }
-
- public ActionImport getActionImport(final FullQualifiedName entityContainer, final String name) throws ODataException
- {
- if (entityContainer.equals(nameContainer)) {
- if (name.equals("AIRTPrimParam")) {
- return new ActionImport()
- .setName("AIRTPrimParam")
- .setAction(ActionProvider.nameUARTPrimParam);
-
- } else if (name.equals("AIRTPrimCollParam")) {
- return new ActionImport()
- .setName("AIRTPrimCollParam")
- .setAction(ActionProvider.nameUARTPrimCollParam);
-
- } else if (name.equals("AIRTCompParam")) {
- return new ActionImport()
- .setName("AIRTCompParam")
- .setAction(ActionProvider.nameUARTCompParam);
-
- } else if (name.equals("AIRTCompCollParam")) {
- return new ActionImport()
- .setName("AIRTCompCollParam")
- .setAction(ActionProvider.nameUARTCompCollParam);
-
- } else if (name.equals("AIRTETParam")) {
- return new ActionImport()
- .setName("AIRTETParam")
- .setAction(ActionProvider.nameUARTETParam);
-
- } else if (name.equals("AIRTETCollAllPrimParam")) {
- return new ActionImport()
- .setName("AIRTETCollAllPrimParam")
- .setAction(ActionProvider.nameUARTESParam);
- }
- }
-
- return null;
- }
-
- public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String name)
- throws ODataException {
-
- if (entityContainer.equals(nameContainer)) {
- if (name.equals("FINRTInt16")) {
- return new FunctionImport()
- .setName("FINRTInt16")
- .setFunction(FunctionProvider.nameUFNRTInt16)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FINInvisibleRTInt16")) {
- return new FunctionImport()
- .setName("FINInvisibleRTInt16")
- .setFunction(FunctionProvider.nameUFNRTInt16);
-
- } else if (name.equals("FINInvisible2RTInt16")) {
- return new FunctionImport()
- .setName("FINInvisible2RTInt16")
- .setFunction(FunctionProvider.nameUFNRTInt16);
-
- } else if (name.equals("FICRTETKeyNav")) {
- return new FunctionImport()
- .setName("FICRTETKeyNav")
- .setFunction(FunctionProvider.nameUFCRTETKeyNav);
-
- } else if (name.equals("FICRTETTwoKeyNavParam")) {
- return new FunctionImport()
- .setName("FICRTETTwoKeyNavParam")
- .setFunction(FunctionProvider.nameUFCRTETTwoKeyNavParam)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTStringTwoParam")) {
- return new FunctionImport()
- .setName("FICRTStringTwoParam")
- .setFunction(FunctionProvider.nameUFCRTStringTwoParam)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTCollStringTwoParam")) {
- return new FunctionImport()
- .setName("FICRTCollStringTwoParam")
- .setFunction(FunctionProvider.nameUFCRTCollStringTwoParam)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTCTAllPrimTwoParam")) {
- return new FunctionImport()
- .setName("FICRTCTAllPrimTwoParam")
- .setFunction(FunctionProvider.nameUFCRTCTAllPrimTwoParam)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTESMixPrimCollCompTwoParam")) {
- return new FunctionImport()
- .setName("FICRTESMixPrimCollCompTwoParam")
- .setFunction(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FINRTESMixPrimCollCompTwoParam")) {
- return new FunctionImport()
- .setName("FINRTESMixPrimCollCompTwoParam")
- .setFunction(FunctionProvider.nameUFNRTESMixPrimCollCompTwoParam)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTCollCTTwoPrim")) {
- return new FunctionImport()
- .setName("FICRTCollCTTwoPrim")
- .setFunction(FunctionProvider.nameUFCRTCollCTTwoPrim)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTETMedia")) {
- return new FunctionImport()
- .setName("FICRTETMedia")
- .setFunction(FunctionProvider.nameUFCRTETMedia)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTCTTwoPrimParam")) {
- return new FunctionImport()
- .setName("FICRTCTTwoPrimParam")
- .setFunction(FunctionProvider.nameUFCRTCTTwoPrimParam)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTCTTwoPrim")) {
- return new FunctionImport()
- .setName("FICRTCTTwoPrim")
- .setFunction(FunctionProvider.nameUFCRTCTTwoPrim)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTCollString")) {
- return new FunctionImport()
- .setName("FICRTCollString")
- .setFunction(FunctionProvider.nameUFCRTCollString)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTString")) {
- return new FunctionImport()
- .setName("FICRTString")
- .setFunction(FunctionProvider.nameUFCRTString)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTESTwoKeyNavParam")) {
- return new FunctionImport()
- .setName("FICRTESTwoKeyNavParam")
- .setFunction(FunctionProvider.nameUFCRTESTwoKeyNavParam)
- .setIncludeInServiceDocument(true);
-
- } else if (name.equals("FICRTCollCTTwoPrimParam")) {
- return new FunctionImport()
- .setName("FICRTCollCTTwoPrimParam")
- .setFunction(FunctionProvider.nameUFCRTCollCTTwoPrimParam)
- .setIncludeInServiceDocument(true);
-
- }
- }
-
- return null;
- }
-
- public Singleton getSingleton(final FullQualifiedName entityContainer, final String name) throws ODataException {
- if (entityContainer.equals(nameContainer)) {
-
- if (name.equals("SI")) {
- return new Singleton()
- .setName("SI")
- .setType(EntityTypeProvider.nameETTwoPrim);
-
- } else if (name.equals("SINav")) {
- return new Singleton()
- .setName("SINav")
- .setType(EntityTypeProvider.nameETTwoKeyNav)
- .setNavigationPropertyBindings(Arrays.asList(
- new NavigationPropertyBinding()
- .setPath("NavPropertyETTwoKeyNavMany")
- .setTarget(new Target().setTargetName("ESTwoKeyNav"))));
-
- } else if (name.equals("SIMedia")) {
- return new Singleton()
- .setName("SIMedia")
- .setType(EntityTypeProvider.nameETMedia);
- }
- }
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EdmTechProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EdmTechProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EdmTechProvider.java
deleted file mode 100644
index 13faf90..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EdmTechProvider.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.Action;
-import org.apache.olingo.server.api.edm.provider.ActionImport;
-import org.apache.olingo.server.api.edm.provider.AliasInfo;
-import org.apache.olingo.server.api.edm.provider.ComplexType;
-import org.apache.olingo.server.api.edm.provider.EdmProvider;
-import org.apache.olingo.server.api.edm.provider.EntityContainer;
-import org.apache.olingo.server.api.edm.provider.EntityContainerInfo;
-import org.apache.olingo.server.api.edm.provider.EntitySet;
-import org.apache.olingo.server.api.edm.provider.EntityType;
-import org.apache.olingo.server.api.edm.provider.EnumType;
-import org.apache.olingo.server.api.edm.provider.Function;
-import org.apache.olingo.server.api.edm.provider.FunctionImport;
-import org.apache.olingo.server.api.edm.provider.Schema;
-import org.apache.olingo.server.api.edm.provider.Singleton;
-import org.apache.olingo.server.api.edm.provider.Term;
-import org.apache.olingo.server.api.edm.provider.TypeDefinition;
-
-public class EdmTechProvider extends EdmProvider {
-
- public static final String nameSpace = "com.sap.odata.test1";
-
- private final SchemaProvider schemaProvider;
- private final EntityTypeProvider entityTypeProvider;
- private final ContainerProvider containerProvider;
- private final ComplexTypeProvider complexTypeProvider;
- private final EnumTypeProvider enumTypeProvider;
- private final ActionProvider actionProvider;
- private final FunctionProvider functionProvider;
- private final TypeDefinitionProvider typeDefinitionProvider;
-
- public EdmTechProvider() {
- containerProvider = new ContainerProvider();
- entityTypeProvider = new EntityTypeProvider();
- complexTypeProvider = new ComplexTypeProvider();
- enumTypeProvider = new EnumTypeProvider();
- actionProvider = new ActionProvider();
- functionProvider = new FunctionProvider();
- typeDefinitionProvider = new TypeDefinitionProvider();
- schemaProvider = new SchemaProvider(this);
- }
-
- @Override
- public List<AliasInfo> getAliasInfos() throws ODataException {
- return Arrays.asList(
- new AliasInfo().setAlias("Namespace1_Alias").setNamespace(nameSpace)
- );
- }
-
- @Override
- public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
- return enumTypeProvider.getEnumType(enumTypeName);
- }
-
- @Override
- public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) throws ODataException {
- return typeDefinitionProvider.getTypeDefinition(typeDefinitionName);
- }
-
- @Override
- public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
- return entityTypeProvider.getEntityType(entityTypeName);
- }
-
- @Override
- public ComplexType getComplexType(final FullQualifiedName complexTypeName) throws ODataException {
- return complexTypeProvider.getComplexType(complexTypeName);
- }
-
- @Override
- public List<Action> getActions(final FullQualifiedName actionName) throws ODataException {
- return actionProvider.getActions(actionName);
- }
-
- @Override
- public List<Function> getFunctions(final FullQualifiedName functionName) throws ODataException {
- return functionProvider.getFunctions(functionName);
- }
-
- @Override
- public Term getTerm(final FullQualifiedName termName) throws ODataException {
- return null;
- }
-
- @Override
- public EntitySet getEntitySet(final FullQualifiedName entityContainer, final String entitySetName)
- throws ODataException {
- return containerProvider.getEntitySet(entityContainer, entitySetName);
- }
-
- @Override
- public Singleton getSingleton(final FullQualifiedName entityContainer, final String singletonName)
- throws ODataException {
- return containerProvider.getSingleton(entityContainer, singletonName);
- }
-
- @Override
- public ActionImport getActionImport(final FullQualifiedName entityContainer, final String actionImportName)
- throws ODataException {
- return containerProvider.getActionImport(entityContainer, actionImportName);
- }
-
- @Override
- public FunctionImport getFunctionImport(final FullQualifiedName entityContainer, final String functionImportName)
- throws ODataException {
- return containerProvider.getFunctionImport(entityContainer, functionImportName);
- }
-
- @Override
- public List<Schema> getSchemas() throws ODataException {
- return schemaProvider.getSchemas();
- }
-
- @Override
- public EntityContainer getEntityContainer() throws ODataException {
- return containerProvider.getEntityContainer();
- }
-
- @Override
- public EntityContainerInfo getEntityContainerInfo(final FullQualifiedName entityContainerName) throws ODataException {
- return containerProvider.getEntityContainerInfo(entityContainerName);
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EntityTypeProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EntityTypeProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EntityTypeProvider.java
deleted file mode 100644
index 88cc8cc..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EntityTypeProvider.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import java.util.Arrays;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.EntityType;
-import org.apache.olingo.server.api.edm.provider.NavigationProperty;
-import org.apache.olingo.server.api.edm.provider.Property;
-import org.apache.olingo.server.api.edm.provider.PropertyRef;
-import org.apache.olingo.server.api.edm.provider.ReferentialConstraint;
-
-public class EntityTypeProvider {
-
- public static final FullQualifiedName nameETAllKey = new FullQualifiedName(SchemaProvider.nameSpace, "ETAllKey");
- public static final FullQualifiedName nameETAllNullable = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETAllNullable");
- public static final FullQualifiedName nameETAllPrim = new FullQualifiedName(SchemaProvider.nameSpace, "ETAllPrim");
- public static final FullQualifiedName nameETBase = new FullQualifiedName(SchemaProvider.nameSpace, "ETBase");
- public static final FullQualifiedName nameETBaseTwoKeyNav = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETBaseTwoKeyNav");
- public static final FullQualifiedName nameETBaseTwoKeyTwoPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "ETBaseTwoKeyTwoPrim");
- public static final FullQualifiedName nameETCollAllPrim = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETCollAllPrim");
- public static final FullQualifiedName nameETCompAllPrim = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETCompAllPrim");
- public static final FullQualifiedName nameETCompCollAllPrim = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETCompCollAllPrim");
- public static final FullQualifiedName nameETCompCollComp = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETCompCollComp");
- public static final FullQualifiedName nameETCompComp = new FullQualifiedName(SchemaProvider.nameSpace, "ETCompComp");
- public static final FullQualifiedName nameETCompMixPrimCollComp =
- new FullQualifiedName(SchemaProvider.nameSpace, "ETCompMixPrimCollComp");
- public static final FullQualifiedName nameETFourKeyAlias = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETFourKeyAlias");
- public static final FullQualifiedName nameETKeyNav = new FullQualifiedName(SchemaProvider.nameSpace, "ETKeyNav");
- public static final FullQualifiedName nameETKeyPrimNav = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETKeyPrimNav");
- public static final FullQualifiedName nameETKeyTwoKeyComp = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETKeyTwoKeyComp");
- public static final FullQualifiedName nameETMedia = new FullQualifiedName(SchemaProvider.nameSpace, "ETMedia");
- public static final FullQualifiedName nameETMixPrimCollComp = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETMixPrimCollComp");
- public static final FullQualifiedName nameETServerSidePaging =
- new FullQualifiedName(SchemaProvider.nameSpace, "ETServerSidePaging");
- public static final FullQualifiedName nameETTwoBase = new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoBase");
- public static final FullQualifiedName nameETTwoBaseTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoBaseTwoKeyNav");
- public static final FullQualifiedName nameETTwoBaseTwoKeyTwoPrim =
- new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoBaseTwoKeyTwoPrim");
- public static final FullQualifiedName nameETTwoKeyNav =
- new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoKeyNav");
- public static final FullQualifiedName nameETTwoKeyTwoPrim = new FullQualifiedName(SchemaProvider.nameSpace,
- "ETTwoKeyTwoPrim");
- public static final FullQualifiedName nameETTwoPrim = new FullQualifiedName(SchemaProvider.nameSpace, "ETTwoPrim");
-
- public EntityType getEntityType(final FullQualifiedName entityTypeName) throws ODataException {
- if (entityTypeName.equals(nameETAllPrim)) {
- return new EntityType()
- .setName("ETAllPrim")
- .setKey(Arrays.asList(
- new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString,
- PropertyProvider.propertyBoolean, PropertyProvider.propertyByte, PropertyProvider.propertySByte,
- PropertyProvider.propertyInt32, PropertyProvider.propertyInt64,
- PropertyProvider.propertySingle, PropertyProvider.propertyDouble, PropertyProvider.propertyDecimal,
- PropertyProvider.propertyBinary, PropertyProvider.propertyDate, PropertyProvider.propertyDateTimeOffset,
- PropertyProvider.propertyDuration, PropertyProvider.propertyGuid, PropertyProvider.propertyTimeOfDay
- /* TODO add propertyStream */))
- .setNavigationProperties(Arrays.asList(PropertyProvider.navPropertyETTwoPrimOne_ETTwoPrim,
- PropertyProvider.collectionNavPropertyETTwoPrimMany_ETTwoPrim));
-
- } else if (entityTypeName.equals(nameETCollAllPrim)) {
- return new EntityType()
- .setName("ETCollAllPrim")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
-
- .setProperties(
- Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.collPropertyString,
- PropertyProvider.collPropertyBoolean, PropertyProvider.collPropertyByte,
- PropertyProvider.collPropertySByte, PropertyProvider.collPropertyInt16,
- PropertyProvider.collPropertyInt32, PropertyProvider.collPropertyInt64,
- PropertyProvider.collPropertySingle, PropertyProvider.collPropertyDouble,
- PropertyProvider.collPropertyDecimal, PropertyProvider.collPropertyBinary,
- PropertyProvider.collPropertyDate, PropertyProvider.collPropertyDateTimeOffset,
- PropertyProvider.collPropertyDuration, PropertyProvider.collPropertyGuid,
- PropertyProvider.collPropertyTimeOfDay /* TODO add propertyStream */));
-
- } else if (entityTypeName.equals(nameETTwoPrim)) {
- return new EntityType()
- .setName("ETTwoPrim")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString))
- .setNavigationProperties(
- Arrays.asList(PropertyProvider.navPropertyETAllPrimOne_ETAllPrim,
- PropertyProvider.collectionNavPropertyETAllPrimMany_ETAllPrim));
-
- } else if (entityTypeName.equals(nameETMixPrimCollComp)) {
- return new EntityType()
- .setName("ETMixPrimCollComp")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.collPropertyString,
- PropertyProvider.propertyComplex_CTTwoPrim, PropertyProvider.collPropertyComplex_CTTwoPrim));
-
- } else if (entityTypeName.equals(nameETTwoKeyTwoPrim)) {
- return new EntityType()
- .setName("ETTwoKeyTwoPrim")
- .setKey(Arrays.asList(
- new PropertyRef().setPropertyName("PropertyInt16"),
- new PropertyRef().setPropertyName("PropertyString")))
- .setProperties(Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString));
-
- } else if (entityTypeName.equals(nameETBaseTwoKeyTwoPrim)) {
- return new EntityType()
- .setName("ETBaseTwoKeyTwoPrim")
- .setBaseType(nameETTwoKeyTwoPrim);
-
- } else if (entityTypeName.equals(nameETTwoBaseTwoKeyTwoPrim)) {
- return new EntityType()
- .setName("ETTwoBaseTwoKeyTwoPrim")
- .setBaseType(nameETTwoKeyTwoPrim);
-
- } else if (entityTypeName.equals(nameETBase)) {
- return new EntityType()
- .setName("ETBase")
- .setBaseType(nameETTwoPrim)
- .setProperties(Arrays.asList(new Property()
- .setName("AdditionalPropertyString_5")
- .setType(PropertyProvider.nameString)));
-
- } else if (entityTypeName.equals(nameETTwoBase)) {
- return new EntityType()
- .setName("ETTwoBase")
- .setBaseType(nameETBase)
- .setProperties(Arrays.asList(new Property()
- .setName("AdditionalPropertyString_6")
- .setType(PropertyProvider.nameString))
- );
-
- } else if (entityTypeName.equals(nameETAllKey)) {
- return new EntityType()
- .setName("ETAllKey")
- .setKey(Arrays.asList(
- new PropertyRef().setPropertyName("PropertyString"),
- new PropertyRef().setPropertyName("PropertyBoolean"),
- new PropertyRef().setPropertyName("PropertyByte"),
- new PropertyRef().setPropertyName("PropertySByte"),
- new PropertyRef().setPropertyName("PropertyInt16"),
- new PropertyRef().setPropertyName("PropertyInt32"),
- new PropertyRef().setPropertyName("PropertyInt64"),
- new PropertyRef().setPropertyName("PropertyDecimal"),
- new PropertyRef().setPropertyName("PropertyDate"),
- new PropertyRef().setPropertyName("PropertyDateTimeOffset"),
- new PropertyRef().setPropertyName("PropertyDuration"),
- new PropertyRef().setPropertyName("PropertyGuid"),
- new PropertyRef().setPropertyName("PropertyTimeOfDay")))
- .setProperties(
- Arrays.asList(
- PropertyProvider.propertyString_NotNullable, PropertyProvider.propertyBoolean_NotNullable,
- PropertyProvider.propertyByte_NotNullable, PropertyProvider.propertySByte_NotNullable,
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyInt32_NotNullable,
- PropertyProvider.propertyInt64_NotNullable,
- PropertyProvider.propertyDecimal_NotNullable, PropertyProvider.propertyDate_NotNullable,
- PropertyProvider.propertyDateTimeOffset_NotNullable,
- PropertyProvider.propertyDuration_NotNullable, PropertyProvider.propertyGuid_NotNullable,
- PropertyProvider.propertyTimeOfDay_NotNullable /* TODO add propertyStream */));
-
- } else if (entityTypeName.equals(nameETCompAllPrim)) {
- return new EntityType()
- .setName("ETCompAllPrim")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(
- Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTAllPrim));
-
- } else if (entityTypeName.equals(nameETCompCollAllPrim)) {
- return new EntityType()
- .setName("ETCompCollAllPrim")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
-
- .setProperties(
- Arrays.asList(PropertyProvider.propertyInt16_NotNullable,
- PropertyProvider.propertyComplex_CTCollAllPrim));
-
- } else if (entityTypeName.equals(nameETCompComp)) {
- return new EntityType()
- .setName("ETCompComp")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(
- Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTCompComp));
-
- } else if (entityTypeName.equals(nameETCompCollComp)) {
- return new EntityType()
- .setName("ETCompCollComp")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(
- Arrays
- .asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTCompCollComp));
-
- } else if (entityTypeName.equals(nameETMedia)) {
- return new EntityType()
- .setName("ETMedia")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(Arrays.asList(PropertyProvider.propertyInt16_NotNullable))
- .setHasStream(true);
-
- } else if (entityTypeName.equals(nameETKeyTwoKeyComp)) {
- return new EntityType()
- .setName("ETKeyTwoKeyComp")
- .setKey(Arrays.asList(
- new PropertyRef()
- .setPropertyName("PropertyInt16"),
- new PropertyRef()
- .setPropertyName("PropertyComplex/PropertyInt16")
- .setAlias("KeyAlias1"),
- new PropertyRef()
- .setPropertyName("PropertyComplex/PropertyString")
- .setAlias("KeyAlias2"),
- new PropertyRef()
- .setPropertyName("PropertyComplexComplex/PropertyComplex/PropertyString")
- .setAlias("KeyAlias3")))
- .setProperties(
- Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTTwoPrim,
- PropertyProvider.propertyComplexComplex_CTCompComp));
-
- } else if (entityTypeName.equals(nameETServerSidePaging)) {
- return new EntityType()
- .setName(nameETServerSidePaging.getName())
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(Arrays.asList(PropertyProvider.propertyInt16_NotNullable,
- PropertyProvider.propertyString_NotNullable));
-
- } else if (entityTypeName.equals(nameETAllNullable)) {
- return new EntityType()
- .setName("ETAllNullable")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyKey")))
- .setProperties(
- Arrays.asList(
- new Property()
- .setName("PropertyKey").setType(PropertyProvider.nameInt16).setNullable(false),
- PropertyProvider.propertyInt16_ExplicitNullable, PropertyProvider.propertyString_ExplicitNullable,
- PropertyProvider.propertyBoolean_ExplicitNullable, PropertyProvider.propertyByte_ExplicitNullable,
- PropertyProvider.propertySByte_ExplicitNullable, PropertyProvider.propertyInt32_ExplicitNullable,
- PropertyProvider.propertyInt64_ExplicitNullable, PropertyProvider.propertySingle_ExplicitNullable,
- PropertyProvider.propertyDouble_ExplicitNullable, PropertyProvider.propertyDecimal_ExplicitNullable,
- PropertyProvider.propertyBinary_ExplicitNullable, PropertyProvider.propertyDate_ExplicitNullable,
- PropertyProvider.propertyDateTimeOffset_ExplicitNullable,
- PropertyProvider.propertyDuration_ExplicitNullable, PropertyProvider.propertyGuid_ExplicitNullable,
- PropertyProvider.propertyTimeOfDay_ExplicitNullable /* TODO add propertyStream */,
- PropertyProvider.collPropertyString_ExplicitNullable,
- PropertyProvider.collPropertyBoolean_ExplicitNullable,
- PropertyProvider.collPropertyByte_ExplicitNullable,
- PropertyProvider.collPropertySByte_ExplicitNullable,
- PropertyProvider.collPropertyInt16_ExplicitNullable,
- PropertyProvider.collPropertyInt32_ExplicitNullable,
- PropertyProvider.collPropertyInt64_ExplicitNullable,
- PropertyProvider.collPropertySingle_ExplicitNullable,
- PropertyProvider.collPropertyDouble_ExplicitNullable,
- PropertyProvider.collPropertyDecimal_ExplicitNullable,
- PropertyProvider.collPropertyBinary_ExplicitNullable,
- PropertyProvider.collPropertyDate_ExplicitNullable,
- PropertyProvider.collPropertyDateTimeOffset_ExplicitNullable,
- PropertyProvider.collPropertyDuration_ExplicitNullable,
- PropertyProvider.collPropertyGuid_ExplicitNullable,
- PropertyProvider.collPropertyTimeOfDay_ExplicitNullable /* TODO add propertyStream */));
-
- } else if (entityTypeName.equals(nameETKeyNav)) {
- return new EntityType()
- .setName("ETKeyNav")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(
- Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
- PropertyProvider.propertyComplex_CTNavFiveProp,
- PropertyProvider.propertyComplexAllPrim_CTAllPrim, PropertyProvider.propertyComplexTwoPrim_CTTwoPrim,
- PropertyProvider.collPropertyString, PropertyProvider.collPropertyInt16,
- PropertyProvider.collPropertyComplex_CTPrimComp,
- new Property()
- .setName("PropertyComplexComplex").setType(ComplexTypeProvider.nameCTCompNav)
- ))
- .setNavigationProperties(
- Arrays.asList(
- PropertyProvider.navPropertyETTwoKeyNavOne_ETTwoKeyNav_NotNullable,
- PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav,
- PropertyProvider.navPropertyETKeyNavOne_ETKeyNav,
- PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav,
- PropertyProvider.navPropertyETMediaOne_ETMedia,
- PropertyProvider.collectionNavPropertyETMediaMany_ETMedia
- ));
- } else if (entityTypeName.equals(nameETKeyPrimNav)) {
- return new EntityType()
- .setName("ETKeyPrimNav")
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_ExplicitNullable))
- .setNavigationProperties(
- Arrays.asList(
- PropertyProvider.navPropertyETKeyPrimNavOne_ETKeyPrimNav));
-
- } else if (entityTypeName.equals(nameETTwoKeyNav)) {
- return new EntityType()
- .setName("ETTwoKeyNav")
- .setKey(Arrays.asList(
- new PropertyRef().setPropertyName("PropertyInt16"),
- new PropertyRef().setPropertyName("PropertyString")))
- .setProperties(
- Arrays.asList(
- PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
- PropertyProvider.propertyComplex_CTPrimComp_NotNullable,
- new Property().setName("PropertyComplexNav").setType(ComplexTypeProvider.nameCTBasePrimCompNav)
- .setNullable(false),
- PropertyProvider.propertyComplexEnum_CTPrimEnum_NotNullable,
- PropertyProvider.collPropertyComplex_CTPrimComp,
- new Property().setName("CollPropertyComplexNav").setType(ComplexTypeProvider.nameCTNavFiveProp)
- .setCollection(true),
- PropertyProvider.collPropertyString, PropertyProvider.propertyComplexTwoPrim_CTTwoPrim,
- PropertyProvider.propertyEnumString_ENString
- ))
- .setNavigationProperties(Arrays.asList(
- new NavigationProperty()
- .setName("NavPropertyETKeyNavOne")
- .setType(nameETKeyNav)
- .setReferentialConstraints(Arrays.asList(
- new ReferentialConstraint()
- .setProperty("PropertyInt16")
- .setReferencedProperty("PropertyInt16"))),
- PropertyProvider.collectionNavPropertyETKeyNavMany_ETKeyNav,
- PropertyProvider.navPropertyETTwoKeyNavOne_ETTwoKeyNav,
- PropertyProvider.collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav));
-
- } else if (entityTypeName.equals(nameETBaseTwoKeyNav)) {
- return new EntityType()
- .setName("ETBaseTwoKeyNav")
- .setBaseType(nameETTwoKeyNav)
- .setProperties(Arrays.asList(PropertyProvider.propertyDate_ExplicitNullable))
- .setNavigationProperties(Arrays.asList(
- new NavigationProperty()
- .setName("NavPropertyETBaseTwoKeyNavOne")
- .setType(nameETBaseTwoKeyNav),
- new NavigationProperty()
- .setName("NavPropertyETTwoBaseTwoKeyNavOne")
- .setType(nameETTwoBaseTwoKeyNav)));
-
- } else if (entityTypeName.equals(nameETTwoBaseTwoKeyNav)) {
- return new EntityType()
- .setName("ETTwoBaseTwoKeyNav")
- .setBaseType(nameETBaseTwoKeyNav)
- .setKey(Arrays.asList(new PropertyRef().setPropertyName("PropertyInt16")))
- .setProperties(Arrays.asList(PropertyProvider.propertyGuid_ExplicitNullable))
- .setNavigationProperties(Arrays.asList(
- new NavigationProperty()
- .setName("NavPropertyETBaseTwoKeyNavMany")
- .setType(nameETBaseTwoKeyNav)
- .setCollection(true)
- ));
-
- } else if (entityTypeName.equals(nameETFourKeyAlias)) {
- return new EntityType()
- .setName("ETFourKeyAlias")
- .setKey(
- Arrays.asList(
- new PropertyRef().setPropertyName("PropertyInt16"),
- new PropertyRef().setPath("PropertyComplex/PropertyInt16").setPropertyName("PropertyInt16").setAlias(
- "KeyAlias1"),
- new PropertyRef().setPath("PropertyComplex/PropertyString").setPropertyName("PropertyString")
- .setAlias("KeyAlias2"),
- new PropertyRef().setPath("PropertyComplexComplex/PropertyComplex/PropertyString").setPropertyName(
- "PropertyString").setAlias("KeyAlias3"))).setProperties(
- Arrays.asList(PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyComplex_CTTwoPrim,
- PropertyProvider.propertyComplexComplex_CTCompComp));
- } else if (entityTypeName.equals(nameETCompMixPrimCollComp)) {
- return new EntityType()
- .setName("ETCompMixPrimCollComp")
- .setKey(Arrays.asList(
- new PropertyRef()
- .setPropertyName("PropertyInt16")))
- .setProperties(
- Arrays.asList(PropertyProvider.propertyInt16_NotNullable,
- PropertyProvider.propertyMixedPrimCollComp_CTMixPrimCollComp));
- }
-
- return null;
- }
-}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EnumTypeProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EnumTypeProvider.java b/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EnumTypeProvider.java
deleted file mode 100644
index 2583782..0000000
--- a/lib/server-ref/src/main/java/org/apache/olingo/server/ref/provider/EnumTypeProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.ref.provider;
-
-import java.util.Arrays;
-
-import org.apache.olingo.commons.api.ODataException;
-import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
-import org.apache.olingo.commons.api.edm.FullQualifiedName;
-import org.apache.olingo.server.api.edm.provider.EnumMember;
-import org.apache.olingo.server.api.edm.provider.EnumType;
-
-public class EnumTypeProvider {
-
- public static final FullQualifiedName nameENString = new FullQualifiedName(SchemaProvider.nameSpace, "ENString");
-
- public EnumType getEnumType(final FullQualifiedName enumTypeName) throws ODataException {
- if (enumTypeName.equals(nameENString)) {
- return new EnumType()
- .setName("ENString")
- .setFlags(true)
- .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName())
- .setMembers(Arrays.asList(
- new EnumMember().setName("String1").setValue("1"),
- new EnumMember().setName("String2").setValue("2"),
- new EnumMember().setName("String3").setValue("3")));
- }
-
- return null;
- }
-}
[28/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
----------------------------------------------------------------------
diff --git a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java b/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
deleted file mode 100644
index 1478cfe..0000000
--- a/lib/server-ref/src/test/java/org/apache/olingo/server/core/uri/antlr/TestFullResourcePath.java
+++ /dev/null
@@ -1,5110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.olingo.server.core.uri.antlr;
-
-import java.io.UnsupportedEncodingException;
-import java.util.Arrays;
-
-import org.apache.olingo.commons.api.ODataApplicationException;
-import org.apache.olingo.commons.api.edm.Edm;
-import org.apache.olingo.commons.core.Encoder;
-import org.apache.olingo.server.api.uri.UriInfoKind;
-import org.apache.olingo.server.api.uri.UriResourceKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.BinaryOperatorKind;
-import org.apache.olingo.server.api.uri.queryoption.expression.ExpressionVisitException;
-import org.apache.olingo.server.api.uri.queryoption.expression.MethodKind;
-import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
-import org.apache.olingo.server.core.uri.parser.UriParserException;
-import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
-import org.apache.olingo.server.core.uri.testutil.FilterValidator;
-import org.apache.olingo.server.core.uri.testutil.ResourceValidator;
-import org.apache.olingo.server.core.uri.testutil.TestUriValidator;
-import org.apache.olingo.server.ref.provider.ComplexTypeProvider;
-import org.apache.olingo.server.ref.provider.EntityTypeProvider;
-import org.apache.olingo.server.ref.provider.EnumTypeProvider;
-import org.apache.olingo.server.ref.provider.PropertyProvider;
-import org.junit.Test;
-
-public class TestFullResourcePath {
- Edm edm = null;
- TestUriValidator testUri = null;
- ResourceValidator testRes = null;
- FilterValidator testFilter = null;
-
- public TestFullResourcePath() {
- edm = new EdmProviderImpl(new EdmTechTestProvider());
- testUri = new TestUriValidator().setEdm(edm);
- testRes = new ResourceValidator().setEdm(edm);
- testFilter = new FilterValidator().setEdm(edm);
- }
-
- @Test
- public void test() throws UriParserException {
-
- }
-
- @Test
- public void testFunctionBound_varOverloading() {
- // on ESTwoKeyNav
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- // with string parameter
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='ABC')").goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- // with string parameter
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()").goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
- }
-
- @Test
- public void runBfuncBnCpropCastRtEs() {
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESBaseTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, false)
- .n()
- .isFunction("BFCCTPrimCompRTESBaseTwoKeyNav");
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESBaseTwoKeyNav()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, false)
- .n()
- .isFunction("BFCCTPrimCompRTESBaseTwoKeyNav")
- .isType(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isUriPathInfoKind(UriResourceKind.count);
-
- }
-
- @Test
- public void runBfuncBnCpropCollRtEs() {
- testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComplex/com.sap.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isUriPathInfoKind(UriResourceKind.complexProperty)
- .isComplex("CollPropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .n()
- .isFunction("BFCCollCTPrimCompRTESAllPrim");
-
- testUri
- .run("ESKeyNav(PropertyInt16=1)/CollPropertyComplex/com.sap.odata.test1.BFCCollCTPrimCompRTESAllPrim()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isUriPathInfoKind(UriResourceKind.complexProperty)
- .isComplex("CollPropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .n()
- .isFunction("BFCCollCTPrimCompRTESAllPrim")
- .isType(EntityTypeProvider.nameETAllPrim, true)
- .n()
- .isUriPathInfoKind(UriResourceKind.count);
- }
-
- @Test
- public void runBfuncBnCpropRtEs() {
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')"
- + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isUriPathInfoKind(UriResourceKind.complexProperty)
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, false)
- .n()
- .isFunction("BFCCTPrimCompRTESTwoKeyNav");
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')"
- + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESTwoKeyNav()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isUriPathInfoKind(UriResourceKind.complexProperty)
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, false)
- .n()
- .isFunction("BFCCTPrimCompRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .n()
- .isUriPathInfoKind(UriResourceKind.count);
-
- }
-
- @Test
- public void runBfuncBnEntityRtEs() {
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isFunction("BFCETTwoKeyNavRTESTwoKeyNav");
- }
-
- @Test
- public void runBfuncBnEntityCastRtEs() {
- testUri
- .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/com.sap.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
-
- testUri
- .run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='(''2'')')"
- + "/com.sap.odata.test1.BFCETBaseTwoKeyNavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'(''2'')'")
- .n()
- .isFunction("BFCETBaseTwoKeyNavRTESTwoKeyNav");
- }
-
- @Test
- public void runBfuncBnEsCastRtEs() {
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/com.sap.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey");
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/com.sap.odata.test1.BFCESBaseTwoKeyNavRTESBaseTwoKey()"
- + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isFunction("BFCESBaseTwoKeyNavRTESBaseTwoKey")
- .isType(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
- testUri.run("ESTwoKeyNav"
- + "/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()"
- + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')"
- + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
- }
-
- @Test
- public void runBfuncBnEsRtCprop() {
- testUri.run("ESAllPrim/com.sap.odata.test1.BFCESAllPrimRTCTAllPrim()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .n()
- .isFunction("BFCESAllPrimRTCTAllPrim")
- .isType(ComplexTypeProvider.nameCTAllPrim);
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCTTwoPrim()/com.sap.odata.test1.CTBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCTTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim, false)
- .isTypeFilterOnEntry(ComplexTypeProvider.nameCTBase);
- }
-
- @Test
- public void runBfuncBnEsRtCpropColl() {
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollCTTwoPrim()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCollCTTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim, true)
- .n()
- .isUriPathInfoKind(UriResourceKind.count);
- }
-
- @Test
- public void runBfuncBnEsRtEntityPpNp() {
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
- .n()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()/NavPropertyETKeyNavOne/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
- .n()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .n()
- .isUriPathInfoKind(UriResourceKind.ref);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/NavPropertyETMediaOne/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
- .n()
- .isValue();
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
- + "/NavPropertyETTwoKeyNavOne")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNavParam")
- .isParameter(0, "ParameterString", "'1'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
- + "/NavPropertyETTwoKeyNavOne/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNavParam")
- .isParameter(0, "ParameterString", "'1'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
- + "/NavPropertyETTwoKeyNavOne/PropertyComplex/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNavParam")
- .isParameter(0, "ParameterString", "'1'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp)
- .n()
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTAllPrim);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
- + "/NavPropertyETTwoKeyNavOne/PropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNavParam")
- .isParameter(0, "ParameterString", "'1'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
- + "/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/PropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNavParam")
- .isParameter(0, "ParameterString", "'1'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
- }
-
- @Test
- public void runBfuncBnEsRtEntyPpNpCast() {
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTTwoKeyNav()"
- + "/NavPropertyETTwoKeyNavOne/com.sap.odata.test1.ETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTTwoKeyNav")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
- testUri
- .run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')"
- + "/NavPropertyETTwoKeyNavOne/com.sap.odata.test1.ETTwoBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
- }
-
- @Test
- public void runBfuncBnEsRtEntityPpCp() {
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTNavFiveProp);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComplex/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTNavFiveProp)
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyComplex/PropertyInt16/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isComplex("PropertyComplex")
- .isType(ComplexTypeProvider.nameCTNavFiveProp)
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
- .n()
- .isValue();
-
- }
-
- @Test
- public void runBfuncBnEsRtEntyPpCpCast() {
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
- + "/PropertyComplexTwoPrim/com.sap.odata.test1.CTTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNavParam")
- .isParameter(0, "ParameterString", "'1'")
- .n()
- .isComplex("PropertyComplexTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim)
- .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNavParam(ParameterString='1')"
- + "/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
- + "/PropertyComplexTwoPrim/com.sap.odata.test1.CTTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNavParam")
- .isParameter(0, "ParameterString", "'1'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isComplex("PropertyComplexTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim)
- .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
- }
-
- @Test
- public void runBfuncBnEsRtEntityPpSp() {
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESKeyNavRTETKeyNav()/PropertyInt16/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESKeyNavRTETKeyNav")
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false)
- .n()
- .isValue();
-
- }
-
- @Test
- public void runBfuncBnEsRtEs() {
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isParameter(0, "ParameterString", "'2'")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- testUri.run("ESKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav(ParameterString='3')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isParameter(0, "ParameterString", "'3'")
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .n()
- .isCount();
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()(PropertyInt16=1,PropertyString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'");
-
- }
-
- @Test
- public void runBfuncBnEsRtEsBa() {
-
- testUri.run("ESKeyNav(PropertyInt16=1)/CollPropertyComplex"
- + "/com.sap.odata.test1.BFCCollCTPrimCompRTESAllPrim()/com.sap.odata.test1.BAESAllPrimRTETAllPrim")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isComplex("CollPropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp)
- .n()
- .isFunction("BFCCollCTPrimCompRTESAllPrim")
- .n()
- .isAction("BAESAllPrimRTETAllPrim");
-
- }
-
- @Test
- public void runBfuncBnEsRtPrim() {
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTString()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTString");
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTString()/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTString")
- .isType(PropertyProvider.nameString)
- .n()
- .isValue();
- }
-
- @Test
- public void runbfuncBnEsRtPrimColl() {
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollString()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCollString")
- .isType(PropertyProvider.nameString, true);
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTCollString()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isFunction("BFCESTwoKeyNavRTCollString")
- .isType(PropertyProvider.nameString, true)
- .n()
- .isCount();
- }
-
- @Test
- public void runBfuncBnPpropCollRtEs() {
- testUri.run("ESKeyNav(1)/CollPropertyString/com.sap.odata.test1.BFCCollStringRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
- .n()
- .isFunction("BFCCollStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true);
-
- testUri.run("ESKeyNav(1)/CollPropertyString/com.sap.odata.test1.BFCCollStringRTESTwoKeyNav()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
- .n()
- .isFunction("BFCCollStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .n()
- .isCount();
- }
-
- @Test
- public void runBfuncBnPpropRtEs() {
-
- testUri.run("ESKeyNav(1)/PropertyString/com.sap.odata.test1.BFCStringRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
- .n()
- .isFunction("BFCStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true);
-
- testUri.run("ESKeyNav(1)/PropertyString/com.sap.odata.test1.BFCStringRTESTwoKeyNav()/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
- .n()
- .isFunction("BFCStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .n()
- .isCount();
-
- testUri.run("ESKeyNav(1)/PropertyString/com.sap.odata.test1.BFCStringRTESTwoKeyNav()/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false)
- .n()
- .isFunction("BFCStringRTESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .n()
- .isRef();
- }
-
- @Test
- public void runBfuncBnSingleRtEs() {
-
- testUri.run("SINav/com.sap.odata.test1.BFCSINavRTESTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isFunction("BFCSINavRTESTwoKeyNav");
- }
-
- @Test
- public void runBfuncBnSingleCastRtEs() {
- testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/com.sap.odata.test1.BFCETBaseTwoKeyNavRTESBaseTwoKey()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isFunction("BFCETBaseTwoKeyNavRTESBaseTwoKey");
- }
-
- @Test
- public void runActionBound_on_EntityEntry() {
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isAction("BAETTwoKeyNavRTETTwoKeyNav");
-
- testUri.run("ESKeyNav(PropertyInt16=1)/com.sap.odata.test1.BAETTwoKeyNavRTETTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isAction("BAETTwoKeyNavRTETTwoKeyNav");
- }
-
- @Test
- public void runActionBound_on_EntityCollection() {
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BAESTwoKeyNavRTESTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .n()
- .isAction("BAESTwoKeyNavRTESTwoKeyNav");
- }
-
- @Test
- public void runFunctionBound_on_var_Types() {
-
- // on primitive
- testUri.run("ESAllPrim(1)/PropertyString/com.sap.odata.test1.BFCStringRTESTwoKeyNav()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETAllPrim, false)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.primitiveProperty)
- .isType(PropertyProvider.nameString);
-
- // on collection of primitive
- testUri.run("ESCollAllPrim(1)/CollPropertyString/com.sap.odata.test1.BFCCollStringRTESTwoKeyNav()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETCollAllPrim, false)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.primitiveProperty)
- .isType(PropertyProvider.nameString);
-
- // on complex
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
- + "/PropertyComplex/com.sap.odata.test1.BFCCTPrimCompRTESTwoKeyNav()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.complexProperty)
- .at(2)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- // on collection of complex
- testUri.run("ESKeyNav(1)/CollPropertyComplex/com.sap.odata.test1.BFCCollCTPrimCompRTESAllPrim()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .at(1)
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .at(2)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETAllPrim);
-
- // on entity
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='ABC')"
- + "/com.sap.odata.test1.BFCETTwoKeyNavRTESTwoKeyNav()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .at(1)
- .isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
-
- // on collection of entity
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.BFCESTwoKeyNavRTESTwoKeyNav()")
- .goPath()
- .at(0)
- .isUriPathInfoKind(UriResourceKind.entitySet)
- .isType(EntityTypeProvider.nameETTwoKeyNav, true)
- .at(1).isUriPathInfoKind(UriResourceKind.function)
- .isType(EntityTypeProvider.nameETTwoKeyNav);
- }
-
- @Test
- public void runActionBound_on_EntityCast() {
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/com.sap.odata.test1.BAETBaseTwoKeyNavRTETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isAction("BAETBaseTwoKeyNavRTETBaseTwoKeyNav");
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')"
- + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav/com.sap.odata.test1.BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
- .n()
- .isAction("BAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav");
- }
-
- @Test
- public void runCrossjoin() {
- testUri.run("$crossjoin(ESKeyNav)")
- .isKind(UriInfoKind.crossjoin)
- .isCrossJoinEntityList(Arrays.asList("ESKeyNav"));
-
- testUri.run("$crossjoin(ESKeyNav, ESTwoKeyNav)")
- .isKind(UriInfoKind.crossjoin)
- .isCrossJoinEntityList(Arrays.asList("ESKeyNav", "ESTwoKeyNav"));
- }
-
- @Test
- public void runCrossjoinError() {
- testUri.runEx("$crossjoin").isExSyntax(0);
- testUri.runEx("$crossjoin/error").isExSyntax(0);
- testUri.runEx("$crossjoin()").isExSyntax(0);
- // testUri.runEx("$crossjoin(ESKeyNav, ESTwoKeyNav)/invalid").isExSyntax(0);
- }
-
- @Test
- public void runEntityId() {
- testUri.run("$entity?$id=ESKeyNav(1)")
- .isKind(UriInfoKind.entityId)
- .isIdText("ESKeyNav(1)");
- testUri.run("$entity/com.sap.odata.test1.ETKeyNav?$id=ESKeyNav(1)")
- .isKind(UriInfoKind.entityId)
- .isEntityType(EntityTypeProvider.nameETKeyNav)
- .isIdText("ESKeyNav(1)");
- }
-
- @Test
- public void runEntityIdError() {
- // TODO planned: move to validator
- // testUri.runEx("$entity").isExSyntax(0);
- // testUri.runEx("$entity?$idfalse=ESKeyNav(1)").isExSyntax(0);
- // testUri.runEx("$entity/com.sap.odata.test1.invalidType?$id=ESKeyNav(1)").isExSemantic(0);
- // testUri.runEx("$entity/invalid?$id=ESKeyNav(1)").isExSyntax(0);
- }
-
- @Test
- public void runEsName() {
- testUri.run("ESAllPrim")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isType(EntityTypeProvider.nameETAllPrim, true);
-
- testUri.run("ESAllPrim/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isType(EntityTypeProvider.nameETAllPrim, true)
- .n()
- .isCount();
- }
-
- @Test
- public void runEsNameError() {
-
- testUri.runEx("ESAllPrim/$count/$ref").isExSemantic(0);
- testUri.runEx("ESAllPrim/$ref/$count").isExSemantic(0);
- testUri.runEx("ESAllPrim/$ref/invalid").isExSemantic(0);
- testUri.runEx("ESAllPrim/$count/invalid").isExSemantic(0);
- testUri.runEx("ESAllPrim(1)/whatever").isExSemantic(0);
- // testUri.runEx("ESAllPrim(PropertyInt16='1')").isExSemantic(0);
- testUri.runEx("ESAllPrim(PropertyInt16)").isExSemantic(0);
- testUri.runEx("ESAllPrim(PropertyInt16=)").isExSyntax(0);
- testUri.runEx("ESAllPrim(PropertyInt16=1,Invalid='1')").isExSemantic(0);
-
- testUri.runEx("ETBaseTwoKeyTwoPrim/com.sap.odata.test1.ETBaseTwoKeyTwoPrim"
- + "/com.sap.odata.test1.ETTwoBaseTwoKeyTwoPrim").isExSemantic(0);
-
- testUri.runEx("ETBaseTwoKeyTwoPrim/com.sap.odata.test1.ETBaseTwoKeyTwoPrim(1)/com.sap.odata.test1.ETAllKey")
- .isExSemantic(0);
-
- testUri.runEx("ETBaseTwoKeyTwoPrim(1)/com.sap.odata.test1.ETBaseTwoKeyTwoPrim('1')/com.sap.odata.test1.ETAllKey")
- .isExSemantic(0);
-
- testUri.runEx("ETBaseTwoKeyTwoPrim(1)/com.sap.odata.test1.ETBaseTwoKeyTwoPrim"
- + "/com.sap.odata.test1.ETTwoBaseTwoKeyTwoPrim")
- .isExSemantic(0);
-
- testUri.runEx("ETBaseTwoKeyTwoPrim/com.sap.odata.test1.ETBaseTwoKeyTwoPrim"
- + "/com.sap.odata.test1.ETTwoBaseTwoKeyTwoPrim(1)")
- .isExSemantic(0);
-
- testUri.runEx("ETBaseTwoKeyTwoPrim/com.sap.odata.test1.ETAllKey")
- .isExSemantic(0);
-
- testUri.runEx("ETBaseTwoKeyTwoPrim()")
- .isExSemantic(0);
-
- testUri.runEx("ESAllNullable(1)/CollPropertyString/$value")
- .isExSemantic(0);
-
- testUri.runEx("ETMixPrimCollComp(1)/ComplexProperty/$value").isExSemantic(0);
- }
-
- @Test
- public void runEsNameCast() {
- testUri.run("ESTwoPrim/com.sap.odata.test1.ETBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, true)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
-
- testUri.run("ESTwoPrim/com.sap.odata.test1.ETBase(-32768)/com.sap.odata.test1.ETTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, false)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase)
- .isKeyPredicate(0, "PropertyInt16", "-32768")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
-
- testUri.run("ESTwoPrim/com.sap.odata.test1.ETTwoBase(-32768)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, false)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
- .isKeyPredicate(0, "PropertyInt16", "-32768");
-
- testUri.run("ESTwoPrim/Namespace1_Alias.ETTwoBase(-32768)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim, false)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase)
- .isKeyPredicate(0, "PropertyInt16", "-32768");
-
- }
-
- @Test
- public void runEsNamePpSpCast() {
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyDate")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isPrimitiveProperty("PropertyDate", PropertyProvider.nameDate, false);
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyComplex/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
- }
-
- @Test
- public void runEsNameKey() {
- testUri.run("ESCollAllPrim(1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESCollAllPrim");
-
- testUri.run("ESCollAllPrim(PropertyInt16=1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESCollAllPrim");
-
- testUri.run("ESFourKeyAlias(PropertyInt16=1,KeyAlias1=2,KeyAlias2='3',KeyAlias3='4')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESFourKeyAlias")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "KeyAlias1", "2")
- .isKeyPredicate(2, "KeyAlias2", "'3'")
- .isKeyPredicate(3, "KeyAlias3", "'4'");
-
- testUri.run("ESCollAllPrim(null)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESCollAllPrim");
- }
-
- @Test
- public void runEsNameParaKeys() throws UnsupportedEncodingException {
- testUri.run(encode("ESAllKey(PropertyString='O''Neil',PropertyBoolean=true,PropertyByte=255,"
- + "PropertySByte=-128,PropertyInt16=-32768,PropertyInt32=-2147483648,"
- + "PropertyInt64=-9223372036854775808,PropertyDecimal=0.1,PropertyDate=2013-09-25,"
- + "PropertyDateTimeOffset=2002-10-10T12:00:00-05:00,"
- + "PropertyDuration=duration'P10DT5H34M21.123456789012S',"
- + "PropertyGuid=12345678-1234-1234-1234-123456789012,"
- + "PropertyTimeOfDay=12:34:55.123456789012)"))
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllKey")
- .isKeyPredicate(0, "PropertyString", "'O''Neil'")
- .isKeyPredicate(1, "PropertyBoolean", "true")
- .isKeyPredicate(2, "PropertyByte", "255")
- .isKeyPredicate(3, "PropertySByte", "-128")
- .isKeyPredicate(4, "PropertyInt16", "-32768")
- .isKeyPredicate(5, "PropertyInt32", "-2147483648")
- .isKeyPredicate(6, "PropertyInt64", "-9223372036854775808")
- .isKeyPredicate(7, "PropertyDecimal", "0.1")
- .isKeyPredicate(8, "PropertyDate", "2013-09-25")
- .isKeyPredicate(9, "PropertyDateTimeOffset", "2002-10-10T12:00:00-05:00")
- .isKeyPredicate(10, "PropertyDuration", "duration'P10DT5H34M21.123456789012S'")
- .isKeyPredicate(11, "PropertyGuid", "12345678-1234-1234-1234-123456789012")
- .isKeyPredicate(12, "PropertyTimeOfDay", "12:34:55.123456789012");
- }
-
- @Test
- public void runEsNameKeyCast() {
- /*
- * testUri.runEx("ESTwoPrim(1)/com.sap.odata.test1.ETBase(1)")
- * .isExSemantic(0);
- *
- * testUri.runEx("ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase(1)")
- * .isExSemantic(0);
- *
- * testUri.runEx("ESBase/com.sap.odata.test1.ETTwoPrim(1)")
- * .isExSemantic(0);
- */
-
- testUri.run("ESTwoPrim(1)/com.sap.odata.test1.ETBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBase);
-
- testUri.run("ESTwoPrim(1)/com.sap.odata.test1.ETTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBase);
-
- testUri.run("ESTwoPrim/com.sap.odata.test1.ETBase(1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
-
- testUri.run("ESTwoPrim/com.sap.odata.test1.ETTwoBase(1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
-
- testUri.run("ESTwoPrim/com.sap.odata.test1.ETBase(1)/com.sap.odata.test1.ETTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBase);
-
- testUri.run("ESTwoPrim/com.sap.odata.test1.ETTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoPrim")
- .isType(EntityTypeProvider.nameETTwoPrim)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBase);
- }
-
- @Test
- public void runEsNameParaKeysCast() {
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
- testUri.run("ESTwoKeyNav/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=1,PropertyString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'");
- }
-
- @Test
- public void run_EsNamePpCp() {
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isComplex("PropertyComplex");
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/PropertyComplex/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isComplex("PropertyComplex");
- }
-
- @Test
- public void runEsNamePpCpColl() {
- testUri.run("ESMixPrimCollComp(5)/CollPropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESMixPrimCollComp")
- .isKeyPredicate(0, "PropertyInt16", "5")
- .n()
- .isComplex("CollPropertyComplex")
- .isType(ComplexTypeProvider.nameCTTwoPrim, true);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isComplex("CollPropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, true);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavOne/CollPropertyComplex/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isComplex("CollPropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .n()
- .isCount();
- }
-
- @Test
- public void runEsNamePpCpCast() {
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplex");
-
- testUri
- .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyComplex/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isComplex("PropertyComplex");
-
- testUri
- .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyComplexTwoPrim/com.sap.odata.test1.CTBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
-
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplexTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim)
- .isTypeFilter(ComplexTypeProvider.nameCTBase);
-
- testUri
- .run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/PropertyComplexTwoPrim/com.sap.odata.test1.CTTwoBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplexTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim)
- .isTypeFilter(ComplexTypeProvider.nameCTTwoBase);
- }
-
- @Test
- public void runNsNamePpNp() {
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true);
-
- testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2");
-
- testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETKeyNavMany(PropertyInt16=2)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2");
-
- testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .n()
- .isComplex("PropertyComplex");
-
- testUri.run("ESKeyNav(1)/NavPropertyETKeyNavMany(2)/NavPropertyETKeyNavOne")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .n()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
- + "/NavPropertyETKeyNavMany(4)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "4");
-
- testUri.run("ESKeyNav(1)/PropertyComplex/NavPropertyETTwoKeyNavOne")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavOne", EntityTypeProvider.nameETTwoKeyNav, false);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='(3)')"
- + "/PropertyComplex/PropertyComplex/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'(3)'")
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- testUri.run("ESKeyNav(1)/NavPropertyETMediaMany(2)/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETMediaMany", EntityTypeProvider.nameETMedia, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .n()
- .isValue();
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
- + "/NavPropertyETKeyNavOne/NavPropertyETMediaOne/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .n()
- .isNavProperty("NavPropertyETMediaOne", EntityTypeProvider.nameETMedia, false)
- .n()
- .isValue();
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
- + "/NavPropertyETKeyNavOne/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .n()
- .isRef();
- }
-
- @Test
- public void runEsNamePpNpCast() {
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/NavPropertyETKeyNavMany")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/NavPropertyETKeyNavMany(3)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "3");
-
- testUri.run("ESTwoKeyNav(PropertyInt16=1,PropertyString='2')/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/NavPropertyETTwoKeyNavMany/com.sap.odata.test1.ETTwoBaseTwoKeyNav(PropertyInt16=3,PropertyString='4')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESTwoKeyNav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "3")
- .isKeyPredicate(1, "PropertyString", "'4'")
- .isTypeFilterOnCollection(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')"
- + "/NavPropertyETTwoKeyNavMany/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=4,PropertyString='5')"
- + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav/NavPropertyETBaseTwoKeyNavMany")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "4")
- .isKeyPredicate(1, "PropertyString", "'5'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav)
- .n()
- .isNavProperty("NavPropertyETBaseTwoKeyNavMany", EntityTypeProvider.nameETBaseTwoKeyNav, true);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/"
- + "NavPropertyETTwoKeyNavMany/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=4,PropertyString='5')/"
- + "NavPropertyETKeyNavMany")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "4")
- .isKeyPredicate(1, "PropertyString", "'5'")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
- }
-
- @Test
- public void runEsNamePpNpRc() {
- // checks for using referential constrains to fill missing keys
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany('2')").goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
- .isKeyPredicate(1, "PropertyString", "'2'");
-
- testUri.run("ESKeyNav(PropertyInt16=1)/NavPropertyETTwoKeyNavMany(PropertyString='2')").goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicateRef(0, "PropertyInt16", "PropertyInt16")
- .isKeyPredicate(1, "PropertyString", "'2'");
-
- }
-
- @Test
- public void runEsNamePpSp() {
- testUri.run("ESAllPrim(1)/PropertyByte")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false);
-
- testUri.run("ESAllPrim(1)/PropertyByte/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("PropertyByte", PropertyProvider.nameByte, false)
- .n()
- .isValue();
-
- testUri.run("ESMixPrimCollComp(1)/PropertyComplex/PropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESMixPrimCollComp")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
- }
-
- @Test
- public void runEsNamePpSpColl() {
- testUri.run("ESCollAllPrim(1)/CollPropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESCollAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
-
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=2,PropertyString='3')/CollPropertyString/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
- .n()
- .isCount();
-
- }
-
- @Test
- public void runEsNameRef() {
- testUri.run("ESAllPrim/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .n()
- .isRef();
-
- testUri.run("ESAllPrim(-32768)/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESAllPrim")
- .isKeyPredicate(0, "PropertyInt16", "-32768")
- .n()
- .isRef();
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, true)
- .n()
- .isRef();
- testUri.run("ESKeyNav(1)/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='2')/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isEntitySet("ESKeyNav")
- .isKeyPredicate(0, "PropertyInt16", "1")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'")
- .n()
- .isRef();
- }
-
- @Test
- public void runFunctionImpBf() {
-
- testUri.run("FICRTString()/com.sap.odata.test1.BFCStringRTESTwoKeyNav()");
- }
-
- @Test
- public void runFunctionImpCastBf() {
-
- testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/com.sap.odata.test1.ETBaseTwoKeyNav"
- + "/com.sap.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isFunction("UFCRTETTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
-
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
- + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
- + "/com.sap.odata.test1.BFCETBaseTwoKeyNavRTETTwoKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .n()
- .isFunction("BFCETBaseTwoKeyNavRTETTwoKeyNav");
- }
-
- @Test
- public void runFunctionImpEntity() {
-
- testUri.run("FICRTETKeyNav()")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETKeyNav")
- .isFunction("UFCRTETKeyNav")
- .isType(EntityTypeProvider.nameETKeyNav);
-
- testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=2,PropertyString='3')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'");
-
- testUri.run("FICRTETMedia()/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETMedia")
- .isFunction("UFCRTETMedia")
- .n()
- .isValue();
-
- testUri.run("FICRTETKeyNav()/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETKeyNav")
- .isFunction("UFCRTETKeyNav")
- .n()
- .isRef();
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/$ref")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .n()
- .isRef();
-
- testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)/com.sap.odata.test1.ETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isFunction("UFCRTETTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
- testUri.run("FICRTETTwoKeyNavParam(ParameterInt16=1)(PropertyInt16=2,PropertyString='3')"
- + "/com.sap.odata.test1.ETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTETTwoKeyNavParam")
- .isFunction("UFCRTETTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnEntry(EntityTypeProvider.nameETBaseTwoKeyNav);
-
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
- + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'");
- }
-
- @Test
- public void runFunctionImpEs() {
- /**/
- testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
- .isFunction("UFCRTESMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'2'")
- .isType(EntityTypeProvider.nameETMixPrimCollComp);
-
- testUri.run("FINRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FINRTESMixPrimCollCompTwoParam")
- .isFunction("UFNRTESMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'2'")
- .isType(EntityTypeProvider.nameETMixPrimCollComp);
-
- testUri.run("FICRTESMixPrimCollCompTwoParam(ParameterInt16=1,ParameterString='2')/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESMixPrimCollCompTwoParam")
- .isFunction("UFCRTESMixPrimCollCompTwoParam")
- .isParameter(0, "ParameterInt16", "1")
- .isParameter(1, "ParameterString", "'2'")
- .isType(EntityTypeProvider.nameETMixPrimCollComp)
- .n()
- .isCount();
- }
-
- @Test
- public void runFunctionImpError() {
- testUri.runEx("FICRTCollCTTwoPrimParam()").isExSemantic(0);
- testUri.runEx("FICRTCollCTTwoPrimParam(invalidParam=2)").isExSemantic(0);
- }
-
- @Test
- public void runFunctionImpEsAlias() {
-
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@parameterAlias)?@parameterAlias=1");
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@parameterAlias)/$count?@parameterAlias=1");
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=@invalidAlias)?@validAlias=1");
- }
-
- @Test
- public void runFunctionImpEsCast() {
-
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/com.sap.odata.test1.ETBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav);
-
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)/com.sap.odata.test1.ETBaseTwoKeyNav/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isCount();
-
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
- + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'");
-
- testUri.run("FICRTESTwoKeyNavParam(ParameterInt16=1)"
- + "/com.sap.odata.test1.ETBaseTwoKeyNav(PropertyInt16=2,PropertyString='3')"
- + "/com.sap.odata.test1.ETTwoBaseTwoKeyNav")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isFunctionImport("FICRTESTwoKeyNavParam")
- .isFunction("UFCRTESTwoKeyNavParam")
- .isParameter(0, "ParameterInt16", "1")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilterOnCollection(EntityTypeProvider.nameETBaseTwoKeyNav)
- .isKeyPredicate(0, "PropertyInt16", "2")
- .isKeyPredicate(1, "PropertyString", "'3'")
- .isTypeFilterOnEntry(EntityTypeProvider.nameETTwoBaseTwoKeyNav);
-
- }
-
- @Test
- public void runSingletonEntityValue() {
- testUri.run("SIMedia/$value")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SIMedia")
- .n().isValue();
- }
-
- @Test
- public void runSingletonPpNpCast() {
- testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/NavPropertyETKeyNavMany")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
-
- testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/NavPropertyETKeyNavMany(1)")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1");
-
- }
-
- @Test
- public void runSingletonPpCpCast() {
- testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplex");
-
- testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyComplex/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isComplex("PropertyComplex");
-
- testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyComplexTwoPrim/com.sap.odata.test1.CTBase")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isComplex("PropertyComplexTwoPrim")
- .isType(ComplexTypeProvider.nameCTTwoPrim)
- .isTypeFilter(ComplexTypeProvider.nameCTBase);
-
- }
-
- @Test
- public void runSingletonPpSpCast() {
- testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/PropertyInt16")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- testUri.run("SINav/com.sap.odata.test1.ETBaseTwoKeyNav/CollPropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .isType(EntityTypeProvider.nameETTwoKeyNav)
- .isTypeFilter(EntityTypeProvider.nameETBaseTwoKeyNav)
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
- .isType(PropertyProvider.nameString, true);
-
- }
-
- @Test
- public void runSingletonEntityPpNp() {
- testUri.run("SINav/NavPropertyETKeyNavMany")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
-
- testUri.run("SINav/NavPropertyETTwoKeyNavMany(PropertyInt16=1,PropertyString='2')")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isNavProperty("NavPropertyETTwoKeyNavMany", EntityTypeProvider.nameETTwoKeyNav, false)
- .isKeyPredicate(0, "PropertyInt16", "1")
- .isKeyPredicate(1, "PropertyString", "'2'");
-
- }
-
- @Test
- public void runSingletonEntityPpCp() {
- testUri.run("SINav/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isComplex("PropertyComplex");
-
- testUri.run("SINav/PropertyComplex/PropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isComplex("PropertyComplex")
- .n()
- .isComplex("PropertyComplex");
-
- }
-
- @Test
- public void runSingletonEntityPpCpColl() {
- testUri.run("SINav/CollPropertyComplex")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isComplex("CollPropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, true);
-
- testUri.run("SINav/CollPropertyComplex/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isComplex("CollPropertyComplex")
- .isType(ComplexTypeProvider.nameCTPrimComp, true)
- .n()
- .isCount();
- }
-
- @Test
- public void runSingletonEntityPpSp() {
- testUri.run("SINav/PropertyString")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isPrimitiveProperty("PropertyString", PropertyProvider.nameString, false);
- }
-
- @Test
- public void runSingletonEntityPpSpColl() {
- testUri.run("SINav/CollPropertyString")
-
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true);
- testUri.run("SINav/CollPropertyString/$count")
- .isKind(UriInfoKind.resource).goPath()
- .first()
- .isSingleton("SINav")
- .n()
- .isPrimitiveProperty("CollPropertyString", PropertyProvider.nameString, true)
- .n()
- .isCount();
- }
-
- @Test
- public void runExpand() {
-
- testUri.run("ESKeyNav(1)?$expand=*")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .isSegmentStar(0);
-
- testUri.run("ESKeyNav(1)?$expand=*/$ref")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .isSegmentStar(0)
- .isSegmentRef(1);
-
- testUri.run("ESKeyNav(1)?$expand=*/$ref,NavPropertyETKeyNavMany")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .isSegmentStar(0).isSegmentRef(1)
- .next()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true);
-
- testUri.run("ESKeyNav(1)?$expand=*($levels=3)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .isSegmentStar(0)
- .isLevelText("3");
-
- testUri.run("ESKeyNav(1)?$expand=*($levels=max)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .isSegmentStar(0)
- .isLevelText("max");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isRef();
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$ref")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .isType(EntityTypeProvider.nameETKeyNav, false)
- .n().isRef();
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($filter=PropertyInt16 eq 1)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isRef()
- .goUpExpandValidator().isFilterSerialized("<<PropertyInt16> eq <1>>");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($orderby=PropertyInt16)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isRef()
- .goUpExpandValidator()
- .isSortOrder(0, false)
- .goOrder(0).goPath().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($skip=1)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isRef()
- .goUpExpandValidator()
- .isSkipText("1");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($top=2)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isRef()
- .goUpExpandValidator()
- .isTopText("2");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($count=true)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isRef()
- .goUpExpandValidator()
- .isInlineCountText("true");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($skip=1;$top=3)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isRef()
- .goUpExpandValidator()
- .isSkipText("1")
- .isTopText("3");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$ref($skip=1%3b$top=3)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isRef()
- .goUpExpandValidator()
- .isSkipText("1")
- .isTopText("3");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$count")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isCount();
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavOne/$count")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavOne", EntityTypeProvider.nameETKeyNav, false)
- .isType(EntityTypeProvider.nameETKeyNav, false)
- .n().isCount();
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany/$count($filter=PropertyInt16 gt 1)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .n().isCount()
- .goUpExpandValidator()
- .isFilterSerialized("<<PropertyInt16> gt <1>>");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany($filter=PropertyInt16 eq 1)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .goUpExpandValidator()
- .isFilterSerialized("<<PropertyInt16> eq <1>>");
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany($orderby=PropertyInt16)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityTypeProvider.nameETKeyNav, true)
- .isType(EntityTypeProvider.nameETKeyNav, true)
- .goUpExpandValidator()
- .isSortOrder(0, false)
- .goOrder(0).goPath().isPrimitiveProperty("PropertyInt16", PropertyProvider.nameInt16, false);
-
- testUri.run("ESKeyNav(1)?$expand=NavPropertyETKeyNavMany($skip=1)")
- .isKind(UriInfoKind.resource).goPath().goExpand()
- .first()
- .goPath().first()
- .isNavProperty("NavPropertyETKeyNavMany", EntityT
<TRUNCATED>
[23/31] [OLINGO-266] refactor ref - tecsvc
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
new file mode 100644
index 0000000..fe8c97c
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
@@ -0,0 +1,590 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.NavigationProperty;
+import org.apache.olingo.server.api.edm.provider.Property;
+
+public class PropertyProvider {
+
+ // Primitive Type Names
+ public static final FullQualifiedName nameBinary = EdmPrimitiveTypeKind.Binary.getFullQualifiedName();
+ public static final FullQualifiedName nameBoolean = EdmPrimitiveTypeKind.Boolean.getFullQualifiedName();
+ public static final FullQualifiedName nameByte = EdmPrimitiveTypeKind.Byte.getFullQualifiedName();
+
+ public static final FullQualifiedName nameDate = EdmPrimitiveTypeKind.Date.getFullQualifiedName();
+ public static final FullQualifiedName nameDateTimeOffset =
+ EdmPrimitiveTypeKind.DateTimeOffset.getFullQualifiedName();
+
+ public static final FullQualifiedName nameDecimal = EdmPrimitiveTypeKind.Decimal.getFullQualifiedName();
+ public static final FullQualifiedName nameDouble = EdmPrimitiveTypeKind.Double.getFullQualifiedName();
+ public static final FullQualifiedName nameDuration = EdmPrimitiveTypeKind.Duration.getFullQualifiedName();
+
+ public static final FullQualifiedName nameGuid = EdmPrimitiveTypeKind.Guid.getFullQualifiedName();
+ public static final FullQualifiedName nameInt16 = EdmPrimitiveTypeKind.Int16.getFullQualifiedName();
+ public static final FullQualifiedName nameInt32 = EdmPrimitiveTypeKind.Int32.getFullQualifiedName();
+ public static final FullQualifiedName nameInt64 = EdmPrimitiveTypeKind.Int64.getFullQualifiedName();
+
+ public static final FullQualifiedName nameSByte = EdmPrimitiveTypeKind.SByte.getFullQualifiedName();
+ public static final FullQualifiedName nameSingle = EdmPrimitiveTypeKind.Single.getFullQualifiedName();
+
+ public static final FullQualifiedName nameString = EdmPrimitiveTypeKind.String.getFullQualifiedName();
+ public static final FullQualifiedName nameTimeOfDay = EdmPrimitiveTypeKind.TimeOfDay.getFullQualifiedName();
+
+ // Primitive Properties --------------------------------------------------------------------------------------------
+ public static final Property collPropertyBinary = new Property()
+ .setName("CollPropertyBinary")
+ .setType(nameBinary)
+ .setCollection(true);
+
+ public static final Property collPropertyBinary_ExplicitNullable = new Property()
+ .setName("CollPropertyBinary")
+ .setType(nameBinary)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyBoolean = new Property()
+ .setName("CollPropertyBoolean")
+ .setType(nameBoolean)
+ .setCollection(true);
+
+ public static final Property collPropertyBoolean_ExplicitNullable = new Property()
+ .setName("CollPropertyBoolean")
+ .setType(nameBoolean)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyByte = new Property()
+ .setName("CollPropertyByte")
+ .setType(nameByte)
+ .setCollection(true);
+
+ public static final Property collPropertyByte_ExplicitNullable = new Property()
+ .setName("CollPropertyByte")
+ .setType(nameByte)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyDate = new Property()
+ .setName("CollPropertyDate")
+ .setType(nameDate)
+ .setCollection(true);
+
+ public static final Property collPropertyDate_ExplicitNullable = new Property()
+ .setName("CollPropertyDate")
+ .setType(nameDate)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyDateTimeOffset = new Property()
+ .setName("CollPropertyDateTimeOffset")
+ .setType(nameDateTimeOffset)
+ .setCollection(true);
+
+ public static final Property collPropertyDateTimeOffset_ExplicitNullable = new Property()
+ .setName("CollPropertyDateTimeOffset")
+ .setType(nameDateTimeOffset)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyDecimal = new Property()
+ .setName("CollPropertyDecimal")
+ .setType(nameDecimal)
+ .setCollection(true);
+
+ public static final Property collPropertyDecimal_ExplicitNullable = new Property()
+ .setName("CollPropertyDecimal")
+ .setType(nameDecimal)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyDouble = new Property()
+ .setName("CollPropertyDouble")
+ .setType(nameDouble)
+ .setCollection(true);
+
+ public static final Property collPropertyDouble_ExplicitNullable = new Property()
+ .setName("CollPropertyDouble")
+ .setType(nameDouble)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyDuration = new Property()
+ .setName("CollPropertyDuration")
+ .setType(nameDuration)
+ .setCollection(true);
+
+ public static final Property collPropertyDuration_ExplicitNullable = new Property()
+ .setName("CollPropertyDuration")
+ .setType(nameDuration)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyGuid = new Property()
+ .setName("CollPropertyGuid")
+ .setType(nameGuid)
+ .setCollection(true);
+
+ public static final Property collPropertyGuid_ExplicitNullable = new Property()
+ .setName("CollPropertyGuid")
+ .setType(nameGuid)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyInt16 = new Property()
+ .setName("CollPropertyInt16")
+ .setType(nameInt16)
+ .setCollection(true);
+
+ public static final Property collPropertyInt16_ExplicitNullable = new Property()
+ .setName("CollPropertyInt16")
+ .setType(nameInt16)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyInt32 = new Property()
+ .setName("CollPropertyInt32")
+ .setType(nameInt32)
+ .setCollection(true);
+
+ public static final Property collPropertyInt32_ExplicitNullable = new Property()
+ .setName("CollPropertyInt32")
+ .setType(nameInt32)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyInt64 = new Property()
+ .setName("CollPropertyInt64")
+ .setType(nameInt64)
+ .setCollection(true);
+
+ public static final Property collPropertyInt64_ExplicitNullable = new Property()
+ .setName("CollPropertyInt64")
+ .setType(nameInt64)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertySByte = new Property()
+ .setName("CollPropertySByte")
+ .setType(nameSByte)
+ .setCollection(true);
+
+ public static final Property collPropertySByte_ExplicitNullable = new Property()
+ .setName("CollPropertySByte")
+ .setType(nameSByte)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertySingle = new Property()
+ .setName("CollPropertySingle")
+ .setType(nameSingle)
+ .setCollection(true);
+
+ public static final Property collPropertySingle_ExplicitNullable = new Property()
+ .setName("CollPropertySingle")
+ .setType(nameSingle)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyString = new Property()
+ .setName("CollPropertyString")
+ .setType(nameString)
+ .setCollection(true);
+
+ public static final Property collPropertyString_ExplicitNullable = new Property()
+ .setName("CollPropertyString")
+ .setType(nameString)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property collPropertyTimeOfDay = new Property()
+ .setName("CollPropertyTimeOfDay")
+ .setType(nameTimeOfDay)
+ .setCollection(true);
+
+ public static final Property collPropertyTimeOfDay_ExplicitNullable = new Property()
+ .setName("CollPropertyTimeOfDay")
+ .setType(nameTimeOfDay)
+ .setNullable(true)
+ .setCollection(true);
+
+ public static final Property propertyBinary = new Property()
+ .setName("PropertyBinary")
+ .setType(nameBinary);
+
+ public static final Property propertyBinary_NotNullable = new Property()
+ .setName("PropertyBinary")
+ .setType(nameBinary)
+ .setNullable(false);
+
+ public static final Property propertyBinary_ExplicitNullable = new Property()
+ .setName("PropertyBinary")
+ .setType(nameBinary)
+ .setNullable(true);
+
+ public static final Property propertyBoolean = new Property()
+ .setName("PropertyBoolean")
+ .setType(nameBoolean);
+
+ public static final Property propertyBoolean_NotNullable = new Property()
+ .setName("PropertyBoolean")
+ .setType(nameBoolean)
+ .setNullable(false);
+
+ public static final Property propertyBoolean_ExplicitNullable = new Property()
+ .setName("PropertyBoolean")
+ .setType(nameBoolean)
+ .setNullable(true);
+
+ public static final Property propertyByte = new Property()
+ .setName("PropertyByte")
+ .setType(nameByte);
+
+ public static final Property propertyByte_NotNullable = new Property()
+ .setName("PropertyByte")
+ .setType(nameByte)
+ .setNullable(false);
+
+ public static final Property propertyByte_ExplicitNullable = new Property()
+ .setName("PropertyByte")
+ .setType(nameByte)
+ .setNullable(true);
+
+ public static final Property propertyDate = new Property()
+ .setName("PropertyDate")
+ .setType(nameDate);
+
+ public static final Property propertyDate_NotNullable = new Property()
+ .setName("PropertyDate")
+ .setType(nameDate)
+ .setNullable(false);
+
+ public static final Property propertyDate_ExplicitNullable = new Property()
+ .setName("PropertyDate")
+ .setType(nameDate)
+ .setNullable(true);
+
+ public static final Property propertyDateTimeOffset = new Property()
+ .setName("PropertyDateTimeOffset")
+ .setType(nameDateTimeOffset);
+
+ public static final Property propertyDateTimeOffset_NotNullable = new Property()
+ .setName("PropertyDateTimeOffset")
+ .setType(nameDateTimeOffset)
+ .setNullable(false);
+
+ public static final Property propertyDateTimeOffset_ExplicitNullable = new Property()
+ .setName("PropertyDateTimeOffset")
+ .setType(nameDateTimeOffset)
+ .setNullable(true);
+
+ public static final Property propertyDecimal = new Property()
+ .setName("PropertyDecimal")
+ .setType(nameDecimal);
+
+ public static final Property propertyDecimal_NotNullable = new Property()
+ .setName("PropertyDecimal")
+ .setType(nameDecimal)
+ .setNullable(false);
+
+ public static final Property propertyDecimal_ExplicitNullable = new Property()
+ .setName("PropertyDecimal")
+ .setType(nameDecimal)
+ .setNullable(true);
+
+ public static final Property propertyDouble = new Property()
+ .setName("PropertyDouble")
+ .setType(nameDouble);
+
+ public static final Property propertyDouble_NotNullable = new Property()
+ .setName("PropertyDouble")
+ .setType(nameDouble)
+ .setNullable(false);
+
+ public static final Property propertyDouble_ExplicitNullable = new Property()
+ .setName("PropertyDouble")
+ .setType(nameDouble)
+ .setNullable(true);
+
+ public static final Property propertyDuration = new Property()
+ .setName("PropertyDuration")
+ .setType(nameDuration);
+
+ public static final Property propertyDuration_NotNullable = new Property()
+ .setName("PropertyDuration")
+ .setType(nameDuration)
+ .setNullable(false);
+
+ public static final Property propertyDuration_ExplicitNullable = new Property()
+ .setName("PropertyDuration")
+ .setType(nameDuration)
+ .setNullable(true);
+
+ public static final Property propertyGuid = new Property()
+ .setName("PropertyGuid")
+ .setType(nameGuid);
+
+ public static final Property propertyGuid_NotNullable = new Property()
+ .setName("PropertyGuid")
+ .setType(nameGuid)
+ .setNullable(false);
+
+ public static final Property propertyGuid_ExplicitNullable = new Property()
+ .setName("PropertyGuid")
+ .setType(nameGuid)
+ .setNullable(true);
+
+ public static final Property propertyInt16 = new Property()
+ .setName("PropertyInt16")
+ .setType(nameInt16);
+
+ public static final Property propertyInt16_NotNullable = new Property()
+ .setName("PropertyInt16")
+ .setType(nameInt16)
+ .setNullable(false);
+
+ public static final Property propertyInt16_ExplicitNullable = new Property()
+ .setName("PropertyInt16")
+ .setType(nameInt16)
+ .setNullable(true);
+
+ public static final Property propertyInt32 = new Property()
+ .setName("PropertyInt32")
+ .setType(nameInt32);
+
+ public static final Property propertyInt32_NotNullable = new Property()
+ .setName("PropertyInt32")
+ .setType(nameInt32)
+ .setNullable(false);
+
+ public static final Property propertyInt32_ExplicitNullable = new Property()
+ .setName("PropertyInt32")
+ .setType(nameInt32)
+ .setNullable(true);
+
+ public static final Property propertyInt64 = new Property()
+ .setName("PropertyInt64")
+ .setType(nameInt64);
+
+ public static final Property propertyInt64_NotNullable = new Property()
+ .setName("PropertyInt64")
+ .setType(nameInt64)
+ .setNullable(false);
+
+ public static final Property propertyInt64_ExplicitNullable = new Property()
+ .setName("PropertyInt64")
+ .setType(nameInt64)
+ .setNullable(true);
+
+ public static final Property propertySByte = new Property()
+ .setName("PropertySByte")
+ .setType(nameSByte);
+
+ public static final Property propertySByte_NotNullable = new Property()
+ .setName("PropertySByte")
+ .setType(nameSByte)
+ .setNullable(false);
+
+ public static final Property propertySByte_ExplicitNullable = new Property()
+ .setName("PropertySByte")
+ .setType(nameSByte)
+ .setNullable(true);
+
+ public static final Property propertySingle = new Property()
+ .setName("PropertySingle")
+ .setType(nameSingle);
+
+ public static final Property propertySingle_NotNullable = new Property()
+ .setName("PropertySingle")
+ .setType(nameSingle)
+ .setNullable(false);
+
+ public static final Property propertySingle_ExplicitNullable = new Property()
+ .setName("PropertySingle")
+ .setType(nameSingle)
+ .setNullable(true);
+
+ public static final Property propertyString = new Property()
+ .setName("PropertyString")
+ .setType(nameString);
+
+ public static final Property propertyString_NotNullable = new Property()
+ .setName("PropertyString")
+ .setType(nameString)
+ .setNullable(false);
+
+ public static final Property propertyString_ExplicitNullable = new Property()
+ .setName("PropertyString")
+ .setType(nameString)
+ .setNullable(true);
+
+ public static final Property propertyTimeOfDay = new Property()
+ .setName("PropertyTimeOfDay")
+ .setType(nameTimeOfDay);
+
+ public static final Property propertyTimeOfDay_NotNullable = new Property()
+ .setName("PropertyTimeOfDay")
+ .setType(nameTimeOfDay)
+ .setNullable(false);
+
+ public static final Property propertyTimeOfDay_ExplicitNullable = new Property()
+ .setName("PropertyTimeOfDay")
+ .setType(nameTimeOfDay)
+ .setNullable(true);
+
+ /*
+ * TODO add propertyStream
+ * Property propertyStream = new Property()
+ * .setName("PropertyStream")
+ * .setType(EdmStream.getFullQualifiedName());
+ */
+
+ // Complex Properties ----------------------------------------------------------------------------------------------
+ public static final Property collPropertyComplex_CTPrimComp = new Property()
+ .setName("CollPropertyComplex")
+ .setType(ComplexTypeProvider.nameCTPrimComp)
+ .setCollection(true);
+
+ public static final Property collPropertyComplex_CTTwoPrim = new Property()
+ .setName("CollPropertyComplex")
+ .setType(ComplexTypeProvider.nameCTTwoPrim)
+ .setCollection(true);
+
+ public static final Property propertyComplex_CTAllPrim = new Property()
+ .setName("PropertyComplex")
+ .setType(ComplexTypeProvider.nameCTAllPrim);
+
+ public static final Property propertyComplex_CTCollAllPrim = new Property()
+ .setName("PropertyComplex")
+ .setType(ComplexTypeProvider.nameCTCollAllPrim);
+
+ public static final Property propertyComplex_CTCompCollComp = new Property()
+ .setName("PropertyComplex")
+ .setType(ComplexTypeProvider.nameCTCompCollComp);
+
+ public static final Property propertyComplex_CTCompComp = new Property()
+ .setName("PropertyComplex")
+ .setType(ComplexTypeProvider.nameCTCompComp);
+
+ public static final Property propertyComplex_CTNavFiveProp = new Property()
+ .setName("PropertyComplex")
+ .setType(ComplexTypeProvider.nameCTNavFiveProp);
+
+ public static final Property propertyComplex_CTPrimComp_NotNullable = new Property()
+ .setName("PropertyComplex")
+ .setType(ComplexTypeProvider.nameCTPrimComp)
+ .setNullable(false);
+
+ public static final Property propertyComplex_CTTwoPrim = new Property()
+ .setName("PropertyComplex")
+ .setType(ComplexTypeProvider.nameCTTwoPrim);
+
+ public static final Property propertyComplexAllPrim_CTAllPrim = new Property()
+ .setName("PropertyComplexAllPrim")
+ .setType(ComplexTypeProvider.nameCTAllPrim);
+
+ public static final Property propertyComplexComplex_CTCompComp = new Property()
+ .setName("PropertyComplexComplex")
+ .setType(ComplexTypeProvider.nameCTCompComp);
+
+ public static final Property propertyComplexEnum_CTPrimEnum_NotNullable = new Property()
+ .setName("PropertyComplexEnum")
+ .setType(ComplexTypeProvider.nameCTPrimEnum)
+ .setNullable(false);
+
+ public static final Property propertyComplexTwoPrim_CTTwoPrim = new Property()
+ .setName("PropertyComplexTwoPrim")
+ .setType(ComplexTypeProvider.nameCTTwoPrim);
+
+ public static final Property propertyMixedPrimCollComp_CTMixPrimCollComp = new Property()
+ .setName("PropertyMixedPrimCollComp")
+ .setType(ComplexTypeProvider.nameCTMixPrimCollComp);
+
+ // Navigation Properties -------------------------------------------------------------------------------------------
+ public static final NavigationProperty collectionNavPropertyETKeyNavMany_ETKeyNav = new NavigationProperty()
+ .setName("NavPropertyETKeyNavMany")
+ .setType(EntityTypeProvider.nameETKeyNav)
+ .setCollection(true);
+
+ public static final NavigationProperty collectionNavPropertyETMediaMany_ETMedia = new NavigationProperty()
+ .setName("NavPropertyETMediaMany")
+ .setType(EntityTypeProvider.nameETMedia)
+ .setCollection(true);
+
+ public static final NavigationProperty collectionNavPropertyETTwoKeyNavMany_ETTwoKeyNav = new NavigationProperty()
+ .setName("NavPropertyETTwoKeyNavMany")
+ .setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setCollection(true)
+ .setPartner("NavPropertyETKeyNavOne");
+
+ public static final NavigationProperty collectionNavPropertyETTwoKeyNavOne_ETTwoKeyNav = new NavigationProperty()
+ .setName("NavPropertyETTwoKeyNavOne")
+ .setType(EntityTypeProvider.nameETTwoKeyNav);
+
+ public static final NavigationProperty collectionNavPropertyETTwoPrimMany_ETTwoPrim = new NavigationProperty()
+ .setName("NavPropertyETTwoPrimMany")
+ .setType(EntityTypeProvider.nameETTwoPrim)
+ .setCollection(true)
+ .setNullable(false);
+
+ public static final NavigationProperty collectionNavPropertyETAllPrimMany_ETAllPrim = new NavigationProperty()
+ .setName("NavPropertyETAllPrimMany")
+ .setType(EntityTypeProvider.nameETAllPrim)
+ .setCollection(true);
+
+ public static final NavigationProperty navPropertyETKeyNavOne_ETKeyNav = new NavigationProperty()
+ .setName("NavPropertyETKeyNavOne")
+ .setType(EntityTypeProvider.nameETKeyNav);
+
+ public static final NavigationProperty navPropertyETMediaOne_ETMedia = new NavigationProperty()
+ .setName("NavPropertyETMediaOne")
+ .setType(EntityTypeProvider.nameETMedia);
+
+ public static final NavigationProperty navPropertyETKeyPrimNavOne_ETKeyPrimNav = new NavigationProperty()
+ .setName("NavPropertyETKeyPrimNavOne")
+ .setType(EntityTypeProvider.nameETKeyPrimNav);
+
+ public static final NavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav_NotNullable = new NavigationProperty()
+ .setName("NavPropertyETTwoKeyNavOne")
+ .setType(EntityTypeProvider.nameETTwoKeyNav)
+ .setNullable(false);
+
+ public static final NavigationProperty navPropertyETTwoKeyNavOne_ETTwoKeyNav = new NavigationProperty()
+ .setName("NavPropertyETTwoKeyNavOne")
+ .setType(EntityTypeProvider.nameETTwoKeyNav);
+
+ public static final NavigationProperty navPropertyETTwoPrimOne_ETTwoPrim = new NavigationProperty()
+ .setName("NavPropertyETTwoPrimOne")
+ .setType(EntityTypeProvider.nameETTwoPrim)
+ .setNullable(false);
+
+ public static final NavigationProperty navPropertyETAllPrimOne_ETAllPrim = new NavigationProperty()
+ .setName("NavPropertyETAllPrimOne")
+ .setType(EntityTypeProvider.nameETAllPrim);
+
+ // EnumProperties --------------------------------------------------------------------------------------------------
+ public static final Property propertyEnumString_ENString = new Property()
+ .setName("PropertyEnumString")
+ .setType(EnumTypeProvider.nameENString);
+
+ // TypeDefinition Properties ---------------------------------------------------------------------------------------
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
new file mode 100644
index 0000000..c941c70
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/SchemaProvider.java
@@ -0,0 +1,250 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.server.api.edm.provider.Action;
+import org.apache.olingo.server.api.edm.provider.ActionImport;
+import org.apache.olingo.server.api.edm.provider.ComplexType;
+import org.apache.olingo.server.api.edm.provider.EntityContainer;
+import org.apache.olingo.server.api.edm.provider.EntitySet;
+import org.apache.olingo.server.api.edm.provider.EntityType;
+import org.apache.olingo.server.api.edm.provider.EnumType;
+import org.apache.olingo.server.api.edm.provider.Function;
+import org.apache.olingo.server.api.edm.provider.FunctionImport;
+import org.apache.olingo.server.api.edm.provider.Schema;
+import org.apache.olingo.server.api.edm.provider.Singleton;
+
+public class SchemaProvider {
+
+ private EdmTechProvider prov;
+
+ public static final String nameSpace = "com.sap.odata.test1";
+
+ public SchemaProvider(final EdmTechProvider prov) {
+ this.prov = prov;
+ }
+
+ public List<Schema> getSchemas() throws ODataException {
+ List<Schema> schemas = new ArrayList<Schema>();
+ Schema schema = new Schema();
+ schema.setNamespace("com.sap.odata.test1");
+ schema.setAlias("Namespace1_Alias");
+ schemas.add(schema);
+ // EnumTypes
+ List<EnumType> enumTypes = new ArrayList<EnumType>();
+ schema.setEnumTypes(enumTypes);
+ enumTypes.add(prov.getEnumType(EnumTypeProvider.nameENString));
+ // EntityTypes
+ List<EntityType> entityTypes = new ArrayList<EntityType>();
+ schema.setEntityTypes(entityTypes);
+
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllPrim));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCollAllPrim));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoPrim));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMixPrimCollComp));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoKeyTwoPrim));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETBase));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoBase));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllKey));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompAllPrim));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompCollAllPrim));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompComp));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompCollComp));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETMedia));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETFourKeyAlias));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETServerSidePaging));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAllNullable));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyNav));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoKeyNav));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompMixPrimCollComp));
+ entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyPrimNav));
+
+ // ComplexTypes
+ List<ComplexType> complexType = new ArrayList<ComplexType>();
+ schema.setComplexTypes(complexType);
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrim));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTAllPrim));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCollAllPrim));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoPrim));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTMixPrimCollComp));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTBase));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBase));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompComp));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompCollComp));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrimComp));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTNavFiveProp));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTPrimEnum));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTBasePrimCompNav));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTTwoBasePrimCompNav));
+ complexType.add(prov.getComplexType(ComplexTypeProvider.nameCTCompNav));
+
+ // TypeDefinitions
+
+ // Actions
+ List<Action> actions = new ArrayList<Action>();
+ schema.setActions(actions);
+ actions.addAll(prov.getActions(ActionProvider.nameBAETTwoKeyNavRTETTwoKeyNav));
+ actions.addAll(prov.getActions(ActionProvider.nameBAESAllPrimRTETAllPrim));
+ actions.addAll(prov.getActions(ActionProvider.nameBAESTwoKeyNavRTESTwoKeyNav));
+ actions.addAll(prov.getActions(ActionProvider.nameBAETBaseTwoKeyNavRTETBaseTwoKeyNav));
+ actions.addAll(prov.getActions(ActionProvider.nameBAETTwoBaseTwoKeyNavRTETBaseTwoKeyNav));
+ actions.addAll(prov.getActions(ActionProvider.nameUARTPrimParam));
+ actions.addAll(prov.getActions(ActionProvider.nameUARTPrimCollParam));
+ actions.addAll(prov.getActions(ActionProvider.nameUARTCompParam));
+ actions.addAll(prov.getActions(ActionProvider.nameUARTCompCollParam));
+ actions.addAll(prov.getActions(ActionProvider.nameUARTETParam));
+ actions.addAll(prov.getActions(ActionProvider.nameUARTESParam));
+
+ // Functions
+ List<Function> functions = new ArrayList<Function>();
+ schema.setFunctions(functions);
+
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTInt16));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETTwoKeyNavParamCTTwoPrim));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTStringTwoParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESTwoKeyNavParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTString));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollStringTwoParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollString));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTAllPrimTwoParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTTwoPrimParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollCTTwoPrimParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCTTwoPrim));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTCollCTTwoPrim));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETMedia));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTESMixPrimCollCompTwoParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTETAllPrimTwoParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFCRTESMixPrimCollCompTwoParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameUFNRTCollCTNavFiveProp));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCStringRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTETTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESBaseTwoKeyNavRTESBaseTwoKey));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESAllPrimRTCTAllPrim));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCTTwoPrim));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollCTTwoPrim));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTString));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollString));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCSINavRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETBaseTwoKeyNavRTESBaseTwoKey));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCollStringRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESBaseTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCollCTPrimCompRTESAllPrim));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETKeyNavRTETKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFESTwoKeyNavRTESTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTETTwoKeyNav));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCETTwoKeyNavRTCTTwoPrim));
+
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCTNavFiveProp));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTCollCTNavFiveProp));
+
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESTwoKeyNavRTStringParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCESKeyNavRTETKeyNavParam));
+ functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTETTwoKeyNavParam));
+ // functions.addAll(prov.getFunctions(FunctionProvider.nameBFCCTPrimCompRTESTwoKeyNavParam));
+
+ // EntityContainer
+ EntityContainer container = new EntityContainer();
+ schema.setEntityContainer(container);
+ container.setName(ContainerProvider.nameContainer.getName());
+
+ // EntitySets
+ List<EntitySet> entitySets = new ArrayList<EntitySet>();
+ container.setEntitySets(entitySets);
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCollAllPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixPrimCollComp"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBase"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBase"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoKeyTwoPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBaseTwoKeyTwoPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBaseTwoKeyTwoPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllKey"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompAllPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompCollAllPrim"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompComp"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompCollComp"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMedia"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyTwoKeyComp"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESInvisible"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESServerSidePaging"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESAllNullable"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyNav"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoKeyNav"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESBaseTwoKeyNav"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESCompMixPrimCollComp"));
+ entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESFourKeyAlias"));
+
+ // Singletons
+ List<Singleton> singletons = new ArrayList<Singleton>();
+ container.setSingletons(singletons);
+ singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SI"));
+ singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SINav"));
+ singletons.add(prov.getSingleton(ContainerProvider.nameContainer, "SIMedia"));
+
+ // ActionImports
+ List<ActionImport> actionImports = new ArrayList<ActionImport>();
+ container.setActionImports(actionImports);
+ actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTPrimParam"));
+ actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTPrimCollParam"));
+ actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTCompParam"));
+ actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTCompCollParam"));
+ actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTETParam"));
+ actionImports.add(prov.getActionImport(ContainerProvider.nameContainer, "AIRTETCollAllPrimParam"));
+
+ // FunctionImports
+ List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
+ container.setFunctionImports(functionImports);
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTInt16"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisibleRTInt16"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINInvisible2RTInt16"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETKeyNav"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETTwoKeyNavParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTStringTwoParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollStringTwoParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTAllPrimTwoParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESMixPrimCollCompTwoParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FINRTESMixPrimCollCompTwoParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrim"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTETMedia"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrimParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCTTwoPrim"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollString"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTString"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTESTwoKeyNavParam"));
+ functionImports.add(prov.getFunctionImport(ContainerProvider.nameContainer, "FICRTCollCTTwoPrimParam"));
+
+ return schemas;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java
new file mode 100644
index 0000000..2688586
--- /dev/null
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/TypeDefinitionProvider.java
@@ -0,0 +1,30 @@
+/*
+ * 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.server.tecsvc.provider;
+
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.server.api.edm.provider.TypeDefinition;
+
+public class TypeDefinitionProvider {
+
+ public TypeDefinition getTypeDefinition(final FullQualifiedName typeDefinitionName) {
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/resources/simplelogger.properties
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/resources/simplelogger.properties b/lib/server-tecsvc/src/main/resources/simplelogger.properties
new file mode 100644
index 0000000..2a3350c
--- /dev/null
+++ b/lib/server-tecsvc/src/main/resources/simplelogger.properties
@@ -0,0 +1,20 @@
+#
+# 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.
+#
+org.slf4j.simpleLogger.defaultLogLevel=debug
+org.slf4j.simpleLogger.logFile=System.out
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/webapp/WEB-INF/web.xml b/lib/server-tecsvc/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..a5e5154
--- /dev/null
+++ b/lib/server-tecsvc/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,42 @@
+<?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.
+-->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="WebApp_ID" version="2.5">
+
+ <display-name>Apache Olingo OData 4.0 Technical Service</display-name>
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+ <servlet>
+ <servlet-name>ODataServlet</servlet-name>
+ <servlet-class>org.apache.olingo.server.tecsvc.TechnicalServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>ODataServlet</servlet-name>
+ <url-pattern>/odata.svc/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/main/webapp/index.html
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/webapp/index.html b/lib/server-tecsvc/src/main/webapp/index.html
new file mode 100644
index 0000000..7773c60
--- /dev/null
+++ b/lib/server-tecsvc/src/main/webapp/index.html
@@ -0,0 +1,32 @@
+<html>
+<!--
+ 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.
+-->
+
+<body>
+ <h1>Olingo OData 4.0</h1>
+ <hr>
+ <h2>Technical Service</h2>
+ <lu>
+ <li><a href="odata.svc/">Service Document</a></li>
+ <li><a href="odata.svc/$metadata">Metadata</a></li>
+ </lu>
+
+</body>
+
+</html>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
new file mode 100644
index 0000000..8713348
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/json/ServiceDocumentTest.java
@@ -0,0 +1,133 @@
+/*
+ * 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.server.core.serializer.json;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityContainer;
+import org.apache.olingo.commons.api.edm.EdmEntitySet;
+import org.apache.olingo.commons.api.edm.EdmFunctionImport;
+import org.apache.olingo.commons.api.edm.EdmSingleton;
+import org.apache.olingo.server.api.ODataServer;
+import org.apache.olingo.server.api.serializer.ODataFormat;
+import org.apache.olingo.server.api.serializer.ODataSerializer;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ServiceDocumentTest {
+
+ private Edm edm;
+
+ @Before
+ public void before() {
+
+ EdmEntitySet edmEntitySet1 = mock(EdmEntitySet.class);
+ when(edmEntitySet1.getName()).thenReturn("entitySetName1");
+ when(edmEntitySet1.isIncludeInServiceDocument()).thenReturn(true);
+
+ EdmEntitySet edmEntitySet2 = mock(EdmEntitySet.class);
+ when(edmEntitySet2.getName()).thenReturn("entitySetName2");
+ when(edmEntitySet2.isIncludeInServiceDocument()).thenReturn(true);
+
+ EdmEntitySet edmEntitySet3 = mock(EdmEntitySet.class);
+ when(edmEntitySet3.getName()).thenReturn("entitySetName3");
+ when(edmEntitySet3.isIncludeInServiceDocument()).thenReturn(false);
+
+ List<EdmEntitySet> entitySets = new ArrayList<EdmEntitySet>();
+ entitySets.add(edmEntitySet1);
+ entitySets.add(edmEntitySet2);
+ entitySets.add(edmEntitySet3);
+
+ EdmFunctionImport functionImport1 = mock(EdmFunctionImport.class);
+ when(functionImport1.getName()).thenReturn("functionImport1");
+ when(functionImport1.isIncludeInServiceDocument()).thenReturn(true);
+
+ EdmFunctionImport functionImport2 = mock(EdmFunctionImport.class);
+ when(functionImport2.getName()).thenReturn("functionImport2");
+ when(functionImport2.isIncludeInServiceDocument()).thenReturn(true);
+
+ EdmFunctionImport functionImport3 = mock(EdmFunctionImport.class);
+ when(functionImport3.getName()).thenReturn("functionImport3");
+ when(functionImport3.isIncludeInServiceDocument()).thenReturn(false);
+
+ List<EdmFunctionImport> functionImports = new ArrayList<EdmFunctionImport>();
+ functionImports.add(functionImport1);
+ functionImports.add(functionImport2);
+ functionImports.add(functionImport3);
+
+ EdmSingleton singleton1 = mock(EdmSingleton.class);
+ when(singleton1.getName()).thenReturn("singleton1");
+
+ EdmSingleton singleton2 = mock(EdmSingleton.class);
+ when(singleton2.getName()).thenReturn("singleton2");
+
+ EdmSingleton singleton3 = mock(EdmSingleton.class);
+ when(singleton3.getName()).thenReturn("singleton3");
+
+ List<EdmSingleton> singletons = new ArrayList<EdmSingleton>();
+ singletons.add(singleton1);
+ singletons.add(singleton2);
+ singletons.add(singleton3);
+
+ EdmEntityContainer edmEntityContainer = mock(EdmEntityContainer.class);
+ when(edmEntityContainer.getEntitySets()).thenReturn(entitySets);
+ when(edmEntityContainer.getFunctionImports()).thenReturn(functionImports);
+ when(edmEntityContainer.getSingletons()).thenReturn(singletons);
+
+ edm = mock(Edm.class);
+ when(edm.getEntityContainer(null)).thenReturn(edmEntityContainer);
+ }
+
+ @Test
+ public void writeServiceDocumentJson() throws Exception {
+ String serviceRoot = "http://localhost:8080/odata.svc";
+
+ ODataServer server = ODataServer.newInstance();
+ assertNotNull(server);
+
+ ODataSerializer serializer = server.getSerializer(ODataFormat.JSON);
+ assertNotNull(serializer);
+
+ InputStream result = serializer.serviceDocument(edm, serviceRoot);
+ assertNotNull(result);
+ String jsonString = IOUtils.toString(result);
+
+ assertTrue(jsonString.contains("entitySetName1"));
+ assertTrue(jsonString.contains("entitySetName2"));
+ assertFalse(jsonString.contains("entitySetName3"));
+
+ assertTrue(jsonString.contains("functionImport1"));
+ assertTrue(jsonString.contains("functionImport2"));
+ assertFalse(jsonString.contains("functionImport3"));
+
+ assertTrue(jsonString.contains("singleton1"));
+ assertTrue(jsonString.contains("singleton2"));
+ assertTrue(jsonString.contains("singleton3"));
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
new file mode 100644
index 0000000..17ac957
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/serializer/xml/MetadataDocumentTest.java
@@ -0,0 +1,254 @@
+/*
+ * 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.server.core.serializer.xml;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.mock;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.olingo.commons.api.ODataException;
+import org.apache.olingo.commons.api.ODataRuntimeException;
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
+import org.apache.olingo.commons.api.edm.FullQualifiedName;
+import org.apache.olingo.commons.api.edm.Target;
+import org.apache.olingo.server.api.ODataServer;
+import org.apache.olingo.server.api.edm.provider.Action;
+import org.apache.olingo.server.api.edm.provider.ActionImport;
+import org.apache.olingo.server.api.edm.provider.ComplexType;
+import org.apache.olingo.server.api.edm.provider.EdmProvider;
+import org.apache.olingo.server.api.edm.provider.EntityContainer;
+import org.apache.olingo.server.api.edm.provider.EntitySet;
+import org.apache.olingo.server.api.edm.provider.EntityType;
+import org.apache.olingo.server.api.edm.provider.EnumMember;
+import org.apache.olingo.server.api.edm.provider.EnumType;
+import org.apache.olingo.server.api.edm.provider.Function;
+import org.apache.olingo.server.api.edm.provider.FunctionImport;
+import org.apache.olingo.server.api.edm.provider.NavigationProperty;
+import org.apache.olingo.server.api.edm.provider.NavigationPropertyBinding;
+import org.apache.olingo.server.api.edm.provider.Parameter;
+import org.apache.olingo.server.api.edm.provider.Property;
+import org.apache.olingo.server.api.edm.provider.ReturnType;
+import org.apache.olingo.server.api.edm.provider.Schema;
+import org.apache.olingo.server.api.edm.provider.Singleton;
+import org.apache.olingo.server.api.edm.provider.TypeDefinition;
+import org.apache.olingo.server.api.serializer.ODataFormat;
+import org.apache.olingo.server.api.serializer.ODataSerializer;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.tecsvc.provider.EdmTechProvider;
+import org.junit.Test;
+
+public class MetadataDocumentTest {
+
+ @Test(expected = ODataRuntimeException.class)
+ public void metadataOnJsonResultsInException() {
+ ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.JSON);
+ serializer.metadataDocument(mock(Edm.class));
+ }
+
+ @Test
+ public void writeMetadataWithEmptyMockedEdm() {
+ ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
+ Edm edm = mock(Edm.class);
+ serializer.metadataDocument(edm);
+ }
+
+ @Test
+ public void writeMetadataWithLocalTestEdm() throws Exception {
+ ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
+ Edm edm = new EdmProviderImpl(new TestMetadataProvider());
+ InputStream metadata = serializer.metadataDocument(edm);
+ assertNotNull(metadata);
+
+ String metadataString = IOUtils.toString(metadata);
+ assertTrue(metadataString
+ .contains("<edmx:Edmx Version=\"4.0\" xmlns:edmx=\"http://docs.oasis-open.org/odata/ns/edmx\">"));
+
+ assertTrue(metadataString
+ .contains("<Schema xmlns=\"http://docs.oasis-open.org/odata/ns/edm\" " +
+ "Namespace=\"namespace\" Alias=\"alias\">"));
+
+ assertTrue(metadataString
+ .contains("<EntityType Name=\"ETBaseName\"><Property Name=\"P1\" Type=\"Edm.Int16\"/><NavigationProperty " +
+ "Name=\"N1\" Type=\"namespace.ETBaseName\" Nullable=\"true\" Partner=\"N1\"/></EntityType>"));
+
+ assertTrue(metadataString
+ .contains("<EntityType Name=\"ETDerivedName\" BaseType=\"namespace.ETBaseName\"><Property Name=\"P2\" " +
+ "Type=\"Edm.Int16\"/><NavigationProperty Name=\"N2\" Type=\"namespace.ETDerivedName\" Nullable=\"true\" " +
+ "Partner=\"N2\"/></EntityType>"));
+
+ assertTrue(metadataString
+ .contains("<ComplexType Name=\"CTBaseName\"><Property Name=\"P1\" Type=\"Edm.Int16\"/><NavigationProperty " +
+ "Name=\"N1\" Type=\"namespace.ETBaseName\" Nullable=\"true\" Partner=\"N1\"/></ComplexType>"));
+
+ assertTrue(metadataString
+ .contains("<ComplexType Name=\"CTDerivedName\" BaseType=\"namespace.CTBaseName\"><Property Name=\"P2\" " +
+ "Type=\"Edm.Int16\"/><NavigationProperty Name=\"N2\" Type=\"namespace.ETDerivedName\" Nullable=\"true\" " +
+ "Partner=\"N2\"/></ComplexType>"));
+
+ assertTrue(metadataString.contains("<TypeDefinition Name=\"typeDef\" Type=\"Edm.Int16\"/>"));
+
+ assertTrue(metadataString.contains("<Action Name=\"ActionWOParameter\" IsBound=\"false\"/>"));
+
+ assertTrue(metadataString
+ .contains("<Action Name=\"ActionName\" IsBound=\"true\"><Parameter Name=\"param\" Type=\"Edm.Int16\"/>" +
+ "<Parameter Name=\"param2\" Type=\"Collection(Edm.Int16)\"/><ReturnType Type=\"namespace.CTBaseName\"/>" +
+ "</Action>"));
+
+ assertTrue(metadataString
+ .contains("<Function Name=\"FunctionWOParameter\" IsBound=\"false\" IsComposable=\"false\"><ReturnType " +
+ "Type=\"namespace.CTBaseName\"/></Function>"));
+
+ assertTrue(metadataString
+ .contains("<Function Name=\"FunctionName\" IsBound=\"true\" IsComposable=\"false\"><Parameter Name=\"param\" " +
+ "Type=\"Edm.Int16\"/><Parameter Name=\"param2\" Type=\"Collection(Edm.Int16)\"/><ReturnType " +
+ "Type=\"namespace.CTBaseName\"/></Function>"));
+
+ assertTrue(metadataString.contains("<EntityContainer Name=\"container\">"));
+
+ assertTrue(metadataString
+ .contains("<EntitySet Name=\"EntitySetName\" EntityType=\"namespace.ETBaseName\"><NavigationPropertyBinding " +
+ "Path=\"N1\" Target=\"namespace.container/EntitySetName\"/></EntitySet>"));
+ assertTrue(metadataString
+ .contains("<Singleton Name=\"SingletonName\" EntityType=\"namespace.ETBaseName\"><NavigationPropertyBinding " +
+ "Path=\"N1\" Target=\"namespace.container/EntitySetName\"/></Singleton>"));
+
+ assertTrue(metadataString.contains("<ActionImport Name=\"actionImport\" Action=\"namespace.ActionWOParameter\"/>"));
+
+ assertTrue(metadataString
+ .contains("<FunctionImport Name=\"actionImport\" Function=\"namespace.FunctionName\" " +
+ "EntitySet=\"namespace.EntitySetName\" IncludeInServiceDocument=\"false\"/>"));
+
+ assertTrue(metadataString.contains("</EntityContainer></Schema></edmx:DataServices></edmx:Edmx>"));
+ }
+
+ @Test
+ public void writeMetadataWithTechnicalScenario() {
+ ODataSerializer serializer = ODataServer.newInstance().getSerializer(ODataFormat.XML);
+ EdmProviderImpl edm = new EdmProviderImpl(new EdmTechProvider());
+ InputStream metadata = serializer.metadataDocument(edm);
+ assertNotNull(metadata);
+ // The technical scenario is too big to verify. We are content for now to make sure we can serialize it.
+ // System.out.println(StringUtils.inputStreamToString(metadata, false));
+ }
+
+ private class TestMetadataProvider extends EdmProvider {
+
+ @Override
+ public List<Schema> getSchemas() throws ODataException {
+ Property p1 = new Property().setName("P1").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName());
+ String ns = "namespace";
+ NavigationProperty n1 = new NavigationProperty().setName("N1")
+ .setType(new FullQualifiedName(ns, "ETBaseName")).setNullable(true).setPartner("N1");
+ Property p2 = new Property().setName("P2").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName());
+ NavigationProperty n2 = new NavigationProperty().setName("N2")
+ .setType(new FullQualifiedName(ns, "ETDerivedName")).setNullable(true).setPartner("N2");
+ Schema schema = new Schema().setNamespace(ns).setAlias("alias");
+ List<ComplexType> complexTypes = new ArrayList<ComplexType>();
+ schema.setComplexTypes(complexTypes);
+ ComplexType ctBase =
+ new ComplexType().setName("CTBaseName").setProperties(Arrays.asList(p1)).setNavigationProperties(
+ Arrays.asList(n1));
+ complexTypes.add(ctBase);
+ ComplexType ctDerived =
+ new ComplexType().setName("CTDerivedName").setBaseType(new FullQualifiedName(ns, "CTBaseName"))
+ .setProperties(Arrays.asList(p2)).setNavigationProperties(Arrays.asList(n2));
+ complexTypes.add(ctDerived);
+
+ List<EntityType> entityTypes = new ArrayList<EntityType>();
+ schema.setEntityTypes(entityTypes);
+ EntityType etBase =
+ new EntityType().setName("ETBaseName").setProperties(Arrays.asList(p1)).setNavigationProperties(
+ Arrays.asList(n1));
+ entityTypes.add(etBase);
+ EntityType etDerived =
+ new EntityType().setName("ETDerivedName").setBaseType(new FullQualifiedName(ns, "ETBaseName"))
+ .setProperties(Arrays.asList(p2)).setNavigationProperties(Arrays.asList(n2));
+ entityTypes.add(etDerived);
+
+ List<Action> actions = new ArrayList<Action>();
+ schema.setActions(actions);
+ // TODO:EntitySetPath
+ actions.add((new Action().setName("ActionWOParameter")));
+ List<Parameter> parameters = new ArrayList<Parameter>();
+ parameters.add(new Parameter().setName("param").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()));
+ parameters.add(new Parameter().setName("param2").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName())
+ .setCollection(true));
+ actions.add(new Action().setName("ActionName").setBound(true).setParameters(parameters).setReturnType(
+ new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName"))));
+
+ List<Function> functions = new ArrayList<Function>();
+ schema.setFunctions(functions);
+ functions.add((new Function().setName("FunctionWOParameter")
+ .setReturnType(new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName")))));
+ functions.add(new Function().setName("FunctionName").setBound(true).setParameters(parameters).setReturnType(
+ new ReturnType().setType(new FullQualifiedName(ns, "CTBaseName"))));
+
+ List<EnumType> enumTypes = new ArrayList<EnumType>();
+ schema.setEnumTypes(enumTypes);
+ List<EnumMember> members = new ArrayList<EnumMember>();
+ members.add(new EnumMember().setName("member").setValue("1"));
+ enumTypes.add(new EnumType().setName("EnumName").setFlags(true).setMembers(members));
+
+ List<TypeDefinition> typeDefinitions = new ArrayList<TypeDefinition>();
+ schema.setTypeDefinitions(typeDefinitions);
+ typeDefinitions.add(new TypeDefinition().setName("typeDef")
+ .setUnderlyingType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()));
+
+ EntityContainer container = new EntityContainer().setName("container");
+ schema.setEntityContainer(container);
+
+ List<ActionImport> actionImports = new ArrayList<ActionImport>();
+ container.setActionImports(actionImports);
+ actionImports.add(new ActionImport().setName("actionImport").setAction(
+ new FullQualifiedName(ns, "ActionWOParameter")).setEntitySet(
+ new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
+
+ List<FunctionImport> functionImports = new ArrayList<FunctionImport>();
+ container.setFunctionImports(functionImports);
+ functionImports.add(new FunctionImport().setName("actionImport").setFunction(
+ new FullQualifiedName(ns, "FunctionName")).setEntitySet(
+ new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
+
+ List<EntitySet> entitySets = new ArrayList<EntitySet>();
+ container.setEntitySets(entitySets);
+ List<NavigationPropertyBinding> nPB = new ArrayList<NavigationPropertyBinding>();
+ nPB.add(new NavigationPropertyBinding().setPath("N1").setTarget(
+ new Target().setEntityContainer(new FullQualifiedName(ns, "container")).setTargetName("EntitySetName")));
+ entitySets.add(new EntitySet().setName("EntitySetName").setType(new FullQualifiedName(ns, "ETBaseName"))
+ .setNavigationPropertyBindings(nPB));
+
+ List<Singleton> singletons = new ArrayList<Singleton>();
+ container.setSingletons(singletons);
+ singletons.add(new Singleton().setName("SingletonName").setType(new FullQualifiedName(ns, "ETBaseName"))
+ .setNavigationPropertyBindings(nPB));
+
+ List<Schema> schemas = new ArrayList<Schema>();
+ schemas.add(schema);
+ return schemas;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
new file mode 100644
index 0000000..f54ad57
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/RawUriTest.java
@@ -0,0 +1,151 @@
+/*
+ * 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.server.core.uri;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.olingo.server.core.uri.parser.RawUri;
+import org.apache.olingo.server.core.uri.parser.UriDecoder;
+import org.apache.olingo.server.core.uri.parser.UriParserSyntaxException;
+import org.junit.Test;
+
+public class RawUriTest {
+
+ private RawUri runRawParser(final String uri, final int scipSegments) throws UriParserSyntaxException {
+ return UriDecoder.decodeUri(uri, scipSegments);
+ }
+
+ @Test
+ public void testOption() throws Exception {
+ RawUri rawUri;
+ rawUri = runRawParser("?", 0);
+ checkOptionCount(rawUri, 0);
+
+ rawUri = runRawParser("?a", 0);
+ checkOption(rawUri, 0, "a", "");
+
+ rawUri = runRawParser("?a=b", 0);
+ checkOption(rawUri, 0, "a", "b");
+
+ rawUri = runRawParser("?=", 0);
+ checkOption(rawUri, 0, "", "");
+
+ rawUri = runRawParser("?=b", 0);
+ checkOption(rawUri, 0, "", "b");
+
+ rawUri = runRawParser("?a&c", 0);
+ checkOption(rawUri, 0, "a", "");
+ checkOption(rawUri, 1, "c", "");
+
+ rawUri = runRawParser("?a=b&c", 0);
+ checkOption(rawUri, 0, "a", "b");
+ checkOption(rawUri, 1, "c", "");
+
+ rawUri = runRawParser("?a=b&c=d", 0);
+ checkOption(rawUri, 0, "a", "b");
+ checkOption(rawUri, 1, "c", "d");
+
+ rawUri = runRawParser("?=&=", 0);
+ checkOption(rawUri, 0, "", "");
+ checkOption(rawUri, 1, "", "");
+
+ rawUri = runRawParser("?=&c=d", 0);
+ checkOption(rawUri, 0, "", "");
+ checkOption(rawUri, 1, "c", "d");
+ }
+
+ private void checkOption(final RawUri rawUri, final int index, final String name, final String value) {
+ RawUri.QueryOption option = rawUri.queryOptionListDecoded.get(index);
+
+ assertEquals(name, option.name);
+ assertEquals(value, option.value);
+
+ }
+
+ private void checkOptionCount(final RawUri rawUri, final int count) {
+ assertEquals(count, rawUri.queryOptionListDecoded.size());
+ }
+
+ @Test
+ public void testPath() throws Exception {
+ RawUri rawUri;
+
+ rawUri = runRawParser("http://test.org", 0);
+ checkPath(rawUri, "", new ArrayList<String>());
+
+ rawUri = runRawParser("http://test.org/", 0);
+ checkPath(rawUri, "/", Arrays.asList(""));
+
+ rawUri = runRawParser("http://test.org/entitySet", 0);
+ checkPath(rawUri, "/entitySet", Arrays.asList("entitySet"));
+
+ rawUri = runRawParser("http://test.org/nonServiceSegment/entitySet", 0);
+ checkPath(rawUri, "/nonServiceSegment/entitySet", Arrays.asList("nonServiceSegment", "entitySet"));
+
+ rawUri = runRawParser("http://test.org/nonServiceSegment/entitySet", 1);
+ checkPath(rawUri, "/nonServiceSegment/entitySet", Arrays.asList("entitySet"));
+
+ rawUri = runRawParser("", 0);
+ checkPath(rawUri, "", new ArrayList<String>());
+
+ rawUri = runRawParser("/", 0);
+ checkPath(rawUri, "/", Arrays.asList(""));
+
+ rawUri = runRawParser("/entitySet", 0);
+ checkPath(rawUri, "/entitySet", Arrays.asList("entitySet"));
+
+ rawUri = runRawParser("entitySet", 0);
+ checkPath(rawUri, "entitySet", Arrays.asList("entitySet"));
+
+ rawUri = runRawParser("nonServiceSegment/entitySet", 0);
+ checkPath(rawUri, "nonServiceSegment/entitySet", Arrays.asList("nonServiceSegment", "entitySet"));
+
+ rawUri = runRawParser("nonServiceSegment/entitySet", 1);
+ checkPath(rawUri, "nonServiceSegment/entitySet", Arrays.asList("entitySet"));
+
+ rawUri = runRawParser("http://test.org/a?abc=xx+yz", 0);
+ }
+
+ @Test
+ public void testSplitt() {
+ UriDecoder.splitt("", '/');
+ UriDecoder.splitt("/", '/');
+ UriDecoder.splitt("a", '/');
+ UriDecoder.splitt("a/", '/');
+ UriDecoder.splitt("/a", '/');
+ UriDecoder.splitt("a/a", '/');
+ }
+
+ private void checkPath(final RawUri rawUri, final String path, final List<String> list) {
+ assertEquals(path, rawUri.path);
+
+ assertEquals(list.size(), rawUri.pathSegmentListDecoded.size());
+
+ int i = 0;
+ while (i < list.size()) {
+ assertEquals(list.get(i), rawUri.pathSegmentListDecoded.get(i));
+ i++;
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/a98d3b4a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
new file mode 100644
index 0000000..a71762c
--- /dev/null
+++ b/lib/server-tecsvc/src/test/java/org/apache/olingo/server/core/uri/UriInfoImplTest.java
@@ -0,0 +1,201 @@
+/*
+ * 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.server.core.uri;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.olingo.commons.api.edm.Edm;
+import org.apache.olingo.commons.api.edm.EdmEntityType;
+import org.apache.olingo.server.api.uri.UriInfoAll;
+import org.apache.olingo.server.api.uri.UriInfoBatch;
+import org.apache.olingo.server.api.uri.UriInfoCrossjoin;
+import org.apache.olingo.server.api.uri.UriInfoEntityId;
+import org.apache.olingo.server.api.uri.UriInfoKind;
+import org.apache.olingo.server.api.uri.UriInfoMetadata;
+import org.apache.olingo.server.api.uri.UriInfoResource;
+import org.apache.olingo.server.api.uri.UriInfoService;
+import org.apache.olingo.server.api.uri.queryoption.CustomQueryOption;
+import org.apache.olingo.server.core.edm.provider.EdmProviderImpl;
+import org.apache.olingo.server.core.uri.queryoption.CountOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.CustomQueryOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.ExpandOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.FilterOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.FormatOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.IdOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.LevelsOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.OrderByOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.QueryOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.SearchOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.SelectOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.SkipOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.SkipTokenOptionImpl;
+import org.apache.olingo.server.core.uri.queryoption.TopOptionImpl;
+import org.apache.olingo.server.core.uri.testutil.EdmTechTestProvider;
+import org.apache.olingo.server.tecsvc.provider.EntityTypeProvider;
+import org.junit.Test;
+
+public class UriInfoImplTest {
+
+ Edm edm = new EdmProviderImpl(new EdmTechTestProvider());
+
+ @Test
+ public void testKind() {
+ UriInfoImpl uriInfo = new UriInfoImpl().setKind(UriInfoKind.all);
+ assertEquals(UriInfoKind.all, uriInfo.getKind());
+ }
+
+ @Test
+ public void testCasts() {
+ UriInfoImpl uriInfo = new UriInfoImpl();
+
+ UriInfoAll all = uriInfo.asUriInfoAll();
+ assertEquals(uriInfo, all);
+
+ UriInfoBatch batch = uriInfo.asUriInfoBatch();
+ assertEquals(uriInfo, batch);
+
+ UriInfoCrossjoin crossjoin = uriInfo.asUriInfoCrossjoin();
+ assertEquals(uriInfo, crossjoin);
+
+ UriInfoEntityId entityID = uriInfo.asUriInfoEntityId();
+ assertEquals(uriInfo, entityID);
+
+ UriInfoMetadata metadata = uriInfo.asUriInfoMetadata();
+ assertEquals(uriInfo, metadata);
+
+ UriInfoResource resource = uriInfo.asUriInfoResource();
+ assertEquals(uriInfo, resource);
+
+ UriInfoService service = uriInfo.asUriInfoService();
+ assertEquals(uriInfo, service);
+
+ }
+
+ @Test
+ public void testEntityNames() {
+ UriInfoImpl uriInfo = new UriInfoImpl();
+ uriInfo.addEntitySetName("A");
+ uriInfo.addEntitySetName("B");
+
+ assertEquals("A", uriInfo.getEntitySetNames().get(0));
+ assertEquals("B", uriInfo.getEntitySetNames().get(1));
+
+ }
+
+ @Test
+ public void testResourceParts() {
+ UriInfoImpl uriInfo = new UriInfoImpl();
+
+ UriResourceActionImpl action = new UriResourceActionImpl();
+ UriResourceEntitySetImpl entitySet0 = new UriResourceEntitySetImpl();
+ UriResourceEntitySetImpl entitySet1 = new UriResourceEntitySetImpl();
+
+ uriInfo.addResourcePart(action);
+ uriInfo.addResourcePart(entitySet0);
+
+ assertEquals(action, uriInfo.getUriResourceParts().get(0));
+ assertEquals(entitySet0, uriInfo.getUriResourceParts().get(1));
+
+ assertEquals(entitySet0, uriInfo.getLastResourcePart());
+
+ uriInfo.addResourcePart(entitySet1);
+ assertEquals(entitySet1, uriInfo.getLastResourcePart());
+ }
+
+ @Test
+ public void testCustomQueryOption() {
+ UriInfoImpl uriInfo = new UriInfoImpl();
+
+ List<QueryOptionImpl> queryOptions = new ArrayList<QueryOptionImpl>();
+
+ ExpandOptionImpl expand = new ExpandOptionImpl();
+ FilterOptionImpl filter = new FilterOptionImpl();
+ FormatOptionImpl format = new FormatOptionImpl();
+ IdOptionImpl id = new IdOptionImpl();
+ CountOptionImpl inlinecount = new CountOptionImpl();
+ OrderByOptionImpl orderby = new OrderByOptionImpl();
+ SearchOptionImpl search = new SearchOptionImpl();
+ SelectOptionImpl select = new SelectOptionImpl();
+ SkipOptionImpl skip = new SkipOptionImpl();
+ SkipTokenOptionImpl skipToken = new SkipTokenOptionImpl();
+ TopOptionImpl top = new TopOptionImpl();
+ LevelsOptionImpl levels = new LevelsOptionImpl();
+
+ CustomQueryOptionImpl customOption0 = new CustomQueryOptionImpl();
+ customOption0.setText("A");
+ CustomQueryOptionImpl customOption1 = new CustomQueryOptionImpl();
+ customOption1.setText("B");
+
+ QueryOptionImpl queryOption = new QueryOptionImpl();
+
+ queryOptions.add(expand);
+ queryOptions.add(filter);
+ queryOptions.add(format);
+ queryOptions.add(id);
+ queryOptions.add(inlinecount);
+ queryOptions.add(orderby);
+ queryOptions.add(search);
+ queryOptions.add(select);
+ queryOptions.add(skip);
+ queryOptions.add(skipToken);
+ queryOptions.add(top);
+ queryOptions.add(customOption0);
+ queryOptions.add(customOption1);
+ queryOptions.add(levels);// not stored
+ queryOptions.add(queryOption);// not stored
+ uriInfo.setQueryOptions(queryOptions);
+
+ assertEquals(expand, uriInfo.getExpandOption());
+ assertEquals(filter, uriInfo.getFilterOption());
+ assertEquals(format, uriInfo.getFormatOption());
+ assertEquals(id, uriInfo.getIdOption());
+ assertEquals(inlinecount, uriInfo.getCountOption());
+ assertEquals(orderby, uriInfo.getOrderByOption());
+ assertEquals(search, uriInfo.getSearchOption());
+ assertEquals(select, uriInfo.getSelectOption());
+ assertEquals(skip, uriInfo.getSkipOption());
+ assertEquals(skipToken, uriInfo.getSkipTokenOption());
+ assertEquals(top, uriInfo.getTopOption());
+
+ List<CustomQueryOption> customQueryOptions = uriInfo.getCustomQueryOptions();
+ assertEquals(customOption0, customQueryOptions.get(0));
+ assertEquals(customOption1, customQueryOptions.get(1));
+ }
+
+ @Test
+ public void testFragment() {
+ UriInfoImpl uriInfo = new UriInfoImpl();
+ uriInfo.setFragment("F");
+ assertEquals("F", uriInfo.getFragment());
+ }
+
+ @Test
+ public void testEntityTypeCast() {
+ UriInfoImpl uriInfo = new UriInfoImpl();
+ EdmEntityType entityType = edm.getEntityType(EntityTypeProvider.nameETKeyNav);
+ assertNotNull(entityType);
+
+ uriInfo.setEntityTypeCast(entityType);
+ assertEquals(entityType, uriInfo.getEntityTypeCast());
+ }
+}