JIRAs created:-<br><br><a href="https://issues.jboss.org/browse/JBRULES-3417">https://issues.jboss.org/browse/JBRULES-3417</a><br><br><a href="https://issues.jboss.org/browse/JBRULES-3418">https://issues.jboss.org/browse/JBRULES-3418</a><br>
<br>Unit tests added to 5.3.x branch (@Ignore&#39;d failing) and master (not @Ignore&#39;d and passing).<br><br>Thanks,<br><br>Mike<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Michael Anstis</b> <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt;</span><br>
Date: 27 February 2012 13:00<br>Subject: Re: 5.3.x regression in TypeDeclarationDescr<br>To: drools-dev &lt;<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>&gt;<br><br><br>This now manifests itself as:-<br>
<ul><li>Broken Gunvor tests</li><li><a href="https://bugzilla.redhat.com/show_bug.cgi?id=796612" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=796612</a></li><li><a href="https://bugzilla.redhat.com/show_bug.cgi?id=754093" target="_blank">https://bugzilla.redhat.com/show_bug.cgi?id=754093</a></li>

</ul>With kind regards,<br><br>Mike<br><br><div class="gmail_quote"><div class="im">On 17 February 2012 13:30, Michael Anstis <span dir="ltr">&lt;<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>&gt;</span> wrote:<br>

</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br><br>There appears to be a regression in TypeDeclarationDescr in 5.3.x branch, as illustrated by the below.<br>
<br>
Bean2 is shown as having a super-type of &quot;Object&quot; whereas it should be &quot;Bean1&quot;. The fields are correctly listed.<br>
<br>This is causing tests in Guvnor to fail.<br><br>Could somebody please take a look?<br><br>Thanks,<br><br>Mike<br><br><span style="font-family:courier new,monospace">package org.drools.ide.common.server.rules;</span><br style="font-family:courier new,monospace">


<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">import java.io.StringReader;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">import java.util.List;</span><br style="font-family:courier new,monospace">


<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">import org.drools.compiler.DrlParser;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">import org.drools.compiler.DroolsError;</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">import org.drools.compiler.PackageBuilder;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">import org.drools.definition.type.FactField;</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">import org.drools.lang.descr.PackageDescr;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">import org.drools.lang.descr.TypeDeclarationDescr;</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">import org.junit.Test;</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">public class RegressionTest {</span><br style="font-family:courier new,monospace">


<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    @Test</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    public void regression() {</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">        String drl = &quot;package foo \n&quot;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">                     + &quot;declare Bean1 \n&quot;</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">                     + &quot;age: int \n&quot;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">                     + &quot;name : String \n&quot;</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">                     + &quot;end \n&quot;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">                     + &quot;declare Bean2 extends Bean1\n&quot;</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">                     + &quot;cheese : String \n&quot;</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">                     + &quot;end&quot;;</span><br style="font-family:courier new,monospace">


<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        PackageBuilder builder = new PackageBuilder();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        try {</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">            DrlParser parser = new DrlParser();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">            PackageDescr pkgDescr = parser.parse( drl );</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">            for ( TypeDeclarationDescr baseType : pkgDescr.getTypeDeclarations() ) {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">                String declaredSuperTypeName = baseType.getSuperTypeName();</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">                System.out.println( baseType.getTypeName() + &quot; extends &quot; + declaredSuperTypeName );</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">            }</span><br style="font-family:courier new,monospace">


<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">            builder.addPackageFromDrl( new StringReader( drl ) );</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">            System.out.println(&quot;foo.Bean1 fields=&quot;);</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">            List&lt;FactField&gt; fieldsBean1 = builder.getPackage().getFactType( &quot;foo.Bean1&quot; ).getFields();</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">            for ( FactField field : fieldsBean1 ) {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">                System.out.println( field.getName() );</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">            }</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">            System.out.println(&quot;foo.Bean2 fields=&quot;);</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">            List&lt;FactField&gt; fieldsBean2 = builder.getPackage().getFactType( &quot;foo.Bean2&quot; ).getFields();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">            for ( FactField field : fieldsBean2 ) {</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">                System.out.println( field.getName() );</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">            }</span><br style="font-family:courier new,monospace">


<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">            if ( builder.hasErrors() ) {</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">                for ( DroolsError e : builder.getErrors().getErrors() ) {</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">                    System.out.println( e.getMessage() );</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">                }</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">            }</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        } catch ( Exception e ) {</span><br style="font-family:courier new,monospace">


<span style="font-family:courier new,monospace">            e.printStackTrace();</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">        }</span><br style="font-family:courier new,monospace">


<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">    }</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">}</span><br style="font-family:courier new,monospace">


<br>
</blockquote></div></div></div><br>
</div><br>