Merge branch 'jenkins_with_weblogic' into master
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,7 +2,7 @@ package com.eactive.eai.transformer;
|
|||||||
|
|
||||||
public class SystemKeys {
|
public class SystemKeys {
|
||||||
public static final String TRANSFROMER_BYTESMESSAGE_CHARSET = "transformer.bytesmessage.charset";
|
public static final String TRANSFROMER_BYTESMESSAGE_CHARSET = "transformer.bytesmessage.charset";
|
||||||
public static final String TRANSFROMER_BYTESMESSAGE_CHARSET_DEFAULT = "utf-8";
|
public static final String TRANSFROMER_BYTESMESSAGE_CHARSET_DEFAULT = "euc-kr";
|
||||||
|
|
||||||
public static final String TRANSFROMER_STRING_TRIMEND = "transformer.string.trimend";
|
public static final String TRANSFROMER_STRING_TRIMEND = "transformer.string.trimend";
|
||||||
public static final String TRANSFROMER_VALIDATION = "transformer.validation";
|
public static final String TRANSFROMER_VALIDATION = "transformer.validation";
|
||||||
@@ -86,7 +86,7 @@ public class SystemKeys {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isValidationEnabled() {
|
public static boolean isValidationEnabled() {
|
||||||
return validationEnabled;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isAddDecimalPointEnabled() {
|
public static boolean isAddDecimalPointEnabled() {
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ public class Parser implements Serializable {
|
|||||||
if (funcDef == null) continue;
|
if (funcDef == null) continue;
|
||||||
String functionClass = funcDef.getFunctionClass();
|
String functionClass = funcDef.getFunctionClass();
|
||||||
if (functionClass == null) continue;
|
if (functionClass == null) continue;
|
||||||
if(!functionClass.startsWith("com.eactive.eai.transformer.function")) {
|
if(!(functionClass.startsWith("com.eactive.eai.transformer.function")
|
||||||
|
|| functionClass.startsWith("com.eactive.eai.custom.transformer.function"))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -94,7 +94,10 @@ public class Transformer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!isChanged) {
|
if(!isChanged) {
|
||||||
throw new NullPointerException("변환인자 '[*]' 가 존재하지 않습니다. - "+src);
|
// 현재 아래 예외처리를 통해 Grid -> Grid만 되도록 cnvsnrsultitempathname 안에 path에 [*]있는지 체크하고 예외 발생.
|
||||||
|
// Grid to Group 맵핑 해야할 경우가 생겨, 예외 주석처리.
|
||||||
|
// throw new NullPointerException("변환인자 '[*]' 가 존재하지 않습니다. - "+src);
|
||||||
|
logger.debug("타겟 변환인자에 '[*]' 가 존재하지 않습니다. - "+src);
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
@@ -421,7 +424,19 @@ public class Transformer {
|
|||||||
" | Item (" + itemPath + ") can not be found in Target Message. Check conversion rules - ");
|
" | Item (" + itemPath + ") can not be found in Target Message. Check conversion rules - ");
|
||||||
errors.add(targetMessage.toString());
|
errors.add(targetMessage.toString());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//변환에서 src->target으로 값이 맵핑된적이 있나? Grid to Group 같은 경우에는 첫그리드 index 항목에서 맵핑후,
|
||||||
|
//같은 path의 Group 항목에 중첩될것이니 flag는 true. 그렇다면 PASS 왜냐하면 고객요건이 Grid to Group에서 Grid 첫번째 항목만 맵핑되었으면 함.
|
||||||
|
//해당 로직없으면 계속 덮어씌기가 되며 맨 마지막 index 항목이 맵핑됨.
|
||||||
|
if ( resultItem.isMappingFlag() ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
resultItem.mapped();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -81,14 +81,14 @@ public class ADDPOINT extends PostfixMathCommand {
|
|||||||
}
|
}
|
||||||
public static void main(String[] args) throws Exception{
|
public static void main(String[] args) throws Exception{
|
||||||
ADDPOINT point = new ADDPOINT();
|
ADDPOINT point = new ADDPOINT();
|
||||||
System.out.println(new String(point.addPoint("000000000100",12,0)));
|
// System.out.println(new String(point.addPoint("000000000100",12,0)));
|
||||||
try{
|
try{
|
||||||
System.out.println(Long.valueOf(new String(point.addPoint("000000000100",12,0))));
|
// System.out.println(Long.valueOf(new String(point.addPoint("000000000100",12,0))));
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
try{
|
try{
|
||||||
System.out.println(new BigDecimal(new String(point.addPoint("000000000100",12,0))));
|
// System.out.println(new BigDecimal(new String(point.addPoint("000000000100",12,0))));
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -118,8 +118,8 @@ public class REMOVEPOINT extends PostfixMathCommand {
|
|||||||
// System.out.println(new String(point.addStack(new String("1.2"), 6, 0)));
|
// System.out.println(new String(point.addStack(new String("1.2"), 6, 0)));
|
||||||
// System.out.println(new String(point.addStack(new String("1.2"), 12, 2)));
|
// System.out.println(new String(point.addStack(new String("1.2"), 12, 2)));
|
||||||
// System.out.println(new String(point.addStack(new BigDecimal("1000000000000000000.2"), 20, 2)));
|
// System.out.println(new String(point.addStack(new BigDecimal("1000000000000000000.2"), 20, 2)));
|
||||||
System.out.println(new String(point.addStack(new Double("1000000000000000.2"), 20, 2))); // 16 decimal digits available
|
// System.out.println(new String(point.addStack(new Double("1000000000000000.2"), 20, 2))); // 16 decimal digits available
|
||||||
System.out.println(new String(point.addStack(new Double("1.0000000000000002"), 1, 20))); // 16 decimal digits available
|
// System.out.println(new String(point.addStack(new Double("1.0000000000000002"), 1, 20))); // 16 decimal digits available
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -120,11 +120,11 @@ public class REMOVEPOINTS extends PostfixMathCommand {
|
|||||||
public static void main(String[] args) throws Exception{
|
public static void main(String[] args) throws Exception{
|
||||||
REMOVEPOINTS point = new REMOVEPOINTS();
|
REMOVEPOINTS point = new REMOVEPOINTS();
|
||||||
|
|
||||||
System.out.println(new String(point.addStack(new String("-1.2"), 6, 2)));
|
// System.out.println(new String(point.addStack(new String("-1.2"), 6, 2)));
|
||||||
System.out.println(new String(point.addStack(new String("-1.2"), 6, 0)));
|
// System.out.println(new String(point.addStack(new String("-1.2"), 6, 0)));
|
||||||
System.out.println(new String(point.addStack(new String("-1.2"), 12, 2)));
|
// System.out.println(new String(point.addStack(new String("-1.2"), 12, 2)));
|
||||||
System.out.println(new String(point.addStack(new BigDecimal("-1000000000000000000.2"), 20, 2)));
|
// System.out.println(new String(point.addStack(new BigDecimal("-1000000000000000000.2"), 20, 2)));
|
||||||
System.out.println(new String(point.addStack(new Double("-1000000000000000000.2"), 20, 2)));
|
// System.out.println(new String(point.addStack(new Double("-1000000000000000000.2"), 20, 2)));
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.eactive.eai.transformer.function.crypto;
|
||||||
|
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
|
import org.nfunk.jep.ParseException;
|
||||||
|
import org.nfunk.jep.function.PostfixMathCommand;
|
||||||
|
|
||||||
|
import com.eactive.eai.common.property.PropManager;
|
||||||
|
import com.initech.inisafenet.KeyFixManager;
|
||||||
|
|
||||||
|
public class IniSafeNetKJDecrypt extends PostfixMathCommand {
|
||||||
|
public IniSafeNetKJDecrypt() {
|
||||||
|
numberOfParameters = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(Stack inStack) throws ParseException {
|
||||||
|
checkStack(inStack);
|
||||||
|
|
||||||
|
Object param = inStack.pop();
|
||||||
|
byte[] value = null;
|
||||||
|
|
||||||
|
KeyFixManager keyMgr = null;
|
||||||
|
byte[] decData = null;
|
||||||
|
|
||||||
|
PropManager propManager = PropManager.getInstance();
|
||||||
|
String sConf = propManager.getProperty("IniSafeNet","properties.path");
|
||||||
|
String iniSafeKey = propManager.getProperty("IniSafeNet","key.value");
|
||||||
|
|
||||||
|
if (param instanceof String) {
|
||||||
|
value = ((String) param).getBytes();
|
||||||
|
} else if (param instanceof byte[]) {
|
||||||
|
value = (byte[]) param;
|
||||||
|
} else if (param instanceof Double) {
|
||||||
|
if (((Double) param).doubleValue() == Math.round(((Double) param).doubleValue())) {
|
||||||
|
value = new Long(Math.round(((Double) param).doubleValue())).toString().getBytes();
|
||||||
|
} else {
|
||||||
|
value =((Number) param).toString().getBytes();
|
||||||
|
}
|
||||||
|
} else if (param instanceof Number) {
|
||||||
|
value = ((Number) param).toString().getBytes();
|
||||||
|
} else if (param == null) {
|
||||||
|
inStack.push(null);
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
throw new ParseException("Function의 파라미터 인수가 byte[] 또는 String이 아닙니다. : " + param);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
keyMgr = new KeyFixManager(sConf);
|
||||||
|
decData = keyMgr.decrypt(value);
|
||||||
|
inStack.push(decData);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//throw new ExecutionException(e.getMessage(), parameters, e);
|
||||||
|
throw new ParseException(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
+15
-19
@@ -1,35 +1,30 @@
|
|||||||
package com.eactive.eai.transformer.function.crypto;
|
package com.eactive.eai.transformer.function.crypto;
|
||||||
// not completed source jwhong
|
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import org.nfunk.jep.ParseException;
|
import org.nfunk.jep.ParseException;
|
||||||
import org.nfunk.jep.function.PostfixMathCommand;
|
import org.nfunk.jep.function.PostfixMathCommand;
|
||||||
|
|
||||||
import com.eactive.eai.common.property.PropManager;
|
import com.eactive.eai.common.property.PropManager;
|
||||||
|
import com.initech.inisafenet.KeyFixManager;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
|
|
||||||
import com.eactive.eai.common.seed.SeedKJ;
|
|
||||||
import com.eactive.eai.common.seed.SeedCipher;
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
|
||||||
import java.util.Base64;
|
|
||||||
|
|
||||||
public class IniSafeNetKJEncrypt extends PostfixMathCommand {
|
public class IniSafeNetKJEncrypt extends PostfixMathCommand {
|
||||||
public IniSafeNetKJEncrypt() {
|
public IniSafeNetKJEncrypt() {
|
||||||
numberOfParameters = 2;
|
numberOfParameters = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(Stack inStack) throws ParseException {
|
public void run(Stack inStack) throws ParseException {
|
||||||
checkStack(inStack);
|
checkStack(inStack);
|
||||||
|
|
||||||
// USER FUNCTION에서 Parameter 에서 가져옴
|
|
||||||
Object param2 = inStack.pop();
|
|
||||||
String param2Str = String.valueOf(param2); // null 안전 처리
|
|
||||||
String encryptKey = StringUtils.leftPad(param2Str, 16, '0');
|
|
||||||
|
|
||||||
Object param = inStack.pop();
|
Object param = inStack.pop();
|
||||||
|
|
||||||
byte[] value = null;
|
byte[] value = null;
|
||||||
|
|
||||||
|
KeyFixManager keyMgr = null;
|
||||||
|
byte[] encData = null;
|
||||||
|
|
||||||
|
PropManager propManager = PropManager.getInstance();
|
||||||
|
String sConf = propManager.getProperty("IniSafeNet","properties.path");
|
||||||
|
String iniSafeKey = propManager.getProperty("IniSafeNet","key.value");
|
||||||
|
|
||||||
if (param instanceof String) {
|
if (param instanceof String) {
|
||||||
value = ((String) param).getBytes();
|
value = ((String) param).getBytes();
|
||||||
@@ -49,11 +44,12 @@ public class IniSafeNetKJEncrypt extends PostfixMathCommand {
|
|||||||
} else {
|
} else {
|
||||||
throw new ParseException("Function의 파라미터 인수가 byte[] 또는 String이 아닙니다. : " + param);
|
throw new ParseException("Function의 파라미터 인수가 byte[] 또는 String이 아닙니다. : " + param);
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String encryptedData = SeedKJ.encrypt(new String(value, StandardCharsets.UTF_8), encryptKey);
|
keyMgr = new KeyFixManager(sConf);
|
||||||
|
//encData = keyMgr.encrypt(iniSafeKey, value);
|
||||||
inStack.push(encryptedData);
|
encData = keyMgr.encrypt(value);
|
||||||
|
inStack.push(encData);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//throw new ExecutionException(e.getMessage(), parameters, e);
|
//throw new ExecutionException(e.getMessage(), parameters, e);
|
||||||
throw new ParseException(e.getMessage(), e);
|
throw new ParseException(e.getMessage(), e);
|
||||||
|
|||||||
@@ -4,29 +4,25 @@ import java.util.Stack;
|
|||||||
|
|
||||||
import org.nfunk.jep.ParseException;
|
import org.nfunk.jep.ParseException;
|
||||||
import org.nfunk.jep.function.PostfixMathCommand;
|
import org.nfunk.jep.function.PostfixMathCommand;
|
||||||
|
|
||||||
import com.eactive.eai.common.property.PropManager;
|
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
// kj bank import 2025-09-23 jwhong
|
// kj bank import 2025-09-23 jwhong
|
||||||
//import org.kjbank.simple.core.crypto.seed.SeedUtil;
|
//import com.eactive.eai.common.seed.SeedKJ;
|
||||||
import com.eactive.eai.common.seed.SeedKJ;
|
//security-1.0.0.jar 사용으로 변경 2026-01-05
|
||||||
|
import com.eactive.eai.security.seed.Seed;
|
||||||
|
import com.eactive.eai.common.context.ElinkTransactionContext;
|
||||||
|
|
||||||
public class SeedKJDecrypt extends PostfixMathCommand {
|
public class SeedKJDecrypt extends PostfixMathCommand {
|
||||||
public SeedKJDecrypt() {
|
public SeedKJDecrypt() {
|
||||||
numberOfParameters = 2;
|
numberOfParameters = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(Stack inStack) throws ParseException {
|
public void run(Stack inStack) throws ParseException {
|
||||||
checkStack(inStack);
|
checkStack(inStack);
|
||||||
|
|
||||||
// USER FUNCTION에서 Parameter 에서 가져옴
|
String seedKey = ElinkTransactionContext.getSeedKey();
|
||||||
Object param2 = inStack.pop();
|
String decryptKey = StringUtils.leftPad(seedKey, 16, '0');
|
||||||
String param2Str = String.valueOf(param2); // null 안전 처리
|
|
||||||
String decryptKey = StringUtils.leftPad(param2Str, 16, '0');
|
|
||||||
|
|
||||||
Object param = inStack.pop();
|
Object param = inStack.pop();
|
||||||
|
|
||||||
@@ -52,8 +48,8 @@ public class SeedKJDecrypt extends PostfixMathCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String decryptedData = SeedKJ.decrypt(new String(value, StandardCharsets.UTF_8), decryptKey);
|
String decryptedData = Seed.decrypt(decryptKey, new String(value, StandardCharsets.UTF_8));
|
||||||
|
|
||||||
inStack.push(decryptedData);
|
inStack.push(decryptedData);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
//throw new ExecutionException(e.getMessage(), parameters, e);
|
//throw new ExecutionException(e.getMessage(), parameters, e);
|
||||||
|
|||||||
@@ -5,29 +5,27 @@ import java.util.Stack;
|
|||||||
import org.nfunk.jep.ParseException;
|
import org.nfunk.jep.ParseException;
|
||||||
import org.nfunk.jep.function.PostfixMathCommand;
|
import org.nfunk.jep.function.PostfixMathCommand;
|
||||||
|
|
||||||
import com.eactive.eai.common.property.PropManager;
|
|
||||||
|
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
|
|
||||||
// kj bank import 2025-09-23 jwhong
|
// security-1.0.0.jar 사용으로 변경 2026-01-05
|
||||||
import com.eactive.eai.common.seed.SeedKJ;
|
import com.eactive.eai.security.seed.Seed;
|
||||||
import com.eactive.eai.common.seed.SeedCipher;
|
//kj bank import 2025-09-23 jwhong
|
||||||
|
//import com.eactive.eai.common.seed.SeedKJ;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
//import org.kjbank.simple.core.crypto.seed.SeedUtil;
|
import com.eactive.eai.common.context.ElinkTransactionContext;
|
||||||
|
|
||||||
public class SeedKJEncrypt extends PostfixMathCommand {
|
public class SeedKJEncrypt extends PostfixMathCommand {
|
||||||
public SeedKJEncrypt() {
|
public SeedKJEncrypt() {
|
||||||
numberOfParameters = 2;
|
numberOfParameters = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(Stack inStack) throws ParseException {
|
public void run(Stack inStack) throws ParseException {
|
||||||
checkStack(inStack);
|
checkStack(inStack);
|
||||||
|
|
||||||
// USER FUNCTION에서 Parameter 에서 가져옴
|
String seedKey = ElinkTransactionContext.getSeedKey();
|
||||||
Object param2 = inStack.pop();
|
String encryptKey = StringUtils.leftPad(seedKey, 16, '0');
|
||||||
String param2Str = String.valueOf(param2); // null 안전 처리
|
|
||||||
String encryptKey = StringUtils.leftPad(param2Str, 16, '0');
|
|
||||||
|
|
||||||
Object param = inStack.pop();
|
Object param = inStack.pop();
|
||||||
|
|
||||||
@@ -53,7 +51,7 @@ public class SeedKJEncrypt extends PostfixMathCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
String encryptedData = SeedKJ.encrypt(new String(value, StandardCharsets.UTF_8), encryptKey);
|
String encryptedData = Seed.encrypt(encryptKey, new String(value, StandardCharsets.UTF_8));
|
||||||
|
|
||||||
inStack.push(encryptedData);
|
inStack.push(encryptedData);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|||||||
@@ -0,0 +1,37 @@
|
|||||||
|
package com.eactive.eai.transformer.function.generic;
|
||||||
|
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nfunk.jep.ParseException;
|
||||||
|
import org.nfunk.jep.function.PostfixMathCommand;
|
||||||
|
|
||||||
|
public class Concat extends PostfixMathCommand {
|
||||||
|
public Concat() {
|
||||||
|
numberOfParameters = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(Stack inStack) throws ParseException {
|
||||||
|
|
||||||
|
checkStack(inStack);
|
||||||
|
|
||||||
|
Object p2 = inStack.pop();
|
||||||
|
|
||||||
|
if (p2 instanceof String) {
|
||||||
|
String str2 = (String) p2;
|
||||||
|
Object p1 = inStack.pop();
|
||||||
|
|
||||||
|
if (p1 instanceof String) {
|
||||||
|
String str1 = (String) p1;
|
||||||
|
|
||||||
|
inStack.push(str1 + str2);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new ParseException("Invalid parameter type, p1 is not string");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
throw new ParseException("Invalid parameter type, p2 is not string");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -32,6 +32,6 @@ public class LeftTrim extends PostfixMathCommand {
|
|||||||
inStack.add(" abd ");
|
inStack.add(" abd ");
|
||||||
t.run(inStack);
|
t.run(inStack);
|
||||||
String data = (String)inStack.pop();
|
String data = (String)inStack.pop();
|
||||||
System.out.println("["+data+"]");
|
// System.out.println("["+data+"]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,6 +32,6 @@ public class RightTrim extends PostfixMathCommand {
|
|||||||
inStack.add(" abd ");
|
inStack.add(" abd ");
|
||||||
t.run(inStack);
|
t.run(inStack);
|
||||||
String data = (String)inStack.pop();
|
String data = (String)inStack.pop();
|
||||||
System.out.println("["+data+"]");
|
// System.out.println("["+data+"]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,15 @@ import org.nfunk.jep.function.PostfixMathCommand;
|
|||||||
|
|
||||||
public class Trim extends PostfixMathCommand {
|
public class Trim extends PostfixMathCommand {
|
||||||
public Trim() {
|
public Trim() {
|
||||||
numberOfParameters = 1;
|
numberOfParameters = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(Stack inStack) throws ParseException {
|
public void run(Stack inStack) throws ParseException {
|
||||||
checkStack(inStack);
|
checkStack(inStack);
|
||||||
|
|
||||||
Object p1 = inStack.pop();
|
Object p1 = inStack.pop();
|
||||||
|
|
||||||
|
Object p2 = inStack.pop();
|
||||||
|
|
||||||
if (p1 instanceof byte[]) {
|
if (p1 instanceof byte[]) {
|
||||||
inStack.push(new String((byte[]) p1).trim());
|
inStack.push(new String((byte[]) p1).trim());
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.eactive.eai.transformer.function.validate;
|
||||||
|
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nfunk.jep.ParseException;
|
||||||
|
import org.nfunk.jep.function.PostfixMathCommand;
|
||||||
|
|
||||||
|
public class ifblank extends PostfixMathCommand {
|
||||||
|
|
||||||
|
public ifblank() {
|
||||||
|
numberOfParameters = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(Stack inStack) throws ParseException {
|
||||||
|
|
||||||
|
checkStack(inStack);
|
||||||
|
|
||||||
|
Object p1 = inStack.pop();
|
||||||
|
Object p2 = inStack.pop();
|
||||||
|
|
||||||
|
if ( p2 instanceof String ) {
|
||||||
|
String str1 = (String) p1;
|
||||||
|
|
||||||
|
if ( StringUtils.isBlank(str1) ){
|
||||||
|
inStack.push(p2);
|
||||||
|
}else {
|
||||||
|
inStack.push(p1);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new ParseException("Invalid parameter type, p2 is not string");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) throws ParseException {
|
||||||
|
Stack sk = new Stack<Object>();
|
||||||
|
|
||||||
|
sk.push("default");
|
||||||
|
sk.push("asdf");
|
||||||
|
|
||||||
|
new ifblank().run(sk);
|
||||||
|
|
||||||
|
// System.out.println(sk.pop());
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package com.eactive.eai.transformer.function.validate;
|
||||||
|
|
||||||
|
import java.util.Stack;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.nfunk.jep.ParseException;
|
||||||
|
import org.nfunk.jep.function.PostfixMathCommand;
|
||||||
|
|
||||||
|
public class isBlank extends PostfixMathCommand {
|
||||||
|
|
||||||
|
public isBlank() {
|
||||||
|
numberOfParameters = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void run(Stack inStack) throws ParseException {
|
||||||
|
|
||||||
|
checkStack(inStack);
|
||||||
|
|
||||||
|
Object p1 = inStack.pop();
|
||||||
|
|
||||||
|
if (p1 instanceof String) {
|
||||||
|
String str1 = (String) p1;
|
||||||
|
|
||||||
|
inStack.push(StringUtils.isBlank(str1));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
throw new ParseException("Invalid parameter type, p1 is not string");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -58,6 +58,16 @@ abstract public class Item implements Serializable, Cloneable {
|
|||||||
|
|
||||||
protected String multiLang = ""; // multi language 관련
|
protected String multiLang = ""; // multi language 관련
|
||||||
|
|
||||||
|
boolean mappingFlag = false;
|
||||||
|
|
||||||
|
public boolean isMappingFlag() {
|
||||||
|
return mappingFlag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void mapped() {
|
||||||
|
mappingFlag = true;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* reference item
|
* reference item
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -194,7 +194,8 @@ public abstract class Leaf extends Item {
|
|||||||
public Object clone() {
|
public Object clone() {
|
||||||
Item clone = (Item) super.clone();
|
Item clone = (Item) super.clone();
|
||||||
clone.initDefaultValue();
|
clone.initDefaultValue();
|
||||||
clone.setMappedValue(false);
|
clone.setMappedValue(false); //반복횟수 참조변수가 맵핑 되었는지
|
||||||
|
clone.mappingFlag = false; //SRC->TGT 전문으로 값이 맵핑된적이 있는지에 대한 플래그 위에 flag(mappedValue)랑 헷갈리면 안됨.
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -514,7 +514,7 @@ abstract public class Message extends Composite {
|
|||||||
public String toXMLString() {
|
public String toXMLString() {
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
|
|
||||||
sb.append("<?xml version=\"1.0\" encoding=\"euc-kr\"?>");
|
// sb.append("<?xml version=\"1.0\" encoding=\"euc-kr\"?>");
|
||||||
// if (layout != null) {
|
// if (layout != null) {
|
||||||
// sb.append(layout.toXMLString(Constants.TAB));
|
// sb.append(layout.toXMLString(Constants.TAB));
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -229,44 +229,44 @@ public class ByteUtil {
|
|||||||
//System.out.println("sub="+new String(data));
|
//System.out.println("sub="+new String(data));
|
||||||
}
|
}
|
||||||
stopWatch.stop();
|
stopWatch.stop();
|
||||||
System.out.println(" elapsed : " + stopWatch.toString());
|
// System.out.println(" elapsed : " + stopWatch.toString());
|
||||||
|
|
||||||
byte[] data = null;
|
byte[] data = null;
|
||||||
//merge
|
//merge
|
||||||
data = ByteUtil.merge("12345".getBytes(), "67890".getBytes());
|
data = ByteUtil.merge("12345".getBytes(), "67890".getBytes());
|
||||||
System.out.println("merge="+new String(data));
|
// System.out.println("merge="+new String(data));
|
||||||
|
|
||||||
//copy
|
//copy
|
||||||
data = ByteUtil.copy("12345".getBytes());
|
data = ByteUtil.copy("12345".getBytes());
|
||||||
System.out.println("copy="+new String(data));
|
// System.out.println("copy="+new String(data));
|
||||||
|
|
||||||
data = ByteUtil.paddingleft("12345".getBytes(), 10, (byte)0x30);
|
data = ByteUtil.paddingleft("12345".getBytes(), 10, (byte)0x30);
|
||||||
System.out.println("paddingleft="+new String(data));
|
// System.out.println("paddingleft="+new String(data));
|
||||||
data = ByteUtil.paddingleft("12345".getBytes(), 5, (byte)0x30);
|
data = ByteUtil.paddingleft("12345".getBytes(), 5, (byte)0x30);
|
||||||
System.out.println("paddingleft="+new String(data));
|
// System.out.println("paddingleft="+new String(data));
|
||||||
|
|
||||||
|
|
||||||
data = ByteUtil.paddingleft("12345".getBytes(), 10, (byte)0x30);
|
data = ByteUtil.paddingleft("12345".getBytes(), 10, (byte)0x30);
|
||||||
System.out.println("paddingleft="+new String(data));
|
// System.out.println("paddingleft="+new String(data));
|
||||||
data = ByteUtil.paddingleft("12345".getBytes(), 5, (byte)0x30);
|
data = ByteUtil.paddingleft("12345".getBytes(), 5, (byte)0x30);
|
||||||
System.out.println("paddingleft="+new String(data));
|
// System.out.println("paddingleft="+new String(data));
|
||||||
|
|
||||||
int length = 10;
|
int length = 10;
|
||||||
data = ByteUtil.padding("12345".getBytes(), length, (byte)0x30);
|
data = ByteUtil.padding("12345".getBytes(), length, (byte)0x30);
|
||||||
System.out.println("padding="+new String(data));
|
// System.out.println("padding="+new String(data));
|
||||||
data = ByteUtil.paddingright("12345".getBytes(), length, (byte)0x30);
|
data = ByteUtil.paddingright("12345".getBytes(), length, (byte)0x30);
|
||||||
System.out.println("paddingright="+new String(data));
|
// System.out.println("paddingright="+new String(data));
|
||||||
|
|
||||||
length = 5;
|
length = 5;
|
||||||
data = ByteUtil.padding("12345".getBytes(), length, (byte)0x30);
|
data = ByteUtil.padding("12345".getBytes(), length, (byte)0x30);
|
||||||
System.out.println("padding="+new String(data));
|
// System.out.println("padding="+new String(data));
|
||||||
data = ByteUtil.paddingright("12345".getBytes(), length, (byte)0x30);
|
data = ByteUtil.paddingright("12345".getBytes(), length, (byte)0x30);
|
||||||
System.out.println("paddingright="+new String(data));
|
// System.out.println("paddingright="+new String(data));
|
||||||
|
|
||||||
length = 4;
|
length = 4;
|
||||||
data = ByteUtil.padding("12345".getBytes(), length, (byte)0x30);
|
data = ByteUtil.padding("12345".getBytes(), length, (byte)0x30);
|
||||||
System.out.println("padding="+new String(data));
|
// System.out.println("padding="+new String(data));
|
||||||
data = ByteUtil.paddingright("12345".getBytes(), length, (byte)0x30);
|
data = ByteUtil.paddingright("12345".getBytes(), length, (byte)0x30);
|
||||||
System.out.println("paddingright="+new String(data));
|
// System.out.println("paddingright="+new String(data));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ public class ConcatFunction extends PostfixMathCommand {
|
|||||||
|
|
||||||
public ConcatFunction() {
|
public ConcatFunction() {
|
||||||
numberOfParameters = 2;
|
numberOfParameters = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void run(Stack inStack) throws ParseException {
|
public void run(Stack inStack) throws ParseException {
|
||||||
checkStack(inStack);
|
checkStack(inStack);
|
||||||
@@ -20,5 +20,6 @@ public class ConcatFunction extends PostfixMathCommand {
|
|||||||
String value = param1 + param2;
|
String value = param1 + param2;
|
||||||
|
|
||||||
inStack.push(value);
|
inStack.push(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,59 +1,243 @@
|
|||||||
package com.eactive.eai.transformer.transform;
|
package com.eactive.eai.transformer.transform;
|
||||||
|
|
||||||
|
import org.json.simple.JSONObject;
|
||||||
|
import org.json.simple.JSONValue;
|
||||||
import org.junit.Assert;
|
import org.junit.Assert;
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.TestInstance;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest;
|
||||||
import org.springframework.test.context.ContextConfiguration;
|
import org.springframework.test.context.ContextConfiguration;
|
||||||
import org.springframework.test.context.jdbc.Sql;
|
import org.springframework.test.context.jdbc.Sql;
|
||||||
|
|
||||||
import com.eactive.eai.common.lifecycle.LifecycleException;
|
import com.eactive.eai.common.lifecycle.LifecycleException;
|
||||||
|
import com.eactive.eai.transformer.engine.TransformEngine;
|
||||||
|
import com.eactive.eai.transformer.engine.Transformer;
|
||||||
import com.eactive.eai.transformer.function.jpa.TransformJPATestConfiguration;
|
import com.eactive.eai.transformer.function.jpa.TransformJPATestConfiguration;
|
||||||
import com.eactive.eai.transformer.layout.LayoutManager;
|
import com.eactive.eai.transformer.layout.LayoutManager;
|
||||||
import com.eactive.eai.transformer.layout.LayoutTypeManager;
|
import com.eactive.eai.transformer.layout.LayoutTypeManager;
|
||||||
|
import com.eactive.eai.transformer.message.JSONMessage;
|
||||||
|
import com.eactive.eai.transformer.message.Message;
|
||||||
|
import com.eactive.eai.transformer.message.MessageFactory;
|
||||||
|
|
||||||
@DataJpaTest
|
@DataJpaTest
|
||||||
@ContextConfiguration(classes = { TransformJPATestConfiguration.class })
|
@ContextConfiguration(classes = { TransformJPATestConfiguration.class })
|
||||||
@Sql({ "/com/eactive/eai/transformer/init_tseaitr06.sql", "/com/eactive/eai/transformer/init_tseaitr07.sql",
|
@Sql({ "/com/eactive/eai/transformer/init_tseaitr06.sql", "/com/eactive/eai/transformer/init_tseaitr07.sql",
|
||||||
"/com/eactive/eai/transformer/init_tseaitr08.sql", "/com/eactive/eai/transformer/init_tseaitr01.sql",
|
"/com/eactive/eai/transformer/init_tseaitr08.sql", "/com/eactive/eai/transformer/init_tseaitr01.sql",
|
||||||
"/com/eactive/eai/transformer/init_tseaitr02.sql", "/com/eactive/eai/transformer/init_tseaitr03.sql" })
|
"/com/eactive/eai/transformer/init_tseaitr02.sql", "/com/eactive/eai/transformer/init_tseaitr03.sql" })
|
||||||
|
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
|
||||||
class TransformManagerTest {
|
class TransformManagerTest {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
TransformManager transformManager;
|
TransformManager transformManager;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
LayoutManager layoutManager;
|
LayoutManager layoutManager;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
LayoutTypeManager layoutTypeManager;
|
LayoutTypeManager layoutTypeManager;
|
||||||
|
|
||||||
|
TransformEngine engine;
|
||||||
|
|
||||||
|
boolean initialized = false;
|
||||||
|
|
||||||
|
@BeforeEach
|
||||||
|
void initOnceAfterSql() throws LifecycleException {
|
||||||
|
if (!initialized) {
|
||||||
|
layoutTypeManager.start();
|
||||||
|
layoutManager.start();
|
||||||
|
transformManager.reload();
|
||||||
|
engine = TransformEngine.getInstance();
|
||||||
|
initialized = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testReload() throws LifecycleException {
|
void testCase01() throws LifecycleException {
|
||||||
// given
|
|
||||||
layoutTypeManager.start();
|
engine = TransformEngine.getInstance();
|
||||||
layoutManager.start();
|
|
||||||
// when
|
|
||||||
transformManager.reload();
|
|
||||||
|
|
||||||
// then
|
|
||||||
Assert.assertTrue(transformManager.getAllTransformName().length > 0);
|
Assert.assertTrue(transformManager.getAllTransformName().length > 0);
|
||||||
for (String transformName : transformManager.getAllTransformName()) {
|
|
||||||
System.out.println("====================================================================================");
|
String data ="{\r\n"
|
||||||
System.out.println(transformName);
|
+ " \"data\" : {\r\n"
|
||||||
Transform transform = transformManager.getTransform(transformName);
|
+ " \"cino\" : \"cino_src\",\r\n"
|
||||||
System.out.print("Source Layouts : ");
|
+ " \"code\" : \"code\",\r\n"
|
||||||
transform.getSourceLayouts().forEachRemaining(System.out::print);
|
+ " \"listCount\" : 1,\r\n"
|
||||||
System.out.println();
|
+ " \"list\" : [\r\n"
|
||||||
|
+ " { \"item1\" : \"1111\", \"item2\" : \"2222\" , \"item3\" : \"3333\"},\r\n"
|
||||||
|
+ " { \"item1\" : \"1111\", \"item2\" : \"2222\" , \"item3\" : \"3333\"},\r\n"
|
||||||
|
+ " { \"item1\" : \"1111\", \"item2\" : \"2222\" , \"item3\" : \"3333\"}\r\n"
|
||||||
|
+ " ]\r\n"
|
||||||
|
+ " }\r\n"
|
||||||
|
+ " \r\n"
|
||||||
|
+ "}\r\n"
|
||||||
|
+ "";
|
||||||
|
|
||||||
System.out.println("Target Layout : " + transform.getTargetLayout());
|
|
||||||
|
Message source = MessageFactory.getFactory().getMessage("TST_TOSSTEST1_SRC");
|
||||||
|
|
||||||
|
String rootItemName = ((JSONMessage) source).getLayout().getRootItem().getName();
|
||||||
|
|
||||||
transform.getTransformItemList().forEach(System.out::println);
|
JSONObject value = (JSONObject) JSONValue.parse(data);
|
||||||
System.out.println("====================================================================================");
|
JSONObject root = new JSONObject();
|
||||||
|
root.put(rootItemName, value);
|
||||||
|
source.setData(root.toJSONString());
|
||||||
|
System.out.println(source.getData());
|
||||||
|
|
||||||
|
Transformer transformer = engine.getTransformer();
|
||||||
|
Message target = transformer.transform("TRANSFORM_TST_TEST1_REQ", new Message[] { source });
|
||||||
|
|
||||||
|
System.out.println(target.toString());
|
||||||
|
String testResult = new String((byte[])target.getData());
|
||||||
|
|
||||||
|
String expectedResult = "cino_code 000031111 2222 3333 1111 2222 3333 1111 2222 3333 ";
|
||||||
|
|
||||||
|
Assert.assertArrayEquals(expectedResult.getBytes(), testResult.getBytes());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testCase02() throws LifecycleException {
|
||||||
|
|
||||||
// then
|
engine = TransformEngine.getInstance();
|
||||||
Assert.assertTrue(transformManager.getTransform(transformName).getTransformItemList().size() > 0);
|
|
||||||
}
|
Assert.assertTrue(transformManager.getAllTransformName().length > 0);
|
||||||
|
|
||||||
|
String data = "{ \"cino\" : \"cino\",\r\n"
|
||||||
|
+ " \"list\" : [\r\n"
|
||||||
|
+ " { \"str\" : \"11111\", \"num\" : 11111 },\r\n"
|
||||||
|
+ " { \"str\" : \"22222\", \"num\" : 22222 },\r\n"
|
||||||
|
+ " { \"str\" : \"33333\", \"num\" : 33333 }\r\n"
|
||||||
|
+ " ],\r\n"
|
||||||
|
+ " \"data\" : 1234\r\n"
|
||||||
|
+ "}\r\n"
|
||||||
|
+ "";
|
||||||
|
|
||||||
|
Message source = MessageFactory.getFactory().getMessage("TST_TOSSTEST2_SRC");
|
||||||
|
|
||||||
|
String rootItemName = ((JSONMessage) source).getLayout().getRootItem().getName();
|
||||||
|
|
||||||
|
JSONObject value = (JSONObject) JSONValue.parse(data);
|
||||||
|
JSONObject root = new JSONObject();
|
||||||
|
root.put(rootItemName, value);
|
||||||
|
source.setData(root.toJSONString());
|
||||||
|
System.out.println(source.getData());
|
||||||
|
|
||||||
|
Transformer transformer = engine.getTransformer();
|
||||||
|
Message target = transformer.transform("TRANSFORM_TST_TEST2_REQ", new Message[] { source });
|
||||||
|
|
||||||
|
System.out.println(target.toString());
|
||||||
|
String testResult = (String) target.getData();
|
||||||
|
String expectedResult = "{\"data\":1234,\"list\":{\"str\":\"11111\",\"num\":\"11111\"},\"cino\":\"cino\"}";
|
||||||
|
|
||||||
|
Assert.assertArrayEquals(expectedResult.getBytes(), testResult.getBytes());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testCase03() throws LifecycleException {
|
||||||
|
|
||||||
|
engine = TransformEngine.getInstance();
|
||||||
|
|
||||||
|
Assert.assertTrue(transformManager.getAllTransformName().length > 0);
|
||||||
|
|
||||||
|
String data = "{ \"cino\" : \"cino\",\r\n"
|
||||||
|
+ " \"list\" : [\r\n"
|
||||||
|
+ " { \"str\" : \"11111\", \"num\" : 11111 },\r\n"
|
||||||
|
+ " { \"str\" : \"22222\", \"num\" : 22222 },\r\n"
|
||||||
|
+ " { \"str\" : \"33333\", \"num\" : 33333 }\r\n"
|
||||||
|
+ " ],\r\n"
|
||||||
|
+ " \"data\" : 1234\r\n"
|
||||||
|
+ "}\r\n"
|
||||||
|
+ "";
|
||||||
|
|
||||||
|
Message source = MessageFactory.getFactory().getMessage("TST_TOSSTEST3_SRC");
|
||||||
|
|
||||||
|
String rootItemName = ((JSONMessage) source).getLayout().getRootItem().getName();
|
||||||
|
|
||||||
|
JSONObject value = (JSONObject) JSONValue.parse(data);
|
||||||
|
JSONObject root = new JSONObject();
|
||||||
|
root.put(rootItemName, value);
|
||||||
|
source.setData(root.toJSONString());
|
||||||
|
System.out.println(source.getData());
|
||||||
|
|
||||||
|
Transformer transformer = engine.getTransformer();
|
||||||
|
Message target = transformer.transform("TRANSFORM_TST_TEST3_REQ", new Message[] { source });
|
||||||
|
|
||||||
|
System.out.println(target.toString());
|
||||||
|
String testResult = new String((byte[])target.getData());
|
||||||
|
String expectedResult = "012341111111111cino ";
|
||||||
|
|
||||||
|
Assert.assertArrayEquals(expectedResult.getBytes(), testResult.getBytes());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testCase04() throws LifecycleException {
|
||||||
|
|
||||||
|
engine = TransformEngine.getInstance();
|
||||||
|
|
||||||
|
Assert.assertTrue(transformManager.getAllTransformName().length > 0);
|
||||||
|
|
||||||
|
String data = "{ \"cino\" : \"cino\",\r\n"
|
||||||
|
+ " \"list\" : \r\n"
|
||||||
|
+ " { \"str\" : \"11111\", \"num\" : 11111 },\r\n"
|
||||||
|
+ " \"data\" : 1234\r\n"
|
||||||
|
+ "}\r\n"
|
||||||
|
+ "";
|
||||||
|
|
||||||
|
Message source = MessageFactory.getFactory().getMessage("TST_TOSSTEST4_SRC");
|
||||||
|
|
||||||
|
String rootItemName = ((JSONMessage) source).getLayout().getRootItem().getName();
|
||||||
|
|
||||||
|
JSONObject value = (JSONObject) JSONValue.parse(data);
|
||||||
|
JSONObject root = new JSONObject();
|
||||||
|
root.put(rootItemName, value);
|
||||||
|
source.setData(root.toJSONString());
|
||||||
|
System.out.println(source.getData());
|
||||||
|
|
||||||
|
Transformer transformer = engine.getTransformer();
|
||||||
|
Message target = transformer.transform("TRANSFORM_TST_TEST4_REQ", new Message[] { source });
|
||||||
|
|
||||||
|
System.out.println(target.toString());
|
||||||
|
String testResult = (String) target.getData();
|
||||||
|
String expectedResult = "{\"data\":1234,\"list\":{\"str\":\"11111\",\"num\":\"11111\"},\"cino\":\"cino\"}";
|
||||||
|
Assert.assertArrayEquals(expectedResult.getBytes(), testResult.getBytes());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void testCase05() throws LifecycleException {
|
||||||
|
|
||||||
|
engine = TransformEngine.getInstance();
|
||||||
|
|
||||||
|
Assert.assertTrue(transformManager.getAllTransformName().length > 0);
|
||||||
|
|
||||||
|
String data = "{ \"cino\" : \"cino\",\r\n"
|
||||||
|
+ " \"list\" : \r\n"
|
||||||
|
+ " { \"str\" : \"11111\", \"num\" : 11111 },\r\n"
|
||||||
|
+ " \"data\" : 1234\r\n"
|
||||||
|
+ "}\r\n"
|
||||||
|
+ "";
|
||||||
|
|
||||||
|
Message source = MessageFactory.getFactory().getMessage("TST_TOSSTEST5_SRC");
|
||||||
|
|
||||||
|
String rootItemName = ((JSONMessage) source).getLayout().getRootItem().getName();
|
||||||
|
|
||||||
|
JSONObject value = (JSONObject) JSONValue.parse(data);
|
||||||
|
JSONObject root = new JSONObject();
|
||||||
|
root.put(rootItemName, value);
|
||||||
|
source.setData(root.toJSONString());
|
||||||
|
System.out.println(source.getData());
|
||||||
|
|
||||||
|
Transformer transformer = engine.getTransformer();
|
||||||
|
Message target = transformer.transform("TRANSFORM_TST_TEST5_REQ", new Message[] { source });
|
||||||
|
|
||||||
|
System.out.println(target.toString());
|
||||||
|
String testResult = new String((byte[])target.getData());
|
||||||
|
String expectedResult = "012341111111111cino ";
|
||||||
|
|
||||||
|
Assert.assertArrayEquals(expectedResult.getBytes(), testResult.getBytes());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
INSERT INTO tseaitr01 (cnvsnname,cnvsndesc,lastamndhms,eaisevrdstcd,modfimgtstusdstcd,useyn,verinfo,author) VALUES
|
INSERT INTO tseaitr01 (cnvsnname,cnvsndesc,lastamndhms,eaisevrdstcd,modfimgtstusdstcd,useyn,verinfo,author) VALUES
|
||||||
('TRANSFORM_TST_ETSTTST00000002S1_REQ','BASIC_TEST_001','20220810165406 ','E',' ','1','00000',NULL),
|
('TRANSFORM_TST_TEST1_REQ', 'grid-to-grid', '20241226104652 ','E',' ','1','0',NULL),
|
||||||
('TRANSFORM_TST_ETSTTST00000002S1_RES','BASIC_TEST_001','20220810165406 ','E',' ','1','00000',NULL),
|
('TRANSFORM_TST_TEST2_REQ', 'grid-to-group', '20241226104652 ','E',' ','1','0',NULL),
|
||||||
('TRANSFORM_TST_BASICTEST002_RES','BASIC_TEST_002','20230522163339 ','E',' ','1','0',NULL),
|
('TRANSFORM_TST_TEST3_REQ', 'grid-to-group(byte)', '20241226104652 ','E',' ','1','0',NULL),
|
||||||
('TRANSFORM_TST_BASICTEST002_REQ','BASIC_TEST_002','20230522163528 ','E',' ','1','0',NULL);
|
('TRANSFORM_TST_TEST4_REQ', 'group-to-group 기본값 테스트', '20241226104652 ','E',' ','1','0',NULL),
|
||||||
|
('TRANSFORM_TST_TEST5_REQ', 'group-to-group(byte) 기본값 테스트', '20241226104652 ','E',' ','1','0',NULL)
|
||||||
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
INSERT INTO tseaitr02 (cnvsnname,loutname,sourcrsultdstcd) VALUES
|
INSERT INTO tseaitr02 (cnvsnname,loutname,sourcrsultdstcd) VALUES
|
||||||
('TRANSFORM_TST_ETSTTST00000002S1_REQ','TST_STST00000002_REQ','SRC_LAYOUT'),
|
('TRANSFORM_TST_TEST1_REQ', 'TST_TOSSTEST1_TGT', 'TGT_LAYOUT'),
|
||||||
('TRANSFORM_TST_ETSTTST00000002S1_REQ','TST_TTST00000002_REQ','TGT_LAYOUT'),
|
('TRANSFORM_TST_TEST1_REQ', 'TST_TOSSTEST1_SRC', 'SRC_LAYOUT'),
|
||||||
('TRANSFORM_TST_ETSTTST00000002S1_RES','TST_STST00000002_RES','TGT_LAYOUT'),
|
('TRANSFORM_TST_TEST2_REQ', 'TST_TOSSTEST2_TGT', 'TGT_LAYOUT'),
|
||||||
('TRANSFORM_TST_ETSTTST00000002S1_RES','TST_TTST00000002_RES','SRC_LAYOUT'),
|
('TRANSFORM_TST_TEST2_REQ', 'TST_TOSSTEST2_SRC', 'SRC_LAYOUT'),
|
||||||
('TRANSFORM_TST_BASICTEST002_RES','TST_TTST10000003_RES','SRC_LAYOUT'),
|
('TRANSFORM_TST_TEST3_REQ', 'TST_TOSSTEST3_TGT', 'TGT_LAYOUT'),
|
||||||
('TRANSFORM_TST_BASICTEST002_RES','TST_STST10000003_RES','TGT_LAYOUT'),
|
('TRANSFORM_TST_TEST3_REQ', 'TST_TOSSTEST3_SRC', 'SRC_LAYOUT'),
|
||||||
('TRANSFORM_TST_BASICTEST002_REQ','TST_STST10000003_REQ','SRC_LAYOUT'),
|
('TRANSFORM_TST_TEST4_REQ', 'TST_TOSSTEST4_TGT', 'TGT_LAYOUT'),
|
||||||
('TRANSFORM_TST_BASICTEST002_REQ','TST_TTST10000003_REQ','TGT_LAYOUT');
|
('TRANSFORM_TST_TEST4_REQ', 'TST_TOSSTEST4_SRC', 'SRC_LAYOUT'),
|
||||||
|
('TRANSFORM_TST_TEST5_REQ', 'TST_TOSSTEST5_TGT', 'TGT_LAYOUT'),
|
||||||
|
('TRANSFORM_TST_TEST5_REQ', 'TST_TOSSTEST5_SRC', 'SRC_LAYOUT')
|
||||||
|
;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,12 @@
|
|||||||
INSERT INTO tseaitr07 (loutname,loutptrnname,loutdesc,lastamndhms,eaibzwkdstcd,uapplname,sysintfacname,eaisevrdstcd,modfimgtstusdstcd,useyn,verinfo,author) VALUES
|
INSERT INTO tseaitr07 (loutname,loutptrnname,loutdesc,lastamndhms,eaibzwkdstcd,uapplname,sysintfacname,eaisevrdstcd,modfimgtstusdstcd,useyn,verinfo,author) VALUES
|
||||||
('STD_HNCPHEADER_REQ','BYTES','하나캐피탈_HEADER','2022081016492819','IIA',' ',' ','E',' ','1','00001','SI210210'),
|
('TST_TOSSTEST1_SRC', 'JSON', 'bigInteger 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
('TST_STST00000002_REQ','BYTES','BASIC_TEST_001','2022081016540565','TST',' ',' ','E',' ','1','00002','admin'),
|
('TST_TOSSTEST1_TGT', 'BYTES', 'bigInteger 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
('TST_STST00000002_RES','BYTES','BASIC_TEST_001','2022081016540567','TST',' ',' ','E',' ','1','00002','admin'),
|
('TST_TOSSTEST2_SRC', 'JSON', '토스 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
('TST_TTST00000002_REQ','JSON','BASIC_TEST_001','2022081016540569','TST',' ',' ','E',' ','1','00002','admin'),
|
('TST_TOSSTEST2_TGT', 'JSON', '토스 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
('TST_TTST00000002_RES','JSON','BASIC_TEST_001','2022081016540570','TST',' ',' ','E',' ','1','00002','admin'),
|
('TST_TOSSTEST3_SRC', 'JSON', '토스 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
('TST_STST10000003_RES','BYTES','BASIC_TEST_001','2023051815523876','TST',' ',' ','E',' ','1','00002','admin'),
|
('TST_TOSSTEST3_TGT', 'BYTES', '토스 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
('TST_TTST10000003_REQ','JSON','BASIC_TEST_001','2023051815524814','TST',' ',' ','E',' ','1','00002','admin'),
|
('TST_TOSSTEST4_SRC', 'JSON', '기본값 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
('TST_TTST10000003_RES','JSON','BASIC_TEST_001','2023051815525581','TST',' ',' ','E',' ','1','00002','admin'),
|
('TST_TOSSTEST4_TGT', 'JSON', '기본값 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
('TST_STST10000003_REQ','BYTES','BASIC_TEST_001','2023052210512676','TST',' ',' ','E',' ','1','00002','admin');
|
('TST_TOSSTEST5_SRC', 'JSON', '기본값 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin'),
|
||||||
|
('TST_TOSSTEST5_TGT', 'BYTES', '기본값 테스트', '2026011010051131', 'TST', ' ', ' ', 'E', ' ', '1', '00002', 'admin')
|
||||||
|
;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user