Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "ECF/RS Test Framework"

< ECF
(Details)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
= &nbsp;OSGi Remote Services Testing framework  =
+
= OSGi Remote Services Testing framework  =
  
 
This page contains the project proposal created by [Jasintha Dasanayake] for the GSoC 2012. Comments from the viewers are welcome.
 
This page contains the project proposal created by [Jasintha Dasanayake] for the GSoC 2012. Comments from the viewers are welcome.
Line 7: Line 7:
 
ECF has provided an implementation for OSGI Remote service Specification. The OSGI remote service specification 4.2 has been implemented in the latest release of the ECF.<br>Although ECF provides a good interface to develop OSGI Remote Services, there is no proper implementation for testing those services. <br>We can write unit tests, but it isn't good enough to test remote services Therefore I am proposing a remote service testing framework for ECF.
 
ECF has provided an implementation for OSGI Remote service Specification. The OSGI remote service specification 4.2 has been implemented in the latest release of the ECF.<br>Although ECF provides a good interface to develop OSGI Remote Services, there is no proper implementation for testing those services. <br>We can write unit tests, but it isn't good enough to test remote services Therefore I am proposing a remote service testing framework for ECF.
  
= Details<br> =
+
= Details<br> =
  
The main goal of this project is to provide an annotation based extendible test framework for testing remote services which has been implemented using the ECF .<br>Following are the major tasks in implementing this framework.  
+
The main goal of this project is to provide an annotation based extendible test framework for testing remote services which has been implemented using the ECF .  
  
1. Introduce annotations<br>Introduce new annotations based on the remote service functionalities.<br> e.g.: @hostService , @regService, etc.
+
<br><u>'''Following are the major tasks in implementing this framework.'''</u>  
  
2 Process the annotations<br>Develop the core processor to process above annotations and identify the meaning of the annotations. The test class will be read using java reflection then those annotation will be processing <br>using the java annotation tool framework which provide an annotation processor.
+
'''1. Introduce annotations'''<br>Introduce new annotations based on the remote service functionalities.<br> e.g.: @hostService , @regService, etc.  
  
3 Invoke tests <br>Start the test process according to the provided annotations.
+
'''2 Process the annotations'''<br>Develop the core processor to process above annotations and identify the meaning of those annotations. The test class will be read using java reflection and those annotation will be processing using the java annotation tool framework which provide an annotation processor.  
  
Example <br>Assume there is a service called FooService which has 3 operation calls X, Y and Z. <br>Using the proposed test framework, we can implement tests as follows,
+
'''3 Invoke tests '''<br>Start the test process according to the provided annotations.
 +
 
 +
Example <br>Assume there is a service called FooService which has 3 operation calls X, Y and Z. <br>Using the proposed test framework, we can implement tests as follows,  
  
 
In the test Class  
 
In the test Class  
  
@hostService{ // ' provide the relevant parameters here ex.. IP of the host '}
+
@hostService{ // ' provide the relevant parameters here ex.. IP of the host '}  
  
@regService {//'provide the param which need to publish the service in registy ex: Service name... '}
+
@regService {//'provide the param which need to publish the service in registy ex: Service name... '}  
  
@X<br>public void testXoperation(){<br>//implemetation<br>}
+
@X<br>public void testXoperation(){<br>//implemetation<br>}  
  
@Y<br>public void testYoperation(){
+
@Y<br>public void testYoperation(){  
  
}<br>…………….
+
}<br>…………….  
  
 
@hostService - Host the Service in the given server  
 
@hostService - Host the Service in the given server  
Line 38: Line 40:
  
  
 +
'''4 Result validation'''<br>
 +
 +
A test is considered successful if it completed without throwing any exception or if  it threw an exception that was expected
 +
 +
I thinking  to add this expectedExceptions attribute into operation  annotation ( @X…)
 +
 +
@X(expectedExceptions = NumberFormatException.class)
 +
 +
The testing framework also include  JUnit's Assert class, which lets you perform assertions on complex objects. An "assert" failing will trigger an AssertionErrorException, which in turn will mark the method as failed
 +
 +
 +
 +
<br>
 +
 +
= Deliverables  =
 +
 +
*Test framework Implimentation&nbsp;
 +
*Relevant Documentations and User Guides.
  
 
= <br>Timeline: =
 
= <br>Timeline: =
  
 
April 25:<br>Getting familiar with Remote Service Implementation (I have already started this task)<br>Interact with the mentor and the ECF community is vital in this period.<br>May 23:<br>Start the development of the freamwork (There is a high possibility to start this work earlier)<br>July 11:<br>Complete the functionalities of the hosting and registering the service using the annotation <br>Testing the written code should be done throughout this period<br>&nbsp;July 14:<br>Submit the code for midterm evaluations.<br>August 15:<br>Complete the functionalities of the operation mapping annotations <br>Testing the written code should be done throughout this period<br>August 22:<br>Complete documentation<br>August 25:<br>Submit completed source code<br>&nbsp;<br><br>
 
April 25:<br>Getting familiar with Remote Service Implementation (I have already started this task)<br>Interact with the mentor and the ECF community is vital in this period.<br>May 23:<br>Start the development of the freamwork (There is a high possibility to start this work earlier)<br>July 11:<br>Complete the functionalities of the hosting and registering the service using the annotation <br>Testing the written code should be done throughout this period<br>&nbsp;July 14:<br>Submit the code for midterm evaluations.<br>August 15:<br>Complete the functionalities of the operation mapping annotations <br>Testing the written code should be done throughout this period<br>August 22:<br>Complete documentation<br>August 25:<br>Submit completed source code<br>&nbsp;<br><br>

Latest revision as of 10:42, 11 April 2012

OSGi Remote Services Testing framework

This page contains the project proposal created by [Jasintha Dasanayake] for the GSoC 2012. Comments from the viewers are welcome.

Summary

ECF has provided an implementation for OSGI Remote service Specification. The OSGI remote service specification 4.2 has been implemented in the latest release of the ECF.
Although ECF provides a good interface to develop OSGI Remote Services, there is no proper implementation for testing those services.
We can write unit tests, but it isn't good enough to test remote services Therefore I am proposing a remote service testing framework for ECF.

Details

The main goal of this project is to provide an annotation based extendible test framework for testing remote services which has been implemented using the ECF .


Following are the major tasks in implementing this framework.

1. Introduce annotations
Introduce new annotations based on the remote service functionalities.
e.g.: @hostService , @regService, etc.

2 Process the annotations
Develop the core processor to process above annotations and identify the meaning of those annotations. The test class will be read using java reflection and those annotation will be processing using the java annotation tool framework which provide an annotation processor.

3 Invoke tests
Start the test process according to the provided annotations.

Example
Assume there is a service called FooService which has 3 operation calls X, Y and Z.
Using the proposed test framework, we can implement tests as follows,

In the test Class

@hostService{ // ' provide the relevant parameters here ex.. IP of the host '}

@regService {//'provide the param which need to publish the service in registy ex: Service name... '}

@X
public void testXoperation(){
//implemetation
}

@Y
public void testYoperation(){

}
…………….

@hostService - Host the Service in the given server

@regservice - Register and publish the service in service registry

@X or @Y - provide the mapping to service operation


4 Result validation

A test is considered successful if it completed without throwing any exception or if it threw an exception that was expected

I thinking to add this expectedExceptions attribute into operation annotation ( @X…)

@X(expectedExceptions = NumberFormatException.class)

The testing framework also include JUnit's Assert class, which lets you perform assertions on complex objects. An "assert" failing will trigger an AssertionErrorException, which in turn will mark the method as failed



Deliverables

  • Test framework Implimentation 
  • Relevant Documentations and User Guides.


Timeline:

April 25:
Getting familiar with Remote Service Implementation (I have already started this task)
Interact with the mentor and the ECF community is vital in this period.
May 23:
Start the development of the freamwork (There is a high possibility to start this work earlier)
July 11:
Complete the functionalities of the hosting and registering the service using the annotation
Testing the written code should be done throughout this period
 July 14:
Submit the code for midterm evaluations.
August 15:
Complete the functionalities of the operation mapping annotations
Testing the written code should be done throughout this period
August 22:
Complete documentation
August 25:
Submit completed source code
 

Back to the top