bossadvisors / memcached-session-manager

Automatically exported from code.google.com/p/memcached-session-manager
0 stars 0 forks source link

Tomcat doesn't start in TestUtils on Windows - backslash escape needed #87

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Building trunk and 1.3.6 doesn't work on Windows, because TestUtils uses the 
File.separator as a replacement in replaceAll(). But backslashes have a special 
meaning there.

Possible trivial patch attached.

Original issue reported on code.google.com by rainer.j...@kippdata.de on 9 Mar 2011 at 12:21

Attachments:

GoogleCodeExporter commented 9 years ago
I'd suspect that with this patch tests don't run through even on windows, as

"foo.bar.baz".replaceAll( "\\.", Pattern.quote( "\\" ) );

gives me "fooQ\EbarQ\Ebaz" which is not expected (expected on windows: 
"foo\bar\baz")

Therefore I'm using "\\\\" as replacement for the dots for windows.

Pushed in master and tomcat7 branch. Can you confirm that this is working for 
you?

Original comment by martin.grotzke on 9 Mar 2011 at 1:01

GoogleCodeExporter commented 9 years ago
Yes, sorry the patch was nonsense. I hoped to provide a better one before you 
take a look, but there was lunch break before :)

Your patch works fine. Still two tests failing but seemingly unrelated.

testNonStickySessionIsStoredInSecondaryMemcachedForBackup fails likely because 
there is no secondary memcached on the test system. The other failing test is 
testChangeSessionId(NON_STICKY). It fails in line

verify( _memcachedMock, times( 1 ) ).set( eq( session.getId() ), anyInt(), 
any() );

with message:

Argument(s) are different! Wanted:
memcachedClient.set(
    "E7400A2744F820E192F9FB4B68D5B044-n1",
    <any>,
    <any>
);
-> at 
de.javakaffee.web.msm.MemcachedBackupSessionManagerTest.testChangeSessionId(Memc
achedBackupSessionManagerTest.java:254)
Actual invocation has different arguments:
memcachedClient.set(
    "validity:04476FA52995AACD01CA4BDEB8D497F4-n1",
    1800,
    [0, 0, 7, 8, 0, 0, 1, 46, -102, -61, -45, 110, 0, 0, 1, 46, -102, -61, -45, 110]
);
-> at 
de.javakaffee.web.msm.LockingStrategy.onAfterBackupSession(LockingStrategy.java:
270)

        at de.javakaffee.web.msm.MemcachedBackupSessionManagerTest.testChangeSessionId(MemcachedBackupSessionManagerTest.java:254)
... Removed 22 stack frames
FAILED: testNonStickySessionIsStoredInSecondaryMemcachedForBackup
java.lang.AssertionError: expected:<true> but was:<false>
        at de.javakaffee.web.msm.integration.NonStickySessionsIntegrationTest.testNonStickySessionIsStoredInSecondaryMemcachedForBackup(NonStickySessionsIntegrationTest.java:437)
... Removed 27 stack frames

Is it an expected failure? Should I open an issue for this test failure?
It seems there's no discussion list (or I didn't find it).

Original comment by rainer.j...@kippdata.de on 9 Mar 2011 at 1:32

GoogleCodeExporter commented 9 years ago
Sorry, more test failures I overlooked:

de.javakaffee.web.msm.MemcachedBackupSessionManagerTest
de.javakaffee.web.msm.MemcachedSessionManagerIntegrationTest
de.javakaffee.web.msm.SessionTrackerValveTest
de.javakaffee.web.msm.TranscoderServiceTest
de.javakaffee.web.msm.integration.MemcachedFailoverIntegrationTest
de.javakaffee.web.msm.integration.NonStickySessionsIntegrationTest
de.javakaffee.web.msm.integration.TomcatFailoverIntegrationTest
de.javakaffee.web.msm.serializer.hibernate.JavaSerializationHibernateCollections
Test

Original comment by rainer.j...@kippdata.de on 9 Mar 2011 at 1:37

GoogleCodeExporter commented 9 years ago
Ok, so I close this issue now as the backslash-thing is fixed.

The mailing list is at http://groups.google.com/group/memcached-session-manager 
(the link is on the home page left bottom).

If you can open an issue for these 2 failing tests it would be great (are they 
failing when running with buildr, from eclipse/IDE?)! Other tests might be 
reported by buildr as failed as they're following the other ones. You can run a 
single test via e.g.
$ buildr test:MemcachedBackupSessionManagerTest

Original comment by martin.grotzke on 9 Mar 2011 at 2:06