优化测试用例

This commit is contained in:
everywhere.z
2022-07-14 18:47:57 +08:00
parent a40dc6fe84
commit 20a955dc49
10 changed files with 62 additions and 46 deletions

View File

@@ -17,11 +17,13 @@ public class ICmp {
@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
public void process(NodeComponent bindCmp) throws Exception {
DefaultContext context = bindCmp.getFirstContextBean();
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
synchronized (ICmp.class){
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
}
}
System.out.println("Icomp executed! throw Exception!");
throw new TestException();

View File

@@ -10,11 +10,13 @@ public class ICmp extends NodeComponent {
@Override
public void process() throws Exception {
DefaultContext context = this.getFirstContextBean();
if (context.hasData("count")) {
Integer count = context.getData("count");
context.setData("count", ++count);
} else {
context.setData("count", 1);
synchronized (ICmp.class){
if (context.hasData("count")) {
Integer count = context.getData("count");
context.setData("count", ++count);
} else {
context.setData("count", 1);
}
}
System.out.println("Icomp executed! throw Exception!");
throw new TestException();

View File

@@ -12,11 +12,13 @@ public class ICmp extends NodeComponent {
@Override
public void process() throws Exception {
DefaultContext context = this.getFirstContextBean();
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
synchronized (ICmp.class){
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
}
}
System.out.println("Icomp executed! throw Exception!");
throw new TestException();

View File

@@ -13,11 +13,13 @@ public class ICmp extends NodeComponent {
@Override
public void process() throws Exception {
DefaultContext context = this.getFirstContextBean();
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
synchronized (ICmp.class){
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
}
}
System.out.println("Icomp executed! throw Exception!");
throw new TestException();

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<flow>
<chain name="chain1">
THEN(a, b, c)
THEN(a, b, c);
</chain>
<chain name="chain1">
THEN(a, b, c)
THEN(a, b, c);
</chain>

View File

@@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<flow>
<chain name="chain1">
THEN(a, b, c)
THEN(a, b, c);
</chain>
<chain name="chain3">
THEN(a, WHEN(b, c).ignoreError(false))
THEN(a, WHEN(b, c).ignoreError(false));
</chain>
<chain name="chain4">
THEN(c, d)
THEN(c, d);
</chain>
<chain name="chain5">
SWITCH(e).to(b, c)
SWITCH(e).to(b, c);
</chain>
</flow>

View File

@@ -17,11 +17,13 @@ public class ICmp {
@LiteflowMethod(LiteFlowMethodEnum.PROCESS)
public void process(NodeComponent bindCmp) throws Exception {
DefaultContext context = bindCmp.getFirstContextBean();
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
synchronized (ICmp.class){
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
}
}
System.out.println("Icomp executed! throw Exception!");
throw new TestException();

View File

@@ -11,11 +11,13 @@ public class ICmp extends NodeComponent {
@Override
public void process() throws Exception {
DefaultContext context = this.getFirstContextBean();
if (context.hasData("count")) {
Integer count = context.getData("count");
context.setData("count", ++count);
} else {
context.setData("count", 1);
synchronized (ICmp.class){
if (context.hasData("count")) {
Integer count = context.getData("count");
context.setData("count", ++count);
} else {
context.setData("count", 1);
}
}
System.out.println("Icomp executed! throw Exception!");
throw new TestException();

View File

@@ -13,11 +13,13 @@ public class ICmp extends NodeComponent {
@Override
public void process() throws Exception {
DefaultContext context = this.getFirstContextBean();
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
synchronized (ICmp.class){
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
}
}
System.out.println("Icomp executed! throw Exception!");
throw new TestException();

View File

@@ -13,11 +13,13 @@ public class ICmp extends NodeComponent {
@Override
public void process() throws Exception {
DefaultContext context = this.getFirstContextBean();
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
synchronized (ICmp.class){
if (context.hasData("count")){
Integer count = context.getData("count");
context.setData("count", ++count);
} else{
context.setData("count", 1);
}
}
System.out.println("Icomp executed! throw Exception!");
throw new TestException();