Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[ecf-dev] Progress Update ECF R-OSGI TEST FRAMEWORK

Hi Markus , Scott, Harshan and All 

 I have  completed the following features in the R-OSGI Test Framework 

  •  Register and Host the remote Service  
  •  Create Service Client 
  •  Read the test case annotations and process the annotations 
  •  Pass the user input into service proxy object and invoke  service object and obtain the result 
  •  Compare the with the expected result and  real result and generate the output 

Test framework define annotations and Details 

@ServiceTest(IService = "",ImplService="",
libraries ="org.jasintha.ecf.service.cal_1.0.0.jar" )

All the test class should use this annotation, framework only process  classes which having this annotation
here you need to specify your interface and Imple classes, If those classes are not in your current project, you need to give the bundle name and import  those bundle into the project. If above classes in your current project
you can ignore the libraries.

 @Test(Methodname = "add")
 This is used to annotate your test method, you need to specify the original method name as the parameter 

@Param(value="4")int param1
 using this annotation you can pass the parameter to the method

 If you expect a value as a return of this method you can pass that value using this annotation 

@ResultException(expected = NumberFormatException.class)
if you expect a Exception as a result of this method you can define that exception using this annotation

@ServiceHost(hostId ="r-osgi://")
if you want to test your method with the existing r-osgi service without using framework service you can use this annotation and specify the host 

 These are the current annotations in the framework  I am sure we need to do some changes to above annotations also may need to introduce few annotations according to the your comments and suggestions 

 Compete Test case look like as follows 

@Test(Methodname = "add")
public @Result(valu="4")int testadd1(@Param(value="2")int param1,@Param(value="2")int param2){
        return 0;

 @Test(Methodname = "addString")
public @ResultException(expected = NumberFormatException.class)int testadd2(@Param(value="abc")String param1,@Param(value="2")String param2){
        return 0;

I have done a small demonstrations to the Harshana,  here I have attached screen shots of that demo,  you also can try out the framework, code is available in the git repository [1] ,
( tested in the Linux and eclipse Helios ,java 1.6 environment)

Step to test the Framework
  1. Download the org.eclipse.ecf.remoteservice.testframework form the git repo
  2. Import the project into your eclipse work-space 
  3. There is one external dependency(Apache common lang ) I already have put that jar into lib folder so you don't have to worry 
  4. Add  ECF budles into the class path 
  5. Run the Eclipse . 

I would like to do a demo to Markus and Scott too,  Because I strongly  want to develop a very good and  useful Testing framework for R-OSGI.

Shall we arrange a goto meeting or skype  session ASAP to discuss changes and future works 


Thanks and Regards

[1] -

Thanks & Regards

Jasintha Dasanayake
MSc  Student , SHU Uk 

mobile +94 772 916 596 ,

Attachment: menu.png
Description: PNG image

Attachment: Result.png
Description: PNG image

Attachment: testCases.png
Description: PNG image

Back to the top