Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nwn_Api_auto_test
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shuai
nwn_Api_auto_test
Commits
d070efd9
Commit
d070efd9
authored
Jan 30, 2019
by
Li Yongyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
md5 算法优化
parent
702705cd
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
7 deletions
+44
-7
CaseMake.xls
nwn_Api_auto_test/TestData/CaseMake.xls
+0
-0
DataAll.xls
nwn_Api_auto_test/TestData/DataAll.xls
+0
-0
DefectTest.xml
nwn_Api_auto_test/src/DefectTest.xml
+1
-1
LMFMD5.java
nwn_Api_auto_test/src/com/offcn/api/nwn/md5/LMFMD5.java
+35
-2
nwngetsign.java
nwn_Api_auto_test/src/com/offcn/api/nwn/md5/nwngetsign.java
+5
-1
delEduPackage.java
...uto_test/src/com/offcn/api/nwn/service/delEduPackage.java
+1
-1
findEdupack.java
..._auto_test/src/com/offcn/api/nwn/service/findEdupack.java
+1
-1
APITest_nwn.java
nwn_Api_auto_test/src/com/offcn/test/APITest_nwn.java
+1
-1
No files found.
nwn_Api_auto_test/TestData/CaseMake.xls
View file @
d070efd9
No preview for this file type
nwn_Api_auto_test/TestData/DataAll.xls
View file @
d070efd9
No preview for this file type
nwn_Api_auto_test/src/DefectTest.xml
View file @
d070efd9
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
<classes>
<classes>
<class
name=
"com.puhui.test.RenMai_APITest"
>
<class
name=
"com.puhui.test.RenMai_APITest"
>
<methods>
<methods>
<include
name=
"f"
invocation-numbers=
"0 1 2 3 4 5 6 7 8 "
/>
<include
name=
"f"
invocation-numbers=
"0 1 2 3 4 5 6 7 8
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
"
/>
</methods>
</methods>
</class>
</class>
</classes>
</classes>
...
...
nwn_Api_auto_test/src/com/offcn/api/nwn/md5/LMFMD5.java
View file @
d070efd9
package
com
.
offcn
.
api
.
nwn
.
md5
;
package
com
.
offcn
.
api
.
nwn
.
md5
;
import
java.io.UnsupportedEncodingException
;
import
java.security.MessageDigest
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.security.NoSuchAlgorithmException
;
public
class
LMFMD5
{
public
class
LMFMD5
{
//����һ����LMFMD5
//����һ����LMFMD5
public
static
String
MD5
(
String
sourceStr
)
{
public
static
String
MD5
(
String
str
)
{
/*
String result = "";
String result = "";
try {
try {
MessageDigest md = MessageDigest.getInstance("MD5");
MessageDigest md = MessageDigest.getInstance("MD5");
...
@@ -31,7 +34,37 @@ public class LMFMD5 {
...
@@ -31,7 +34,37 @@ public class LMFMD5 {
} catch (NoSuchAlgorithmException e) {
} catch (NoSuchAlgorithmException e) {
System.out.println(e);
System.out.println(e);
}
}
return
result
;
return result;*/
MessageDigest
messageDigest
=
null
;
try
{
messageDigest
=
MessageDigest
.
getInstance
(
"MD5"
);
messageDigest
.
reset
();
messageDigest
.
update
(
str
.
getBytes
(
"UTF-8"
));
}
catch
(
NoSuchAlgorithmException
e
)
{
// NOSONAR
System
.
out
.
println
(
e
.
getMessage
());
}
catch
(
UnsupportedEncodingException
e
)
{
// NOSONAR
System
.
out
.
println
(
e
.
getMessage
());
}
byte
[]
byteArray
=
messageDigest
.
digest
();
StringBuffer
md5StrBuff
=
new
StringBuffer
();
for
(
int
i
=
0
;
i
<
byteArray
.
length
;
i
++)
{
if
(
Integer
.
toHexString
(
0xFF
&
byteArray
[
i
]).
length
()
==
1
)
md5StrBuff
.
append
(
"0"
).
append
(
Integer
.
toHexString
(
0xFF
&
byteArray
[
i
]));
else
md5StrBuff
.
append
(
Integer
.
toHexString
(
0xFF
&
byteArray
[
i
]));
}
// return md5StrBuff.toString().toUpperCase();
return
md5StrBuff
.
toString
();
}
}
}
}
nwn_Api_auto_test/src/com/offcn/api/nwn/md5/nwngetsign.java
View file @
d070efd9
package
com
.
offcn
.
api
.
nwn
.
md5
;
package
com
.
offcn
.
api
.
nwn
.
md5
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLDecoder
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.Date
;
import
com.offcn.process.NWN
;
import
com.offcn.process.NWN
;
public
class
nwngetsign
{
public
class
nwngetsign
{
...
@@ -30,10 +33,11 @@ public class nwngetsign {
...
@@ -30,10 +33,11 @@ public class nwngetsign {
str
=
str
+
"bf2h3%^j?ljkj3706kji88697"
;
//教务的加密,规则固定需要加
str
=
str
+
"bf2h3%^j?ljkj3706kji88697"
;
//教务的加密,规则固定需要加
System
.
out
.
println
(
"str==="
+
str
);
System
.
out
.
println
(
"str==="
+
str
);
//String str1 = "appid=tiku&avatar=http://thirdqq.qlogo.cn/qqapp/1106773681/5B50BBF83A00DC46B16B708F720A5D46/100&device_id=861837034477409&login_type=qq&nickname=hobo&open_id=1&platform=Android&version=1"+"&123456";
//String str1 = "appid=tiku&avatar=http://thirdqq.qlogo.cn/qqapp/1106773681/5B50BBF83A00DC46B16B708F720A5D46/100&device_id=861837034477409&login_type=qq&nickname=hobo&open_id=1&platform=Android&version=1"+"&123456";
String
res
=
new
LMFMD5
().
MD5
(
str
);
String
res
=
new
LMFMD5
().
MD5
(
str
);
System
.
out
.
println
(
"res==="
+
res
);
System
.
out
.
println
(
"res==="
+
res
);
return
res
;
return
res
;
...
...
nwn_Api_auto_test/src/com/offcn/api/nwn/service/delEduPackage.java
View file @
d070efd9
...
@@ -29,7 +29,7 @@ import net.sf.json.JSONObject;
...
@@ -29,7 +29,7 @@ import net.sf.json.JSONObject;
/**
/**
*
添加母版层级
*
删除班级(教务包)
*
*
* @author liyy
* @author liyy
*
*
...
...
nwn_Api_auto_test/src/com/offcn/api/nwn/service/findEdupack.java
View file @
d070efd9
...
@@ -29,7 +29,7 @@ import net.sf.json.JSONObject;
...
@@ -29,7 +29,7 @@ import net.sf.json.JSONObject;
/**
/**
*
添加母版层级
*
查找母版下是否有对应的教务包
*
*
* @author liyy
* @author liyy
*
*
...
...
nwn_Api_auto_test/src/com/offcn/test/APITest_nwn.java
View file @
d070efd9
...
@@ -113,7 +113,7 @@ public class APITest_nwn extends NWN{
...
@@ -113,7 +113,7 @@ public class APITest_nwn extends NWN{
//数据回写
//数据回写
// HashMap<String, Object> ExpectResult=MapUtil.Expect(data);
// HashMap<String, Object> ExpectResult=MapUtil.Expect(data);
/*
SheetUtils sheet = new SheetUtils("DataAll.xls", "Output");
/*
SheetUtils sheet = new SheetUtils("DataAll.xls", "Output");
sheet.writeExcel(
sheet.writeExcel(
data.get("NO").toString(),
data.get("NO").toString(),
data.get("TCNO").toString() + "_Step" + data.get("Step").toString(),
data.get("TCNO").toString() + "_Step" + data.get("Step").toString(),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment