Examples of PathKeys


Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "get");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] {Long.class});
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "statuses");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertEquals(keys.getAsLong("statusID"), new Long(1));
    assertNull(keys.getAsString("foo"));
  }
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "get");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] {CompoundKey.class});
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "follows");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertEquals(keys.getAsLong("followerID"), new Long(1L));
    assertEquals(keys.getAsLong("followeeID"), new Long(2L));
  }
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "update");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] { Long.class, Status.class });
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "statuses");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertEquals(keys.getAsLong("statusID"), new Long(1));
    assertNull(keys.getAsString("foo"));
  }
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "delete");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] { Long.class });
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "statuses");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertEquals(keys.getAsLong("statusID"), new Long(1));
    assertNull(keys.getAsString("foo"));
  }
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "batchGet");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] {Set.class});
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "follows");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertNull(keys.getAsString("followerID"));
    assertNull(keys.getAsString("followeeID"));

    CompoundKey key1 = new CompoundKey();
    key1.append("followerID", 1L);
    key1.append("followeeID", 2L);
    CompoundKey key2 = new CompoundKey();
    key2.append("followerID", 3L);
    key2.append("followeeID", 4L);
    Set<CompoundKey> expectedBatchKeys = new HashSet<CompoundKey>();
    expectedBatchKeys.add(key1);
    expectedBatchKeys.add(key2);

    assertEquals(keys.getBatchIds().size(), 2);
    for (CompoundKey batchKey : keys.<CompoundKey>getBatchIds())
    {
      assertTrue(expectedBatchKeys.contains(batchKey));
      expectedBatchKeys.remove(batchKey);
    }
    assertEquals(expectedBatchKeys.size(), 0);
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

)
public class AssociationsSubResource extends CollectionResourceTemplate<String, Message>
{
  public Message get(String key)
  {
    PathKeys pathKeys = getContext().getPathKeys();
    String srcKey = pathKeys.getAsString("src");
    String destKey = pathKeys.getAsString("dest");
    Message message = new Message();
    message.setId(srcKey);
    message.setTone(Tone.FRIENDLY);
    message.setMessage(destKey);
    return message;
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "get");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] {});
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "trending");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertNull(keys.getBatchIds());
  }
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "update");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] { Trending.class });
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "trending");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertNull(keys.getBatchIds());
  }
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "update");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] { PatchRequest.class });
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "trending");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertNull(keys.getBatchIds());
  }
View Full Code Here

Examples of com.linkedin.restli.server.PathKeys

    assertEquals(resourceMethodDescriptor.getMethod().getName(), "delete");
    assertEquals(resourceMethodDescriptor.getMethod().getParameterTypes(), new Class<?>[] {});
    assertEquals(resourceMethodDescriptor.getResourceModel().getName(), "trending");

    assertNotNull(result.getContext());
    PathKeys keys = result.getContext().getPathKeys();
    assertNull(keys.getBatchIds());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.