[OLINGO-575] Cleanup todos

This commit is contained in:
Christian Amend 2015-03-06 15:14:19 +01:00
parent 07c37106ed
commit be7f0fd1db
26 changed files with 35 additions and 153 deletions

View File

@ -416,55 +416,6 @@ public class APIBasicDesignTestITCase extends AbstractTestITCase {
container.getProducts().getByKey(1012).operations().getProductDetails(1);
assertEquals(1, result.execute().size());
}
//CHECKSTYLE:OFF (Maven checkstyle)
// TODO: check replacement
// @Test
// public void workingWithComplexCollections() throws IOException {
// // ---------------------------------------
// // Instantiate V3 Service (Currently, complex collections not provided by V4 service)
// // ---------------------------------------
// org.apache.olingo.fit.proxy.v3.staticservice.Service<org.apache.olingo.client.api.v3.EdmEnabledODataClient> v3serv =
// org.apache.olingo.fit.proxy.v3.staticservice.Service.getV3(
// "http://localhost:9080/stub/StaticService/V30/Static.svc");
// v3serv.getClient().getConfiguration().setDefaultBatchAcceptFormat(ContentType.APPLICATION_OCTET_STREAM);
// final DefaultContainer v3cont = v3serv.getEntityContainer(DefaultContainer.class);
// assertNotNull(v3cont);
// v3serv.getContext().detachAll();
// // ---------------------------------------
//
// final ContactDetailsCollection bci = v3cont.getCustomer().getByKey(-10).getBackupContactInfo(); // 1 HTTP Request
// assertNotNull(bci);
// assertTrue(bci.isEmpty());
//
// bci.execute();
// assertFalse(bci.isEmpty());
// assertEquals(9, bci.size());
//
// final PhoneCollection phoneCollection = bci.iterator().next().getMobilePhoneBag(); // No new HTTP Request
// assertFalse(phoneCollection.isEmpty());
//
// assertEquals("jlessdhjbgglmofcyßucßqbrfßppgzvygdyssßpehkrdetitmßfddsplccvussrvidmkodchdfzjvfgossbciq",
// bci.iterator().next().getHomePhone().getPhoneNumber()); // No new HTTP Request
//
// // assertNotNull(v3cont.getOrder().getByKey(8).getCustomer().getBackupContactInfo().execute().iterator().next().
// // getHomePhone().getPhoneNumber());
// // Not supported by the test service BTW generates a single request as expected:
// // <service root>/Order(8)/Customer/BackupContactInfo
// v3serv.getContext().detachAll();
//
// // Static test service doesn't support query options about complexes: the following provides just a client example
// v3cont.getCustomer().getByKey(-10).getBackupContactInfo().
// select("HomePhone").
// filter("HomePhone eq 12345").
// skip(1).
// top(10).
// orderBy("HomePhone").
// execute(); // New HTTP Request
//
// v3serv.getContext().detachAll();
// }
//CHECKSTYLE:ON (Maven checkstyle)
@Test
public void workingWithPrimitiveCollections() throws IOException {

View File

@ -156,7 +156,6 @@ public class BasicBatchITCase extends AbstractBaseTestITCase {
@Override
protected ODataClient getClient() {
// TODO Auto-generated method stub
return null;
}

View File

@ -18,6 +18,11 @@
*/
package org.apache.olingo.fit.v4;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.client.api.communication.ODataClientErrorException;
import org.apache.olingo.client.api.communication.request.retrieve.ODataPropertyRequest;
@ -27,15 +32,9 @@ import org.apache.olingo.commons.api.domain.ODataPrimitiveValue;
import org.apache.olingo.commons.api.domain.ODataProperty;
import org.apache.olingo.commons.api.domain.ODataValuable;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.constants.ODataServiceVersion;
import org.apache.olingo.commons.api.format.ODataFormat;
import org.junit.Test;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
public class PropertyValueTestITCase extends AbstractTestITCase {
@Test

View File

@ -52,7 +52,6 @@ import org.apache.olingo.client.core.http.BasicAuthHttpClientFactory;
import org.apache.olingo.commons.api.Constants;
import org.apache.olingo.commons.api.domain.ODataValue;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeException;
import org.apache.olingo.commons.api.edm.EdmPrimitiveTypeKind;
import org.apache.olingo.commons.api.edm.geo.Geospatial;
import org.apache.olingo.commons.core.edm.primitivetype.EdmBinary;
import org.apache.olingo.commons.core.edm.primitivetype.EdmDateTimeOffset;
@ -143,18 +142,6 @@ public final class URIUtils {
return uri.normalize();
}
// TODO: Delete prefix method since these are not relevant in V4
private static String prefix(final EdmPrimitiveTypeKind typeKind) {
String result = StringUtils.EMPTY;
return result;
}
//TODO: Delete suffix method since these are not relevant in V4
private static String suffix(final EdmPrimitiveTypeKind typeKind) {
String result = StringUtils.EMPTY;
return result;
}
private static String timestamp(final Timestamp timestamp)
throws UnsupportedEncodingException, EdmPrimitiveTypeException {
@ -242,9 +229,8 @@ public final class URIUtils {
: (obj instanceof Boolean)
? BooleanUtils.toStringTrueFalse((Boolean) obj)
: (obj instanceof UUID)
? prefix(EdmPrimitiveTypeKind.Guid)
+ obj.toString()
+ suffix(EdmPrimitiveTypeKind.Guid)
? obj.toString()
: (obj instanceof byte[])
? EdmBinary.getInstance().toUriLiteral(Hex.encodeHexString((byte[]) obj))
: (obj instanceof Timestamp)
@ -256,19 +242,15 @@ public final class URIUtils {
: (obj instanceof BigDecimal)
? EdmDecimal.getInstance().valueToString(obj, null, null,
Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null)
+ suffix(EdmPrimitiveTypeKind.Decimal)
: (obj instanceof Double)
? EdmDouble.getInstance().valueToString(obj, null, null,
Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null)
+ suffix(EdmPrimitiveTypeKind.Double)
: (obj instanceof Float)
? EdmSingle.getInstance().valueToString(obj, null, null,
Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null)
+ suffix(EdmPrimitiveTypeKind.Single)
: (obj instanceof Long)
? EdmInt64.getInstance().valueToString(obj, null, null,
Constants.DEFAULT_PRECISION, Constants.DEFAULT_SCALE, null)
+ suffix(EdmPrimitiveTypeKind.Int64)
: (obj instanceof Geospatial)
? URLEncoder.encode(EdmPrimitiveTypeFactory.getInstance(
((Geospatial) obj).getEdmPrimitiveTypeKind()).

View File

@ -18,6 +18,19 @@
*/
package org.apache.olingo.commons.core.edm;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.olingo.commons.api.edm.Edm;
import org.apache.olingo.commons.api.edm.EdmAction;
@ -35,19 +48,6 @@ import org.apache.olingo.commons.api.edm.FullQualifiedName;
import org.junit.Before;
import org.junit.Test;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class EdmImplCachingTest {
private final FullQualifiedName NAME1 = new FullQualifiedName("testNamespace1", "testName1");
@ -418,20 +418,17 @@ public class EdmImplCachingTest {
@Override
protected EdmTerm createTerm(final FullQualifiedName termName) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected EdmAnnotations createAnnotationGroup(final FullQualifiedName target) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected List<EdmAnnotation> createAnnotations(final FullQualifiedName annotatedName) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
}
}

View File

@ -282,20 +282,17 @@ public class EdmImplCallCreateTest {
@Override
protected EdmTerm createTerm(final FullQualifiedName termName) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected EdmAnnotations createAnnotationGroup(final FullQualifiedName targetName) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected List<EdmAnnotation> createAnnotations(final FullQualifiedName annotatedName) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
}
}

View File

@ -78,7 +78,6 @@ public class AtomDeserializerTest {
" </content>\r\n" +
" </entry>";
//TODO: THis was a test for V3
final AtomDeserializer deserializer = new AtomDeserializer();
final InputStream in = new ByteArrayInputStream(content.getBytes("UTF-8"));
final ResWrap<Entity> entity = deserializer.toEntity(in);
@ -226,7 +225,6 @@ public class AtomDeserializerTest {
" </metadata:properties>\r\n" +
" </content>\r\n" +
" </entry>";
//TODO: THis was a test for V3
final AtomDeserializer deserializer = new AtomDeserializer();
final InputStream in = new ByteArrayInputStream(content.getBytes("UTF-8"));
final ResWrap<Entity> entity = deserializer.toEntity(in);
@ -318,7 +316,6 @@ public class AtomDeserializerTest {
" </metadata:properties>\r\n" +
" </content>\r\n" +
" </entry>";
//TODO: THis was a test for V3
final AtomDeserializer deserializer = new AtomDeserializer();
final InputStream in = new ByteArrayInputStream(content.getBytes("UTF-8"));
final ResWrap<Entity> entity = deserializer.toEntity(in);

View File

@ -20,7 +20,6 @@ package org.apache.olingo.server.api.edm.provider;
public class ReferentialConstraint {
// TODO: check data type
private String property;
private String referencedProperty;

View File

@ -49,7 +49,6 @@ public class FixedFormatDeserializerImpl implements FixedFormatDeserializer {
return result.toByteArray();
}
// TODO: Deserializer
@Override
public List<BatchRequestPart> parseBatchRequest(InputStream content, String boundary, BatchOptions options)
throws BatchDeserializerException {

View File

@ -69,13 +69,11 @@ public class EdmComplexTypeImpl extends AbstractEdmComplexType {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -198,13 +198,11 @@ public class EdmEntityContainerImpl extends AbstractEdmEntityContainer {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -48,13 +48,11 @@ public class EdmEntitySetImpl extends EdmBindingTargetImpl implements EdmEntityS
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -100,13 +100,11 @@ public class EdmEntityTypeImpl extends AbstractEdmEntityType {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -65,7 +65,6 @@ public class EdmFunctionImportImpl extends EdmOperationImportImpl implements Edm
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -34,13 +34,11 @@ public class EdmMemberImpl extends AbstractEdmMember {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}

View File

@ -107,13 +107,11 @@ public class EdmNavigationPropertyImpl extends AbstractEdmNavigationProperty {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -87,13 +87,11 @@ public abstract class EdmOperationImpl extends AbstractEdmOperation {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}

View File

@ -36,13 +36,11 @@ public abstract class EdmOperationImportImpl extends AbstractEdmOperationImport
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -74,13 +74,11 @@ public class EdmParameterImpl extends AbstractEdmParameter {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -108,13 +108,11 @@ public class EdmPropertyImpl extends AbstractEdmProperty {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -328,19 +328,16 @@ public class EdmProviderImpl extends AbstractEdm {
@Override
protected EdmTerm createTerm(final FullQualifiedName termName) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected EdmAnnotations createAnnotationGroup(final FullQualifiedName targetName) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected List<EdmAnnotation> createAnnotations(final FullQualifiedName annotatedName) {
// TODO: implement
return null;
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -32,13 +32,11 @@ public class EdmReferentialConstraintImpl extends AbstractEdmReferentialConstrai
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -18,6 +18,9 @@
*/
package org.apache.olingo.server.core.edm.provider;
import java.util.ArrayList;
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.EdmAnnotation;
@ -40,10 +43,6 @@ import org.apache.olingo.server.api.edm.provider.Function;
import org.apache.olingo.server.api.edm.provider.Schema;
import org.apache.olingo.server.api.edm.provider.TypeDefinition;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class EdmSchemaImpl extends AbstractEdmSchema {
private final Schema schema;
@ -144,31 +143,26 @@ public class EdmSchemaImpl extends AbstractEdmSchema {
@Override
protected List<EdmTerm> createTerms() {
// TODO: implement
return Collections.emptyList();
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected List<EdmAnnotations> createAnnotationGroups() {
// TODO: implement
return Collections.emptyList();
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
protected List<EdmAnnotation> createAnnotations() {
// TODO: implement
return Collections.emptyList();
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -40,13 +40,11 @@ public class EdmSingletonImpl extends EdmBindingTargetImpl implements EdmSinglet
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -85,13 +85,11 @@ public class EdmTypeDefinitionImpl extends AbstractEdmTypeDefinition {
@Override
public EdmAnnotation getAnnotation(final EdmTerm term) {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
@Override
public List<EdmAnnotation> getAnnotations() {
// TODO: implement
throw new UnsupportedOperationException("Not supported yet.");
}
}

View File

@ -652,12 +652,10 @@ public class UriValidator {
if (!edmPrimitiveType.validate(edmPrimitiveType.fromUriLiteral(value),
property.isNullable(), property.getMaxLength(),
property.getPrecision(), property.getScale(), property.isUnicode())) {
// TODO: Check exception here
throw new UriValidationException("PrimitiveTypeException",
UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name);
}
} catch (EdmPrimitiveTypeException e) {
// TODO: Check exception here
throw new UriValidationException("PrimitiveTypeException", e,
UriValidationException.MessageKeys.INVALID_KEY_PROPERTY, name);
}