for (EntityContainer container : schema.getEntityContainers()) {
assertEquals("Container1", container.getName());
assertEquals(Boolean.TRUE, container.isDefaultEntityContainer());
assertEquals(4, container.getFunctionImports().size());
FunctionImport functionImport1 = container.getFunctionImports().get(0);
assertEquals("EmployeeSearch", functionImport1.getName());
assertEquals("Employees", functionImport1.getEntitySet());
assertEquals(NAMESPACE, functionImport1.getReturnType().getTypeName().getNamespace());
assertEquals("Employee", functionImport1.getReturnType().getTypeName().getName());
assertEquals(EdmMultiplicity.MANY, functionImport1.getReturnType().getMultiplicity());
assertEquals("GET", functionImport1.getHttpMethod());
assertEquals(2, functionImport1.getParameters().size());
assertEquals("q1", functionImport1.getParameters().get(0).getName());
assertEquals(EdmSimpleTypeKind.String, functionImport1.getParameters().get(0).getType());
assertEquals(Boolean.TRUE, functionImport1.getParameters().get(0).getFacets().isNullable());
assertEquals("q2", functionImport1.getParameters().get(1).getName());
assertEquals(EdmSimpleTypeKind.Int32, functionImport1.getParameters().get(1).getType());
assertEquals(Boolean.FALSE, functionImport1.getParameters().get(1).getFacets().isNullable());
FunctionImport functionImport2 = container.getFunctionImports().get(1);
assertEquals("RoomSearch", functionImport2.getName());
assertEquals("Rooms", functionImport2.getEntitySet());
assertEquals(NAMESPACE, functionImport2.getReturnType().getTypeName().getNamespace());
assertEquals("Room", functionImport2.getReturnType().getTypeName().getName());
assertEquals(EdmMultiplicity.MANY, functionImport2.getReturnType().getMultiplicity());
assertEquals("GET", functionImport2.getHttpMethod());
assertEquals(2, functionImport2.getParameters().size());
assertEquals("q1", functionImport2.getParameters().get(0).getName());
assertEquals(EdmSimpleTypeKind.String, functionImport2.getParameters().get(0).getType());
assertEquals(Boolean.TRUE, functionImport2.getParameters().get(0).getFacets().isNullable());
assertEquals("q2", functionImport2.getParameters().get(1).getName());
assertEquals(EdmSimpleTypeKind.Int32, functionImport2.getParameters().get(1).getType());
assertEquals(Boolean.FALSE, functionImport2.getParameters().get(1).getFacets().isNullable());
FunctionImport functionImport3 = container.getFunctionImports().get(2);
assertEquals("NoParamters", functionImport3.getName());
List<FunctionImportParameter> parameters3 = functionImport3.getParameters();
assertNotNull(parameters3);
assertEquals(0, parameters3.size());
FunctionImport functionImport4 = container.getFunctionImports().get(3);
assertEquals("NoReturn", functionImport4.getName());
List<FunctionImportParameter> parameters4 = functionImport4.getParameters();
assertNotNull(parameters4);
assertEquals(0, parameters4.size());
assertNull(functionImport4.getReturnType());
}
}
}