[mashup-dev] svn commit r3496 - in trunk/mashup/java/modules: hostobjects/src/org/wso2/mashup/hostobjects/file hostobjects/test/org/wso2/mashup/hostobjects/file integration/test-resources/scripts

svn at wso2.org svn at wso2.org
Mon Jun 4 10:55:33 PDT 2007


Author: thilina
Date: Mon Jun  4 10:55:24 2007
New Revision: 3496

Modified:
   trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/file/JavaScriptFileObject.java
   trunk/mashup/java/modules/hostobjects/test/org/wso2/mashup/hostobjects/file/JavaScriptFileObjectTest.java
   trunk/mashup/java/modules/integration/test-resources/scripts/hostObjectTest.js
Log:
renaming the file open functions

Modified: trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/file/JavaScriptFileObject.java
==============================================================================
--- trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/file/JavaScriptFileObject.java	(original)
+++ trunk/mashup/java/modules/hostobjects/src/org/wso2/mashup/hostobjects/file/JavaScriptFileObject.java	Mon Jun  4 10:55:24 2007
@@ -109,7 +109,7 @@
         return "File";
     }
 
-    public void jsFunction_openFileForReading() throws IOException {
+    public void jsFunction_openForReading() throws IOException {
         if (writer != null)
             throw new MashupFault(
                     "Cannot read from the already writing file. Please close the file beforehand by calling close().");
@@ -118,11 +118,11 @@
         }
     }
 
-    public void jsFunction_openFileForWriting() throws IOException {
+    public void jsFunction_openForWriting() throws IOException {
         getWriter(false);
     }
 
-    public void jsFunction_openFileForAppending() throws IOException {
+    public void jsFunction_openForAppending() throws IOException {
         getWriter(true);
     }
 

Modified: trunk/mashup/java/modules/hostobjects/test/org/wso2/mashup/hostobjects/file/JavaScriptFileObjectTest.java
==============================================================================
--- trunk/mashup/java/modules/hostobjects/test/org/wso2/mashup/hostobjects/file/JavaScriptFileObjectTest.java	(original)
+++ trunk/mashup/java/modules/hostobjects/test/org/wso2/mashup/hostobjects/file/JavaScriptFileObjectTest.java	Mon Jun  4 10:55:24 2007
@@ -25,7 +25,7 @@
         
         JavaScriptFileObject fileObject1 = new JavaScriptFileObject();
         fileObject1.file= new File("target/test-classes/test_readline.txt");
-        fileObject1.jsFunction_openFileForReading();
+        fileObject1.jsFunction_openForReading();
         String firstLine =fileObject1.jsFunction_readLine();
         assertEquals("WSO2 Mashup Server File Object", firstLine);
         
@@ -50,7 +50,7 @@
     public void testJsFunction_close() throws IOException {
         JavaScriptFileObject fileObject = new JavaScriptFileObject();
         fileObject.file= new File("target/test-classes/test_finishreading.txt");
-        fileObject.jsFunction_openFileForReading();
+        fileObject.jsFunction_openForReading();
         assertNotNull(fileObject.jsFunction_readLine());
         boolean success=false;
         try {
@@ -61,7 +61,7 @@
         assertTrue(success);
         
         fileObject.jsFunction_close();
-        fileObject.jsFunction_openFileForWriting();
+        fileObject.jsFunction_openForWriting();
         fileObject.jsFunction_write("This should not fail");
         fileObject.jsFunction_write("This should not fail");
         fileObject.jsFunction_close();

Modified: trunk/mashup/java/modules/integration/test-resources/scripts/hostObjectTest.js
==============================================================================
--- trunk/mashup/java/modules/integration/test-resources/scripts/hostObjectTest.js	(original)
+++ trunk/mashup/java/modules/integration/test-resources/scripts/hostObjectTest.js	Mon Jun  4 10:55:24 2007
@@ -72,10 +72,10 @@
 	if (!file.exists){
 		throw new Error();
 	}
-	file.openFileForWriting();
+	file.openForWriting();
 	file.write("WSO2 Mashup Server");
 	file.close();
-	file.openFileForReading();
+	file.openForReading();
 	file.readLine();
 	file.close();
 	var result= file.deleteFile();




More information about the Mashup-dev mailing list