From: <com...@fc...> - 2008-03-15 14:17:05
|
Author: mosipov Date: Sat Mar 15 15:17:07 2008 New Revision: 1698 Modified: FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UploadResponseTest.java Log: CLOSED - #2005: Test Cases für UploadResponse have to be reworked Modified: FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UploadResponseTest.java ============================================================================== --- FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UploadResponseTest.java (original) +++ FCKeditor.Java/branches/2.4/src/test/java/net/fckeditor/tool/UploadResponseTest.java Sat Mar 15 15:17:07 2008 @@ -22,15 +22,16 @@ public void notANumber() throws Exception { new UploadResponse("1"); } -/* + @Test public void onlyErrorNumber() throws Exception { - UploadResponse actual = UploadResponse.UR_INVALID_EXTENSION; + UploadResponse actual = new UploadResponse( + UploadResponse.EN_INVALID_EXTENSION); String expected = new String("<script type=\"text/javascript\">\n" + "window.parent.OnUploadCompleted(202);\n</script>"); assertEquals(expected, actual.toString()); } - */ + @Test public void fourArguments() throws Exception { UploadResponse actual = new UploadResponse(UploadResponse.EN_OK,"/fckeditor-java/userfiles/image/fredck.jpg"); @@ -46,23 +47,23 @@ + "window.parent.OnUploadCompleted(201,'/fckeditor-java/userfiles/image/hacked_php.txt','hacked_php.txt');\n</script>"); assertEquals(expected, actual.toString()); } -/* + @Test public void customMessage() throws Exception { UploadResponse actual = new UploadResponse(UploadResponse.EN_ERROR); - actual.setCustomMessage(UploadResponse.CM_HTTP_400); + actual.setCustomMessage("some error"); String expected = new String("<script type=\"text/javascript\">\n" - + "window.parent.OnUploadCompleted(1,'','','400 Bad request');\n</script>"); + + "window.parent.OnUploadCompleted(1,'','','some error');\n</script>"); assertEquals(expected, actual.toString()); } -*/ -/* + + @Test public void nullArguments() throws Exception { - UploadResponse actual = new UploadResponse(UploadResponse.EN_GENERIC_NUMBER,null,null,null); + UploadResponse actual = new UploadResponse(UploadResponse.EN_ERROR,null,null,null); String expected = new String("<script type=\"text/javascript\">\n" - + "window.parent.OnUploadCompleted(-1,'','','');\n</script>"); + + "window.parent.OnUploadCompleted(1,'','','');\n</script>"); assertEquals(expected, actual.toString()); } -*/ + } |