Skip to content

Commit 48290c9

Browse files
committed
Java: Update the flow test case generator to emit data extension like model data.
1 parent 9507dc1 commit 48290c9

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

java/ql/src/utils/flowtestcasegenerator/FlowTestCaseSupportMethods.qll

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ abstract class SupportMethod extends string {
9797
int getPriority() { result = 50 }
9898

9999
/**
100-
* Gets the CSV row describing this support method if it is needed to set up the output for this test.
100+
* Gets the data extension row describing this support method if it is needed to set up the output for this test.
101101
*
102-
* For example, `newWithMapValue` will propagate a value from `Argument[0]` to `MapValue of ReturnValue`, and `getMapValue`
102+
* For example, `newWithMapValue` will propagate a value from `Argument[0]` to `ReturnValue.MapValue`, and `getMapValue`
103103
* will do the opposite.
104104
*/
105-
string getCsvModel() { none() }
105+
string getDataExtensionModel() { none() }
106106
}
107107

108108
/**
@@ -162,10 +162,11 @@ private class DefaultGetMethod extends GetMethod {
162162
result = "Object get" + contentToken(c) + "Default(Object container) { return null; }"
163163
}
164164

165-
override string getCsvModel() {
165+
override string getDataExtensionModel() {
166166
result =
167-
"generatedtest;Test;false;" + this.getName() + ";(Object);;Argument[0]." +
168-
getComponentSpec(SummaryComponent::content(c)) + ";ReturnValue;value;manual"
167+
"\"generatedtest\", \"Test\", False, \"" + this.getName() +
168+
"\", \"(Object)\", \"\", \"Argument[0]." + getComponentSpec(SummaryComponent::content(c)) +
169+
"\", \"ReturnValue\", \"value\", \"manual\""
169170
}
170171
}
171172

@@ -358,10 +359,11 @@ private class DefaultGenMethod extends GenMethod {
358359
result = "Object newWith" + contentToken(c) + "Default(Object element) { return null; }"
359360
}
360361

361-
override string getCsvModel() {
362+
override string getDataExtensionModel() {
362363
result =
363-
"generatedtest;Test;false;" + this.getName() + ";(Object);;Argument[0];ReturnValue." +
364-
getComponentSpec(SummaryComponent::content(c)) + ";value;manual"
364+
"\"generatedtest\", \"Test\", False, \"" + this.getName() +
365+
"\", \"(Object)\", \"\", \"Argument[0]\", \"ReturnValue." +
366+
getComponentSpec(SummaryComponent::content(c)) + "\", \"value\", \"manual\""
365367
}
366368
}
367369

java/ql/src/utils/flowtestcasegenerator/GenerateFlowTestCase.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,12 @@ SupportMethod getASupportMethod() {
8585
}
8686

8787
/**
88-
* Returns a CSV specification of the taint-/value-propagation behavior of a test support method (`get` or `newWith` method).
88+
* Returns a data extension specification of the taint-/value-propagation behavior of a test support method (`get` or `newWith` method).
8989
*/
90-
query string getASupportMethodModel() { result = getASupportMethod().getCsvModel() }
90+
query string getASupportMethodModel() { result = getASupportMethod().getDataExtensionModel() }
9191

9292
/**
93-
* Gets a Java file body testing all requested CSV rows against whatever classes and methods they resolve against.
93+
* Gets a Java file body testing all requested Models as Data rows against whatever classes and methods they resolve against.
9494
*/
9595
query string getTestCase() {
9696
result =

0 commit comments

Comments
 (0)