Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Painless: Add public member read/write access test. #28156

Merged
merged 1 commit into from
Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
public class FeatureTest {
private int x;
private int y;
public int z;

/** empty ctor */
public FeatureTest() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class org.elasticsearch.index.mapper.IpFieldMapper$IpFieldType$IpScriptDocValues
# for testing.
# currently FeatureTest exposes overloaded constructor, field load store, and overloaded static methods
class org.elasticsearch.painless.FeatureTest only_fqn {
int z
()
(int,int)
int getX()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,9 @@ public void testPrimitivesHaveMethods() {
assertEquals("5", exec("int x = 5; return x.toString();"));
assertEquals(0, exec("int x = 5; return x.compareTo(5);"));
}

public void testPublicMemberAccess() {
assertEquals(5, exec("org.elasticsearch.painless.FeatureTest ft = new org.elasticsearch.painless.FeatureTest();" +
"ft.z = 5; return ft.z;"));
}
}