On Thu, Jun 21, 2012 at 9:59 PM, Afkham Azeez <[email protected]> wrote:
> Nice work.
>
> Tenant addition is common. So you should separate that out & make it
> reusable. Ideally, what should happen is;
>
> 1. Start Carbon server
> 2. Create a tenant
> 3. Run integration tests for super tenant
> 4. Run the same integration test for the tenant created in step 2 above
>
> Steps 1 & 2 could be performed in the @BeforeSuite.
>
> I can also see that you have followed the catch & fail anti-pattern.
> Please fix that. If an unexpected exception occurs, the test should result
> in an error, not a failure!
>
>
> } catch (IOException e) {
> log.error("Error while copying the example webapp sample into
> tenant " +
> DOMAIN + "'s space", e);
> fail("Webapp Deployment for tenant : " + DOMAIN + " has failed");
> }
>
>
> catch (Exception e) {
> log.error("Error occurred while trying test webapp for tenant : "
> + DOMAIN + " : " +
> e.getMessage());
> fail("Caught exception " + e.toString());
> } finally {
>
>
+1, I will make the necessary changes to this test.
Thanks,
Kishanthan.
>
> In order to learn why catch & fail is a bad practice, please read
> http://www.exubero.com/junit/antipatterns.html#Catching_Unexpected_Exceptions
>
> Azeez
>
>
> On Mon, Jun 18, 2012 at 3:18 PM, Kishanthan Thangarajah <
> [email protected]> wrote:
>
>> Hi All,
>> I have added an integration test[1] to AS keeping in mind this particular
>> issue.
>> The test covers:
>> 1. A simple tenant addition.
>> 2. Deploying a webapp in the added tenant's space.
>> 3. Testing the successful deployment of the webapp.
>>
>> We can extend this test for other artifacts, tenant mgt operations etc.
>>
>> Thanks,
>> Kishanthan.
>> [1]
>> https://svn.wso2.org/repos/wso2/carbon/platform/trunk/products/as/modules/integration/src/test/java/org/wso2/appserver/integration/tests/TenantMgtTestCase.java
>> On Fri, Jun 15, 2012 at 12:09 AM, Afkham Azeez <[email protected]> wrote:
>>
>>>
>>>
>>> On Thu, Jun 14, 2012 at 9:50 PM, Tharindu Mathew <[email protected]>wrote:
>>>
>>>> Don't we have tests to verify this problem? This kind of change has
>>>> costs a LOT of expensive man hours...
>>>>
>>>
>>> Stil nobody has started writing tests for tenant level stuff :(
>>>
>>>>
>>>> On Thu, Jun 14, 2012 at 9:45 PM, Pradeep Fernando <[email protected]>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> issue was in the carbonContextHolderBase class. Due to some recent
>>>>> changes (not allowing the super tenant to set the tenantId). Hence
>>>>> originally created super tenant carbon context get used all the way.
>>>>>
>>>>> Now fixed.
>>>>>
>>>>> thanks,
>>>>> --pradeep
>>>>> _______________________________________________
>>>>> Dev mailing list
>>>>> [email protected]
>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>>
>>>> Tharindu
>>>>
>>>> blog: http://mackiemathew.com/
>>>> M: +94777759908
>>>>
>>>>
>>>> _______________________________________________
>>>> Dev mailing list
>>>> [email protected]
>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>
>>>>
>>>
>>>
>>> --
>>> *Afkham Azeez*
>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>> Member; Apache Software Foundation; http://www.apache.org/
>>> * <http://www.apache.org/>**
>>> email: **[email protected]* <[email protected]>* 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*
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> [email protected]
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>>
>> --
>> *Kishanthan Thangarajah*
>> Software Engineer,
>> Development Technologies Team,
>> WSO2, Inc.
>> lean.enterprise.middleware
>>
>> Mobile - +94773426635
>> Blog - *http://kishanthan.wordpress.com*
>> Twitter - *http://twitter.com/kishanthan*
>>
>>
>
>
> --
> *Afkham Azeez*
> Director of Architecture; WSO2, Inc.; http://wso2.com
> Member; Apache Software Foundation; http://www.apache.org/
> * <http://www.apache.org/>**
> email: **[email protected]* <[email protected]>* 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*
>
>
--
*Kishanthan Thangarajah*
Software Engineer,
Development Technologies Team,
WSO2, Inc.
lean.enterprise.middleware
Mobile - +94773426635
Blog - *http://kishanthan.wordpress.com*
Twitter - *http://twitter.com/kishanthan*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev