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 11:00:13 UTC
[jira] Created: (HARMONY-4461) [buildtest][func] Test
javax/management/monitor/stringmonitor/FunctionsTest is not correct
[buildtest][func] Test javax/management/monitor/stringmonitor/FunctionsTest is not correct
------------------------------------------------------------------------------------------
Key: HARMONY-4461
URL: https://issues.apache.org/jira/browse/HARMONY-4461
Project: Harmony
Issue Type: Bug
Reporter: Vera Petrashkova
Priority: Minor
The following test from Functional test suite
functional/org/apache/harmony/test/func/api/javax/management/monitor/stringmonitor/FunctionsTest.xml
contains incorrect testcase testIrregularValues.
According to the testcase description:
testIrregularValues:
This test is intended to check the functionality of StringMonitor in case
when string-to-compare and observed string can be assigned with boundary
values (null and "")
MBeanServer is created; StringMonitor and MyStringBuffer aMBeans are registered.
StringMonitor is configured: only notifyMatch flag is set to true,
string-to-compare is common non-empty string.
NotificationListener is added to monitor.
MyStringBuffer is started in a separate thread, monitor is activated
(empty and null strings are possible values for observed string).
NotificationListener checks that string-to-compare is equal to string
being observed.
StringMonitor is reconfigured (string-to-compare is empty).
NotificationListener waits for next notification.
f correct notification is received test considered to be passed.
It is not clear what does this test really verify when it string-to-compare equals null.
J2SE API specification of StringMonitor.setStringToCompare(String) method
its can not be invoked with null parameter. VM should throw IllegalArgumentException.
So string-to-compare is assigned with string "null" .
But observed string is assigned with null value.
See source code:
----------------FunctionsTest.java------------------
public Result testIrregularValues() throws Exception {
/* Monitor is configured in setUp method */
monitor.setStringToCompare("");
/*
* Now test begins. String to compare matches to observed attribute, so
* "matches" notification should be sent. Due to NotifyDiffer
* flag=false, "differs" notifications shouldn't be sent
*/
nListener.setParameters("String", mySbName,
"jmx.monitor.string.differs");
log.add("Test: Waiting for 2 notifications " + "for empty string");
enableTimer();
monitor.start();
synchronized (sync) {
sync.wait();
}
res &= timer.getRes();
res &= nListener.getRes();
timer.interrupt();
nListener.setParameters("String", mySbName,
"jmx.monitor.string.matches");
enableTimer();
mySb.setString("");
synchronized (sync) {
sync.wait();
}
res &= timer.getRes();
res &= nListener.getRes();
timer.interrupt();
log.add("Test: Waiting for error notification for null string");
monitor.setStringToCompare("null"); <<<<<<<<<<<<<<<<<<<<<<
nListener.setParameters("String", mySbName, "jmx.monitor.error.type");
enableTimer();
mySb.setString(null); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
synchronized (sync) {
sync.wait();
}
res &= timer.getRes();
res &= nListener.getRes();
timer.interrupt();
return res ? passed() : failed("");
}
------------------------------
As the result this test case fails on RI.
It should be removed or redesigned.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (HARMONY-4461) [buildtest][func] Test
javax/management/monitor/stringmonitor/FunctionsTest is not correct
Posted by "Alexey Varlamov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HARMONY-4461?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alexey Varlamov updated HARMONY-4461:
-------------------------------------
Component/s: build - test - ci
> [buildtest][func] Test javax/management/monitor/stringmonitor/FunctionsTest is not correct
> ------------------------------------------------------------------------------------------
>
> Key: HARMONY-4461
> URL: https://issues.apache.org/jira/browse/HARMONY-4461
> Project: Harmony
> Issue Type: Bug
> Components: build - test - ci
> Reporter: Vera Petrashkova
> Priority: Minor
>
> The following test from Functional test suite
> functional/org/apache/harmony/test/func/api/javax/management/monitor/stringmonitor/FunctionsTest.xml
> contains incorrect testcase testIrregularValues.
> According to the testcase description:
> testIrregularValues:
> This test is intended to check the functionality of StringMonitor in case
> when string-to-compare and observed string can be assigned with boundary
> values (null and "")
> MBeanServer is created; StringMonitor and MyStringBuffer aMBeans are registered.
> StringMonitor is configured: only notifyMatch flag is set to true,
> string-to-compare is common non-empty string.
> NotificationListener is added to monitor.
> MyStringBuffer is started in a separate thread, monitor is activated
> (empty and null strings are possible values for observed string).
> NotificationListener checks that string-to-compare is equal to string
> being observed.
> StringMonitor is reconfigured (string-to-compare is empty).
> NotificationListener waits for next notification.
> f correct notification is received test considered to be passed.
> It is not clear what does this test really verify when it string-to-compare equals null.
> J2SE API specification of StringMonitor.setStringToCompare(String) method
> its can not be invoked with null parameter. VM should throw IllegalArgumentException.
> So string-to-compare is assigned with string "null" .
> But observed string is assigned with null value.
> See source code:
> ----------------FunctionsTest.java------------------
> public Result testIrregularValues() throws Exception {
> /* Monitor is configured in setUp method */
> monitor.setStringToCompare("");
> /*
> * Now test begins. String to compare matches to observed attribute, so
> * "matches" notification should be sent. Due to NotifyDiffer
> * flag=false, "differs" notifications shouldn't be sent
> */
> nListener.setParameters("String", mySbName,
> "jmx.monitor.string.differs");
> log.add("Test: Waiting for 2 notifications " + "for empty string");
> enableTimer();
> monitor.start();
> synchronized (sync) {
> sync.wait();
> }
> res &= timer.getRes();
> res &= nListener.getRes();
> timer.interrupt();
> nListener.setParameters("String", mySbName,
> "jmx.monitor.string.matches");
> enableTimer();
> mySb.setString("");
> synchronized (sync) {
> sync.wait();
> }
> res &= timer.getRes();
> res &= nListener.getRes();
> timer.interrupt();
> log.add("Test: Waiting for error notification for null string");
> monitor.setStringToCompare("null"); <<<<<<<<<<<<<<<<<<<<<<
> nListener.setParameters("String", mySbName, "jmx.monitor.error.type");
> enableTimer();
> mySb.setString(null); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> synchronized (sync) {
> sync.wait();
> }
> res &= timer.getRes();
> res &= nListener.getRes();
> timer.interrupt();
> return res ? passed() : failed("");
> }
> ------------------------------
> As the result this test case fails on RI.
> It should be removed or redesigned.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.