[YANGTOOLS-195] MDSAL code generator ignores "uses" in RPC input args Created: 27/Jun/14  Updated: 10/Apr/22  Resolved: 27/Jun/14

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Ashwin Pankaj Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Linux
Platform: PC


External issue ID: 1251

 Description   

If you generate code for the following yang model using org.opendaylight.yangtools.maven.sal.api.gen.plugin.CodeGeneratorImpl

grouping global-fields {
leaf glob-id

{type uint32;}
}

rpc myRPC {

input {
leaf id {type uint32;}

uses global-fields;
}
output {
leaf success

{type boolean;}

}
}

the myRPCInput interface does not contain getter for "glob-id" field.
I think the code generator cannot handle "uses" statement in RPC input arg.



 Comments   
Comment by Martin Vitez [ 27/Jun/14 ]

Ashwin,
MyRPCInput interface does not contain getter for "glob-id" field, but it extends GlobalFields interface (the one generated for grouping), which contains this getter.

Comment by Martin Vitez [ 27/Jun/14 ]

Actually, with newly merged changes it turns out that on MAC there could be a problem with yangtools. If this is your case, please specify your OS version and JVM version.

Comment by Tony Tkacik [ 27/Jun/14 ]

Probably similar problem in controller

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizerTest
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Tests run: 10, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 4.016 sec <<< FAILURE! - in org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizerTest
testToLegacyNormalizedNode(org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizerTest) Time elapsed: 0.26 sec <<< FAILURE!
java.lang.AssertionError: Child node QName expected:<(urn:opendaylight:params:xml:ns:yang:controller:md:sal:normalization:test?revision=2014-03-13)inner-list> but was:<(urn:opendaylight:params:xml:ns:yang:controller:md:sal:normalization:test?revision=2014-03-13)id>
at org.junit.Assert.fail(Assert.java:91)
at org.junit.Assert.failNotEquals(Assert.java:645)
at org.junit.Assert.assertEquals(Assert.java:126)
at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizerTest.verifyLegacyNode(DataNormalizerTest.java:437)
at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizerTest.verifyLegacyNode(DataNormalizerTest.java:441)
at org.opendaylight.controller.md.sal.common.impl.util.compat.DataNormalizerTest.testToLegacyNormalizedNode(DataNormalizerTest.java:245)

Results :

Failed tests:
DataNormalizerTest.testToLegacyNormalizedNode:245->verifyLegacyNode:441->verifyLegacyNode:437 Child node QName expected:<(urn:opendaylight:params:xml:ns:yang:controller:md:sal:normalization:test?revision=2014-03-13)inner-list> but was:<(urn:opendaylight:params:xml:ns:yang:controller:md:sal:normalization:test?revision=2014-03-13)id

Comment by Ashwin Pankaj [ 27/Jun/14 ]

> Ashwin,
> MyRPCInput interface does not contain getter for "glob-id" field, but it
> extends GlobalFields interface (the one generated for grouping), which
> contains this getter.
Thanks Martin,
I just verified that this is the case. Should I close the bug?

Comment by Martin Vitez [ 27/Jun/14 ]

Resolved, not a bug.

Generated at Wed Feb 07 20:52:32 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.