PIDE: removed bug in JavaToIsa.scala
authorWalther Neuper <wneuper@ist.tugraz.at>
Sun, 19 Jul 2015 15:46:10 +0200
changeset 4728b936756c4a26
parent 4727 21335af0ba6a
child 4729 ef60b3270e17
PIDE: removed bug in JavaToIsa.scala
which has been introduced in the last changeset, but not detected/
isac-java/src/java-tests/isac/bridge/TestPIDE.java
isac-java/src/java/isac/bridge/xml/JavaToIsa.scala
     1.1 --- a/isac-java/src/java-tests/isac/bridge/TestPIDE.java	Sun Jul 19 14:42:05 2015 +0200
     1.2 +++ b/isac-java/src/java-tests/isac/bridge/TestPIDE.java	Sun Jul 19 15:46:10 2015 +0200
     1.3 @@ -144,13 +144,9 @@
     1.4          to.setKind("Pbl");
     1.5          int level = 0;
     1.6          String rules = "false";
     1.7 -	    /*DEL*/ System.out.println("### 4 from = " + from.toSMLString()); //OK from = ([],Pbl)
     1.8 -	    /*DEL*/ System.out.println("### 4 to   = " + to.toSMLString());   //OK to   = ([],Pbl)
     1.9          XML.Tree GET_FORMULAE_out = sys.invoke(Operations.GET_FORMULAE,
    1.10            JavaToIsa.get_formulae(new scala.math.BigInt(BigInteger.valueOf(calcid)),
    1.11            from, to, new scala.math.BigInt(BigInteger.valueOf(level)), rules));
    1.12 -        // GET_FORMULAE_out = <SYSERROR><CALCID>1</CALCID><ERROR>getFormulaeFromTo: From = To</ERROR></SYSERROR>
    1.13 -        //                                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    1.14          //IntFormulaCompound   ..POSTPONED TO shift ConvertXML into isac-java
    1.15          System.out.println("# 4 # " + GET_FORMULAE_out);
    1.16  
    1.17 @@ -159,9 +155,6 @@
    1.18          pos.setKind("Pbl");
    1.19  	    Vector<Integer> pos_path = new Vector<>();
    1.20  	    String pos_kind = "Pbl";
    1.21 -	    /*DEL*/ System.out.println("### 6 JavaToIsa.ref_formula --> vvvvv");
    1.22 -	    /*DEL*/ System.out.println(JavaToIsa.ref_formula(new scala.math.BigInt(BigInteger.valueOf(calcid)), pos));
    1.23 -	    /*DEL*/ System.out.println("### 6 JavaToIsa.ref_formula --> ^^^^^");
    1.24  	    XML.Tree REF_FORMULA_out = sys.invoke(Operations.REF_FORMULA,
    1.25  	      JavaToIsa.ref_formula(new scala.math.BigInt(BigInteger.valueOf(calcid)), pos));
    1.26  	    //^^^^^^^^^^ cumbersome without import CalcHead .. Model .. ModelItemList
    1.27 @@ -216,8 +209,8 @@
    1.28  	    Position form_pos = new Position(form_ints, form_kind);
    1.29  	    System.out.println(form_pos.toSMLString());
    1.30  	    System.out.println(form_isa);
    1.31 -	    //*DEL*/ assertEquals(form_pos.toSMLString(), "([],Res)");
    1.32 -	    //*DEL*/ assertEquals(form_isa, "[x = 1]");
    1.33 +	    assertEquals(form_pos.toSMLString(), "([],Res)");
    1.34 +	    assertEquals(form_isa, "[x = 1]");
    1.35  	    System.out.println("# 10 # " + REF_FORMULA_out);
    1.36  
    1.37  	    //----- step 13 ---------------------------------------------------------------
     2.1 --- a/isac-java/src/java/isac/bridge/xml/JavaToIsa.scala	Sun Jul 19 14:42:05 2015 +0200
     2.2 +++ b/isac-java/src/java/isac/bridge/xml/JavaToIsa.scala	Sun Jul 19 15:46:10 2015 +0200
     2.3 @@ -90,7 +90,7 @@
     2.4    //----- step 4 -----------------------
     2.5    def xml_of_Position(pos: Position): XML.Tree = {
     2.6      val is: List[Integer] = pos.getIntList().asInstanceOf[Vector[Integer]].asScala.toList
     2.7 -    ConvertXML.xml_of_pos(List(1: java.lang.Integer) map Integer_to_BigInt, pos.getKind())
     2.8 +    ConvertXML.xml_of_pos(is map Integer_to_BigInt, pos.getKind())
     2.9    }
    2.10  
    2.11    //def get_formulae(calcid: scala.math.BigInt, from: ICalcIterator,to: ICalcIterator,