[OLINGO-1083] Change EntityType attribute to Type in Singletons accroding to spec

Signed-off-by: Christian Amend <christian.amend@sap.com>
This commit is contained in:
i036162 2017-02-24 16:45:49 +01:00 committed by Christian Amend
parent e41b81ea09
commit 00a5b1d2e1
3 changed files with 4 additions and 3 deletions

View File

@ -113,6 +113,7 @@ public class MetadataDocumentXmlSerializer {
private static final String XML_IS_COMPOSABLE = "IsComposable";
private static final String XML_IS_BOUND = "IsBound";
private static final String XML_ENTITY_TYPE = "EntityType";
private static final String XML_SINGLETON_TYPE = XML_TYPE;
private static final String XML_SINGLETON = "Singleton";
private static final String XML_ACTION = "Action";
private static final String XML_ACTION_IMPORT = "ActionImport";
@ -607,7 +608,7 @@ public class MetadataDocumentXmlSerializer {
for (EdmSingleton singleton : singletons) {
writer.writeStartElement(XML_SINGLETON);
writer.writeAttribute(XML_NAME, singleton.getName());
writer.writeAttribute(XML_ENTITY_TYPE, getAliasedFullQualifiedName(singleton.getEntityType(), false));
writer.writeAttribute(XML_SINGLETON_TYPE, getAliasedFullQualifiedName(singleton.getEntityType(), false));
appendNavigationPropertyBindings(writer, singleton);
appendAnnotations(writer, singleton);

View File

@ -247,7 +247,7 @@ public class MetadataDocumentXmlSerializerTest {
assertTrue(metadata.contains("<ComplexType Name=\"CTTwoPrimBase\" BaseType=\"Alias.CTTwoPrim\"/>"));
assertTrue(metadata.contains("<Property Name=\"PropertyInt16\" Type=\"Edm.Int16\" Nullable=\"false\"/>"));
assertTrue(metadata.contains("<EntitySet Name=\"ESAllPrim\" EntityType=\"Alias.ETAbstractBase\"/>"));
assertTrue(metadata.contains("<Singleton Name=\"SI\" EntityType=\"Alias.ETAbstractBase\"/>"));
assertTrue(metadata.contains("<Singleton Name=\"SI\" Type=\"Alias.ETAbstractBase\"/>"));
assertTrue(metadata.contains("<ActionImport Name=\"AIRTPrimParam\" Action=\"Alias.UARTPrimParam\"/>"));
assertTrue(metadata.contains("<FunctionImport Name=\"FINRTInt16\" " +
"Function=\"Alias.UFNRTInt16\" IncludeInServiceDocument=\"true\"/>"));

View File

@ -116,7 +116,7 @@ public class MetadataDocumentTest {
containsString("<EntitySet Name=\"ESTwoPrim\" EntityType=\"Namespace1_Alias.ETTwoPrim\">"));
assertThat(metadata,
containsString("<Singleton Name=\"SINav\" EntityType=\"Namespace1_Alias.ETTwoKeyNav\">"
containsString("<Singleton Name=\"SINav\" Type=\"Namespace1_Alias.ETTwoKeyNav\">"
+ "<NavigationPropertyBinding Path=\"NavPropertyETTwoKeyNavMany\" Target=\"ESTwoKeyNav\"/>"
+ "<NavigationPropertyBinding Path=\"NavPropertyETTwoKeyNavOne\" Target=\"ESTwoKeyNav\"/>"
+ "<NavigationPropertyBinding Path=\"NavPropertyETKeyNavOne\" Target=\"ESKeyNav\"/>"