Search in sources :

Example 6 with HttpClientSessionImpl

use of com.canoo.dp.impl.server.client.HttpClientSessionImpl in project dolphin-platform by canoo.

the class ClientSessionImplTest method testInvalidate.

@Test
public void testInvalidate() {
    // given:
    ClientSession dolphinSession = new HttpClientSessionImpl(new HttpSessionMock());
    // when:
    dolphinSession.setAttribute("test-attribute1", "Hello Dolphin Session");
    dolphinSession.setAttribute("test-attribute2", "Yeah!");
    dolphinSession.setAttribute("test-attribute3", "Dolphin Platform");
    dolphinSession.invalidate();
    // then:
    Assert.assertEquals(0, dolphinSession.getAttributeNames().size());
    Assert.assertFalse(dolphinSession.getAttributeNames().contains("test-attribute1"));
    Assert.assertFalse(dolphinSession.getAttributeNames().contains("test-attribute2"));
    Assert.assertFalse(dolphinSession.getAttributeNames().contains("test-attribute3"));
    Assert.assertNull(dolphinSession.getAttribute("test-attribute1"));
    Assert.assertNull(dolphinSession.getAttribute("test-attribute2"));
    Assert.assertNull(dolphinSession.getAttribute("test-attribute3"));
}
Also used : HttpSessionMock(com.canoo.impl.server.util.HttpSessionMock) ClientSession(com.canoo.platform.server.client.ClientSession) HttpClientSessionImpl(com.canoo.dp.impl.server.client.HttpClientSessionImpl) Test(org.testng.annotations.Test)

Example 7 with HttpClientSessionImpl

use of com.canoo.dp.impl.server.client.HttpClientSessionImpl in project dolphin-platform by canoo.

the class ClientSessionImplTest method testNullAttribute.

@Test
public void testNullAttribute() {
    // given:
    ClientSession dolphinSession = new HttpClientSessionImpl(new HttpSessionMock());
    // then:
    Assert.assertEquals(0, dolphinSession.getAttributeNames().size());
    Assert.assertNull(dolphinSession.getAttribute("test-attribute"));
}
Also used : HttpSessionMock(com.canoo.impl.server.util.HttpSessionMock) ClientSession(com.canoo.platform.server.client.ClientSession) HttpClientSessionImpl(com.canoo.dp.impl.server.client.HttpClientSessionImpl) Test(org.testng.annotations.Test)

Aggregations

HttpClientSessionImpl (com.canoo.dp.impl.server.client.HttpClientSessionImpl)7 HttpSessionMock (com.canoo.impl.server.util.HttpSessionMock)7 ClientSession (com.canoo.platform.server.client.ClientSession)7 Test (org.testng.annotations.Test)7