Skip to content

Commit

Permalink
修复单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
entropy-cloud committed Aug 11, 2024
1 parent 4b171d5 commit 2ca66b4
Show file tree
Hide file tree
Showing 15 changed files with 120 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -910,16 +910,31 @@
"allowWrite": false,
"name": "PARAM_BIZ_OBJ_NAME"
},
{
"allowUnsafeAccess": false,
"allowWrite": false,
"name": "PARAM_DISPLAY_NAME"
},
{
"allowUnsafeAccess": false,
"allowWrite": false,
"name": "PARAM_ENTITY_NAME"
},
{
"allowUnsafeAccess": false,
"allowWrite": false,
"name": "PARAM_FIELD_DISPLAY_NAME"
},
{
"allowUnsafeAccess": false,
"allowWrite": false,
"name": "PARAM_FIELD_NAME"
},
{
"allowUnsafeAccess": false,
"allowWrite": false,
"name": "PARAM_OBJ_NAME"
},
{
"allowUnsafeAccess": false,
"allowWrite": false,
Expand Down Expand Up @@ -15140,6 +15155,10 @@
"boolean"
]
},
{
"name": "getColExtendForSibling",
"parameterTypes": []
},
{
"name": "getColParent",
"parameterTypes": []
Expand Down Expand Up @@ -15204,6 +15223,10 @@
"name": "getProcessExpr",
"parameterTypes": []
},
{
"name": "getRowExtendForSibling",
"parameterTypes": []
},
{
"name": "getRowParent",
"parameterTypes": []
Expand Down Expand Up @@ -15260,6 +15283,12 @@
"boolean"
]
},
{
"name": "setColExtendForSibling",
"parameterTypes": [
"java.lang.Boolean"
]
},
{
"name": "setColParent",
"parameterTypes": [
Expand Down Expand Up @@ -15380,6 +15409,12 @@
"boolean"
]
},
{
"name": "setRowExtendForSibling",
"parameterTypes": [
"java.lang.Boolean"
]
},
{
"name": "setRowParent",
"parameterTypes": [
Expand Down Expand Up @@ -26165,6 +26200,12 @@
"io.nop.core.lang.eval.IEvalAction"
]
},
{
"name": "setValidator",
"parameterTypes": [
"io.nop.core.lang.eval.IEvalFunction"
]
},
{
"name": "setValidator",
"parameterTypes": [
Expand Down
1 change: 1 addition & 0 deletions nop-cli-core/src/main/resources/nop-vfs-index.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
/nop/report/xlib/xpt-rt.xlib
/nop/report/xlib/xpt.xlib
/nop/rpc/imp/api.imp.xml
/nop/rpc/imp/api.imp.xml.rej
/nop/rpc/imp/template.api.xlsx
/nop/schema/action-auth.xdef
/nop/schema/api.xdef
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import io.micrometer.core.instrument.MeterRegistry;
import io.nop.api.core.ApiConfigs;
import io.nop.api.core.config.AppConfig;
import io.nop.api.core.convert.ConvertHelper;
import io.nop.api.core.ioc.BeanContainer;
import io.nop.commons.metrics.GlobalMeterRegistry;
import io.nop.commons.util.StringHelper;
Expand Down Expand Up @@ -38,7 +39,7 @@ public static void start() {

if (parentProfile.isPresent()) {
System.setProperty(ApiConfigs.CFG_PROFILE_PARENT.getName(), parentProfile.get());
AppConfig.getConfigProvider().updateConfigValue(ApiConfigs.CFG_PROFILE_PARENT, parentProfile.get());
AppConfig.getConfigProvider().updateConfigValue(ApiConfigs.CFG_PROFILE_PARENT, ConvertHelper.toCsvSet(parentProfile.get()));
}

BeanContainer.registerInstance(new NopQuarkusBeanContainer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ public abstract class _RuleOutputDefineModel extends io.nop.xlang.xmeta.ObjVarDe
*/
private io.nop.rule.core.model.RuleAggregateMethod _aggregate ;

/**
*
* xml name: mandatory
*
*/
private boolean _mandatory = false;

/**
*
* xml name: useWeight
Expand All @@ -49,6 +56,25 @@ public void setAggregate(io.nop.rule.core.model.RuleAggregateMethod value){
}


/**
*
* xml name: mandatory
*
*/

public boolean isMandatory(){
return _mandatory;
}


public void setMandatory(boolean value){
checkAllowChange();

this._mandatory = value;

}


/**
*
* xml name: useWeight
Expand Down Expand Up @@ -84,6 +110,7 @@ protected void outputJson(IJsonHandler out){
super.outputJson(out);

out.putNotNull("aggregate",this.getAggregate());
out.putNotNull("mandatory",this.isMandatory());
out.putNotNull("useWeight",this.isUseWeight());
}

Expand All @@ -97,6 +124,7 @@ protected void copyTo(RuleOutputDefineModel instance){
super.copyTo(instance);

instance.setAggregate(this.getAggregate());
instance.setMandatory(this.isMandatory());
instance.setUseWeight(this.isUseWeight());
}

Expand Down
4 changes: 2 additions & 2 deletions nop-rule/nop-rule-meta/_templates/_NopRuleDefinition.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"modelTextXmlComponent": null,
"ruleInputs": null,
"ruleOutputs": null,
"beforeExecute": null,
"beforeExecute": "",
"importFile": null,
"rootRuleNodes": null,
"decisionMatrix": null
"decisionMatrix": ""
}
2 changes: 1 addition & 1 deletion nop-rule/nop-rule-meta/_templates/_NopRuleInput.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"type": "",
"mandatory": null,
"computed": null,
"defaultExpr": null,
"defaultExpr": "",
"description": "",
"schema": null
}
2 changes: 1 addition & 1 deletion nop-rule/nop-rule-meta/_templates/_NopRuleOutputValue.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "",
"valueExpr": null
"valueExpr": ""
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,10 @@ A,@var:NopRuleDefinition@ruleId,testMatrix,1,Test Matrix,default,MATX,,"<rule di
</input>
</inputs>
<outputs>
<output displayName=""分数"" name=""result"" type=""Double"" ext:level=""0"">
<output displayName=""分数"" mandatory=""true"" name=""result"" type=""Double"" ext:level=""0"">
<schema/>
</output>
<output displayName=""类型"" name=""type"" type=""String"" ext:level=""0"">
<output displayName=""类型"" mandatory=""true"" name=""type"" type=""String"" ext:level=""0"">
<schema/>
</output>
</outputs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ruleGroup": "default",
"ruleType": "TREE",
"ruleType_label": "TREE-决策树",
"modelText": "<rule displayName=\"测试规则\" x:schema=\"/nop/schema/rule.xdef\" xmlns:x=\"/nop/schema/xdsl.xdef\">\n <inputs>\n <input displayName=\"季度\" mandatory=\"true\" name=\"season\" type=\"String\" ext:level=\"0\">\n <schema/>\n </input>\n <input displayName=\"客人数\" mandatory=\"true\" name=\"guestCount\" type=\"Integer\" ext:level=\"0\">\n <schema/>\n </input>\n </inputs>\n <outputs>\n <output displayName=\"食物\" name=\"dish\" type=\"String\" ext:level=\"0\">\n <schema/>\n </output>\n </outputs>\n</rule>",
"modelText": "<rule displayName=\"测试规则\" x:schema=\"/nop/schema/rule.xdef\" xmlns:x=\"/nop/schema/xdsl.xdef\">\n <inputs>\n <input displayName=\"季度\" mandatory=\"true\" name=\"season\" type=\"String\" ext:level=\"0\">\n <schema/>\n </input>\n <input displayName=\"客人数\" mandatory=\"true\" name=\"guestCount\" type=\"Integer\" ext:level=\"0\">\n <schema/>\n </input>\n </inputs>\n <outputs>\n <output displayName=\"食物\" mandatory=\"true\" name=\"dish\" type=\"String\" ext:level=\"0\">\n <schema/>\n </output>\n </outputs>\n</rule>",
"status": 1,
"status_label": "1-启用",
"version": 0,
Expand All @@ -21,8 +21,8 @@
"name": "season",
"displayName": "季度",
"type": "String",
"mandatory": "true",
"computed": "false",
"mandatory": true,
"computed": false,
"defaultExpr": null,
"description": null,
"schema": {}
Expand All @@ -31,8 +31,8 @@
"name": "guestCount",
"displayName": "客人数",
"type": "Integer",
"mandatory": "true",
"computed": "false",
"mandatory": true,
"computed": false,
"defaultExpr": null,
"description": null,
"schema": {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A,@var:NopRuleDefinition@ruleId,test,1,Test Tree,default,TREE,,"<rule displayNam
</input>
</inputs>
<outputs>
<output displayName=""食物"" name=""dish"" type=""String"" ext:level=""0"">
<output displayName=""食物"" mandatory=""true"" name=""dish"" type=""String"" ext:level=""0"">
<schema/>
</output>
</outputs>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
_chgType,SID,RULE_ID,LABEL,SORT_NO,PREDICATE,OUTPUTS,PARENT_ID,IS_LEAF,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,@var:NopRuleNode@sid_5,@var:NopRuleDefinition@ruleId,<= 4,1,"{""$type"":""le"",""name"":""guestCount"",""value"":4}","{
""dish"": ""\""Dry Aged Gourmet Steak\""""
}",@var:NopRuleNode@sid_4,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_2,@var:NopRuleDefinition@ruleId,Winter,2,"{""$type"":""eq"",""name"":""season"",""value"":""Winter""}",,,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_8,@var:NopRuleDefinition@ruleId,> 8,1,"{""$type"":""gt"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Stew\""""
}",@var:NopRuleNode@sid_7,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_7,@var:NopRuleDefinition@ruleId,"in [""Fall"",""Winter"",""Spring""]",4,"{""$type"":""in"",""name"":""season"",""value"":[""Fall"",""Winter"",""Spring""]}",,,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_1,@var:NopRuleDefinition@ruleId,<= 8,1,"{""$type"":""le"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Spareribs\""""
}",@var:NopRuleNode@sid,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_4,@var:NopRuleDefinition@ruleId,Spring,3,"{""$type"":""eq"",""name"":""season"",""value"":""Spring""}",,,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_10,@var:NopRuleDefinition@ruleId,-,1,"{""$type"":""alwaysTrue""}","{
""dish"": ""\""Light Salad and nice Steak\""""
}",@var:NopRuleNode@sid_9,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_9,@var:NopRuleDefinition@ruleId,Summer,5,"{""$type"":""eq"",""name"":""season"",""value"":""Summer""}",,,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_8,@var:NopRuleDefinition@ruleId,> 8,1,"{""$type"":""gt"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Stew\""""
}",@var:NopRuleNode@sid_7,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_2,@var:NopRuleDefinition@ruleId,Winter,2,"{""$type"":""eq"",""name"":""season"",""value"":""Winter""}",,,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_5,@var:NopRuleDefinition@ruleId,<= 4,1,"{""$type"":""le"",""name"":""guestCount"",""value"":4}","{
""dish"": ""\""Dry Aged Gourmet Steak\""""
}",@var:NopRuleNode@sid_4,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid,@var:NopRuleDefinition@ruleId,Fall,1,"{""$type"":""eq"",""name"":""season"",""value"":""Fall""}",,,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_6,@var:NopRuleDefinition@ruleId,<=8 and >= 5,2,"{""$type"":""and"",""$body"":[{""$type"":""le"",""name"":""guestCount"",""value"":8},{""$type"":""ge"",""name"":""guestCount"",""value"":5}]}","{
""dish"": ""\""Steak\""""
}",@var:NopRuleNode@sid_4,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_9,@var:NopRuleDefinition@ruleId,Summer,5,"{""$type"":""eq"",""name"":""season"",""value"":""Summer""}",,,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_3,@var:NopRuleDefinition@ruleId,<= 8,1,"{""$type"":""le"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Roastbeef\""""
}",@var:NopRuleNode@sid_2,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_1,@var:NopRuleDefinition@ruleId,<= 8,1,"{""$type"":""le"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Spareribs\""""
}",@var:NopRuleNode@sid,true,0,autotest-ref,*,autotest-ref,*,
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
_chgType,FILE_ID,FILE_NAME,FILE_PATH,FILE_EXT,MIME_TYPE,FILE_LENGTH,FILE_LAST_MODIFIED,BIZ_OBJ_NAME,BIZ_OBJ_ID,FIELD_NAME,FILE_HASH,ORIGIN_FILE_ID,IS_PUBLIC,DEL_FLAG,CREATED_BY,CREATE_TIME,REMARK
A,@var:NopFileRecord@fileId,decision-tree.rule.xlsx,@var:NopFileRecord@filePath,xlsx,binary,11856,,NopRuleDefinition,@var:NopFileRecord@bizObjId_1,importFile,,@var:NopFileRecord@originFileId,false,1,autotest-ref,*,
A,@var:NopFileRecord@fileId_1,decision-tree.rule.xlsx,@var:NopFileRecord@filePath_1,xlsx,binary,11856,,NopRuleDefinition,@var:NopFileRecord@bizObjId_1,importFile,,@var:NopFileRecord@originFileId_1,false,1,autotest-ref,*,
A,@var:NopFileRecord@fileId,decision-tree.rule.xlsx,@var:NopFileRecord@filePath,xlsx,binary,11856,,NopRuleDefinition,@var:NopFileRecord@bizObjId_1,importFile,,@var:NopFileRecord@originFileId,false,1,autotest-ref,*,
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A,@var:NopRuleDefinition@ruleId,test,1,Test Tree,default,TREE,,"<rule displayNam
</input>
</inputs>
<outputs>
<output displayName=""食物"" name=""dish"" type=""String"" ext:level=""0"">
<output displayName=""食物"" mandatory=""true"" name=""dish"" type=""String"" ext:level=""0"">
<schema/>
</output>
</outputs>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
_chgType,SID,RULE_ID,LABEL,SORT_NO,PREDICATE,OUTPUTS,PARENT_ID,IS_LEAF,VERSION,CREATED_BY,CREATE_TIME,UPDATED_BY,UPDATE_TIME,REMARK
A,@var:NopRuleNode@sid_6,@var:NopRuleDefinition@ruleId,<=8 and >= 5,2,"{""$type"":""and"",""$body"":[{""$type"":""le"",""name"":""guestCount"",""value"":8},{""$type"":""ge"",""name"":""guestCount"",""value"":5}]}","{
""dish"": ""\""Steak\""""
}",@var:NopRuleNode@sid_4,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_4,@var:NopRuleDefinition@ruleId,Spring,3,"{""$type"":""eq"",""name"":""season"",""value"":""Spring""}",,,false,1,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_3,@var:NopRuleDefinition@ruleId,<= 8,1,"{""$type"":""le"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Roastbeef\""""
}",@var:NopRuleNode@sid_2,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_7,@var:NopRuleDefinition@ruleId,"in [""Fall"",""Winter"",""Spring""]",4,"{""$type"":""in"",""name"":""season"",""value"":[""Fall"",""Winter"",""Spring""]}",,,false,1,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid,@var:NopRuleDefinition@ruleId,Fall,1,"{""$type"":""eq"",""name"":""season"",""value"":""Fall""}",,,false,1,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_10,@var:NopRuleDefinition@ruleId,-,1,"{""$type"":""alwaysTrue""}","{
""dish"": ""\""Light Salad and nice Steak\""""
}",@var:NopRuleNode@sid_9,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_1,@var:NopRuleDefinition@ruleId,<= 8,1,"{""$type"":""le"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Spareribs\""""
}",@var:NopRuleNode@sid,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_6,@var:NopRuleDefinition@ruleId,<=8 and >= 5,2,"{""$type"":""and"",""$body"":[{""$type"":""le"",""name"":""guestCount"",""value"":8},{""$type"":""ge"",""name"":""guestCount"",""value"":5}]}","{
""dish"": ""\""Steak\""""
}",@var:NopRuleNode@sid_4,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_2,@var:NopRuleDefinition@ruleId,Winter,2,"{""$type"":""eq"",""name"":""season"",""value"":""Winter""}",,,false,1,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_5,@var:NopRuleDefinition@ruleId,<= 4,1,"{""$type"":""le"",""name"":""guestCount"",""value"":4}","{
""dish"": ""\""Dry Aged Gourmet Steak\""""
}",@var:NopRuleNode@sid_4,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_9,@var:NopRuleDefinition@ruleId,Summer,5,"{""$type"":""eq"",""name"":""season"",""value"":""Summer""}",,,false,1,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_4,@var:NopRuleDefinition@ruleId,Spring,3,"{""$type"":""eq"",""name"":""season"",""value"":""Spring""}",,,false,1,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_8,@var:NopRuleDefinition@ruleId,> 8,1,"{""$type"":""gt"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Stew\""""
}",@var:NopRuleNode@sid_7,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_1,@var:NopRuleDefinition@ruleId,<= 8,1,"{""$type"":""le"",""name"":""guestCount"",""value"":8}","{
""dish"": ""\""Spareribs\""""
}",@var:NopRuleNode@sid,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_2,@var:NopRuleDefinition@ruleId,Winter,2,"{""$type"":""eq"",""name"":""season"",""value"":""Winter""}",,,false,1,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid_10,@var:NopRuleDefinition@ruleId,-,1,"{""$type"":""alwaysTrue""}","{
""dish"": ""\""Light Salad and nice Steak\""""
}",@var:NopRuleNode@sid_9,true,0,autotest-ref,*,autotest-ref,*,
A,@var:NopRuleNode@sid,@var:NopRuleDefinition@ruleId,Fall,1,"{""$type"":""eq"",""name"":""season"",""value"":""Fall""}",,,false,1,autotest-ref,*,autotest-ref,*,

0 comments on commit 2ca66b4

Please sign in to comment.