mirror of
https://github.com/apache/olingo-odata4.git
synced 2025-02-06 18:18:55 +00:00
[OLINGO-206] singleton validation added
This commit is contained in:
parent
6629384979
commit
1274b1e725
@ -237,6 +237,7 @@ public class SystemQueryValidator {
|
|||||||
case root:
|
case root:
|
||||||
break;
|
break;
|
||||||
case singleton:
|
case singleton:
|
||||||
|
idx = 9;
|
||||||
break;
|
break;
|
||||||
case value: {
|
case value: {
|
||||||
int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
|
int secondLastPathSegmentIndex = uriInfo.getUriResourceParts().size() - 2;
|
||||||
|
@ -57,6 +57,7 @@ public class UriEdmValidatorTest {
|
|||||||
private static final String URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT =
|
private static final String URI_PROPERTY_PRIMITIVE_COLLECTION_COUNT =
|
||||||
"/ESCollAllPrim/CollPropertyString/$count";
|
"/ESCollAllPrim/CollPropertyString/$count";
|
||||||
private static final String URI_PROPERTY_PRIMITIVE_VALUE = "/ESAllPrim(1)/PropertyString/$value";
|
private static final String URI_PROPERTY_PRIMITIVE_VALUE = "/ESAllPrim(1)/PropertyString/$value";
|
||||||
|
private static final String URI_SINGLETON = "/SI";
|
||||||
|
|
||||||
private static final String QO_FILTER = "$filter='1' eq '1'";
|
private static final String QO_FILTER = "$filter='1' eq '1'";
|
||||||
private static final String QO_FORMAT = "$format=bla";
|
private static final String QO_FORMAT = "$format=bla";
|
||||||
@ -121,6 +122,9 @@ public class UriEdmValidatorTest {
|
|||||||
{ URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_TOP },
|
{ URI_PROPERTY_PRIMITIVE_COLLECTION, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_COLLECTION, QO_TOP },
|
||||||
|
|
||||||
{ URI_PROPERTY_PRIMITIVE_VALUE, QO_FORMAT },
|
{ URI_PROPERTY_PRIMITIVE_VALUE, QO_FORMAT },
|
||||||
|
|
||||||
|
{ URI_SINGLETON, QO_FORMAT }, { URI_SINGLETON, QO_EXPAND }, { URI_SINGLETON, QO_SELECT },
|
||||||
|
{ URI_SINGLETON, QO_LEVELS },
|
||||||
};
|
};
|
||||||
|
|
||||||
private String[][] urisWithNonValidSystemQueryOptions = {
|
private String[][] urisWithNonValidSystemQueryOptions = {
|
||||||
@ -210,6 +214,9 @@ public class UriEdmValidatorTest {
|
|||||||
{ URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_LEVELS },
|
{ URI_PROPERTY_PRIMITIVE_VALUE, QO_SKIPTOKEN }, { URI_PROPERTY_PRIMITIVE_VALUE, QO_LEVELS },
|
||||||
{ URI_PROPERTY_PRIMITIVE_VALUE, QO_TOP },
|
{ 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 },
|
||||||
};
|
};
|
||||||
private Parser parser;
|
private Parser parser;
|
||||||
|
|
||||||
@ -219,9 +226,10 @@ public class UriEdmValidatorTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@Ignore
|
// @Ignore
|
||||||
public void bla() throws Exception {
|
public
|
||||||
String[][] m = { { URI_PROPERTY_PRIMITIVE_VALUE, QO_SELECT } };
|
void bla() throws Exception {
|
||||||
|
String[][] m = { { URI_SINGLETON, QO_SELECT } };
|
||||||
String[] uris = constructUri(m);
|
String[] uris = constructUri(m);
|
||||||
System.out.println(uris[0]);
|
System.out.println(uris[0]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user