<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:55:53 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[YANGTOOLS-1345] Remove StmtTestUtils.parseYangSource(String)</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1345</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;We have huge amount of code duplication going on in parser unit tests. This is mostly due to us not having a common assert library. Introduce AbstractYangTest to service as an abstract base class serving as host for assertions.&lt;/p&gt;

&lt;p&gt;Then migrate all callers of StmtTestUtils.parseYangSource(String) to use its methods instead. There are three basic classes of test files which need to be migrated.&lt;/p&gt;

&lt;p&gt;The first are those which are still using Assert.fail() with a catch, i.e. like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    @Test
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; void invalid10Test() &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; Exception {
        &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; {
            StmtTestUtils.parseYangSource(&lt;span class=&quot;code-quote&quot;&gt;&quot;/rfc7950/notifications-in-data-nodes/foo10.yang&quot;&lt;/span&gt;);
            fail(&lt;span class=&quot;code-quote&quot;&gt;&quot;Test should fail due to invalid Yang 1.0&quot;&lt;/span&gt;);
        } &lt;span class=&quot;code-keyword&quot;&gt;catch&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; SomeModifiersUnresolvedException e) {
            assertTrue(e.getCause().getMessage().startsWith(&lt;span class=&quot;code-quote&quot;&gt;&quot;NOTIFICATION is not valid &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt;&quot;&lt;/span&gt;));
        }
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;these should end up looking like this:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;    @Test
    public void invalid10Test() {
        assertInvalidSubstatementException(startsWith(&quot;NOTIFICATION is not valid for&quot;),
            &quot;/rfc7950/notifications-in-data-nodes/foo10.yang&quot;);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The second class are those which expect a module to compile and perhaps assertNotNull():&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    @Test
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; void notificationsInDataContainersTest() &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; Exception {
        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; SchemaContext schemaContext = StmtTestUtils
                .parseYangSource(&lt;span class=&quot;code-quote&quot;&gt;&quot;/rfc7950/notifications-in-data-nodes/foo.yang&quot;&lt;/span&gt;);
        assertNotNull(schemaContext);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;These should should end up looking like this (variable type and naming included):&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    @Test
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; void notificationsInDataContainersTest() &lt;span class=&quot;code-keyword&quot;&gt;throws&lt;/span&gt; Exception {
        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;var&lt;/span&gt; context = assertEffectiveModel(&lt;span class=&quot;code-quote&quot;&gt;&quot;/rfc7950/notifications-in-data-nodes/foo.yang&quot;&lt;/span&gt;);

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The third class are those which are using assertThrows(), and have a number of repetitive assertions:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    @Test
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; void invalid10Test() {
        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; ReactorException ex = assertThrows(ReactorException.class,
            () -&amp;gt; StmtTestUtils.parseYangSource(&lt;span class=&quot;code-quote&quot;&gt;&quot;/rfc7950/bug6870/invalid10.yang&quot;&lt;/span&gt;));
        &lt;span class=&quot;code-keyword&quot;&gt;final&lt;/span&gt; Throwable cause = ex.getCause();
        assertThat(cause, instanceOf(SourceException.class));
        assertThat(cause.getMessage(), startsWith(&lt;span class=&quot;code-quote&quot;&gt;&quot;modifier is not a YANG statement or use of extension&quot;&lt;/span&gt;));
    }

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;this needs to end up looking like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
    @Test
    &lt;span class=&quot;code-keyword&quot;&gt;public&lt;/span&gt; void invalid10Test() {
        assertSourceException(startsWith(&lt;span class=&quot;code-quote&quot;&gt;&quot;modifier is not a YANG statement or use of extension&quot;&lt;/span&gt;),
            &lt;span class=&quot;code-quote&quot;&gt;&quot;/rfc7950/bug6870/invalid10.yang&quot;&lt;/span&gt;);
    }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="34610">YANGTOOLS-1345</key>
            <summary>Remove StmtTestUtils.parseYangSource(String)</summary>
                <type id="10101" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10318&amp;avatarType=issuetype">Task</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="SamoSchneider">Samuel Schneider</assignee>
                                    <reporter username="rovarga">Robert Varga</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Sun, 3 Oct 2021 10:20:05 +0000</created>
                <updated>Sun, 10 Apr 2022 17:42:24 +0000</updated>
                            <resolved>Sun, 27 Mar 2022 11:57:13 +0000</resolved>
                                                    <fixVersion>8.0.3</fixVersion>
                                    <component>parser</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                        <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03zxj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>