mirror of
https://gitee.com/dromara/liteFlow.git
synced 2026-05-14 12:12:08 +08:00
优化测试用例
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user