You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by ch...@apache.org on 2013/09/20 15:34:02 UTC
[40/59] [abbrv] cleanup of odata fit tests
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryXmlReadOnlyTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryXmlReadOnlyTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryXmlReadOnlyTest.java
index 913f5f1..3bb834c 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryXmlReadOnlyTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/EntryXmlReadOnlyTest.java
@@ -1,20 +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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
@@ -28,19 +28,18 @@ import java.lang.reflect.Field;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpResponse;
-import org.custommonkey.xmlunit.XMLAssert;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.ref.model.DataContainer;
import org.apache.olingo.odata2.ref.model.Photo;
import org.apache.olingo.odata2.ref.processor.ListsProcessor;
import org.apache.olingo.odata2.ref.processor.ScenarioDataSource;
+import org.custommonkey.xmlunit.XMLAssert;
+import org.junit.Test;
/**
* Tests employing the reference scenario reading a single entity in XML format.
- *
+ *
*/
public class EntryXmlReadOnlyTest extends AbstractRefXmlTest {
@@ -69,7 +68,11 @@ public class EntryXmlReadOnlyTest extends AbstractRefXmlTest {
response = callUri("Rooms('1')?$expand=nr_Employees");
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=entry");
// assertNull(response.getFirstHeader(HttpHeaders.ETAG));
- assertXpathEvaluatesTo(EMPLOYEE_1_NAME, "/atom:entry/atom:link[@href=\"Rooms('1')/nr_Employees\"]/m:inline/atom:feed/atom:entry/m:properties/d:EmployeeName", getBody(response));
+ assertXpathEvaluatesTo(
+ EMPLOYEE_1_NAME,
+ "/atom:entry/atom:link[@href=\"Rooms('1')/nr_Employees\"]" +
+ "/m:inline/atom:feed/atom:entry/m:properties/d:EmployeeName",
+ getBody(response));
response = callUri("Container2.Photos(Id=1,Type='image%2Fpng')");
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=entry");
@@ -80,7 +83,8 @@ public class EntryXmlReadOnlyTest extends AbstractRefXmlTest {
response = callUri("Container2.Photos(Id=4,Type='foo')");
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=entry");
- assertXpathEvaluatesTo("Container2.Photos(Id=4,Type='foo')/$value", "/atom:entry/atom:content/@src", getBody(response));
+ assertXpathEvaluatesTo("Container2.Photos(Id=4,Type='foo')/$value", "/atom:entry/atom:content/@src",
+ getBody(response));
notFound("Managers('5')");
notFound("Managers('1%2C2')");
@@ -104,7 +108,8 @@ public class EntryXmlReadOnlyTest extends AbstractRefXmlTest {
dataContainer.getPhotos().add(new Photo(42, "strange Photo", "% :/?#[]@ !$&'()*+,;="));
// Check that percent-decoding and -encoding works as expected.
- final String url = "Container2.Photos(Id=42,Type='%25%20%3A%2F%3F%23%5B%5D%40%20%21%24%26%27%28%29%2A%2B%2C%3B%3D')";
+ final String url =
+ "Container2.Photos(Id=42,Type='%25%20%3A%2F%3F%23%5B%5D%40%20%21%24%26%27%28%29%2A%2B%2C%3B%3D')";
final String expected = url.replace("%27", "''");
final HttpResponse response = callUri(url);
final String body = getBody(response);
@@ -119,15 +124,27 @@ public class EntryXmlReadOnlyTest extends AbstractRefXmlTest {
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=entry");
String body = getBody(response);
assertXpathEvaluatesTo(EMPLOYEE_5_NAME, "/atom:entry/m:properties/d:EmployeeName", body);
- assertXpathEvaluatesTo(EMPLOYEE_3_NAME, "/atom:entry/atom:link[@href=\"Employees('5')/ne_Manager\"]/m:inline/atom:entry/m:properties/d:EmployeeName", body);
+ assertXpathEvaluatesTo(EMPLOYEE_3_NAME,
+ "/atom:entry/atom:link[@href=\"Employees('5')/ne_Manager\"]/m:inline/atom:entry/m:properties/d:EmployeeName",
+ body);
response = callUri("Rooms('3')?$expand=nr_Employees/ne_Manager");
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=entry");
body = getBody(response);
assertXpathEvaluatesTo("3", "/atom:entry/atom:content[@type=\"application/xml\"]/m:properties/d:Id", body);
- assertXpathEvaluatesTo("1", "count(/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry)", body);
- assertXpathEvaluatesTo(EMPLOYEE_5_NAME, "/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry/m:properties/d:EmployeeName", body);
- assertXpathEvaluatesTo(EMPLOYEE_3_NAME, "/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry/atom:link[@href=\"Employees('5')/ne_Manager\"]/m:inline/atom:entry/m:properties/d:EmployeeName", body);
+ assertXpathEvaluatesTo("1",
+ "count(/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry)", body);
+ assertXpathEvaluatesTo(
+ EMPLOYEE_5_NAME,
+ "/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]" +
+ "/m:inline/atom:feed/atom:entry/m:properties/d:EmployeeName",
+ body);
+ assertXpathEvaluatesTo(
+ EMPLOYEE_3_NAME,
+ "/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]" +
+ "/m:inline/atom:feed/atom:entry/atom:link[@href=\"Employees('5')/ne_Manager\"]" +
+ "/m:inline/atom:entry/m:properties/d:EmployeeName",
+ body);
notFound("Employees('3')?$expand=noNavProp");
badRequest("Employees('3')?$expand=Age");
@@ -155,22 +172,38 @@ public class EntryXmlReadOnlyTest extends AbstractRefXmlTest {
assertEquals(entry, getBody(callUri("Employees('6')?$select=*,Age")));
assertEquals(entry, getBody(callUri("Employees('6')?$select=*,ne_Room")));
- checkUri("Container2.Photos(Id=4,Type='foo')?$select=%D0%A1%D0%BE%D0%B4%D0%B5%D1%80%D0%B6%D0%B0%D0%BD%D0%B8%D0%B5,Id");
+ checkUri("Container2.Photos(Id=4,Type='foo')?$select=%D0%A1%D0%BE%D0%B4%D0%B5%D1%80%D0%B6" +
+ "%D0%B0%D0%BD%D0%B8%D0%B5,Id");
response = callUri("Employees('6')?$expand=ne_Room&$select=ne_Room/Version");
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=entry");
body = getBody(response);
- assertXpathEvaluatesTo("2", "/atom:entry/atom:link[@href=\"Employees('6')/ne_Room\"]/m:inline/atom:entry/atom:content[@type=\"application/xml\"]/m:properties/d:Version", body);
+ assertXpathEvaluatesTo(
+ "2",
+ "/atom:entry/atom:link[@href=\"Employees('6')/ne_Room\"]/m:inline/atom:entry/atom:content" +
+ "[@type=\"application/xml\"]/m:properties/d:Version",
+ body);
assertXpathNotExists("/atom:entry/m:properties/d:Location", body);
- assertXpathNotExists("/atom:entry/atom:link[@href=\"Employees('6')/ne_Room\"]/m:inline/atom:entry/atom:content[@type=\"application/xml\"]/m:properties/d:Seats", body);
+ assertXpathNotExists(
+ "/atom:entry/atom:link[@href=\"Employees('6')/ne_Room\"]/m:inline/atom:entry/atom:content" +
+ "[@type=\"application/xml\"]/m:properties/d:Seats",
+ body);
response = callUri("Rooms('3')?$expand=nr_Employees/ne_Team&$select=nr_Employees/ne_Team/Name");
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=entry");
body = getBody(response);
- assertXpathEvaluatesTo("Team 2", "/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry/atom:link[@href=\"Employees('5')/ne_Team\"]/m:inline/atom:entry/atom:content/m:properties/d:Name", body);
+ assertXpathEvaluatesTo(
+ "Team 2",
+ "/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry" +
+ "/atom:link[@href=\"Employees('5')/ne_Team\"]/m:inline/atom:entry/atom:content/m:properties/d:Name",
+ body);
assertXpathNotExists("/atom:entry/atom:content/m:properties", body);
- assertXpathNotExists("/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry/m:properties", body);
- assertXpathNotExists("/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry/atom:link[@href=\"Employees('5')/ne_Team\"]/m:inline/atom:entry/atom:content/m:properties/d:Id", body);
+ assertXpathNotExists(
+ "/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry/m:properties", body);
+ assertXpathNotExists(
+ "/atom:entry/atom:link[@href=\"Rooms('3')/nr_Employees\"]/m:inline/atom:feed/atom:entry" +
+ "/atom:link[@href=\"Employees('5')/ne_Team\"]/m:inline/atom:entry/atom:content/m:properties/d:Id",
+ body);
notFound("Teams('3')?$select=noProp");
notFound("Teams()?$select=nt_Employees/noProp");
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedJsonReadOnlyTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedJsonReadOnlyTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedJsonReadOnlyTest.java
index 2f1aeeb..1d78e42 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedJsonReadOnlyTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedJsonReadOnlyTest.java
@@ -1,20 +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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
@@ -22,13 +22,12 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.apache.http.HttpResponse;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
+import org.junit.Test;
/**
* Tests employing the reference scenario reading entity sets in JSON format.
- *
+ *
*/
public class FeedJsonReadOnlyTest extends AbstractRefTest {
@@ -122,7 +121,9 @@ public class FeedJsonReadOnlyTest extends AbstractRefTest {
@Test
public void feedWithTwoLevelInline() throws Exception {
- final HttpResponse response = callUri("Employees()?$expand=ne_Room/nr_Building&$select=Age,ne_Room/Seats,ne_Room/nr_Building/Name&$top=2&$format=json");
+ final HttpResponse response =
+ callUri("Employees()?$expand=ne_Room/nr_Building&$select=Age,ne_Room/Seats,ne_Room/nr_Building/Name&" +
+ "$top=2&$format=json");
checkMediaType(response, HttpContentType.APPLICATION_JSON);
assertEquals("{\"d\":{\"results\":[{\"__metadata\":{"
+ "\"id\":\"" + getEndpoint() + "Employees('1')\","
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedXmlReadOnlyTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedXmlReadOnlyTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedXmlReadOnlyTest.java
index 7e21881..93a30ca 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedXmlReadOnlyTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FeedXmlReadOnlyTest.java
@@ -1,20 +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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
@@ -24,14 +24,13 @@ import static org.custommonkey.xmlunit.XMLAssert.assertXpathNotExists;
import static org.junit.Assert.assertFalse;
import org.apache.http.HttpResponse;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
+import org.junit.Test;
/**
* Tests employing the reference scenario reading entity sets in XML format.
- *
+ *
*/
public class FeedXmlReadOnlyTest extends AbstractRefXmlTest {
@@ -173,7 +172,9 @@ public class FeedXmlReadOnlyTest extends AbstractRefXmlTest {
assertXpathEvaluatesTo("1", "count(/atom:feed/atom:entry)", body);
assertXpathEvaluatesTo(EMPLOYEE_2_NAME, "/atom:feed/atom:entry[1]/atom:title", body);
- response = callUri("Employees?$filter=indexof(ImageUrl,EmployeeId)%20mod%20(Age%20sub%2028)%20eq%20month(EntryDate)%20mul%203%20div%2027%20sub%201");
+ response =
+ callUri("Employees?$filter=indexof(ImageUrl,EmployeeId)%20mod%20(Age%20sub%2028)%20eq%20month" +
+ "(EntryDate)%20mul%203%20div%2027%20sub%201");
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=feed");
body = getBody(response);
assertXpathEvaluatesTo("1", "count(/atom:feed/atom:entry)", body);
@@ -208,7 +209,8 @@ public class FeedXmlReadOnlyTest extends AbstractRefXmlTest {
assertXpathEvaluatesTo(EMPLOYEE_2_NAME, "/atom:entry/atom:title", getBody(response));
checkUri("Employees('1')/ne_Room/nr_Employees('1')?$filter=EmployeeId%20eq%20'1'");
- checkUri("Container2.Photos(Id=4,Type='foo')?$filter=%D0%A1%D0%BE%D0%B4%D0%B5%D1%80%D0%B6%D0%B0%D0%BD%D0%B8%D0%B5%20eq%20'%D0%9F%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82'");
+ checkUri("Container2.Photos(Id=4,Type='foo')?$filter=%D0%A1%D0%BE%D0%B4%D0%B5%D1%80%D0%B6%D0%B0%D0%BD%" +
+ "D0%B8%D0%B5%20eq%20'%D0%9F%D1%80%D0%BE%D0%B4%D1%83%D0%BA%D1%82'");
notFound("Employees('4')?$filter=Age%20eq%2099");
notFound("Rooms('1')/nr_Employees('1')?$filter=Age%20eq%2099");
@@ -245,17 +247,24 @@ public class FeedXmlReadOnlyTest extends AbstractRefXmlTest {
@Test
public void nextLinkQueryOptions() throws Exception {
- final HttpResponse response = callUri("Rooms?$format=atom&$filter=true&$inlinecount=none&$orderby=Name&$skiptoken=1&$skip=0&$top=200&$expand=nr_Building&$select=Seats");
+ final HttpResponse response =
+ callUri("Rooms?$format=atom&$filter=true&$inlinecount=none&$orderby=Name&$skiptoken=1&$skip=0&$top=200" +
+ "&$expand=nr_Building&$select=Seats");
checkMediaType(response, HttpContentType.APPLICATION_ATOM_XML_UTF8 + ";type=feed");
final String body = getBody(response);
- assertXpathEvaluatesTo("Rooms?$format=atom&$filter=true&$inlinecount=none&$orderby=Name&$top=200&$expand=nr_Building&$select=Seats&$skiptoken=97", "/atom:feed/atom:link[@rel='next']/@href", body);
+ assertXpathEvaluatesTo(
+ "Rooms?$format=atom&$filter=true&$inlinecount=none&$orderby=Name&$top=200&$expand=nr_Building" +
+ "&$select=Seats&$skiptoken=97",
+ "/atom:feed/atom:link[@rel='next']/@href", body);
}
@Test
public void nextLinkNavigation() throws Exception {
// We have to create one entry to have one more than the paging size.
final String requestBody = getBody(callUri("Rooms('1')")).replaceAll("<link.+?/>", "");
- HttpResponse response = postUri("Buildings('3')/nb_Rooms", requestBody, HttpContentType.APPLICATION_ATOM_XML_ENTRY, HttpStatusCodes.CREATED);
+ HttpResponse response =
+ postUri("Buildings('3')/nb_Rooms", requestBody, HttpContentType.APPLICATION_ATOM_XML_ENTRY,
+ HttpStatusCodes.CREATED);
getBody(response);
response = callUri("Buildings('3')/nb_Rooms");
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportJsonTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportJsonTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportJsonTest.java
index 00cdd0d..c6ff8dc 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportJsonTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportJsonTest.java
@@ -1,20 +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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
@@ -22,14 +22,13 @@ import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.apache.http.HttpResponse;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.apache.olingo.odata2.api.commons.HttpHeaders;
+import org.junit.Test;
/**
* Tests employing the reference scenario reading function-import output in JSON format.
- *
+ *
*/
public class FunctionImportJsonTest extends AbstractRefTest {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java
index fb11b42..b04ab21 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/FunctionImportXmlTest.java
@@ -1,20 +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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
@@ -27,14 +27,13 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import org.apache.http.HttpResponse;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.apache.olingo.odata2.api.commons.HttpHeaders;
+import org.junit.Test;
/**
* Tests employing the reference scenario reading function-import output in XML format.
- *
+ *
*/
public class FunctionImportXmlTest extends AbstractRefXmlTest {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonChangeTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonChangeTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonChangeTest.java
index 0c07944..9a0e0fc 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonChangeTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonChangeTest.java
@@ -1,33 +1,32 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
+import org.junit.Test;
/**
* Tests employing the reference scenario changing links in JSON format.
- *
+ *
*/
public final class LinksJsonChangeTest extends AbstractRefTest {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonReadOnlyTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonReadOnlyTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonReadOnlyTest.java
index a6425c7..29b8cbc 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonReadOnlyTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksJsonReadOnlyTest.java
@@ -1,33 +1,32 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
import static org.junit.Assert.assertEquals;
import org.apache.http.HttpResponse;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
+import org.junit.Test;
/**
* Tests employing the reference scenario reading links in JSON format.
- *
+ *
*/
public final class LinksJsonReadOnlyTest extends AbstractRefTest {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlChangeTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlChangeTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlChangeTest.java
index 1a71b79..8bb66fb 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlChangeTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlChangeTest.java
@@ -1,35 +1,34 @@
/*******************************************************************************
* 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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
import static org.junit.Assert.assertEquals;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
import org.apache.olingo.odata2.api.commons.ODataHttpMethod;
import org.apache.olingo.odata2.api.edm.Edm;
+import org.junit.Test;
/**
* Tests employing the reference scenario changing links in XML format.
- *
+ *
*/
public final class LinksXmlChangeTest extends AbstractRefTest {
@@ -55,12 +54,14 @@ public final class LinksXmlChangeTest extends AbstractRefTest {
assertEquals(XML_DECLARATION + requestBody, getBody(callUri(uriString)));
final String uriString2 = "Rooms('1')/$links/nr_Employees('1')";
- callUri(ODataHttpMethod.PATCH, uriString2, null, null, requestBody.replace("Rooms", "Employees"), HttpContentType.APPLICATION_XML, HttpStatusCodes.NO_CONTENT);
+ callUri(ODataHttpMethod.PATCH, uriString2, null, null, requestBody.replace("Rooms", "Employees"),
+ HttpContentType.APPLICATION_XML, HttpStatusCodes.NO_CONTENT);
notFound(uriString2);
checkUri(uriString2.replace("Employees('1')", "Employees('3')"));
putUri(uriString.replace("'2'", "'99'"), requestBody, HttpContentType.APPLICATION_XML, HttpStatusCodes.NOT_FOUND);
putUri(uriString, requestBody.replace("'3'", "'999'"), HttpContentType.APPLICATION_XML, HttpStatusCodes.NOT_FOUND);
- putUri("Teams('1')/nt_Employees('2')/$links/ne_Room", requestBody, HttpContentType.APPLICATION_XML, HttpStatusCodes.BAD_REQUEST);
+ putUri("Teams('1')/nt_Employees('2')/$links/ne_Room", requestBody, HttpContentType.APPLICATION_XML,
+ HttpStatusCodes.BAD_REQUEST);
}
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlReadOnlyTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlReadOnlyTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlReadOnlyTest.java
index 4fdf877..8424839 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlReadOnlyTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/LinksXmlReadOnlyTest.java
@@ -1,20 +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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
@@ -23,13 +23,12 @@ import static org.custommonkey.xmlunit.XMLAssert.assertXpathExists;
import static org.junit.Assert.assertFalse;
import org.apache.http.HttpResponse;
-import org.junit.Test;
-
import org.apache.olingo.odata2.api.commons.HttpContentType;
+import org.junit.Test;
/**
* Tests employing the reference scenario reading links in XML format
- *
+ *
*/
public final class LinksXmlReadOnlyTest extends AbstractRefXmlTest {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/b18130ac/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MetadataTest.java
----------------------------------------------------------------------
diff --git a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MetadataTest.java b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MetadataTest.java
index 30c8e37..c472ef0 100644
--- a/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MetadataTest.java
+++ b/odata-fit/src/test/java/org/apache/olingo/odata2/fit/ref/MetadataTest.java
@@ -1,20 +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
+ * 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
+ * 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.
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
******************************************************************************/
package org.apache.olingo.odata2.fit.ref;
@@ -22,14 +22,13 @@ import static org.custommonkey.xmlunit.XMLAssert.assertXpathExists;
import static org.junit.Assert.assertFalse;
import org.apache.http.HttpResponse;
+import org.apache.olingo.odata2.api.commons.HttpContentType;
import org.junit.Before;
import org.junit.Test;
-import org.apache.olingo.odata2.api.commons.HttpContentType;
-
/**
* Tests employing the reference scenario reading the metadata document in XML format
- *
+ *
*/
public class MetadataTest extends AbstractRefXmlTest {
@@ -60,151 +59,441 @@ public class MetadataTest extends AbstractRefXmlTest {
@Test
public void testEntityTypes() throws Exception {
- //Employee
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Key", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Key/edm:PropertyRef[@Name='EmployeeId']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='EmployeeId' and @Type='Edm.String' and @Nullable='false']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='EmployeeName' and @Type='Edm.String' and @m:FC_TargetPath='SyndicationTitle']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='ManagerId' and @Type='Edm.String']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='RoomId' and @Type='Edm.String']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='TeamId' and @Type='Edm.String' and @MaxLength='2']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='Location' and @Type='RefScenario.c_Location']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='Age' and @Type='Edm.Int16']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='EntryDate' and @Type='Edm.DateTime' and @Nullable='true' and @m:FC_TargetPath='SyndicationUpdated']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Property[@Name='ImageUrl' and @Type='Edm.String']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:NavigationProperty[@Name='ne_Manager' and @Relationship='RefScenario.ManagerEmployees' and @FromRole='r_Employees' and @ToRole='r_Manager']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:NavigationProperty[@Name='ne_Team' and @Relationship='RefScenario.TeamEmployees' and @FromRole='r_Employees' and @ToRole='r_Team']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:NavigationProperty[@Name='ne_Room' and @Relationship='RefScenario.RoomEmployees' and @FromRole='r_Employees' and @ToRole='r_Room']", payload);
-
- //Team
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Team' and @BaseType='RefScenario.Base']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Team' and @BaseType='RefScenario.Base']/edm:Property[@Name='isScrumTeam' and @Type='Edm.Boolean' and @Nullable='true']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Team' and @BaseType='RefScenario.Base']/edm:NavigationProperty[@Name='nt_Employees' and @Relationship='RefScenario.TeamEmployees' and @FromRole='r_Team' and @ToRole='r_Employees']", payload);
-
- //Room
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and @BaseType='RefScenario.Base']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and @BaseType='RefScenario.Base']/edm:Property[@Name='Seats' and @Type='Edm.Int16']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and @BaseType='RefScenario.Base']/edm:Property[@Name='Version' and @Type='Edm.Int16' and @ConcurrencyMode='Fixed']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and @BaseType='RefScenario.Base']/edm:NavigationProperty[@Name='nr_Employees' and @Relationship='RefScenario.RoomEmployees' and @FromRole='r_Room' and @ToRole='r_Employees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and @BaseType='RefScenario.Base']/edm:NavigationProperty[@Name='nr_Building' and @Relationship='RefScenario.BuildingRooms' and @FromRole='r_Room' and @ToRole='r_Building']", payload);
-
- //Manager
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Manager' and @BaseType='RefScenario.Employee' and @m:HasStream='true']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Manager' and @BaseType='RefScenario.Employee' and @m:HasStream='true']/edm:NavigationProperty[@Name='nm_Employees' and @Relationship='RefScenario.ManagerEmployees' and @FromRole='r_Manager' and @ToRole='r_Employees']", payload);
-
- //Building
+ // Employee
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']", payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and @m:HasStream='true']/edm:Key",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and " +
+ "@m:HasStream='true']/edm:Key/edm:PropertyRef[@Name='EmployeeId']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and" +
+ " @m:HasStream='true']/edm:Property[@Name='EmployeeId' and @Type='Edm.String' and @Nullable='false']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and" +
+ " @m:HasStream='true']/edm:Property[@Name='EmployeeName' and @Type='Edm.String' and " +
+ "@m:FC_TargetPath='SyndicationTitle']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and " +
+ "@m:HasStream='true']/edm:Property[@Name='ManagerId' and @Type='Edm.String']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and " +
+ "@m:HasStream='true']/edm:Property[@Name='RoomId' and @Type='Edm.String']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and " +
+ "@m:HasStream='true']/edm:Property[@Name='TeamId' and @Type='Edm.String' and @MaxLength='2']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and" +
+ " @m:HasStream='true']/edm:Property[@Name='Location' and @Type='RefScenario.c_Location']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and " +
+ "@m:HasStream='true']/edm:Property[@Name='Age' and @Type='Edm.Int16']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and " +
+ "@m:HasStream='true']/edm:Property[@Name='EntryDate' and @Type='Edm.DateTime' and " +
+ "@Nullable='true' and @m:FC_TargetPath='SyndicationUpdated']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and " +
+ "@m:HasStream='true']/edm:Property[@Name='ImageUrl' and @Type='Edm.String']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and" +
+ " @m:HasStream='true']/edm:NavigationProperty[@Name='ne_Manager' and " +
+ "@Relationship='RefScenario.ManagerEmployees' and @FromRole='r_Employees' and @ToRole='r_Manager']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and" +
+ " @m:HasStream='true']/edm:NavigationProperty[@Name='ne_Team' and " +
+ "@Relationship='RefScenario.TeamEmployees' and @FromRole='r_Employees' and @ToRole='r_Team']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Employee' and " +
+ "@m:HasStream='true']/edm:NavigationProperty[@Name='ne_Room' and " +
+ "@Relationship='RefScenario.RoomEmployees' and @FromRole='r_Employees' and @ToRole='r_Room']",
+ payload);
+
+ // Team
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Team' and @BaseType='RefScenario.Base']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Team' and " +
+ "@BaseType='RefScenario.Base']/edm:Property[@Name='isScrumTeam' and @Type='Edm.Boolean' and @Nullable='true']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Team' and " +
+ "@BaseType='RefScenario.Base']/edm:NavigationProperty[@Name='nt_Employees' and " +
+ "@Relationship='RefScenario.TeamEmployees' and @FromRole='r_Team' and @ToRole='r_Employees']",
+ payload);
+
+ // Room
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and @BaseType='RefScenario.Base']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and " +
+ "@BaseType='RefScenario.Base']/edm:Property[@Name='Seats' and @Type='Edm.Int16']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and " +
+ "@BaseType='RefScenario.Base']/edm:Property[@Name='Version' and @Type='Edm.Int16' and " +
+ "@ConcurrencyMode='Fixed']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and" +
+ " @BaseType='RefScenario.Base']/edm:NavigationProperty[@Name='nr_Employees' and " +
+ "@Relationship='RefScenario.RoomEmployees' and @FromRole='r_Room' and @ToRole='r_Employees']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Room' and " +
+ "@BaseType='RefScenario.Base']/edm:NavigationProperty[@Name='nr_Building' and " +
+ "@Relationship='RefScenario.BuildingRooms' and @FromRole='r_Room' and @ToRole='r_Building']",
+ payload);
+
+ // Manager
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Manager' and " +
+ "@BaseType='RefScenario.Employee' and @m:HasStream='true']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Manager' and " +
+ "@BaseType='RefScenario.Employee' and @m:HasStream='true']/edm:NavigationProperty[@Name='nm_Employees' and " +
+ "@Relationship='RefScenario.ManagerEmployees' and @FromRole='r_Manager' and @ToRole='r_Employees']",
+ payload);
+
+ // Building
assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']", payload);
assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Key", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Key/edm:PropertyRef[@Name='Id']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Property[@Name='Id' and @Type='Edm.String' and @Nullable='false']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Property[@Name='Name' and @Type='Edm.String' and @m:FC_TargetPath='SyndicationAuthorName']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Property[@Name='Image' and @Type='Edm.Binary']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:NavigationProperty[@Name='nb_Rooms' and @Relationship='RefScenario.BuildingRooms' and @FromRole='r_Building' and @ToRole='r_Room']", payload);
-
- //Base
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']/edm:Key", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']/edm:Key/edm:PropertyRef[@Name='Id']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']/edm:Property[@Name='Id' and @Type='Edm.String' and @Nullable='false' and @DefaultValue='1']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']/edm:Property[@Name='Name' and @Type='Edm.String' and @m:FC_TargetPath='SyndicationTitle']", payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Key/edm:PropertyRef[@Name='Id']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Property[@Name='Id' and " +
+ "@Type='Edm.String' and @Nullable='false']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Property[@Name='Name' and " +
+ "@Type='Edm.String' and @m:FC_TargetPath='SyndicationAuthorName']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:Property[@Name='Image' and " +
+ "@Type='Edm.Binary']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Building']/edm:NavigationProperty" +
+ "[@Name='nb_Rooms' and @Relationship='RefScenario.BuildingRooms' and @FromRole='r_Building' and " +
+ "@ToRole='r_Room']",
+ payload);
+
+ // Base
+ assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']/edm:Key", payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']" +
+ "/edm:Key/edm:PropertyRef[@Name='Id']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']" +
+ "/edm:Property[@Name='Id' and @Type='Edm.String' and @Nullable='false' and @DefaultValue='1']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityType[@Name='Base' and @Abstract='true']" +
+ "/edm:Property[@Name='Name' and @Type='Edm.String' and @m:FC_TargetPath='SyndicationTitle']",
+ payload);
}
@Test
public void testComplexTypes() throws Exception {
- //Location
+ // Location
assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_Location']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_Location']/edm:Property[@Name='City' and @Type='RefScenario.c_City']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_Location']/edm:Property[@Name='Country' and @Type='Edm.String']", payload);
-
- //Location
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_Location']/edm:Property[@Name='City' and " +
+ "@Type='RefScenario.c_City']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_Location']/edm:Property[@Name='Country' " +
+ "and @Type='Edm.String']",
+ payload);
+
+ // Location
assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_City']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_City']/edm:Property[@Name='PostalCode' and @Type='Edm.String']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_City']/edm:Property[@Name='CityName' and @Type='Edm.String']", payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_City']/edm:Property[@Name='PostalCode' " +
+ "and @Type='Edm.String']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:ComplexType[@Name='c_City']/edm:Property[@Name='CityName' " +
+ "and @Type='Edm.String']",
+ payload);
}
@Test
public void testAssociation() throws Exception {
- //ManagerEmployees
+ // ManagerEmployees
assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='ManagerEmployees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='ManagerEmployees']/edm:End[@Type='RefScenario.Employee' and @Multiplicity='*' and @Role='r_Employees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='ManagerEmployees']/edm:End[@Type='RefScenario.Manager' and @Multiplicity='1' and @Role='r_Manager']", payload);
-
- //TeamEmployees
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='ManagerEmployees']" +
+ "/edm:End[@Type='RefScenario.Employee' and @Multiplicity='*' and @Role='r_Employees']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='ManagerEmployees']" +
+ "/edm:End[@Type='RefScenario.Manager' and @Multiplicity='1' and @Role='r_Manager']",
+ payload);
+
+ // TeamEmployees
assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='TeamEmployees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='TeamEmployees']/edm:End[@Type='RefScenario.Employee' and @Multiplicity='*' and @Role='r_Employees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='TeamEmployees']/edm:End[@Type='RefScenario.Team' and @Multiplicity='1' and @Role='r_Team']", payload);
-
- //RoomEmployees
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='TeamEmployees']" +
+ "/edm:End[@Type='RefScenario.Employee' and @Multiplicity='*' and @Role='r_Employees']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='TeamEmployees']" +
+ "/edm:End[@Type='RefScenario.Team' and @Multiplicity='1' and @Role='r_Team']",
+ payload);
+
+ // RoomEmployees
assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='RoomEmployees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='RoomEmployees']/edm:End[@Type='RefScenario.Employee' and @Multiplicity='*' and @Role='r_Employees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='RoomEmployees']/edm:End[@Type='RefScenario.Room' and @Multiplicity='1' and @Role='r_Room']", payload);
-
- //BuildingRooms
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='RoomEmployees']" +
+ "/edm:End[@Type='RefScenario.Employee' and @Multiplicity='*' and @Role='r_Employees']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='RoomEmployees']" +
+ "/edm:End[@Type='RefScenario.Room' and @Multiplicity='1' and @Role='r_Room']",
+ payload);
+
+ // BuildingRooms
assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='BuildingRooms']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='BuildingRooms']/edm:End[@Type='RefScenario.Building' and @Multiplicity='1' and @Role='r_Building']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='BuildingRooms']/edm:End[@Type='RefScenario.Room' and @Multiplicity='*' and @Role='r_Room']", payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='BuildingRooms']" +
+ "/edm:End[@Type='RefScenario.Building' and @Multiplicity='1' and @Role='r_Building']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:Association[@Name='BuildingRooms']" +
+ "/edm:End[@Type='RefScenario.Room' and @Multiplicity='*' and @Role='r_Room']",
+ payload);
}
@Test
public void testEntityContainer() throws Exception {
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']", payload);
-
- //EntitySets
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Employees' and @EntityType='RefScenario.Employee']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Teams' and @EntityType='RefScenario.Team']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Rooms' and @EntityType='RefScenario.Room']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Managers' and @EntityType='RefScenario.Manager']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Buildings' and @EntityType='RefScenario.Building']", payload);
-
- //AssociationSets
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='ManagerEmployees' and @Association='RefScenario.ManagerEmployees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='ManagerEmployees' and @Association='RefScenario.ManagerEmployees']/edm:End[@EntitySet='Managers' and @Role='r_Manager']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='ManagerEmployees' and @Association='RefScenario.ManagerEmployees']/edm:End[@EntitySet='Employees' and @Role='r_Employees']", payload);
-
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='TeamEmployees' and @Association='RefScenario.TeamEmployees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='TeamEmployees' and @Association='RefScenario.TeamEmployees']/edm:End[@EntitySet='Teams' and @Role='r_Team']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='TeamEmployees' and @Association='RefScenario.TeamEmployees']/edm:End[@EntitySet='Employees' and @Role='r_Employees']", payload);
-
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='RoomEmployees' and @Association='RefScenario.RoomEmployees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='RoomEmployees' and @Association='RefScenario.RoomEmployees']/edm:End[@EntitySet='Rooms' and @Role='r_Room']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='RoomEmployees' and @Association='RefScenario.RoomEmployees']/edm:End[@EntitySet='Employees' and @Role='r_Employees']", payload);
-
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='BuildingRooms' and @Association='RefScenario.BuildingRooms']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='BuildingRooms' and @Association='RefScenario.BuildingRooms']/edm:End[@EntitySet='Buildings' and @Role='r_Building']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='BuildingRooms' and @Association='RefScenario.BuildingRooms']/edm:End[@EntitySet='Rooms' and @Role='r_Room']", payload);
-
- //FunctionImports
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='EmployeeSearch' and @ReturnType='Collection(RefScenario.Employee)' and @m:HttpMethod='GET' and @EntitySet='Employees']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='EmployeeSearch' and @ReturnType='Collection(RefScenario.Employee)' and @m:HttpMethod='GET' and @EntitySet='Employees']/edm:Parameter[@Name='q' and @Type='Edm.String' and @Nullable='true']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='AllLocations' and @ReturnType='Collection(RefScenario.c_Location)' and @m:HttpMethod='GET']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='AllUsedRoomIds' and @ReturnType='Collection(Edm.String)' and @m:HttpMethod='GET']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='MaximalAge' and @ReturnType='Edm.Int16' and @m:HttpMethod='GET']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='MostCommonLocation' and @ReturnType='RefScenario.c_Location' and @m:HttpMethod='GET']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='ManagerPhoto' and @ReturnType='Edm.Binary' and @m:HttpMethod='GET']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='ManagerPhoto' and @ReturnType='Edm.Binary' and @m:HttpMethod='GET']/edm:Parameter[@Name='Id' and @Type='Edm.String' and @Nullable='false']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and @m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='OldestEmployee' and @ReturnType='RefScenario.Employee' and @m:HttpMethod='GET' and @EntitySet='Employees']", payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']",
+ payload);
+
+ // EntitySets
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Employees' and @EntityType='RefScenario.Employee']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Teams' and @EntityType='RefScenario.Team']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Rooms' and @EntityType='RefScenario.Room']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Managers' and @EntityType='RefScenario.Manager']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:EntitySet[@Name='Buildings' and @EntityType='RefScenario.Building']",
+ payload);
+
+ // AssociationSets
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='ManagerEmployees' and " +
+ "@Association='RefScenario.ManagerEmployees']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='ManagerEmployees' and " +
+ "@Association='RefScenario.ManagerEmployees']/edm:End[@EntitySet='Managers' and @Role='r_Manager']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='ManagerEmployees' and " +
+ "@Association='RefScenario.ManagerEmployees']/edm:End[@EntitySet='Employees' and @Role='r_Employees']",
+ payload);
+
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='TeamEmployees' and " +
+ "@Association='RefScenario.TeamEmployees']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='TeamEmployees' and " +
+ "@Association='RefScenario.TeamEmployees']/edm:End[@EntitySet='Teams' and @Role='r_Team']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='TeamEmployees' and " +
+ "@Association='RefScenario.TeamEmployees']/edm:End[@EntitySet='Employees' and @Role='r_Employees']",
+ payload);
+
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='RoomEmployees' and " +
+ "@Association='RefScenario.RoomEmployees']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='RoomEmployees' and " +
+ "@Association='RefScenario.RoomEmployees']/edm:End[@EntitySet='Rooms' and @Role='r_Room']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='RoomEmployees' and " +
+ "@Association='RefScenario.RoomEmployees']/edm:End[@EntitySet='Employees' and @Role='r_Employees']",
+ payload);
+
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='BuildingRooms' and " +
+ "@Association='RefScenario.BuildingRooms']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='BuildingRooms' and " +
+ "@Association='RefScenario.BuildingRooms']/edm:End[@EntitySet='Buildings' and @Role='r_Building']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:AssociationSet[@Name='BuildingRooms' and " +
+ "@Association='RefScenario.BuildingRooms']/edm:End[@EntitySet='Rooms' and @Role='r_Room']",
+ payload);
+
+ // FunctionImports
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='EmployeeSearch' and " +
+ "@ReturnType='Collection(RefScenario.Employee)' and @m:HttpMethod='GET' and @EntitySet='Employees']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='EmployeeSearch' and " +
+ "@ReturnType='Collection(RefScenario.Employee)' and @m:HttpMethod='GET' and " +
+ "@EntitySet='Employees']/edm:Parameter[@Name='q' and @Type='Edm.String' and @Nullable='true']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='AllLocations' and " +
+ "@ReturnType='Collection(RefScenario.c_Location)' and @m:HttpMethod='GET']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='AllUsedRoomIds' and " +
+ "@ReturnType='Collection(Edm.String)' and @m:HttpMethod='GET']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='MaximalAge' and " +
+ "@ReturnType='Edm.Int16' and @m:HttpMethod='GET']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='MostCommonLocation' " +
+ "and @ReturnType='RefScenario.c_Location' and @m:HttpMethod='GET']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='ManagerPhoto' and " +
+ "@ReturnType='Edm.Binary' and @m:HttpMethod='GET']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='ManagerPhoto' and " +
+ "@ReturnType='Edm.Binary' and @m:HttpMethod='GET']/edm:Parameter[@Name='Id' and @Type='Edm.String' and " +
+ "@Nullable='false']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema/edm:EntityContainer[@Name='Container1' and " +
+ "@m:IsDefaultEntityContainer='true']/edm:FunctionImport[@Name='OldestEmployee' and " +
+ "@ReturnType='RefScenario.Employee' and @m:HttpMethod='GET' and @EntitySet='Employees']",
+ payload);
}
@Test
public void testSchema2() throws Exception {
- //EntityType
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Key", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Key/edm:PropertyRef[@Name='Id']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Key/edm:PropertyRef[@Name='Type']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='Id' and @Type='Edm.Int32' and @Nullable='false' and @ConcurrencyMode='Fixed']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='Name' and @Type='Edm.String' and @m:FC_TargetPath='SyndicationTitle']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='Type' and @Type='Edm.String' and @Nullable='false']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='ImageUrl' and @Type='Edm.String' and @m:FC_TargetPath='SyndicationAuthorUri']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='Image' and @Type='Edm.Binary']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='BinaryData' and @Type='Edm.Binary' and @Nullable='true' and @m:MimeType='image/jpeg']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='Содержание' and @Type='Edm.String' and @Nullable='true' and @m:FC_KeepInContent='false' and @m:FC_NsPrefix='ру' and @m:FC_NsUri='http://localhost' and @m:FC_TargetPath='Содержание']", payload);
-
- //EntityContainer
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityContainer[@Name='Container2']", payload);
- assertXpathExists("/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityContainer[@Name='Container2']/edm:EntitySet[@Name='Photos' and @EntityType='RefScenario2.Photo']", payload);
+ // EntityType
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']" +
+ "/edm:EntityType[@Name='Photo' and @m:HasStream='true']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']" +
+ "/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Key",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']" +
+ "/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Key/edm:PropertyRef[@Name='Id']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']" +
+ "/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Key/edm:PropertyRef[@Name='Type']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']" +
+ "/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='Id' and @Type='Edm.Int32' and " +
+ "@Nullable='false' and @ConcurrencyMode='Fixed']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']" +
+ "/edm:EntityType[@Name='Photo' and @m:HasStream='true']/edm:Property[@Name='Name' and @Type='Edm.String' and " +
+ "@m:FC_TargetPath='SyndicationTitle']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and " +
+ "@m:HasStream='true']/edm:Property[@Name='Type' and @Type='Edm.String' and @Nullable='false']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and " +
+ "@m:HasStream='true']/edm:Property[@Name='ImageUrl' and @Type='Edm.String' and " +
+ "@m:FC_TargetPath='SyndicationAuthorUri']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and " +
+ "@m:HasStream='true']/edm:Property[@Name='Image' and @Type='Edm.Binary']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and " +
+ "@m:HasStream='true']/edm:Property[@Name='BinaryData' and @Type='Edm.Binary' and @Nullable='true' and " +
+ "@m:MimeType='image/jpeg']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityType[@Name='Photo' and " +
+ "@m:HasStream='true']/edm:Property[@Name='Содержание' and @Type='Edm.String' and @Nullable='true' and " +
+ "@m:FC_KeepInContent='false' and @m:FC_NsPrefix='ру' and @m:FC_NsUri='http://localhost' and " +
+ "@m:FC_TargetPath='Содержание']",
+ payload);
+
+ // EntityContainer
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']/edm:EntityContainer[@Name='Container2']",
+ payload);
+ assertXpathExists(
+ "/edmx:Edmx/edmx:DataServices/edm:Schema[@Namespace='RefScenario2']" +
+ "/edm:EntityContainer[@Name='Container2']/edm:EntitySet[@Name='Photos' and @EntityType='RefScenario2.Photo']",
+ payload);
}
}