Skip to content
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

Pippo Template Parent #285

Merged
merged 1 commit into from Jun 21, 2016
Merged

Pippo Template Parent #285

merged 1 commit into from Jun 21, 2016

Conversation

barrantesgerman
Copy link
Contributor

This is the parent of all templates modules

I replaced the tabs for 4 spaces in the poms and modify the return of Memcached SessionDataStore

Any advice/recommendation is welcome

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 14.303% when pulling a954acb on barrantesgerman:master into 1a084f8 on decebals:master.

@@ -75,14 +75,14 @@ public void save(SessionData sessionData) {

@Override
public SessionData get(String sessionId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A suggestion:

try {
    return this.sessions.get(sessionId);
} catch (TimeoutException | InterruptedException | MemcachedException ex) {
    log.error("An error occurred when get SessionData.", ex);
    return null;
}

without to declare the sessionData variable

I prefer to use few code lines to express an idea but without to sacrifice the readability.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will do the change

@decebals
Copy link
Member

👍 Thanks!

@decebals decebals merged commit 99dbc2d into pippo-java:master Jun 21, 2016
@decebals
Copy link
Member

We have a little problem after merged this PR

[main] INFO com.hazelcast.nio.tcp.TcpIpConnection - [172.17.9.55]:5701 [dev] [3.6.3] Connection [Address[172.17.9.55]:5702] lost. Reason: Socket explicitly closed
[main] INFO com.hazelcast.instance.Node - [172.17.9.55]:5701 [dev] [3.6.3] Shutting down node engine...
[hz._hzInstance_2_dev.generic-operation.thread-10] INFO com.hazelcast.nio.tcp.TcpIpConnection - [172.17.9.55]:5702 [dev] [3.6.3] Connection [Address[172.17.9.55]:5701] lost. Reason: Socket explicitly closed
[hz._hzInstance_2_dev.generic-operation.thread-10] INFO com.hazelcast.cluster.ClusterService - [172.17.9.55]:5702 [dev] [3.6.3] Removing Member [172.17.9.55]:5701
[hz._hzInstance_2_dev.generic-operation.thread-10] INFO com.hazelcast.partition.InternalPartitionService - [172.17.9.55]:5702 [dev] [3.6.3] Removing Member [172.17.9.55]:5701
[main] INFO com.hazelcast.instance.NodeExtension - [172.17.9.55]:5701 [dev] [3.6.3] Destroying node NodeExtension.
[main] INFO com.hazelcast.instance.Node - [172.17.9.55]:5701 [dev] [3.6.3] Hazelcast Shutdown is completed in 1106 ms.
[main] INFO com.hazelcast.core.LifecycleService - [172.17.9.55]:5701 [dev] [3.6.3] Address[172.17.9.55]:5701 is SHUTDOWN
[main] INFO com.hazelcast.core.LifecycleService - [172.17.9.55]:5702 [dev] [3.6.3] Address[172.17.9.55]:5702 is SHUTTING_DOWN
[main] INFO com.hazelcast.instance.Node - [172.17.9.55]:5702 [dev] [3.6.3] Shutting down multicast service...
[main] INFO com.hazelcast.instance.Node - [172.17.9.55]:5702 [dev] [3.6.3] Shutting down connection manager...
[hz._hzInstance_2_dev.generic-operation.thread-10] INFO com.hazelcast.cluster.ClusterService - [172.17.9.55]:5702 [dev] [3.6.3] 

Members [1] {
    Member [172.17.9.55]:5702 this
}

[main] INFO com.hazelcast.instance.Node - [172.17.9.55]:5702 [dev] [3.6.3] Shutting down node engine...
[main] INFO com.hazelcast.instance.NodeExtension - [172.17.9.55]:5702 [dev] [3.6.3] Destroying node NodeExtension.
[main] INFO com.hazelcast.instance.Node - [172.17.9.55]:5702 [dev] [3.6.3] Hazelcast Shutdown is completed in 75 ms.
[main] INFO com.hazelcast.core.LifecycleService - [172.17.9.55]:5702 [dev] [3.6.3] Address[172.17.9.55]:5702 is SHUTDOWN
Tests run: 5, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 23.193 sec <<< FAILURE!
testGet(ro.pippo.session.hazelcast.HazelcastSessionDataStorageTest)  Time elapsed: 6.028 sec  <<< FAILURE!
java.lang.AssertionError: expected:<SessionData{id='0520429b6393491cb1834072d93034ec', creationTime=1466493392046, lastAccessedTime=1466493392046, maxInactiveInterval=1800, attributes={KEY=VALUE}}> but was:<null>
    at org.junit.Assert.fail(Assert.java:88)
    at org.junit.Assert.failNotEquals(Assert.java:834)
    at org.junit.Assert.assertEquals(Assert.java:118)
    at org.junit.Assert.assertEquals(Assert.java:144)
    at ro.pippo.session.hazelcast.HazelcastSessionDataStorageTest.testGet(HazelcastSessionDataStorageTest.java:95)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:483)
    at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
    at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
    at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)


Results :

Failed tests:   testGet(ro.pippo.session.hazelcast.HazelcastSessionDataStorageTest): expected:<SessionData{id='0520429b6393491cb1834072d93034ec', creationTime=1466493392046, lastAccessedTime=1466493392046, maxInactiveInterval=1800, attributes={KEY=VALUE}}> but was:<null>

Tests run: 5, Failures: 1, Errors: 0, Skipped: 0

See https://travis-ci.org/decebals/pippo for more info.

@barrantesgerman
Copy link
Contributor Author

I have not changed the test, I'll check that could have happened

@barrantesgerman
Copy link
Contributor Author

I think the problem was that first run Delete and then Get
I will isolate Hazelcast instance for each test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants