Dashboard > WSO2 Mashup Server > ... > Quality Assurance > Mashup Server QA Testing Checklist - Host Objects
  WSO2 Mashup Server Log in | Register   View a printable version of the current page.  
  Mashup Server QA Testing Checklist - Host Objects
Added by Yumani Ranaweera , last edited by Anushka Dayananda on Aug 06, 2008  (view change)
Labels: 
(None)

File host object

# Test Scenario Test Procedure Expected Results Actual Results (0.2 RC2)
Actual Results (0.2 RC3)
1 Checking  the following APIs;
openForWritting()
openForReading()
read()
readLine()
write()
close()
createFile(
print())
-Create a service using the source below;
this.serviceName = "fileHostObjectTesting";
this.documentation = <div>This is a service used to QA the <b>file host objects</b>.</div>;

//get the file object
var file = new File ("hello.text");

newFile.inputTypes = {};
newFile.outputType = "string";
function newFile(){
//cretae a new instance of the file object
	var result = file.createFile();
	if (!result){
		return (result + " = file was not created");}
	else{
		return (result + " = file was created"); }}

WritingReading.inputTypes = {"text" :"string"};
WritingReading.outputType = "string";
function WritingReading(text){
	file.openForWriting();
	file.write(text);
	file.close();
	file.openForReading();
	var readtext = file.read(10);
	file.close();
	return (readtext);
}

-Deploy the service

- After the service is deployed there should be a hello.txt file created in the <service name>.resources folder.
- The WrittingReading function should add a text to the file and also should read and return the 10 chars of the text from ?tryit

PASS PASS
  Checking  the following APIs;
openForWritting()
writeLine()
write()
close()
createFile(
print()
deleteFile() 
move()
- Create a service using the source below;
function FileMove(){
  var fileM = new File("helloM.txt");
  fileM.createFile();
  var moved = fileM.move("moved/helloM.txt");
  return moved;
 }

 function FileCreate(){
  var fileC = new File("tempdir/helloC.txt");
  var resultC= fileC.createFile();
  return resultC;
 }

 function FileDelete(){
  var fileD = new File("helloD.txt");
  fileD.createFile();

  var resultD= fileD.deleteFile();
  return resultD;
 }

 function FileWrite(){
  var fileW = new File("helloW.txt");
  if (fileW.exists){
  fileW.openForWriting();
  fileW.writeLine("this is a new line");
  }

  fileW.createFile();
  fileW.openForWriting();
  fileW.write("WSO2 Mashup Server");
  fileW.close();
 }
-Deploy the service.
FileMove() =Should create helloM.txt in <serviceName>.resources folder and move it to <serviceName>.resources\moved.  Should return 'true' in ?tryit if the file is moved and 'false' otherwise.
FileCreate() =Should create a helloC.txt in  <serviceName>.resources\tempdir folder. Should return 'true' in ?tryit if the file was created and 'false' otherwise.
FileDelete() =Should create a helloC.txt in  <serviceName>.resources\ folder and delete it.
FileWrite() = Should create a helloC.txt in  <serviceName>.resources\ folder and write a line "WSO2 Mashup Server" in it. If the file already exists the line "this is a new line should be written".
FileMove() -PASS
 FileCreate() -PASS

FileDelete() -PASS

FileWrite() -PASS
FileMove() -PASS
 FileCreate() -PASS

FileDelete() -PASS

FileWrite() -PASS

Session host object

# Test Scenario Test Procedure Expected Results Actual Results
1 Checking the 'application' session host object.
     
2 Checking the 'transportsession' session host object.
     
3 Checking the 'request' session host object.
     

System host object

# Test Scenario Test Procedure Expected Results Actual Results
1 Checking a simple scenario      
2 Checking a scenario with the a .js included.
     

Atom host objects

# Test Scenario Test Procedure Expected Results Actual Results (0.2 RC1)
Actual Results (0.2 RC2)
Actual Results (0.2 RC3)
1   -Create a service using the source given below;
atomFeedTest.inputTypes = {};
atomFeedTest.outputType = "string";
function atomFeedTest(){
    //Creating a feed
    var atomFeed = new AtomFeed();

    //Creating an Entry
    var atomEntry = new AtomEntry();
    atomEntry.id= "id:Testing";
    atomEntry.author= "Tester";
    atomEntry.content = "This is a test string to be stored as content in the entry.";

    //Adding the entry to the feed
    atomFeed.addEntry(atomEntry);

    //Writing the feed to a file
    var result = atomFeed.writeTo("new.xml");
	return result;
 }
-Deploy the service and check the WSDL and tryit
-new.xml should be created in <serviceName>.resources folder and it should have the atom entry in it.
PASS PASS PASS

RSS host object

# Test Scenario Test Procedure Expected Results Actual Results (0.2 RC3)
  Check the following APIs;
feed(), reader() APIs
-Create a service using the source below
feedTest1.inputTypes = {};
 feedTest1.outputType = "string";
 function feedTest1(){
  var reader = new FeedReader();
  var feed = new Feed();
  feed = reader.get("http://www.formula1.com/rss/news/headlines.rss");
  var result =feed.writeTo("test.xml");

  var entries = feed.getEntries();
  return entries;
 }

-Save and deploy the service. Check the tryit.

The ?tryit should return the the feed object that was read.
PASS
  Check the exception handling.
-Update the above source as given below; 
feedTest1.inputTypes = {};
 feedTest1.outputType = "string";
 function feedTest1(){
 var reader = new FeedReader();
 var feed = new Feed();
 try {
  feed = reader.get("http://wso2.org/atom/feed");
 }
 catch (e) {
 throw ("invalid feed");
 }
 var result =feed.writeTo("test.xml");

 var entries = feed.getEntries();
 return entries;
 }

-Save and deploy the service and check the ?tryit

The ?tryit should catch the error in the RSS feed.
PASS
   MASHUP-788  -Create a service using the code below.
function test()
 var reader = new FeedReader();
 var feed = reader.get("http://auburnmarshes.spaces.live.com/feed.rss{color:#000099}");
 return <test>{feed.getEntries()\[0\].link}</test>;}
-Save and deploy the service. Check the ?tryit.
- tryit should return the xml representation of the entry.
PASS (1.1 nightly build)
  MASHUP-787 -Create a service using the code below.

function test() {
 var reader = new FeedReader();
 var feed = reader.get("http://auburnmarshes.spaces.live.com/feed.rss");
 return <test>{feed.getEntries()\[0\].link}</test>;}
-Save and deploy the service. Check the ?tryit.
- tryit should return the URL.
PASS (1.1 nightly build)
         
         
         
         
         

Powered by a free Atlassian Confluence Open Source Project License granted to WSO2 Inc.. Evaluate Confluence today.
Powered by Atlassian Confluence 2.7.1, the Enterprise Wiki. Bug/feature request - Atlassian news - Contact administrators