Tabnine Logo
BaseRequestItemTest
Code IndexAdd Tabnine to your IDE (free)

How to use
BaseRequestItemTest
in
org.apache.shindig.protocol

Best Java code snippets using org.apache.shindig.protocol.BaseRequestItemTest (Showing top 20 results out of 315)

origin: org.apache.shindig/shindig-common

@Test
public void testGetTypedParameter() throws Exception {
 request.setParameter("anykey", "{name: 'Bob', id: '1234'}");
 InputData input = request.getTypedParameter("anykey", InputData.class);
 assertEquals("Bob", input.name);
 assertEquals(1234, input.id);
}
origin: org.gatein.shindig/shindig-common

@Test
public void testAttributes() throws Exception {
 assertNull(request.getAttribute("undefined"));
 request.setAttribute("test", "value");
 assertEquals("value", request.getAttribute("test"));
 request.setAttribute("test", null);
 assertNull(request.getAttribute("undefined"));
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testGetParameters() throws Exception {
 request.setParameter("anykey", "{name: 'Bob', id: '1234'}");
 Map<String, Object> params = request.getParameters();
 assertEquals(1, params.size());
 assertTrue(params.containsKey("anykey"));
 try {
  params.put("this", "is bad");
  fail("Params should be immutable");
 } catch (UnsupportedOperationException e) {
  // As expected
 }
}
origin: com.lmco.shindig/shindig-common

@Test
public void testGetTypedParameter() throws Exception {
 request.setParameter("anykey", "{name: 'Bob', id: '1234'}");
 InputData input = request.getTypedParameter("anykey", InputData.class);
 assertEquals("Bob", input.name);
 assertEquals(1234, input.id);
}
origin: org.apache.shindig/shindig-common

@Test
public void testAttributes() throws Exception {
 assertNull(request.getAttribute("undefined"));
 request.setAttribute("test", "value");
 assertEquals("value", request.getAttribute("test"));
 request.setAttribute("test", null);
 assertNull(request.getAttribute("undefined"));
}
origin: org.apache.shindig/shindig-common

@Test
public void testGetParameters() throws Exception {
 request.setParameter("anykey", "{name: 'Bob', id: '1234'}");
 Map<String, Object> params = request.getParameters();
 assertEquals(1, params.size());
 assertTrue(params.containsKey("anykey"));
 try {
  params.put("this", "is bad");
  fail("Params should be immutable");
 } catch (UnsupportedOperationException e) {
  // As expected
 }
}
origin: org.gatein.shindig/shindig-common

@Test
public void testGetTypedParameter() throws Exception {
 request.setParameter("anykey", "{name: 'Bob', id: '1234'}");
 InputData input = request.getTypedParameter("anykey", InputData.class);
 assertEquals("Bob", input.name);
 assertEquals(1234, input.id);
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testAttributes() throws Exception {
 assertNull(request.getAttribute("undefined"));
 request.setAttribute("test", "value");
 assertEquals("value", request.getAttribute("test"));
 request.setAttribute("test", null);
 assertNull(request.getAttribute("undefined"));
}
origin: apache/shindig

@Test
public void testGetParameters() throws Exception {
 request.setParameter("anykey", "{name: 'Bob', id: '1234'}");
 Map<String, Object> params = request.getParameters();
 assertEquals(1, params.size());
 assertTrue(params.containsKey("anykey"));
 try {
  params.put("this", "is bad");
  fail("Params should be immutable");
 } catch (UnsupportedOperationException e) {
  // As expected
 }
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testGetTypedParameter() throws Exception {
 request.setParameter("anykey", "{name: 'Bob', id: '1234'}");
 InputData input = request.getTypedParameter("anykey", InputData.class);
 assertEquals("Bob", input.name);
 assertEquals(1234, input.id);
}
origin: com.lmco.shindig/shindig-common

@Test
public void testAttributes() throws Exception {
 assertNull(request.getAttribute("undefined"));
 request.setAttribute("test", "value");
 assertEquals("value", request.getAttribute("test"));
 request.setAttribute("test", null);
 assertNull(request.getAttribute("undefined"));
}
origin: apache/shindig

@Test
public void testGetTypedParameter() throws Exception {
 request.setParameter("anykey", "{name: 'Bob', id: '1234'}");
 InputData input = request.getTypedParameter("anykey", InputData.class);
 assertEquals("Bob", input.name);
 assertEquals(1234, input.id);
}
origin: apache/shindig

@Test
public void testAttributes() throws Exception {
 assertNull(request.getAttribute("undefined"));
 request.setAttribute("test", "value");
 assertEquals("value", request.getAttribute("test"));
 request.setAttribute("test", null);
 assertNull(request.getAttribute("undefined"));
}
origin: com.lmco.shindig/shindig-common

@Test
public void testJSONConstructor() throws Exception {
 request = new BaseRequestItem(new JSONObject('{' +
     "userId:john.doe," +
     "groupId:@self," +
     "fields:[huey,dewey,louie]" +
   '}'), null, FAKE_TOKEN, converter, converter);
 assertEquals(Lists.newArrayList("huey", "dewey", "louie"), request.getListParameter("fields"));
}
origin: org.gatein.shindig/shindig-common

@Test
public void testJSONConstructor() throws Exception {
 request = new BaseRequestItem(new JSONObject('{' +
     "userId:john.doe," +
     "groupId:@self," +
     "fields:[huey,dewey,louie]" +
   '}'), null, FAKE_TOKEN, converter, converter);
 assertEquals(Lists.newArrayList("huey", "dewey", "louie"), request.getListParameter("fields"));
}
origin: org.apache.shindig/shindig-common

@Test
public void testJSONConstructor() throws Exception {
 request = new BaseRequestItem(new JSONObject('{' +
     "userId:john.doe," +
     "groupId:@self," +
     "fields:[huey,dewey,louie]" +
   '}'), null, FAKE_TOKEN, converter, converter);
 assertEquals(Lists.newArrayList("huey", "dewey", "louie"), request.getListParameter("fields"));
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testJSONConstructor() throws Exception {
 request = new BaseRequestItem(new JSONObject('{' +
     "userId:john.doe," +
     "groupId:@self," +
     "fields:[huey,dewey,louie]" +
   '}'), null, FAKE_TOKEN, converter, converter);
 assertEquals(Lists.newArrayList("huey", "dewey", "louie"), request.getListParameter("fields"));
}
origin: apache/shindig

@Test
public void testJSONConstructor() throws Exception {
 request = new BaseRequestItem(new JSONObject('{' +
     "userId:john.doe," +
     "groupId:@self," +
     "fields:[huey,dewey,louie]" +
   '}'), null, FAKE_TOKEN, converter, converter);
 assertEquals(Lists.newArrayList("huey", "dewey", "louie"), request.getListParameter("fields"));
}
origin: org.wso2.org.apache.shindig/shindig-common

@Test
public void testFields() throws Exception {
 request.setParameter("fields", "");
 assertEquals(Sets.<String>newHashSet(), request.getFields());
 request.setParameter("fields", "happy,sad,grumpy");
 assertEquals(Sets.newHashSet("happy", "sad", "grumpy"), request.getFields());
}
origin: com.lmco.shindig/shindig-common

@Test
public void testFields() throws Exception {
 request.setParameter("fields", "");
 assertEquals(Sets.<String>newHashSet(), request.getFields());
 request.setParameter("fields", "happy,sad,grumpy");
 assertEquals(Sets.newHashSet("happy", "sad", "grumpy"), request.getFields());
}
org.apache.shindig.protocolBaseRequestItemTest

Javadoc

Test BaseRequestItem

Most used methods

  • assertEquals
  • assertNull
  • assertTrue
  • fail

Popular in Java

  • Start an intent from android
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Collectors (java.util.stream)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Runner (org.openjdk.jmh.runner)
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now