Skip to content

Commit

Permalink
更新linux部署配置,去掉访问路径
Browse files Browse the repository at this point in the history
  • Loading branch information
learningperl committed Mar 25, 2016
1 parent 79bd476 commit 74a83b1
Show file tree
Hide file tree
Showing 16 changed files with 69 additions and 52 deletions.
10 changes: 5 additions & 5 deletions WebContent/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<link href="http://fonts.useso.com/css?family=Oswald|Droid+Sans:400,700"
rel="stylesheet">
<!-- The Main CSS File -->
<link rel="stylesheet" href="/WebTester/static/CSS/style.css">
<script src="/WebTester/static/Javascript/jQuery/jquery.min.js"></script>
<link rel="stylesheet" href="/static/CSS/style.css">
<script src="/static/Javascript/jQuery/jquery.min.js"></script>

</head>

Expand Down Expand Up @@ -149,7 +149,7 @@
<div class="wrapper">
<div class="logo">
<a href="index.jsp" Title="autoTest框架"> <img
src="/WebTester/static/Images/Testlogo.png"
src="/static/Images/Testlogo.png"
alt="Testlogo">
</a>
</div>
Expand Down Expand Up @@ -235,15 +235,15 @@
<div class="widget_header">
<h4 class="widget_header_title wwIcon i_16_charts">Options:&nbsp&nbsp</h4>
<img title="添加用例场景"
src="/WebTester/static/Images/Icons/16/add.png"
src="/static/Images/Icons/16/add.png"
style="position: relative; top: 2px; left: 20px; cursor: pointer;"
onclick='pops("pop1");GetKey("idadd",this.name);' /> <input
id="searchText" type="text" value="Search"
class="c_input_Search"
onkeydown='if(event.keyCode==13){AllKeyWords()}'
onfocus='if(this.value=="Search"){this.value=""}'
onblur='if(this.value==""){this.value="Search"}' /> <img
title="搜索 " src="/WebTester/static/Images/Icons/16/Search.png"
title="搜索 " src="/static/Images/Icons/16/Search.png"
style="position: relative; top: 11px; left: 125px; cursor: pointer; float: right;"
onclick='AllKeyWords()' />
</div>
Expand Down
14 changes: 7 additions & 7 deletions WebContent/static/Interface.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<link href="http://fonts.useso.com/css?family=Oswald|Droid+Sans:400,700"
rel="stylesheet">
<!-- The Main CSS File -->
<link rel="stylesheet" href="/WebTester/static/CSS/style.css">
<script src="/WebTester/static/Javascript/jQuery/jquery.min.js"></script>
<link rel="stylesheet" href="/static/CSS/style.css">
<script src="/static/Javascript/jQuery/jquery.min.js"></script>

</head>

Expand Down Expand Up @@ -368,7 +368,7 @@
<div class="wrapper">
<div class="logo">
<a href="index.jsp" Title="autoTest框架"> <img
src="/WebTester/static/Images/Testlogo.png" alt="Testlogo">
src="/static/Images/Testlogo.png" alt="Testlogo">
</a>
</div>
</div>
Expand Down Expand Up @@ -544,21 +544,21 @@
onclick="checkAll()" />
<div class="widget_header">
<h4 class="widget_header_title wwIcon i_16_charts">Options:</h4>
<img title="添加用例场景" src="/WebTester/static/Images/Icons/16/add.png"
<img title="添加用例场景" src="/static/Images/Icons/16/add.png"
style="position: relative; top: 2px; left: 20px; cursor: pointer;"
onclick='pops("pop1");interfaceGetInfo("nameadd",this.name,this);' />
<img title="执行选中用例" src="/WebTester/static/Images/Icons/16/run.png"
<img title="执行选中用例" src="/static/Images/Icons/16/run.png"
style="position: relative; top: 2px; left: 20px; cursor: pointer; width: 18px"
onclick='runTest()' /> <img title="调试接口"
src="/WebTester/static/Images/Icons/16/debug.png"
src="/static/Images/Icons/16/debug.png"
style="position: relative; top: 2px; left: 20px; cursor: pointer; width: 18px"
onclick='debugCase()' /> <input id="searchText" type="text"
value="Search" class="c_input_Search"
onkeydown='if(event.keyCode==13){SearchAll()}'
onfocus='if(this.value=="Search"){this.value=""}'
onblur='if(this.value==""){this.value="Search"}' /> <img
id="Search" title="搜索"
src="/WebTester/static/Images/Icons/16/Search.png"
src="/static/Images/Icons/16/Search.png"
style="position: relative; top: 11px; left: 125px; cursor: pointer; float: right;"
onclick='SearchAll()' />
</div>
Expand Down
14 changes: 7 additions & 7 deletions WebContent/static/UI.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<link href="http://fonts.useso.com/css?family=Oswald|Droid+Sans:400,700"
rel="stylesheet">
<!-- The Main CSS File -->
<link rel="stylesheet" href="/WebTester/static/CSS/style.css">
<script src="/WebTester/static/Javascript/jQuery/jquery.min.js"></script>
<link rel="stylesheet" href="/static/CSS/style.css">
<script src="/static/Javascript/jQuery/jquery.min.js"></script>

</head>
<script>
Expand Down Expand Up @@ -375,7 +375,7 @@
<div class="wrapper">
<div class="logo">
<a href="index.jsp" Title="autoTest框架"> <img
src="/WebTester/static/Images/Testlogo.png"
src="/static/Images/Testlogo.png"
alt="Testlogo">
</a>
</div>
Expand Down Expand Up @@ -554,19 +554,19 @@
<div class="widget_header">
<h4 class="widget_header_title wwIcon i_16_charts">Options:</h4>
<img
title="添加用例场景" src="/WebTester/static/Images/Icons/16/add.png"
title="添加用例场景" src="/static/Images/Icons/16/add.png"
style="position: relative; top: 2px; left: 20px; cursor: pointer;"
onclick='pops("pop1");GetInfo("nameadd",this.name,this);' />
<img
title="执行选中用例" src="/WebTester/static/Images/Icons/16/run.png"
title="执行选中用例" src="/static/Images/Icons/16/run.png"
style="position: relative; top: 2px; left: 20px; cursor: pointer; width: 18px"
onclick='runTest()' />
<input id="caseId" type="text" value="1"
style="position: relative; left: 30px; width: 50px;"
onkeydown='if(event.keyCode==13){debugCase()}'
onblur = 'this.value = this.value.replace(/\D+/g, "");if(this.value==""){this.value="1";}' />
<img
title="调试选中用例" src="/WebTester/static/Images/Icons/16/debug.png"
title="调试选中用例" src="/static/Images/Icons/16/debug.png"
style="position: relative; top: 2px; left: 28px; cursor: pointer; width: 18px"
onclick='debugCase()' />
<input id="searchText" type="text" value="Search"
Expand All @@ -575,7 +575,7 @@
onfocus='if(this.value=="Search"){this.value=""}'
onblur='if(this.value==""){this.value="Search"}' />
<img
id="Search" title="搜索" src="/WebTester/static/Images/Icons/16/Search.png"
id="Search" title="搜索" src="/static/Images/Icons/16/Search.png"
style="position: relative; top: 11px; left: 125px; cursor: pointer; float: right;"
onclick='SearchAll()' />
</div>
Expand Down
6 changes: 3 additions & 3 deletions WebContent/static/inbox.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
<link href="http://fonts.useso.com/css?family=Oswald|Droid+Sans:400,700"
rel="stylesheet">
<!-- The Main CSS File -->
<link rel="stylesheet" href="/WebTester/static/CSS/style.css">
<script src="/WebTester/static/Javascript/jQuery/jquery.min.js"></script>
<link rel="stylesheet" href="/static/CSS/style.css">
<script src="/static/Javascript/jQuery/jquery.min.js"></script>

</head>
<body onload="">
<header class="main_header">
<div class="wrapper">
<div class="logo">
<a href="index.jsp" Title="autoTest框架"> <img
src="/WebTester/static/Images/Testlogo.png"
src="/static/Images/Testlogo.png"
alt="Testlogo">
</a>
</div>
Expand Down
10 changes: 5 additions & 5 deletions WebContent/static/tables.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
<link href="http://fonts.useso.com/css?family=Oswald|Droid+Sans:400,700"
rel="stylesheet">
<!-- The Main CSS File -->
<link rel="stylesheet" href="/WebTester/static/CSS/style.css">
<script src="/WebTester/static/Javascript/jQuery/jquery.min.js"></script>
<script src="/WebTester/static/Javascript/jQuery/jquery-form.js"></script>
<link rel="stylesheet" href="/static/CSS/style.css">
<script src="/static/Javascript/jQuery/jquery.min.js"></script>
<script src="/static/Javascript/jQuery/jquery-form.js"></script>

<script>
Expand Down Expand Up @@ -58,7 +58,7 @@ function getOptions() {
data = xmlhttp.responseText;
if(data !=""){
while(data.indexOf(",")>0){
str+="<option value=\"" +data+ "\">"+ data.substring(0,data.indexOf(",")) +"</option>";
str+="<option value=\"" +data.substring(0,data.indexOf(","))+ "\">"+ data.substring(0,data.indexOf(",")) +"</option>";
data = data.substring(data.indexOf(",")+1,data.length);
}
str+="<option value=\""+data+"\">"+ data +"</option>";
Expand All @@ -75,7 +75,7 @@ function getOptions() {
<div class="wrapper">
<div class="logo">
<a href="index.jsp" Title="autoTest框架"> <img
src="/WebTester/static/Images/Testlogo.png"
src="/static/Images/Testlogo.png"
alt="Testlogo">
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/com/test/KeyWord/servlet/GetKeyWords.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private void getByidadd() {
try {
Statement sm = Mysql.ct.createStatement();
String sql = "";
sql = "SELECT MAX(id) FROM KeyWords";
sql = "SELECT MAX(id) FROM keywords";
ResultSet rs = sm.executeQuery(sql);
rs.next();
int str = 1;
Expand All @@ -71,7 +71,7 @@ private void getById(String id) {
try {
Statement sm = Mysql.ct.createStatement();
String sql = "";
sql = "select * from KeyWords where id='" + id + "'";
sql = "select * from keywords where id='" + id + "'";
ResultSet rs = sm.executeQuery(sql);
while (rs.next()) {
ResultSetMetaData rsmd = rs.getMetaData();
Expand Down
6 changes: 3 additions & 3 deletions src/com/test/KeyWord/servlet/UpdateKeyWords.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public void doPost(HttpServletRequest request, HttpServletResponse resp)
} catch (Exception e) {
}
if (id != null && type != null) {
sqlu += "update KeyWords set id=" + id + ", type=" + type
sqlu += "update keywords set id=" + id + ", type=" + type
+ ", keyName='" + request.getParameter("keyName")
+ "', describes='" + request.getParameter("describes")
+ "', useCase='" + request.getParameter("useCase")
+ "' where id='" + id + "'";
sqli += "insert into KeyWords values(" + id + "," + type + ",'"
sqli += "insert into keywords values(" + id + "," + type + ",'"
+ request.getParameter("keyName") + "','"
+ request.getParameter("describes") + "','"
+ request.getParameter("useCase") + "')";
Expand All @@ -72,7 +72,7 @@ private int updateKeyWords(String sqli, String sqlu, String id) {
// System.out.println(sqlu);
try {
Statement sm = Mysql.ct.createStatement();
String sql = "select id from KeyWords where id='" + id + "'";
String sql = "select id from keywords where id='" + id + "'";
ResultSet rs = sm.executeQuery(sql);
while (rs.next()) {
str = rs.getString(1);
Expand Down
2 changes: 1 addition & 1 deletion src/com/test/KeyWord/servlet/delKeyWords.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ private int delById(String id) {
try {
Statement sm = Mysql.ct.createStatement();
String sql="";
sql="delete from KeyWords where id='"+id+"'";
sql="delete from keywords where id='"+id+"'";
rs = sm.executeUpdate(sql);
sm=null;
}catch (Exception e){
Expand Down
6 changes: 4 additions & 2 deletions src/com/test/service/InterfacerunService.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

import com.test.statics.Mysql;
import com.test.statics.responseList;
import com.test.tools.encodeType;
import com.test.tools.jsonPase;
import com.test.tools.sendUrl;

Expand Down Expand Up @@ -112,19 +113,20 @@ public static void debug(String url,String param,String method){
sendUrl obj = new sendUrl();
switch (method) { // 发送请求
case "post":
if(param.equals("请输入接口地址"))
if(param.equals("请输入接口参数"))
param = "";
responseList.json = obj.sendPost(url, param).toString();
break;
case "get":
if(param.equals("请输入接口地址"))
if(param.equals("请输入接口参数"))
param = "";
System.out.println(url+param);
responseList.json = obj.sendGet(url, param).toString();
break;
default :
responseList.json = "方法:"+method+"不支持!";
}
System.out.println(encodeType.getEncoding(responseList.json));
state = "调试完成";
}

Expand Down
10 changes: 5 additions & 5 deletions src/com/test/service/serviceKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ public serviceKey(){ //查询关键字
String sql = "";
try {
Statement sm = Mysql.ct.createStatement();
ResultSet rs = sm.executeQuery("select DISTINCT type from KeyWords order by type");
ResultSet rs = sm.executeQuery("select DISTINCT type from keywords order by type");
while (rs.next()) {
Statement sm1 = Mysql.ct.createStatement();
//System.out.println("+1");
sql="select * from KeyWords where type='" + rs.getString(1) +"' order by id";
sql="select * from keywords where type='" + rs.getString(1) +"' order by id";
ResultSet rs1 = sm1.executeQuery(sql);
while (rs1.next()) {
ResultSetMetaData rsmd1 = rs1.getMetaData();
Expand Down Expand Up @@ -49,14 +49,14 @@ public serviceKey(String p){ //按条件查询关键字
String sql = "";
try {
Statement sm = Mysql.ct.createStatement();
sql = "SELECT id FROM KeyWords WHERE describes LIKE '%"+p+"%' or keyName LIKE '%"+p+"%'";
sql = "SELECT id FROM keywords WHERE describes LIKE '%"+p+"%' or keyName LIKE '%"+p+"%'";
ResultSet rs = sm.executeQuery(sql);
while (rs.next()) {
Statement sm2 = Mysql.ct.createStatement();
ResultSet rs2 = sm2.executeQuery("select DISTINCT type from KeyWords order by type");
ResultSet rs2 = sm2.executeQuery("select DISTINCT type from keywords order by type");
while (rs2.next()) {
Statement sm1 = Mysql.ct.createStatement();
sql="select * from KeyWords where id='"+rs.getString(1)+"' and type='" + rs2.getString(1) +"' order by id";
sql="select * from keywords where id='"+rs.getString(1)+"' and type='" + rs2.getString(1) +"' order by id";
ResultSet rs1 = sm1.executeQuery(sql);
while (rs1.next()) {
ResultSetMetaData rsmd1 = rs1.getMetaData();
Expand Down
6 changes: 4 additions & 2 deletions src/com/test/service/servletInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.test.statics.outputList;
import com.test.statics.responseList;
import com.test.tools.ImageTool;
import com.test.tools.property;

public class servletInit extends HttpServlet{
/**
Expand All @@ -16,10 +17,11 @@ public class servletInit extends HttpServlet{
public void init() {
new outputList(); //初始化静态数据类
new Mysql(); //初始化Mysql类
new ImageTool(); //初始化图形处理类
new responseList(); //初始化接口数据静态类
//Mysql.Sort();

property pro =new property();
if(pro.readRcErpURL("DISPLAY").toString().equals("true"))
new ImageTool(); //初始化图形处理类
outputList.logs="Server init secc!";
System.out.println("log:info::Init secc!");
return;
Expand Down
3 changes: 2 additions & 1 deletion src/com/test/tools/MyX509TrustManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public class MyX509TrustManager implements X509TrustManager { //开源证书类
MyX509TrustManager() throws Exception {
// create a "default" JSSE X509TrustManager.
KeyStore ks = KeyStore.getInstance("JKS");
ks.load(new FileInputStream("C:/Program Files/Java/jre7/lib/security/cacerts"),"changeit".toCharArray());
property pro =new property();
ks.load(new FileInputStream(pro.readRcErpURL("cacerts")),"changeit".toCharArray());
TrustManagerFactory tmf =
TrustManagerFactory.getInstance("SunX509", "SunJSSE");
tmf.init(ks);
Expand Down
4 changes: 3 additions & 1 deletion src/com/test/tools/Test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@ mysqlp=
chromepath=C:/Program Files/Google/Chrome/Application/chrome.exe
chromedriverpath=E:/workspace/autoTest/WebContent/WEB-INF/lib/chromedriver.exe
IEpath=C:/Program Files/Internet Explorer/iexplore.exe
IEdriverpath=E:/workspace/autoTest/WebContent/WEB-INF/lib/IEDriver.exe
IEdriverpath=E:/workspace/autoTest/WebContent/WEB-INF/lib/IEDriver.exe
DISPLAY=false
cacerts=C:/Program Files/Java/jre7/lib/security/cacerts
16 changes: 11 additions & 5 deletions src/com/test/tools/property.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ public class property {
public String readRcErpURL(String name){
try{
String url = this.getClass().getResource("").getPath().replaceAll("%20", " ");
//System.out.println(url);
String path = url.substring(1, url.length()) + "/Test.properties";
Properties config = new Properties();
config.load(new FileInputStream(path));
return config.getProperty(name);
String path = url.substring(1, url.length()) + "/Test.properties";
System.out.println("log::info:configpath="+path);
Properties config = new Properties();
try{
config.load(new FileInputStream(path));
return config.getProperty(name);
}catch(Exception e1){
path = "/" + path;
config.load(new FileInputStream(path));
return config.getProperty(name);
}
}
catch(Exception e){
e.printStackTrace();
Expand Down
8 changes: 6 additions & 2 deletions src/com/test/tools/sendUrl.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ public String sendGet(String url, String param) {
sslContext.init(null, tm, new java.security.SecureRandom());
// 从上述SSLContext对象中得到SSLSocketFactory对象
SSLSocketFactory ssf = sslContext.getSocketFactory();
// 创建URL对象
URL realUrl = new URL(url + "?" + param);
// 创建URL对象\
URL realUrl;
if(param.length()>0)
realUrl = new URL(url + "?" + param);
else
realUrl = new URL(url);
// 创建HttpsURLConnection对象,并设置其SSLSocketFactory对象
HttpURLConnection conn = null;
// 创建HttpsURLConnection对象,并设置其SSLSocketFactory对象
Expand Down
2 changes: 1 addition & 1 deletion 文档/mysql.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CREATE TABLE `caseoption` (
`actualRes` varchar(512) DEFAULT NULL COMMENT 'ʵ�ʽ�������ڼ�¼���',
`imgName` varchar(32) DEFAULT NULL COMMENT '���к������������ͼͼƬ����',
`caseDescription` varchar(32) DEFAULT NULL COMMENT '��������',
`runState` varchar(16) CHARACTER SET utf8mb4 DEFAULT 'N/A' COMMENT '�������ִ��״̬',
`runState` varchar(16) CHARACTER SET utf8 DEFAULT 'N/A' COMMENT '�������ִ��״̬',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='��������ִ����Ҫ��������Ϣ';

Expand Down

0 comments on commit 74a83b1

Please sign in to comment.