Skip to content

DO NOT MERGE - version 0.4.4.1 #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ If release is successful, commit the version and commit and tag changes in git.
```sh
mvn versions:commit
git add *
git commit -m "version 0.4.4"
git tag -a v0.4.4 -m "version 0.4.4"
git commit -m "version 0.4.4.1"
git tag -a v0.4.4.1 -m "version 0.4.4.1"
git push origin --tags
```

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/agent-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amadeus.session</groupId>
<artifactId>integration-tests</artifactId>
<version>0.4.4</version>
<version>0.4.4.1</version>
</parent>
<name>agent-tests</name>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/arquillian-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amadeus.session</groupId>
<artifactId>integration-tests</artifactId>
<version>0.4.4</version>
<version>0.4.4.1</version>
</parent>
<packaging>jar</packaging>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.amadeus</groupId>
<artifactId>session</artifactId>
<version>0.4.4</version>
<version>0.4.4.1</version>
</parent>
<packaging>pom</packaging>
<name>integration-tests</name>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.amadeus</groupId>
<artifactId>session</artifactId>
<version>0.4.4</version>
<version>0.4.4.1</version>
<packaging>pom</packaging>
<name>HttpSessionReplacer</name>
<description>Provides management of application sessions via a session repository (e.g. Redis). General JEE container use case with HttpSession is supported.</description>
Expand Down
2 changes: 1 addition & 1 deletion session-agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amadeus</groupId>
<artifactId>session</artifactId>
<version>0.4.4</version>
<version>0.4.4.1</version>
</parent>
<name>session-agent</name>
<description>JVM agent that enables session support in a JEE container.</description>
Expand Down
2 changes: 1 addition & 1 deletion session-replacement/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.amadeus</groupId>
<artifactId>session</artifactId>
<version>0.4.4</version>
<version>0.4.4.1</version>
</parent>
<name>session-replacement</name>
<description>Implementation of session management for JEE HttpSessions and general use case. Includes implemenations of in-memory and redis session distribution.</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ public void sessionDestroyed(RepositoryBackedSession session, boolean shutdown)
// We notify all session attribute listeners that each attribute is removed
for (String key : session.getAttributeNamesWithValues()) {
HttpSessionBindingEvent event = new HttpSessionBindingEvent((HttpSession)session, key);
Object o = session.getAttribute(key);
if (o instanceof HttpSessionBindingListener) {
((HttpSessionBindingListener) o).valueUnbound(event);
}
for (HttpSessionAttributeListener listener : descriptor.getHttpSessionAttributeListeners()) {
listener.attributeRemoved(event);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import java.util.Arrays;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpSessionActivationListener;
Expand Down Expand Up @@ -108,14 +111,25 @@ public void testAttributeHasBeenRestored() {

@Test
public void testSessionDestroyed() {
HttpSessionBindingListener bindingListener = mock(HttpSessionBindingListener.class);
String dummy = "dummy";
when(session.getAttribute("binding")).thenReturn(bindingListener);
when(session.getAttribute("attribute")).thenReturn(dummy);
when(session.getAttributeNamesWithValues()).thenReturn(Arrays.asList("binding", "attribute"));
HttpSessionListener listener = mock(HttpSessionListener.class);
descriptor.addHttpSessionListener(listener);
notifier.sessionDestroyed(session, false);
verify(bindingListener).valueUnbound(any(HttpSessionBindingEvent.class));
verify(listener).sessionDestroyed(any(HttpSessionEvent.class));
HttpSessionListener listener2 = mock(HttpSessionListener.class);
HttpSessionBindingListener bindingListener2 = mock(HttpSessionBindingListener.class);
when(session.getAttribute("binding2")).thenReturn(bindingListener2);
when(session.getAttributeNamesWithValues()).thenReturn(Arrays.asList("binding", "attribute", "binding2"));
descriptor.addHttpSessionListener(listener2);
notifier.sessionDestroyed(session, false);
verify(listener, times(2)).sessionDestroyed(any(HttpSessionEvent.class));
verify(bindingListener, times(2)).valueUnbound(any(HttpSessionBindingEvent.class));
verify(bindingListener2).valueUnbound(any(HttpSessionBindingEvent.class));
verify(listener2).sessionDestroyed(any(HttpSessionEvent.class));
}

Expand Down