List of usage examples for javax.servlet.http HttpSession getValueNames
@Deprecated
public String[] getValueNames();
From source file:org.codehaus.wadi.web.TestHttpSession.java
public void testCreateHttpSession(Manager manager) { events.clear();/* w ww . j a va 2s . c o m*/ // create a session HttpSession session = ((WADIHttpSession) manager.create(null)).getWrapper(); assertTrue(!session.getAttributeNames().hasMoreElements()); assertTrue(session.getValueNames().length == 0); Pair pair = (Pair) events.remove(0); assertTrue(pair != null); assertTrue(pair.getType().equals("sessionCreated")); assertTrue(pair.getEvent().getSession() == session); assertTrue(events.size() == 0); }
From source file:org.codehaus.wadi.web.TestHttpSession.java
public void testGetValueNames(Manager manager) { HttpSession session = ((WADIHttpSession) manager.create(null)).getWrapper(); assertTrue(session.getValueNames().length == 0); session.setAttribute("foo", "bar"); assertTrue(session.getValueNames().length == 1); session.setAttribute("bar", "baz"); assertTrue(session.getValueNames().length == 2); session.setAttribute("baz", "foo"); assertTrue(session.getValueNames().length == 3); session.setAttribute("baz", null); assertTrue(session.getValueNames().length == 2); session.setAttribute("bar", null); assertTrue(session.getValueNames().length == 1); session.setAttribute("foo", null); assertTrue(session.getValueNames().length == 0); }