Java Code Examples for org.restlet.Request#setRootRef()

The following examples show how to use org.restlet.Request#setRootRef() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestRestManager.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Test
public void testResolveResourceId () throws Exception {
  Request testRequest = new Request();
  Reference rootRef = new Reference("http://solr.apache.org/");
  testRequest.setRootRef(rootRef);

  Reference resourceRef = new Reference("http://solr.apache.org/schema/analysis/synonyms/de");
  testRequest.setResourceRef(resourceRef);

  String resourceId = RestManager.ManagedEndpoint.resolveResourceId(testRequest);
  assertEquals(resourceId, "/schema/analysis/synonyms/de");
}
 
Example 2
Source File: TestRestManager.java    From lucene-solr with Apache License 2.0 5 votes vote down vote up
@Test
public void testResolveResourceIdDecodeUrlEntities () throws Exception {
  Request testRequest = new Request();
  Reference rootRef = new Reference("http://solr.apache.org/");
  testRequest.setRootRef(rootRef);

  Reference resourceRef = new Reference("http://solr.apache.org/schema/analysis/synonyms/de/%C3%84ndern");
  testRequest.setResourceRef(resourceRef);

  String resourceId = RestManager.ManagedEndpoint.resolveResourceId(testRequest);
  assertEquals(resourceId, "/schema/analysis/synonyms/de/Ă„ndern");
}