[Carbon-dev] How I wrote a test case when I fixed an issue

Afkham Azeez azeez at wso2.com
Wed Jan 4 03:38:53 EST 2012


I just want to share my experience on how I wrote a test case when I fixed
https://wso2.org/jira/browse/CARBON-11833

The test case can be found at
https://svn.wso2.org/repos/wso2/trunk/carbon/core/integration/tests/src/test/java/org/wso2/carbon/integration/tests/AccessNonExistentServiceTestCase.java

The issue was, if a ?wsdl request was sent for a non-existent service, the
server thrown an NPE which results in an HTTP 500. This bug has been
introduced by the recent ghost deployer related changes. This test cases
ensures that the proper response is received if a ?wsdl request is sent for
a non-existent service. Ideally, I think we should be sending a 404 if a
service does not exist, but all along we have been sending a 200, so I
didn't want to change that for the moment since it may break something else.

Please make sure that you follow a similar strategy to add test cases when
you fix Jira issues, and also support issues.

-- 
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **azeez at wso2.com* <azeez at wso2.com>* cell: +94 77 3320919
blog: **http://blog.afkham.org* <http://blog.afkham.org>*
twitter: **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
*
linked-in: **http://lk.linkedin.com/in/afkhamazeez*
*
*
*Lean . Enterprise . Middleware*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.wso2.org/pipermail/carbon-dev/attachments/20120104/f29808ac/attachment.html>


More information about the Carbon-dev mailing list