From 621fb6e82eefb4880ddac161e72d7076b0644d78 Mon Sep 17 00:00:00 2001 From: sa_8001 Date: Fri, 5 Apr 2024 11:57:34 +0900 Subject: [PATCH] =?UTF-8?q?app1,=20app2=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tomcat/webapps/{ => bussiness1}/chl_mci.jsp | 0 tomcat/webapps/{ => bussiness1}/core.jsp | 0 .../webapps/{ => bussiness1}/core.properties | 0 .../{ => bussiness1}/core_tmax_fep.jsp | 0 tomcat/webapps/{ => bussiness1}/index.jsp | 0 tomcat/webapps/{ => bussiness1}/mci_core.jsp | 0 tomcat/webapps/bussiness2/chl_mci.jsp | 45 +++++ tomcat/webapps/bussiness2/core.jsp | 139 ++++++++++++++ tomcat/webapps/bussiness2/core.properties | 4 + tomcat/webapps/bussiness2/core_tmax_fep.jsp | 171 ++++++++++++++++++ tomcat/webapps/bussiness2/index.jsp | 1 + tomcat/webapps/bussiness2/mci_core.jsp | 40 ++++ 12 files changed, 400 insertions(+) rename tomcat/webapps/{ => bussiness1}/chl_mci.jsp (100%) rename tomcat/webapps/{ => bussiness1}/core.jsp (100%) rename tomcat/webapps/{ => bussiness1}/core.properties (100%) rename tomcat/webapps/{ => bussiness1}/core_tmax_fep.jsp (100%) rename tomcat/webapps/{ => bussiness1}/index.jsp (100%) rename tomcat/webapps/{ => bussiness1}/mci_core.jsp (100%) create mode 100755 tomcat/webapps/bussiness2/chl_mci.jsp create mode 100755 tomcat/webapps/bussiness2/core.jsp create mode 100755 tomcat/webapps/bussiness2/core.properties create mode 100755 tomcat/webapps/bussiness2/core_tmax_fep.jsp create mode 100755 tomcat/webapps/bussiness2/index.jsp create mode 100755 tomcat/webapps/bussiness2/mci_core.jsp diff --git a/tomcat/webapps/chl_mci.jsp b/tomcat/webapps/bussiness1/chl_mci.jsp similarity index 100% rename from tomcat/webapps/chl_mci.jsp rename to tomcat/webapps/bussiness1/chl_mci.jsp diff --git a/tomcat/webapps/core.jsp b/tomcat/webapps/bussiness1/core.jsp similarity index 100% rename from tomcat/webapps/core.jsp rename to tomcat/webapps/bussiness1/core.jsp diff --git a/tomcat/webapps/core.properties b/tomcat/webapps/bussiness1/core.properties similarity index 100% rename from tomcat/webapps/core.properties rename to tomcat/webapps/bussiness1/core.properties diff --git a/tomcat/webapps/core_tmax_fep.jsp b/tomcat/webapps/bussiness1/core_tmax_fep.jsp similarity index 100% rename from tomcat/webapps/core_tmax_fep.jsp rename to tomcat/webapps/bussiness1/core_tmax_fep.jsp diff --git a/tomcat/webapps/index.jsp b/tomcat/webapps/bussiness1/index.jsp similarity index 100% rename from tomcat/webapps/index.jsp rename to tomcat/webapps/bussiness1/index.jsp diff --git a/tomcat/webapps/mci_core.jsp b/tomcat/webapps/bussiness1/mci_core.jsp similarity index 100% rename from tomcat/webapps/mci_core.jsp rename to tomcat/webapps/bussiness1/mci_core.jsp diff --git a/tomcat/webapps/bussiness2/chl_mci.jsp b/tomcat/webapps/bussiness2/chl_mci.jsp new file mode 100755 index 0000000..bf65123 --- /dev/null +++ b/tomcat/webapps/bussiness2/chl_mci.jsp @@ -0,0 +1,45 @@ +<%@ page contentType="text/html;charset=euc-kr" %> +<%@ page import = "java.rmi.*, + javax.naming.*, + java.sql.*, + javax.sql.*, + java.io.*, + java.net.*, + java.util.*, + exem.chl.generatecode" + +%> +<% + + generatecode gencode = new generatecode(); + gencode.make_junmun_code(); + + URL url = null; + URLConnection urlConnection = null; + String sUrl = System.getProperty("service.call.url"); + //String sUrl = "http://10.10.52.10:8880/mci/mci_core.jsp"; //MCI call + String sUrl_call_sucess_flag = sUrl + " URL Call succeeded"; + + Thread.sleep(1); + + + try { + + url = new URL(sUrl); + + urlConnection = url.openConnection(); + InputStream is = urlConnection.getInputStream(); + + } catch(Exception e) { + e.printStackTrace(); + sUrl_call_sucess_flag = sUrl + " URL Call failed"; + } +%> + + + + +

URL Call
[<%=sUrl_call_sucess_flag%>]

+

service.call.url
[<%=System.getProperty("service.call.url")%>]

+ + diff --git a/tomcat/webapps/bussiness2/core.jsp b/tomcat/webapps/bussiness2/core.jsp new file mode 100755 index 0000000..5e3ab07 --- /dev/null +++ b/tomcat/webapps/bussiness2/core.jsp @@ -0,0 +1,139 @@ +<%@ page contentType="text/html;charset=euc-kr" %> +<%@ page import = "java.rmi.*, + javax.naming.*, + java.sql.*, + javax.sql.*, + java.io.*, + java.net.*, + java.util.*, + tmax.webt.*" +%> +<% + + //TMAX + WebtConnection connection = null; + WebtBuffer tp_request = null; + WebtBuffer tp_response = null; + + //FEP + URL url = null; + URLConnection urlConnection = null; + String sUrl = "http://10.10.52.10:8880/IMXtest/fep_receiver.jsp"; //FEP call + String sUrl_call_sucess_flag = sUrl + " URL Call succeeded"; + + //Properties pro = new Properties(); + //pro.load(new FileInputStream("C:/smtest/jsp/core.properties")); + //String system_test_target=pro.getProperty("system.test.target"); + String system_test_target="FEP"; + + int random_sleep_milisec = (int) (Math.random() * 13) + 12; + String flag = Integer.toString(random_sleep_milisec).substring(0,1); + //System.out.println("random_sleep_milisec: " + random_sleep_milisec); + //System.out.println("flag: " + flag); + + if(flag.compareTo("1") == 0){ + system_test_target = "FEP"; + }else{ + system_test_target = "TMAX"; + } + + //FEP Call + if(system_test_target.compareTo("FEP")==0){ + + try { + + url = new URL(sUrl); + + urlConnection = url.openConnection(); + InputStream is = urlConnection.getInputStream(); + + /* + byte[] buf = new byte[1024]; + int len = -1; + + try { + while((len = is.read(buf, 0, buf.length)) != -1) { + System.out.write(buf, 0, len); + } + } catch(IOException e) { + e.printStackTrace(); + + } + */ + + } catch(Exception e) { + e.printStackTrace(); + sUrl_call_sucess_flag = sUrl + " URL Call failed"; + } + } + else{ //TMAX Call + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Tmax·Î º¸³¾ Àü¹®¸¦ »ý¼ºÇÑ´Ù. + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + Random random = new Random(); + String lStr_randum_value=Integer.toString(Math.abs(random.nextInt())); + int int_Value_length= lStr_randum_value.length(); + + if(int_Value_length > 10){ + lStr_randum_value = lStr_randum_value.substring(0, 10); + } + else{ + for(int i=0; i<10-int_Value_length; i++){ + lStr_randum_value=lStr_randum_value+"0"; + } + } + + String guid=lStr_randum_value +"_" + System.currentTimeMillis(); + String txcode="tp_txcode001"; + + String sndstr = "[Core -> tmax]tmax call......."+ guid +"................" + txcode ; + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + //[Core -> tmax]tmax call.......5974573420_1706087409995................tp_txcode + ////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + try{ + + connection = new WebtConnection("10.10.52.10", 8888); + WebtRemoteService service = new WebtRemoteService("TOUPPER", connection); + tp_request = service.createStringBuffer(); + tp_request.setString(sndstr); + tp_response = service.tpcall(tp_request); + System.out.println("tmax request : " + tp_request.getString()); + System.out.println("tmax response : " + tp_response.getString()); + + }catch (WebtIOException ioe){ + System.out.print("webt connection closed"); + ioe.printStackTrace(); + }catch (WebtServiceFailException sfe){ + System.out.print("tmax server ruturns TP_FAIL"); + sfe.printStackTrace(); + }catch (WebtServiceException se){ + System.out.print("tmax service fail. tperrno = " + se.getTPErrorMessage()); + se.printStackTrace(); + }finally{ + connection.close(); + } + } + +%> + + + + + +<% +if(system_test_target.compareTo("FEP")==0){ +%> +

URL Call
[<%=sUrl_call_sucess_flag%>]

+<% +}else{ +%> +

TMAX WebT Call Request
[<%=tp_request.getString()%>]

+

TMAX WebT Call Response
[<%=tp_response.getString()%>]

+<% +} +%> + + + diff --git a/tomcat/webapps/bussiness2/core.properties b/tomcat/webapps/bussiness2/core.properties new file mode 100755 index 0000000..2e9492f --- /dev/null +++ b/tomcat/webapps/bussiness2/core.properties @@ -0,0 +1,4 @@ + +# System Target FEP or TMAX +system.test.target=FEP +#system.test.target=TMAX diff --git a/tomcat/webapps/bussiness2/core_tmax_fep.jsp b/tomcat/webapps/bussiness2/core_tmax_fep.jsp new file mode 100755 index 0000000..dce2339 --- /dev/null +++ b/tomcat/webapps/bussiness2/core_tmax_fep.jsp @@ -0,0 +1,171 @@ +<%@ page contentType="text/html;charset=euc-kr" %> +<%@ page import = "java.rmi.*, + javax.naming.*, + java.sql.*, + javax.sql.*, + java.io.*, + java.net.*, + java.util.*, + tmax.webt.*, + exem.core.bizerror" +%> +<% + + //TMAX + WebtConnection connection = null; + WebtBuffer tp_request = null; + WebtBuffer tp_response = null; + + //FEP + URL url = null; + URLConnection urlConnection = null; + String sUrl = System.getProperty("service.call.url"); + //String sUrl = "http://10.10.52.10:8880/fep/fep_receiver.jsp"; //FEP call + String sUrl_call_sucess_flag = sUrl + " URL Call succeeded"; + + //Properties pro = new Properties(); + //pro.load(new FileInputStream("C:/smtest/jsp/core.properties")); + //String system_test_target=pro.getProperty("system.test.target"); + String system_test_target="FEP"; + + int random_sleep_milisec = (int) (Math.random() * 13) + 12; + String flag = Integer.toString(random_sleep_milisec).substring(0,1); + //System.out.println("random_sleep_milisec: " + random_sleep_milisec); + //System.out.println("flag: " + flag); + // + Context ctx=null; + DataSource ds = null; + Connection con = null; + Statement stmt = null; + ResultSet rs = null; + + try{ + Thread.sleep(1); + + ctx=new InitialContext(); + ds = (DataSource) ctx.lookup("custDS"); + con = ds.getConnection(); + stmt = con.createStatement(); + stmt.setFetchSize(50); // fetch size + rs = stmt.executeQuery("select * from( select * from emp order by DBMS_RANDOM.RANDOM ) where rownum < 10"); + + rs.close(); + stmt.close(); + con.close(); + }catch(SQLException se){ + se.printStackTrace(); + rs.close(); + stmt.close(); + con.close(); + } + + if(flag.compareTo("1") == 0){ + system_test_target = "FEP"; + }else{ + system_test_target = "TMAX"; + } + + //FEP Call + if(system_test_target.compareTo("FEP")==0){ + + try { + + url = new URL(sUrl); + + urlConnection = url.openConnection(); + InputStream is = urlConnection.getInputStream(); + + /* + byte[] buf = new byte[1024]; + int len = -1; + + try { + while((len = is.read(buf, 0, buf.length)) != -1) { + System.out.write(buf, 0, len); + } + } catch(IOException e) { + e.printStackTrace(); + + } + */ + + bizerror be = new bizerror(); + be.make_bizerror(); + + } catch(Exception e) { + e.printStackTrace(); + sUrl_call_sucess_flag = sUrl + " URL Call failed"; + } + } + else{ //TMAX Call + + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Tmax�� ���� ������ �����Ѵ�. + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + Random random = new Random(); + String lStr_randum_value=Integer.toString(Math.abs(random.nextInt())); + int int_Value_length= lStr_randum_value.length(); + + if(int_Value_length > 10){ + lStr_randum_value = lStr_randum_value.substring(0, 10); + } + else{ + for(int i=0; i<10-int_Value_length; i++){ + lStr_randum_value=lStr_randum_value+"0"; + } + } + + String guid=lStr_randum_value +"_" + System.currentTimeMillis(); + String txcode="tp_txcode001"; + + String sndstr = "[Core -> tmax]tmax call......."+ guid +"................" + txcode ; + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// + //[Core -> tmax]tmax call.......5974573420_1706087409995................tp_txcode + ////////////////////////////////////////////////////////////////////////////////////////////////////////////// + + try{ + + connection = new WebtConnection("10.10.52.10", 8888); + WebtRemoteService service = new WebtRemoteService("TOUPPER", connection); + tp_request = service.createStringBuffer(); + tp_request.setString(sndstr); + tp_response = service.tpcall(tp_request); + System.out.println("tmax request : " + tp_request.getString()); + System.out.println("tmax response : " + tp_response.getString()); + + }catch (WebtIOException ioe){ + System.out.print("webt connection closed"); + ioe.printStackTrace(); + }catch (WebtServiceFailException sfe){ + System.out.print("tmax server ruturns TP_FAIL"); + sfe.printStackTrace(); + }catch (WebtServiceException se){ + System.out.print("tmax service fail. tperrno = " + se.getTPErrorMessage()); + se.printStackTrace(); + }finally{ + connection.close(); + } + } + +%> + + + + + +<% +if(system_test_target.compareTo("FEP")==0){ +%> +

URL Call
[<%=sUrl_call_sucess_flag%>]

+

service.call.url
[<%=System.getProperty("service.call.url")%>]

+<% +}else{ +%> +

TMAX WebT Call Request
[<%=tp_request.getString()%>]

+

TMAX WebT Call Response
[<%=tp_response.getString()%>]

+<% +} +%> + + + diff --git a/tomcat/webapps/bussiness2/index.jsp b/tomcat/webapps/bussiness2/index.jsp new file mode 100755 index 0000000..fde2089 --- /dev/null +++ b/tomcat/webapps/bussiness2/index.jsp @@ -0,0 +1 @@ +welcome tomcat index.jsp diff --git a/tomcat/webapps/bussiness2/mci_core.jsp b/tomcat/webapps/bussiness2/mci_core.jsp new file mode 100755 index 0000000..117c536 --- /dev/null +++ b/tomcat/webapps/bussiness2/mci_core.jsp @@ -0,0 +1,40 @@ +<%@ page contentType="text/html;charset=euc-kr" %> +<%@ page import = "java.rmi.*, + javax.naming.*, + java.sql.*, + javax.sql.*, + java.io.*, + java.net.*, + java.util.*" +%> +<% + + URL url = null; + URLConnection urlConnection = null; + String sUrl = System.getProperty("service.call.url"); + //String sUrl = "http://10.10.52.10:8880/cor/core_tmax_fep.jsp"; //CORE call + String sUrl_call_sucess_flag = sUrl + " URL Call succeeded"; + + Thread.sleep(1); + + + try { + + url = new URL(sUrl); + + urlConnection = url.openConnection(); + InputStream is = urlConnection.getInputStream(); + + } catch(Exception e) { + e.printStackTrace(); + sUrl_call_sucess_flag = sUrl + " URL Call failed"; + } +%> + + + + +

URL Call
[<%=sUrl_call_sucess_flag%>]

+

service.call.url
[<%=System.getProperty("service.call.url")%>]

+ +