|
|
@ -152,18 +152,18 @@ public class CheckUtilsTest { |
|
|
|
// sub SubProcessParameters
|
|
|
|
// sub SubProcessParameters
|
|
|
|
SubProcessParameters subProcessParameters = new SubProcessParameters(); |
|
|
|
SubProcessParameters subProcessParameters = new SubProcessParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(subProcessParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(subProcessParameters)); |
|
|
|
taskNode.setType(TaskType.SUB_PROCESS.toString()); |
|
|
|
taskNode.setType(TaskType.SUB_PROCESS.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
|
|
|
|
|
|
|
|
subProcessParameters.setProcessDefinitionId(1234); |
|
|
|
subProcessParameters.setProcessDefinitionId(1234); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(subProcessParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(subProcessParameters)); |
|
|
|
taskNode.setType(TaskType.SUB_PROCESS.toString()); |
|
|
|
taskNode.setType(TaskType.SUB_PROCESS.getDesc()); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
|
|
|
|
|
|
|
|
// ShellParameters
|
|
|
|
// ShellParameters
|
|
|
|
ShellParameters shellParameters = new ShellParameters(); |
|
|
|
ShellParameters shellParameters = new ShellParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(shellParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(shellParameters)); |
|
|
|
taskNode.setType(TaskType.SHELL.toString()); |
|
|
|
taskNode.setType(TaskType.SHELL.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
shellParameters.setRawScript(""); |
|
|
|
shellParameters.setRawScript(""); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(shellParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(shellParameters)); |
|
|
@ -175,7 +175,7 @@ public class CheckUtilsTest { |
|
|
|
// ProcedureParameters
|
|
|
|
// ProcedureParameters
|
|
|
|
ProcedureParameters procedureParameters = new ProcedureParameters(); |
|
|
|
ProcedureParameters procedureParameters = new ProcedureParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(procedureParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(procedureParameters)); |
|
|
|
taskNode.setType(TaskType.PROCEDURE.toString()); |
|
|
|
taskNode.setType(TaskType.PROCEDURE.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
procedureParameters.setDatasource(1); |
|
|
|
procedureParameters.setDatasource(1); |
|
|
|
procedureParameters.setType("xx"); |
|
|
|
procedureParameters.setType("xx"); |
|
|
@ -186,7 +186,7 @@ public class CheckUtilsTest { |
|
|
|
// SqlParameters
|
|
|
|
// SqlParameters
|
|
|
|
SqlParameters sqlParameters = new SqlParameters(); |
|
|
|
SqlParameters sqlParameters = new SqlParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(sqlParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(sqlParameters)); |
|
|
|
taskNode.setType(TaskType.SQL.toString()); |
|
|
|
taskNode.setType(TaskType.SQL.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
sqlParameters.setDatasource(1); |
|
|
|
sqlParameters.setDatasource(1); |
|
|
|
sqlParameters.setType("xx"); |
|
|
|
sqlParameters.setType("xx"); |
|
|
@ -197,7 +197,7 @@ public class CheckUtilsTest { |
|
|
|
// MapReduceParameters
|
|
|
|
// MapReduceParameters
|
|
|
|
MapReduceParameters mapreduceParameters = new MapReduceParameters(); |
|
|
|
MapReduceParameters mapreduceParameters = new MapReduceParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(mapreduceParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(mapreduceParameters)); |
|
|
|
taskNode.setType(TaskType.MR.toString()); |
|
|
|
taskNode.setType(TaskType.MR.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
|
|
|
|
|
|
|
|
ResourceInfo resourceInfoMapreduce = new ResourceInfo(); |
|
|
|
ResourceInfo resourceInfoMapreduce = new ResourceInfo(); |
|
|
@ -206,13 +206,13 @@ public class CheckUtilsTest { |
|
|
|
mapreduceParameters.setMainJar(resourceInfoMapreduce); |
|
|
|
mapreduceParameters.setMainJar(resourceInfoMapreduce); |
|
|
|
mapreduceParameters.setProgramType(ProgramType.JAVA); |
|
|
|
mapreduceParameters.setProgramType(ProgramType.JAVA); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(mapreduceParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(mapreduceParameters)); |
|
|
|
taskNode.setType(TaskType.MR.toString()); |
|
|
|
taskNode.setType(TaskType.MR.getDesc()); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
|
|
|
|
|
|
|
|
// SparkParameters
|
|
|
|
// SparkParameters
|
|
|
|
SparkParameters sparkParameters = new SparkParameters(); |
|
|
|
SparkParameters sparkParameters = new SparkParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(sparkParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(sparkParameters)); |
|
|
|
taskNode.setType(TaskType.SPARK.toString()); |
|
|
|
taskNode.setType(TaskType.SPARK.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
sparkParameters.setMainJar(new ResourceInfo()); |
|
|
|
sparkParameters.setMainJar(new ResourceInfo()); |
|
|
|
sparkParameters.setProgramType(ProgramType.SCALA); |
|
|
|
sparkParameters.setProgramType(ProgramType.SCALA); |
|
|
@ -223,7 +223,7 @@ public class CheckUtilsTest { |
|
|
|
// PythonParameters
|
|
|
|
// PythonParameters
|
|
|
|
PythonParameters pythonParameters = new PythonParameters(); |
|
|
|
PythonParameters pythonParameters = new PythonParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(pythonParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(pythonParameters)); |
|
|
|
taskNode.setType(TaskType.PYTHON.toString()); |
|
|
|
taskNode.setType(TaskType.PYTHON.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
pythonParameters.setRawScript("ss"); |
|
|
|
pythonParameters.setRawScript("ss"); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(pythonParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(pythonParameters)); |
|
|
@ -232,42 +232,42 @@ public class CheckUtilsTest { |
|
|
|
// DependentParameters
|
|
|
|
// DependentParameters
|
|
|
|
DependentParameters dependentParameters = new DependentParameters(); |
|
|
|
DependentParameters dependentParameters = new DependentParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(dependentParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(dependentParameters)); |
|
|
|
taskNode.setType(TaskType.DEPENDENT.toString()); |
|
|
|
taskNode.setType(TaskType.DEPENDENT.getDesc()); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
|
|
|
|
|
|
|
|
// FlinkParameters
|
|
|
|
// FlinkParameters
|
|
|
|
FlinkParameters flinkParameters = new FlinkParameters(); |
|
|
|
FlinkParameters flinkParameters = new FlinkParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(flinkParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(flinkParameters)); |
|
|
|
taskNode.setType(TaskType.FLINK.toString()); |
|
|
|
taskNode.setType(TaskType.FLINK.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
flinkParameters.setMainJar(new ResourceInfo()); |
|
|
|
flinkParameters.setMainJar(new ResourceInfo()); |
|
|
|
flinkParameters.setProgramType(ProgramType.JAVA); |
|
|
|
flinkParameters.setProgramType(ProgramType.JAVA); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(flinkParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(flinkParameters)); |
|
|
|
taskNode.setType(TaskType.FLINK.toString()); |
|
|
|
taskNode.setType(TaskType.FLINK.getDesc()); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
|
|
|
|
|
|
|
|
// HTTP
|
|
|
|
// HTTP
|
|
|
|
HttpParameters httpParameters = new HttpParameters(); |
|
|
|
HttpParameters httpParameters = new HttpParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(httpParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(httpParameters)); |
|
|
|
taskNode.setType(TaskType.HTTP.toString()); |
|
|
|
taskNode.setType(TaskType.HTTP.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
httpParameters.setUrl("httpUrl"); |
|
|
|
httpParameters.setUrl("httpUrl"); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(httpParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(httpParameters)); |
|
|
|
taskNode.setType(TaskType.HTTP.toString()); |
|
|
|
taskNode.setType(TaskType.HTTP.getDesc()); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
|
|
|
|
|
|
|
|
// DataxParameters
|
|
|
|
// DataxParameters
|
|
|
|
DataxParameters dataxParameters = new DataxParameters(); |
|
|
|
DataxParameters dataxParameters = new DataxParameters(); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(dataxParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(dataxParameters)); |
|
|
|
taskNode.setType(TaskType.DATAX.toString()); |
|
|
|
taskNode.setType(TaskType.DATAX.getDesc()); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertFalse(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
dataxParameters.setCustomConfig(0); |
|
|
|
dataxParameters.setCustomConfig(0); |
|
|
|
dataxParameters.setDataSource(111); |
|
|
|
dataxParameters.setDataSource(111); |
|
|
|
dataxParameters.setDataTarget(333); |
|
|
|
dataxParameters.setDataTarget(333); |
|
|
|
dataxParameters.setSql("sql"); |
|
|
|
dataxParameters.setSql(TaskType.SQL.getDesc()); |
|
|
|
dataxParameters.setTargetTable("tar"); |
|
|
|
dataxParameters.setTargetTable("tar"); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(dataxParameters)); |
|
|
|
taskNode.setParams(JSONUtils.toJsonString(dataxParameters)); |
|
|
|
taskNode.setType(TaskType.DATAX.toString()); |
|
|
|
taskNode.setType(TaskType.DATAX.getDesc()); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
assertTrue(CheckUtils.checkTaskNodeParameters(taskNode)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|