Skip to content

Commit 8e16a0d

Browse files
committed
Add tests and stubs for the summaries
1 parent 903fdb0 commit 8e16a0d

File tree

5 files changed

+365
-48
lines changed

5 files changed

+365
-48
lines changed
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
package generatedtest;
2+
3+
import akka.util.ByteString;
4+
import com.fasterxml.jackson.databind.JsonNode;
5+
import java.io.File;
6+
import java.util.List;
7+
import java.util.Map;
8+
import java.util.Optional;
9+
import org.w3c.dom.Document;
10+
import play.mvc.Http;
11+
12+
// Test case generated by GenerateFlowTestCase.ql
13+
public class Test {
14+
15+
Object source() {
16+
return null;
17+
}
18+
19+
void sink(Object o) {}
20+
21+
public void test() throws Exception {
22+
23+
{
24+
// "play.mvc;Http$Cookie;true;name;;;Argument[this];ReturnValue;taint;manual"
25+
String out = null;
26+
Http.Cookie in = (Http.Cookie) source();
27+
out = in.name();
28+
sink(out); // $ hasTaintFlow
29+
}
30+
{
31+
// "play.mvc;Http$Cookie;true;value;;;Argument[this];ReturnValue;taint;manual"
32+
String out = null;
33+
Http.Cookie in = (Http.Cookie) source();
34+
out = in.value();
35+
sink(out); // $ hasTaintFlow
36+
}
37+
{
38+
// "play.mvc;Http$Cookies;true;get;;;Argument[this];ReturnValue;taint;manual"
39+
Http.Cookie out = null;
40+
Http.Cookies in = (Http.Cookies) source();
41+
out = in.get(null);
42+
sink(out); // $ hasTaintFlow
43+
}
44+
{
45+
// "play.mvc;Http$Cookies;true;getCookie;;;Argument[this];ReturnValue;taint;manual"
46+
Optional out = null;
47+
Http.Cookies in = (Http.Cookies) source();
48+
out = in.getCookie(null);
49+
sink(out); // $ hasTaintFlow
50+
}
51+
{
52+
// "play.mvc;Http$MultipartFormData$FilePart;true;getContentType;;;Argument[this];ReturnValue;taint;manual"
53+
String out = null;
54+
Http.MultipartFormData.FilePart in = (Http.MultipartFormData.FilePart) source();
55+
out = in.getContentType();
56+
sink(out); // $ hasTaintFlow
57+
}
58+
{
59+
// "play.mvc;Http$MultipartFormData$FilePart;true;getDispositionType;;;Argument[this];ReturnValue;taint;manual"
60+
String out = null;
61+
Http.MultipartFormData.FilePart in = (Http.MultipartFormData.FilePart) source();
62+
out = in.getDispositionType();
63+
sink(out); // $ hasTaintFlow
64+
}
65+
{
66+
// "play.mvc;Http$MultipartFormData$FilePart;true;getFilename;;;Argument[this];ReturnValue;taint;manual"
67+
String out = null;
68+
Http.MultipartFormData.FilePart in = (Http.MultipartFormData.FilePart) source();
69+
out = in.getFilename();
70+
sink(out); // $ hasTaintFlow
71+
}
72+
{
73+
// "play.mvc;Http$MultipartFormData$FilePart;true;getKey;;;Argument[this];ReturnValue;taint;manual"
74+
String out = null;
75+
Http.MultipartFormData.FilePart in = (Http.MultipartFormData.FilePart) source();
76+
out = in.getKey();
77+
sink(out); // $ hasTaintFlow
78+
}
79+
{
80+
// "play.mvc;Http$MultipartFormData$FilePart;true;getRef;;;Argument[this];ReturnValue;taint;manual"
81+
Object out = null;
82+
Http.MultipartFormData.FilePart in = (Http.MultipartFormData.FilePart) source();
83+
out = in.getRef();
84+
sink(out); // $ hasTaintFlow
85+
}
86+
{
87+
// "play.mvc;Http$MultipartFormData;true;asFormUrlEncoded;;;Argument[this];ReturnValue;taint;manual"
88+
Map out = null;
89+
Http.MultipartFormData in = (Http.MultipartFormData) source();
90+
out = in.asFormUrlEncoded();
91+
sink(out); // $ hasTaintFlow
92+
}
93+
{
94+
// "play.mvc;Http$MultipartFormData;true;getFile;;;Argument[this];ReturnValue;taint;manual"
95+
Http.MultipartFormData.FilePart out = null;
96+
Http.MultipartFormData in = (Http.MultipartFormData) source();
97+
out = in.getFile(null);
98+
sink(out); // $ hasTaintFlow
99+
}
100+
{
101+
// "play.mvc;Http$MultipartFormData;true;getFiles;;;Argument[this];ReturnValue;taint;manual"
102+
List out = null;
103+
Http.MultipartFormData in = (Http.MultipartFormData) source();
104+
out = in.getFiles();
105+
sink(out); // $ hasTaintFlow
106+
}
107+
{
108+
// "play.mvc;Http$RawBuffer;true;asBytes;;;Argument[this];ReturnValue;taint;manual"
109+
ByteString out = null;
110+
Http.RawBuffer in = (Http.RawBuffer) source();
111+
out = in.asBytes();
112+
sink(out); // $ hasTaintFlow
113+
}
114+
{
115+
// "play.mvc;Http$RawBuffer;true;asBytes;;;Argument[this];ReturnValue;taint;manual"
116+
ByteString out = null;
117+
Http.RawBuffer in = (Http.RawBuffer) source();
118+
out = in.asBytes(0);
119+
sink(out); // $ hasTaintFlow
120+
}
121+
{
122+
// "play.mvc;Http$RawBuffer;true;asFile;;;Argument[this];ReturnValue;taint;manual"
123+
File out = null;
124+
Http.RawBuffer in = (Http.RawBuffer) source();
125+
out = in.asFile();
126+
sink(out); // $ hasTaintFlow
127+
}
128+
{
129+
// "play.mvc;Http$RequestBody;true;as;;;Argument[this];ReturnValue;taint;manual"
130+
Object out = null;
131+
Http.RequestBody in = (Http.RequestBody) source();
132+
out = in.as(null);
133+
sink(out); // $ hasTaintFlow
134+
}
135+
{
136+
// "play.mvc;Http$RequestBody;true;asBytes;;;Argument[this];ReturnValue;taint;manual"
137+
ByteString out = null;
138+
Http.RequestBody in = (Http.RequestBody) source();
139+
out = in.asBytes();
140+
sink(out); // $ hasTaintFlow
141+
}
142+
{
143+
// "play.mvc;Http$RequestBody;true;asFormUrlEncoded;;;Argument[this];ReturnValue;taint;manual"
144+
Map out = null;
145+
Http.RequestBody in = (Http.RequestBody) source();
146+
out = in.asFormUrlEncoded();
147+
sink(out); // $ hasTaintFlow
148+
}
149+
{
150+
// "play.mvc;Http$RequestBody;true;asJson;;;Argument[this];ReturnValue;taint;manual"
151+
JsonNode out = null;
152+
Http.RequestBody in = (Http.RequestBody) source();
153+
out = in.asJson();
154+
sink(out); // $ hasTaintFlow
155+
}
156+
{
157+
// "play.mvc;Http$RequestBody;true;asMultipartFormData;;;Argument[this];ReturnValue;taint;manual"
158+
Http.MultipartFormData out = null;
159+
Http.RequestBody in = (Http.RequestBody) source();
160+
out = in.asMultipartFormData();
161+
sink(out); // $ hasTaintFlow
162+
}
163+
{
164+
// "play.mvc;Http$RequestBody;true;asRaw;;;Argument[this];ReturnValue;taint;manual"
165+
Http.RawBuffer out = null;
166+
Http.RequestBody in = (Http.RequestBody) source();
167+
out = in.asRaw();
168+
sink(out); // $ hasTaintFlow
169+
}
170+
{
171+
// "play.mvc;Http$RequestBody;true;asText;;;Argument[this];ReturnValue;taint;manual"
172+
String out = null;
173+
Http.RequestBody in = (Http.RequestBody) source();
174+
out = in.asText();
175+
sink(out); // $ hasTaintFlow
176+
}
177+
{
178+
// "play.mvc;Http$RequestBody;true;asXml;;;Argument[this];ReturnValue;taint;manual"
179+
Document out = null;
180+
Http.RequestBody in = (Http.RequestBody) source();
181+
out = in.asXml();
182+
sink(out); // $ hasTaintFlow
183+
}
184+
{
185+
// "play.mvc;Http$RequestBody;true;parseJson;;;Argument[this];ReturnValue;taint;manual"
186+
Optional out = null;
187+
Http.RequestBody in = (Http.RequestBody) source();
188+
out = in.parseJson(null);
189+
sink(out); // $ hasTaintFlow
190+
}
191+
192+
}
193+
194+
}

java/ql/test/library-tests/frameworks/play/test.expected

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import java
2+
import TestUtilities.InlineFlowTest

java/ql/test/stubs/playframework-2.6.x/play/api/mvc/Cookie.java

Lines changed: 131 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)