Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaofang li
MeterSphere
Commits
c9fd6fd6
Commit
c9fd6fd6
authored
4 years ago
by
fit2-zhao
Committed by
fit2-zhao
4 years ago
Browse files
Options
Download
Email Patches
Plain Diff
fix(接口自动化): 修复jmx文件导入解析错误 #1004805
parent
0728a289
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java
+5
-1
.../metersphere/api/dto/automation/parse/MsJmeterParser.java
with
5 additions
and
1 deletion
+5
-1
backend/src/main/java/io/metersphere/api/dto/automation/parse/MsJmeterParser.java
+
5
-
1
View file @
c9fd6fd6
...
...
@@ -240,7 +240,9 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
Body
body
=
new
Body
();
body
.
init
();
body
.
initKvs
();
body
.
getKvs
().
clear
();
body
.
initBinary
();
body
.
getBinary
().
clear
();
samplerProxy
.
setBody
(
body
);
if
(
source
!=
null
&&
source
.
getHTTPFiles
().
length
>
0
)
{
samplerProxy
.
getBody
().
initBinary
();
...
...
@@ -278,7 +280,7 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
samplerProxy
.
getBody
().
setRaw
(
v
);
});
samplerProxy
.
getBody
().
initKvs
();
}
else
if
(
StringUtils
.
isNotEmpty
(
bodyType
))
{
}
else
if
(
StringUtils
.
isNotEmpty
(
bodyType
)
||
(
source
.
getMethod
().
equalsIgnoreCase
(
"POST"
)
&&
source
.
getArguments
().
getArgumentsAsMap
().
size
()
>
0
)
)
{
samplerProxy
.
getBody
().
setType
(
Body
.
WWW_FROM
);
source
.
getArguments
().
getArgumentsAsMap
().
forEach
((
k
,
v
)
->
{
KeyValue
keyValue
=
new
KeyValue
(
k
,
v
);
...
...
@@ -309,6 +311,8 @@ public class MsJmeterParser extends ApiImportAbstractParser<ScenarioImport> {
}
samplerProxy
.
setId
(
UUID
.
randomUUID
().
toString
());
samplerProxy
.
setType
(
"HTTPSamplerProxy"
);
body
.
getKvs
().
add
(
new
KeyValue
());
body
.
getBinary
().
add
(
new
KeyValue
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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