You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jspwiki.apache.org by ja...@apache.org on 2008/05/31 11:14:26 UTC
svn commit: r661988 -
/incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/attachment/AttachmentManagerTest.java
Author: jalkanen
Date: Sat May 31 02:14:26 2008
New Revision: 661988
URL: http://svn.apache.org/viewvc?rev=661988&view=rev
Log:
Added testValidateFileName()
Modified:
incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/attachment/AttachmentManagerTest.java
Modified: incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/attachment/AttachmentManagerTest.java
URL: http://svn.apache.org/viewvc/incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/attachment/AttachmentManagerTest.java?rev=661988&r1=661987&r2=661988&view=diff
==============================================================================
--- incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/attachment/AttachmentManagerTest.java (original)
+++ incubator/jspwiki/trunk/tests/com/ecyrd/jspwiki/attachment/AttachmentManagerTest.java Sat May 31 02:14:26 2008
@@ -349,6 +349,13 @@
}
}
+ public void testValidateFileName() throws Exception
+ {
+ assertEquals( "foo.jpg", "foo.jpg", AttachmentManager.validateFileName( "foo.jpg" ) );
+
+ assertEquals( "C:\\Windows\\test.jpg", "test.jpg", AttachmentManager.validateFileName( "C:\\Windows\\test.jpg" ));
+ }
+
public static Test suite()
{
return new TestSuite( AttachmentManagerTest.class );