Advertisement
Guest User

Untitled

a guest
Dec 5th, 2019
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 19.86 KB | None | 0 0
  1.  
  2. WARNING: An illegal reflective access operation has occurred
  3. WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/home/evacchi/.m2/repository/com/thoughtworks/xstream/xstream/1.4.11.1/xstream-1.4.11.1.jar) to field java.util.TreeMap.comparator
  4. WARNING: Please consider reporting this to the maintainers of com.thoughtworks.xstream.core.util.Fields
  5. WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
  6. WARNING: All illegal access operations will be denied in a future release
  7. 16:34:04.055 [main] DEBUG o.d.m.b.g.e.ExpressionTyper.toTypedExpression:119 - Typed expression Input: drlxExpr = intValue() , patternType = class java.math.BigDecimal ,declarations = []
  8. 16:34:04.071 [main] DEBUG o.d.m.b.g.e.ExpressionTyper.toTypedExpression:124 - Typed expression Output: {expression=TypedExpression{expression=_this.intValue(), jpType=MethodCallExpr, type=int, fieldName='null', unificationVariable=Optional.empty, unificationName=Optional.empty}, usedDeclarations=[], reactOnProperties =[]}
  9. 16:34:04.075 [main] DEBUG o.d.m.b.g.e.ExpressionTyper.toTypedExpression:119 - Typed expression Input: drlxExpr = 0 , patternType = class java.math.BigDecimal ,declarations = []
  10. 16:34:04.075 [main] DEBUG o.d.m.b.g.e.ExpressionTyper.toTypedExpression:124 - Typed expression Output: {expression=TypedExpression{expression=0, jpType=IntegerLiteralExpr, type=int, fieldName='null', unificationVariable=Optional.empty, unificationName=Optional.empty}, usedDeclarations=[], reactOnProperties =[]}
  11. 16:34:04.229 [main] DEBUG o.d.m.b.g.e.ExpressionTyper.toTypedExpression:119 - Typed expression Input: drlxExpr = intValue() , patternType = class java.math.BigDecimal ,declarations = []
  12. 16:34:04.229 [main] DEBUG o.d.m.b.g.e.ExpressionTyper.toTypedExpression:124 - Typed expression Output: {expression=TypedExpression{expression=_this.intValue(), jpType=MethodCallExpr, type=int, fieldName='null', unificationVariable=Optional.empty, unificationName=Optional.empty}, usedDeclarations=[], reactOnProperties =[]}
  13. 16:34:04.229 [main] DEBUG o.d.m.b.g.e.ExpressionTyper.toTypedExpression:119 - Typed expression Input: drlxExpr = 0 , patternType = class java.math.BigDecimal ,declarations = []
  14. 16:34:04.230 [main] DEBUG o.d.m.b.g.e.ExpressionTyper.toTypedExpression:124 - Typed expression Output: {expression=TypedExpression{expression=0, jpType=IntegerLiteralExpr, type=int, fieldName='null', unificationVariable=Optional.empty, unificationName=Optional.empty}, usedDeclarations=[], reactOnProperties =[]}
  15. 16:34:04.484 [main] DEBUG o.d.m.builder.PackageSources.logSource:78 - =====
  16. 16:34:04.484 [main] DEBUG o.d.m.builder.PackageSources.logSource:79 - package org.drools.modelcompiler;
  17.  
  18. import java.util.*;
  19. import org.drools.model.*;
  20. import org.drools.modelcompiler.dsl.pattern.D;
  21. import org.drools.model.Index.ConstraintType;
  22. import java.time.*;
  23. import java.time.format.*;
  24. import java.text.*;
  25. import org.drools.core.util.*;
  26. import java.math.BigDecimal;
  27. import org.drools.model.Model;
  28.  
  29. public abstract class Rules7206AFD5D1A571D4760AE4693F2F5EFD implements Model {
  30.  
  31.     public final static DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern(DateUtils.getDateFormatMask(),
  32.                                                                                             Locale.ENGLISH);
  33.  
  34.     @Override
  35.     public String getName() {
  36.         return "org.drools.modelcompiler";
  37.     }
  38.  
  39.     public static Date string_2_date(String s) {
  40.         return GregorianCalendar.from(LocalDate.parse(s,
  41.                                                       DATE_TIME_FORMATTER).atStartOfDay(ZoneId.systemDefault()))
  42.                                 .getTime();
  43.     }
  44.  
  45.     @Override
  46.     public List<org.drools.model.EntryPoint> getEntryPoints() {
  47.         return Arrays.asList(D.entryPoint("result"),
  48.                              D.entryPoint("output1"),
  49.                              D.entryPoint("positive_or_negative"),
  50.                              D.entryPoint("input1"));
  51.     }
  52.  
  53.     @Override
  54.     public List<org.drools.model.Global> getGlobals() {
  55.         return globals;
  56.     }
  57.  
  58.     @Override
  59.     public List<org.drools.model.TypeMetaData> getTypeMetaDatas() {
  60.         return typeMetaDatas;
  61.     }
  62.  
  63.     public static final org.drools.model.Global<java.lang.String> var_result = D.globalOf(java.lang.String.class,
  64.                                                                                           "org.drools.modelcompiler",
  65.                                                                                           "result");
  66.  
  67.     public static final org.drools.model.Global<org.drools.ruleunit.DataSource> var_output1 = D.globalOf(org.drools.ruleunit.DataSource.class,
  68.                                                                                                          "org.drools.modelcompiler",
  69.                                                                                                          "output1");
  70.  
  71.     public static final org.drools.model.Global<java.lang.String> var_positive_or_negative = D.globalOf(java.lang.String.class,
  72.                                                                                                         "org.drools.modelcompiler",
  73.                                                                                                         "positive_or_negative");
  74.  
  75.     public static final org.drools.model.Global<org.drools.ruleunit.DataSource> var_input1 = D.globalOf(org.drools.ruleunit.DataSource.class,
  76.                                                                                                         "org.drools.modelcompiler",
  77.                                                                                                         "input1");
  78.  
  79.     List<org.drools.model.Global> globals = new ArrayList<>();
  80.  
  81.     List<org.drools.model.TypeMetaData> typeMetaDatas = Collections.emptyList();
  82.  
  83.     {
  84.         globals.add(var_result);
  85.         globals.add(var_output1);
  86.         globals.add(var_positive_or_negative);
  87.         globals.add(var_input1);
  88.     }
  89. }
  90.  
  91. 16:34:04.491 [main] DEBUG o.d.m.builder.PackageSources.logSource:80 - =====
  92. 16:34:04.500 [main] DEBUG o.d.m.builder.PackageSources.logSource:78 - =====
  93. 16:34:04.500 [main] DEBUG o.d.m.builder.PackageSources.logSource:79 - package org.drools.modelcompiler;
  94.  
  95. import java.util.*;
  96. import org.drools.model.*;
  97. import org.drools.modelcompiler.dsl.pattern.D;
  98. import org.drools.model.Index.ConstraintType;
  99. import java.time.*;
  100. import java.time.format.*;
  101. import java.text.*;
  102. import org.drools.core.util.*;
  103. import java.math.BigDecimal;
  104. import static org.drools.modelcompiler.Rules7206AFD5D1A571D4760AE4693F2F5EFD.*;
  105.  
  106. public class Rules7206AFD5D1A571D4760AE4693F2F5EFD_PositiveNegativeDTUnit extends Rules7206AFD5D1A571D4760AE4693F2F5EFD {
  107.  
  108.     @Override
  109.     public String getName() {
  110.         return super.getName() + ".PositiveNegativeDTUnit";
  111.     }
  112.  
  113.     @Override
  114.     public String getPackageName() {
  115.         return super.getName();
  116.     }
  117.  
  118.     /**
  119.      * With the following expression ID:
  120.      * org.drools.modelcompiler.builder.generator.DRLIdGenerator@5398edd0
  121.      */
  122.     @Override
  123.     public List<org.drools.model.Rule> getRules() {
  124.         return rules;
  125.     }
  126.  
  127.     public List<Rule> getRulesList() {
  128.         return Arrays.asList(Rules7206AFD5D1A571D4760AE4693F2F5EFD_PositiveNegativeDTUnitRuleMethods0.rule_R1(),
  129.                              Rules7206AFD5D1A571D4760AE4693F2F5EFD_PositiveNegativeDTUnitRuleMethods0.rule_R2());
  130.     }
  131.  
  132.     List<org.drools.model.Rule> rules = getRulesList();
  133.  
  134.     @Override
  135.     public List<org.drools.model.Query> getQueries() {
  136.         return java.util.Collections.emptyList();
  137.     }
  138. }
  139.  
  140. 16:34:04.501 [main] DEBUG o.d.m.builder.PackageSources.logSource:80 - =====
  141. 16:34:04.508 [main] DEBUG o.d.m.builder.PackageSources.logSource:78 - =====
  142. 16:34:04.508 [main] DEBUG o.d.m.builder.PackageSources.logSource:79 - package org.drools.modelcompiler;
  143.  
  144. import java.util.*;
  145. import org.drools.model.*;
  146. import org.drools.modelcompiler.dsl.pattern.D;
  147. import org.drools.model.Index.ConstraintType;
  148. import java.time.*;
  149. import java.time.format.*;
  150. import java.text.*;
  151. import org.drools.core.util.*;
  152. import java.math.BigDecimal;
  153. import static org.drools.modelcompiler.Rules7206AFD5D1A571D4760AE4693F2F5EFD.*;
  154.  
  155. public class Rules7206AFD5D1A571D4760AE4693F2F5EFD_PositiveNegativeDTUnitRuleMethods0 {
  156.  
  157.     /**
  158.      * Rule name: R1
  159.      */
  160.     public static org.drools.model.Rule rule_R1() {
  161.         final org.drools.model.UnitData<java.lang.String> var_result = D.unitData(java.lang.String.class,
  162.                                                                                   "result");
  163.         final org.drools.model.UnitData<org.drools.ruleunit.DataSource> var_output1 = D.unitData(org.drools.ruleunit.DataSource.class,
  164.                                                                                                  "output1");
  165.         final org.drools.model.UnitData<java.lang.String> var_positive_or_negative = D.unitData(java.lang.String.class,
  166.                                                                                                 "positive_or_negative");
  167.         final org.drools.model.UnitData<org.drools.ruleunit.DataSource> var_input1 = D.unitData(org.drools.ruleunit.DataSource.class,
  168.                                                                                                 "input1");
  169.         final org.drools.model.Variable<java.math.BigDecimal> var_GENERATED_$pattern_BigDecimal$1$ = D.declarationOf(java.math.BigDecimal.class,
  170.                                                                                                                      DomainClassesMetadata7206AFD5D1A571D4760AE4693F2F5EFD.java_math_BigDecimal_Metadata_INSTANCE,
  171.                                                                                                                      "GENERATED_$pattern_BigDecimal$1$",
  172.                                                                                                                      D.from(var_input1));
  173.         org.drools.model.Rule rule = D.rule("org.drools.modelcompiler",
  174.                                             "R1").unit(org.drools.modelcompiler.RuleUnitCompilerTest.PositiveNegativeDTUnit.class)
  175.                                                  .build(D.pattern(var_GENERATED_$pattern_BigDecimal$1$).expr("A2EC7CB8AE538AF07AD89A19790E2028",
  176.                                                                                                              (java.math.BigDecimal _this) -> org.drools.modelcompiler.util.EvaluationUtil.greaterOrEqualNumbers(_this.intValue(),
  177.                                                                                                                                                                                                                 0)),
  178.                                                         D.on(var_output1).execute((org.drools.ruleunit.DataSource output1) -> {
  179.                                                             output1.insert("positive");
  180.                                                         }));
  181.         return rule;
  182.     }
  183.  
  184.     /**
  185.      * Rule name: R2
  186.      */
  187.     public static org.drools.model.Rule rule_R2() {
  188.         final org.drools.model.UnitData<java.lang.String> var_result = D.unitData(java.lang.String.class,
  189.                                                                                   "result");
  190.         final org.drools.model.UnitData<org.drools.ruleunit.DataSource> var_output1 = D.unitData(org.drools.ruleunit.DataSource.class,
  191.                                                                                                  "output1");
  192.         final org.drools.model.UnitData<java.lang.String> var_positive_or_negative = D.unitData(java.lang.String.class,
  193.                                                                                                 "positive_or_negative");
  194.         final org.drools.model.UnitData<org.drools.ruleunit.DataSource> var_input1 = D.unitData(org.drools.ruleunit.DataSource.class,
  195.                                                                                                 "input1");
  196.         final org.drools.model.Variable<java.math.BigDecimal> var_GENERATED_$pattern_BigDecimal$2$ = D.declarationOf(java.math.BigDecimal.class,
  197.                                                                                                                      DomainClassesMetadata7206AFD5D1A571D4760AE4693F2F5EFD.java_math_BigDecimal_Metadata_INSTANCE,
  198.                                                                                                                      "GENERATED_$pattern_BigDecimal$2$",
  199.                                                                                                                      D.from(var_input1));
  200.         org.drools.model.Rule rule = D.rule("org.drools.modelcompiler",
  201.                                             "R2").unit(org.drools.modelcompiler.RuleUnitCompilerTest.PositiveNegativeDTUnit.class)
  202.                                                  .build(D.pattern(var_GENERATED_$pattern_BigDecimal$2$).expr("6B84791EF63D6F840C6239B18E8215E6",
  203.                                                                                                              (java.math.BigDecimal _this) -> org.drools.modelcompiler.util.EvaluationUtil.lessThanNumbers(_this.intValue(),
  204.                                                                                                                                                                                                           0)),
  205.                                                         D.on(var_output1).execute((org.drools.ruleunit.DataSource output1) -> {
  206.                                                             output1.insert("negative");
  207.                                                         }));
  208.         return rule;
  209.     }
  210. }
  211.  
  212. 16:34:04.508 [main] DEBUG o.d.m.builder.PackageSources.logSource:80 - =====
  213. 16:34:04.509 [main] DEBUG o.d.m.builder.PackageSources.logSource:78 - =====
  214. 16:34:04.510 [main] DEBUG o.d.m.builder.PackageSources.logSource:79 - package org.drools.modelcompiler;
  215. public class DomainClassesMetadata7206AFD5D1A571D4760AE4693F2F5EFD {
  216.  
  217.     public static final org.drools.model.DomainClassMetadata java_math_BigDecimal_Metadata_INSTANCE = new java_math_BigDecimal_Metadata();
  218.     private static class java_math_BigDecimal_Metadata implements org.drools.model.DomainClassMetadata {
  219.  
  220.         @Override
  221.         public Class<?> getDomainClass() {
  222.             return java.math.BigDecimal.class;
  223.         }
  224.  
  225.         @Override
  226.         public int getPropertiesSize() {
  227.             return 0;
  228.         }
  229.  
  230.         @Override
  231.         public int getPropertyIndex( String name ) {
  232.             switch(name) {
  233.              }
  234.              throw new RuntimeException("Unknown property '" + name + "' for class class class java.math.BigDecimal");
  235.         }
  236.     }
  237.  
  238.     public static final org.drools.model.DomainClassMetadata java_lang_String_Metadata_INSTANCE = new java_lang_String_Metadata();
  239.     private static class java_lang_String_Metadata implements org.drools.model.DomainClassMetadata {
  240.  
  241.         @Override
  242.         public Class<?> getDomainClass() {
  243.             return java.lang.String.class;
  244.         }
  245.  
  246.         @Override
  247.         public int getPropertiesSize() {
  248.             return 3;
  249.         }
  250.  
  251.         @Override
  252.         public int getPropertyIndex( String name ) {
  253.             switch(name) {
  254.                 case "blank": return 0;
  255.                 case "bytes": return 1;
  256.                 case "empty": return 2;
  257.              }
  258.              throw new RuntimeException("Unknown property '" + name + "' for class class class java.lang.String");
  259.         }
  260.     }
  261.  
  262.     public static final org.drools.model.DomainClassMetadata org_drools_ruleunit_DataSource_Metadata_INSTANCE = new org_drools_ruleunit_DataSource_Metadata();
  263.     private static class org_drools_ruleunit_DataSource_Metadata implements org.drools.model.DomainClassMetadata {
  264.  
  265.         @Override
  266.         public Class<?> getDomainClass() {
  267.             return org.drools.ruleunit.DataSource.class;
  268.         }
  269.  
  270.         @Override
  271.         public int getPropertiesSize() {
  272.             return 0;
  273.         }
  274.  
  275.         @Override
  276.         public int getPropertyIndex( String name ) {
  277.             switch(name) {
  278.              }
  279.              throw new RuntimeException("Unknown property '" + name + "' for class class interface org.drools.ruleunit.DataSource");
  280.         }
  281.     }
  282.  
  283. }
  284. 16:34:04.514 [main] DEBUG o.d.m.builder.PackageSources.logSource:80 - =====
  285. 16:34:06.174 [main] DEBUG o.d.c.c.DefaultAgenda$ExecutionStateMachine.setCurrentState:1433 - State was INACTIVE is now FIRING_ALL_RULES
  286. 16:34:06.201 [main] DEBUG o.d.c.c.DefaultAgenda$ExecutionStateMachine.setCurrentState:1433 - State was FIRING_ALL_RULES is now HALTING
  287. 16:34:06.202 [main] DEBUG o.d.c.c.DefaultAgenda$ExecutionStateMachine.setCurrentState:1433 - State was HALTING is now INACTIVE
  288. 16:34:06.202 [main] DEBUG o.d.c.c.DefaultAgenda$ExecutionStateMachine.setCurrentState:1433 - State was INACTIVE is now FIRING_ALL_RULES
  289. 16:34:06.203 [main] DEBUG o.d.c.c.DefaultAgenda$ExecutionStateMachine.setCurrentState:1433 - State was FIRING_ALL_RULES is now HALTING
  290. 16:34:06.203 [main] DEBUG o.d.c.c.DefaultAgenda$ExecutionStateMachine.setCurrentState:1433 - State was HALTING is now INACTIVE
  291.  
  292.  
  293.  
  294. java.lang.AssertionError:
  295. Expected :negative
  296. Actual   :null
  297. <Click to see difference>
  298.  
  299.  
  300.     at org.junit.Assert.fail(Assert.java:88)
  301.     at org.junit.Assert.failNotEquals(Assert.java:834)
  302.     at org.junit.Assert.assertEquals(Assert.java:118)
  303.     at org.junit.Assert.assertEquals(Assert.java:144)
  304.     at org.drools.modelcompiler.RuleUnitCompilerTest.testWith2Rules(RuleUnitCompilerTest.java:183)
  305.     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  306.     at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  307.     at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  308.     at java.base/java.lang.reflect.Method.invoke(Method.java:566)
  309.     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
  310.     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  311.     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
  312.     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
  313.     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
  314.     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
  315.     at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
  316.     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  317.     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  318.     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  319.     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  320.     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  321.     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  322.     at org.junit.runners.Suite.runChild(Suite.java:128)
  323.     at org.junit.runners.Suite.runChild(Suite.java:27)
  324.     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  325.     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  326.     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  327.     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  328.     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  329.     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  330.     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
  331.     at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
  332.     at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
  333.     at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
  334.     at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement