<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 08/11/2010 10:59, Wolfgang Laun wrote:
    <blockquote
      cite="mid:AANLkTinFrG67Y1YRvEjVDnksZWkGqrcAonZ=ymtdZAsx@mail.gmail.com"
      type="cite">What precisely do&nbsp; you mean by "Rete DSL"?<br>
      -W<br>
    </blockquote>
    I wrote a low level testing DSL for rete networks a while back:<br>
    <a class="moz-txt-link-freetext" href="http://blog.athico.com/2009/11/rete-dsl-testing-harness.html">http://blog.athico.com/2009/11/rete-dsl-testing-harness.html</a><br>
    <br>
    Hmm the new blog template needs some work....<br>
    <br>
    You can see the tests here:<br>
<a class="moz-txt-link-freetext" href="http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-core/src/test/resources/org/drools/reteoo/test/">http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-core/src/test/resources/org/drools/reteoo/test/</a><br>
    <br>
    The tests look a little like:<br>
    <pre>TestCase "Join Node assert/retract test case"

Setup
        ObjectTypeNode:
            otnLeft1, org.drools.Person;
        LeftInputAdapterNode:
            lian0, otnLeft1;
        ObjectTypeNode:
            otnRight1, org.drools.Person;
        ObjectTypeNode:
            otnRight2, org.drools.Person;
        Binding:
             p1, 0, org.drools.Person, age;
        JoinNode:
            join1, lian0, otnRight1;
            age, !=, p1;
        JoinNode:
            join2, join1, otnRight2;
            age, !=, p1;
        Facts:
            new org.drools.Person('darth', 35), new org.drools.Person('bobba', 36),
            new org.drools.Person('yoda', 37), new org.drools.Person('luke', 38),
            new org.drools.Person('dave', 33), new org.drools.Person('bob', 32);
            
Test "Assert/retract test"                 
        /**
         * check single left assertion and retraction
         */
        assert:
            otnLeft1, [h0];
        join1:
            leftMemory, [[h0]];
        join2:
            leftMemory, [];   
        retract:
            otnLeft1, [h0];  
        /**    
         * check single right assertion and retraction
         */
        assert:
            otnRight1, [h1];
        join1:
            rightMemory, [h1];
        join2:
            leftMemory, [];    
        retract:
            otnRight1, [h1]; 
        
        /**        
         *  check single left then right assertion
         */ 
        assert:
            otnLeft1, [h0];  
            otnRight1, [h1];
        join1:
            leftMemory, [[h0]];  
            rightMemory, [h1];
        join2:
            leftMemory, [[h0, h1]]; 
        retract:
            otnLeft1, [h0]; 
            otnRight1, [h1];
           
        /**    
         *  check single right then left assertion
         */    
        assert:
            otnRight1, [h1];
            otnLeft1, [h0];
        join1:
            leftMemory, [[h0]];  
            rightMemory, [h1]  ;
        join2:
            leftMemory, [[h0, h1]]; 
        retract:
            otnLeft1, [h0]; 


            otnRight1, [h1];    
</pre>
    <br>
    <blockquote
      cite="mid:AANLkTinFrG67Y1YRvEjVDnksZWkGqrcAonZ=ymtdZAsx@mail.gmail.com"
      type="cite"><br>
      <div class="gmail_quote">On 8 November 2010 11:33, Leonardo Gomes
        <span dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:leonardo.f.gomes@gmail.com">leonardo.f.gomes@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="border-left: 1px solid
          rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
          1ex;">I've been using the Rete DSL a lot these days and was
          thinking that it could be a good idea to provide some Eclipse
          infra-structure (syntax highlighting, code completion,
          validation) to it using Xtext (<span><a moz-do-not-send="true"
              href="http://www.eclipse.org/Xtext/" target="_blank">http://www.eclipse.org/Xtext/</a>).
            It's built on top of antlr, so maybe we could even reuse the
            grammar that we already have. I know that, by default, you
            should right you grammar using their simplified version.<br>
            <br>
            Maybe the guys there would also be interested in providing
            something to Drools. It could be a showcase for them.<br>
            <br>
            Not sure if this also applies to the Eclipse DRL things that
            we have.<br>
            <br>
            Cheers,<br>
            Leonardo.<br>
          </span>
          <br>
          _______________________________________________<br>
          rules-dev mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
          <a moz-do-not-send="true"
            href="https://lists.jboss.org/mailman/listinfo/rules-dev"
            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>