The test is correct and there is a bug.
/Janne
On 4 Sep 2008, at 13:40, Simon Kitching wrote:
I've run the jspwiki 2.6.3 unit tests on linux, and test
WikiEngineTest.testSpacedNames1
fails.
The test is simple:
public void testSpacedNames1()
throws Exception
{
m_engine.saveText("This is a test", "puppaa");
assertEquals( "normal", "puppaa", m_engine.getText
("This is a test").trim() );
assertEquals( "lowercase", "puppaa", m_engine.getText("this
is a test").trim() );
assertEquals( "randomcase", "puppaa", m_engine.getText("ThiS
Is a teSt").trim() );
}
And the failure reason is simple too. The saveText call succeeds,
and creates an on-disk file
/tmp/testrepository/This+is+a+test.txt
containing the provided content.
The first assert works fine.
The second assert fails, because it looks for a file named
/tmp/testrepository/this+is+a+test.txt
which is of course not found on case-sensitive operating systems.
The getText call then returns an empty string.
Is jspwiki supposed to support pageName lookups that vary by case
(ie the test is right, and jspwiki has a bug), or are pageNames
expected to be case-sensitive on case-sensitive systems (ie the
unit test case has a bug)?
Thanks,
Simon