You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Vera Petrashkova (JIRA)" <ji...@apache.org> on 2007/07/13 07:26:04 UTC

[jira] Created: (HARMONY-4455) [buildtest][func] Testcase testIsActive in StructureTest is not correct

[buildtest][func] Testcase testIsActive in StructureTest is not correct
-----------------------------------------------------------------------

                 Key: HARMONY-4455
                 URL: https://issues.apache.org/jira/browse/HARMONY-4455
             Project: Harmony
          Issue Type: Bug
          Components: build - test - ci
            Reporter: Vera Petrashkova
            Priority: Minor


Functional test 
    functional/org/apache/harmony/test/func/api/javax/management/relation/StructureTest.xml
contains incorrect testcase testIsActive

According to J2SE API specifications of javax.management.relation.RelationService classs:
    public void isActive()
              throws RelationServiceNotRegisteredException
    Checks if the Relation Service is active. 
    Current condition is that the Relation Service must be registered in the MBean Server 
    Specified by: 
                isActive in interface RelationServiceMBean
     Throws: 
          RelationServiceNotRegisteredException - if it is not registered

The specification does not say that RelationService unregistered  in the MBean Server becomes inactive 
and isActive mthod must throw RelationServiceNotRegisteredException.

But the test case testIsActive  expects that isActive() method will throw RelationServiceNotRegisteredException
if RelationService was registered and then unregistered in MBean Server

See source code StructureTest.java
-------------
        public Result testIsActive() throws Exception {

        MBeanServer mBeanServer = MBeanServerFactory.createMBeanServer();

        RelationService relationService = new RelationService(true);
        ObjectName relationServiceName = new ObjectName(
                "mBeanServer:type=RelationService,name=rs");

        mBeanServer.registerMBean(relationService, relationServiceName);
        mBeanServer.unregisterMBean(relationServiceName);

        try {
            relationService.isActive();
            return failed("isActive method incorrect");
        } catch (RelationServiceNotRegisteredException e) {
            return passed();
        }
    }
--------------
As the result this test fails on RI and Harmony because RelationServiceNotRegisteredException is not thrown.

This test should be redesigned or removed


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.