osgi / bugzilla-archive

Archive of OSGi Alliance Specification Bugzilla bugs. The Specification Bugzilla system was decommissioned with the move to GitHub. The issues in this repository are imported from the Specification Bugzilla system for archival purposes.
0 stars 1 forks source link

TR069ParameterValue.getDmtData returns strange result for FORMAT_NODE_URI #1810

Closed bjhargrave closed 13 years ago

bjhargrave commented 13 years ago

Original bug ID: BZ#1942 From: Evgeni Grigorov <e.grigorov@prosyst.com> Reported version: R4 V4.3

bjhargrave commented 13 years ago

Comment author: Evgeni Grigorov <e.grigorov@prosyst.com>

TR069ParameterValue.getDmtData(TR069_TYPE_STRING, "./Device/Services", ...) returns DmtData(./DeviceDevice/Services) instead of DmtData(./Device/Services)

bjhargrave commented 13 years ago

Comment author: Ikuo Yamasaki <yamasaki.ikuo@lab.ntt.co.jp>

Evgeni, could you tell me what kind of arguments are used ? value: tr069Type: valueCharsetName: nodeUri: metaNode.getFormat():

bjhargrave commented 13 years ago

Comment author: Evgeni Grigorov <e.grigorov@prosyst.com>

Evgeni, could you tell me what kind of arguments are used ? value: tr069Type: valueCharsetName: nodeUri: metaNode.getFormat(): Please see org.osgi.test.cases.util.tr069, org.osgi.test.cases.util.tr069.TR069ParameterValueTestCase.testTR069StringType(). There is commented test scenario with a link to the issue.

bjhargrave commented 13 years ago

Comment author: Ikuo Yamasaki <yamasaki.ikuo@lab.ntt.co.jp>

Please see org.osgi.test.cases.util.tr069, org.osgi.test.cases.util.tr069.TR069ParameterValueTestCase.testTR069StringType(). There is commented test scenario with a link to the issue.

I had checked it. The RI definitely has a bug to be fixed. Before I fix the RI, let me confirm:

In your test,

TR069ParameterValue.getDmtData("./Device/Services",TR069_TYPE_STRING, "UTF-8","./Device/Services",metaNode) where metaNode.getFormat() includes FORMAT_NODE_URI.

Regarding first value "./Device/Services", is that intended usage for this method ?

As far as I understand, TR069PA will call this method with the value written in RPC XML. Therefore, it should be TR-069 path. Therefore,

TR069ParameterValue.getDmtData("Device.Services",TR069_TYPE_STRING, "UTF-8","./Device/Services",metaNode) where metaNode.getFormat() includes FORMAT_NODE_URI will return DmtData whose getString() returns "./Device/Services".

TR069ParameterValue.getDmtData(".A.B",TR069_TYPE_STRING, "UTF-8","./Device/DeviceInfo/x",metaNode) where metaNode.getFormat() includes FORMAT_NODE_URI will return DmtData whose getString() returns "./Device/A/B".

Is my understanding correct ?

bjhargrave commented 13 years ago

Comment author: Evgeni Grigorov <e.grigorov@prosyst.com>

Please see org.osgi.test.cases.util.tr069, org.osgi.test.cases.util.tr069.TR069ParameterValueTestCase.testTR069StringType(). There is commented test scenario with a link to the issue.

I had checked it. The RI definitely has a bug to be fixed. Before I fix the RI, let me confirm:

In your test,

TR069ParameterValue.getDmtData("./Device/Services",TR069_TYPE_STRING, "UTF-8","./Device/Services",metaNode) where metaNode.getFormat() includes FORMAT_NODE_URI.

Regarding first value "./Device/Services", is that intended usage for this method ?

As far as I understand, TR069PA will call this method with the value written in RPC XML. Therefore, it should be TR-069 path. Therefore,

TR069ParameterValue.getDmtData("Device.Services",TR069_TYPE_STRING, "UTF-8","./Device/Services",metaNode) where metaNode.getFormat() includes FORMAT_NODE_URI will return DmtData whose getString() returns "./Device/Services".

TR069ParameterValue.getDmtData(".A.B",TR069_TYPE_STRING, "UTF-8","./Device/DeviceInfo/x",metaNode) where metaNode.getFormat() includes FORMAT_NODE_URI will return DmtData whose getString() returns "./Device/A/B".

Is my understanding correct ? I completely agree that the value value should be TR-069 path, but I have those issues:

  1. javadoc of org.osgi.util.tr069.TR069ParameterValue.getDmtData(String, String, String, String, MetaNode): " value to be set to the specified node uri. It must not be null. " i.e. looks like that the value should be already converted
  2. with tr-069 path, I got: junit.framework.AssertionFailedError: The DMT data is not correct! expected:<./Device/Services> but was: at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.failNotEquals(Assert.java:280) at junit.framework.Assert.assertEquals(Assert.java:64) at org.osgi.test.cases.util.tr069.TR069ParameterValueTestCase.checkSimpleDmtData(TR069ParameterValueTestCase.java:602) at org.osgi.test.cases.util.tr069.TR069ParameterValueTestCase.testTR069StringType(TR069ParameterValueTestCase.java:287) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at junit.framework.TestSuite.runTest(TestSuite.java:230) at junit.framework.TestSuite.run(TestSuite.java:225) at aQute.junit.Activator.test(Activator.java:200) at aQute.junit.Activator.run(Activator.java:51)

i.e. TR-069 path is not touched.

I prefer TR-069 paths, so just update the implementation to accept TR-069 paths and I'll update TC.

bjhargrave commented 13 years ago

Comment author: Evgeni Grigorov <e.grigorov@prosyst.com>

[06.04.2011] Conference Call REG confirmed that TR069ParameterValue.getDmtData will operate on absolute TR-069 paths. RI and TC need an update.

bjhargrave commented 13 years ago

Comment author: Ikuo Yamasaki <yamasaki.ikuo@lab.ntt.co.jp>

[06.04.2011] Conference Call REG confirmed that TR069ParameterValue.getDmtData will operate on absolute TR-069 paths. RI and TC need an update.

Is my understanding correct ?

public static DmtData getDmtData(String value, String tr069Type, String valueCharsetName, String nodeUri, MetaNode metaNode)

When this method tries to convert the value to FORMAT_NODE_URI, This method will do the followings:

  1. check whether value is valid TR-069 path (by calling TR069URI.isValidTR069Path(value)). If not, it will fail.
  2. get tr069AbolutePath by calling TR069URI. .getTR069AbsolutePath(TR069URI.getTR069Path(nodeUri), value).
  3. get dmtUri by calling TR069URI.getDmtUri( tr069AbolutePath).
  4. construct DmtData by new DmtData(dmtUri,DmtData.FORMAT_NODE_URI);
bjhargrave commented 13 years ago

Comment author: Kai Hackbarth <k.hackbarth@prosyst.com>

REG agreed to skip step No. 1 in comment No. 6

bjhargrave commented 13 years ago

Comment author: Ikuo Yamasaki <yamasaki.ikuo@lab.ntt.co.jp>

REG agreed to skip step No. 1 in comment No. 6

I fixed RI and commited Evgeni, could you confirm it ?

bjhargrave commented 13 years ago

Comment author: Evgeni Grigorov <e.grigorov@prosyst.com>

The issue is fixed.