Package com.linkedin.restli.server.custom.types

Examples of com.linkedin.restli.server.custom.types.CustomLong$CustomLongCoercer


  public void testCustomTypeParametersCustomLong(ProtocolVersion version, String uri) throws Exception
  {
    ResourceModel repliesResourceModel = buildResourceModel(RepliesCollectionResource.class);
    ResourceMethodDescriptor methodDescriptor = repliesResourceModel.findNamedMethod("customLong");
    RepliesCollectionResource repliesResource = getMockResource(RepliesCollectionResource.class);
    repliesResource.customLong(new CustomLong(100L));
    EasyMock.expectLastCall().andReturn(null).once();
    checkInvocation(repliesResource,  methodDescriptor, "GET", version, uri);
  }
View Full Code Here


  public void testCustomTypeParametersCustomLongArray(ProtocolVersion version, String uri) throws Exception
  {
    ResourceModel repliesResourceModel = buildResourceModel(RepliesCollectionResource.class);
    ResourceMethodDescriptor methodDescriptor = repliesResourceModel.findNamedMethod("customLongArray");
    RepliesCollectionResource repliesResource = getMockResource(RepliesCollectionResource.class);
    CustomLong[] longs = {new CustomLong(100L), new CustomLong(200L)};
    repliesResource.customLongArray(EasyMock.aryEq(longs));
    EasyMock.expectLastCall().andReturn(null).once();
    checkInvocation(repliesResource, methodDescriptor, "GET", version, uri);
  }
View Full Code Here

  }

  @Test
  public void testConvertCustomLong()
  {
    CustomLong forceRegistration = new CustomLong(0L);

    Class<?> customLongClass = CustomLong.class;
    Object convertedCustomLong = ArgumentUtils.convertSimpleValue("100",
                                                                  DataTemplateUtil.getSchema(CustomLongRef.class),
                                                                  customLongClass
    );

    Assert.assertTrue(convertedCustomLong.getClass().equals(customLongClass));
    CustomLong customLong = (CustomLong) convertedCustomLong;
    Assert.assertTrue(customLong.toLong().equals(new Long(100)));
  }
View Full Code Here

TOP

Related Classes of com.linkedin.restli.server.custom.types.CustomLong$CustomLongCoercer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.