Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
runcon
Plantuml Server
Commits
1cf5eb89
Commit
1cf5eb89
authored
Sep 19, 2013
by
Maxime Sinclair
Browse files
[FEATURE] url parameter test case added
parent
a3bd2a1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/test/java/net/sourceforge/plantuml/servlet/TestForm.java
View file @
1cf5eb89
...
...
@@ -133,4 +133,24 @@ public class TestForm extends WebappTestCase {
assertEquals
(
1
,
maps
.
length
);
}
/**
* Verifies that when the encoded source is specified as an URL parameter
* the diagram is displayed and the source is decoded
*/
public
void
testUrlParameter
()
throws
Exception
{
WebConversation
conversation
=
new
WebConversation
();
// Submit the request with a url parameter
WebRequest
request
=
new
GetMethodWebRequest
(
getServerUrl
()
+
"form?url="
+
TestUtils
.
SEQBOB
);
WebResponse
response
=
conversation
.
getResponse
(
request
);
// Analyze response
WebForm
forms
[]
=
response
.
getForms
();
assertEquals
(
2
,
forms
.
length
);
// Ensure the Text field is filled
assertEquals
(
forms
[
0
].
getParameterValue
(
"text"
),
"@startuml\nBob -> Alice : hello\n@enduml"
);
// Ensure the URL field is filled
assertEquals
(
forms
[
1
].
getParameterValue
(
"url"
),
getServerUrl
()
+
"img/"
+
TestUtils
.
SEQBOB
);
// Ensure the the image is present
assertEquals
(
1
,
response
.
getImages
().
length
);
}
}
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