You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2019/01/11 19:07:28 UTC

[groovy] branch master updated: Add a test to reproduce "GROOVY-7812: Static inner classes cannot be accessed from other files when running by 'groovy' command"

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 20d895a  Add a test to reproduce "GROOVY-7812: Static inner classes cannot be accessed from other files when running by 'groovy' command"
20d895a is described below

commit 20d895aec59a813a1f9f022df834bf047d0a960c
Author: Daniel Sun <su...@apache.org>
AuthorDate: Sat Jan 12 03:07:03 2019 +0800

    Add a test to reproduce "GROOVY-7812: Static inner classes cannot be accessed from other files when running by 'groovy' command"
---
 .../groovy/bugs/groovy7812/Main.groovy             | 22 ++++++++++++++++
 .../groovy/bugs/groovy7812/Outer.groovy            | 24 +++++++++++++++++
 src/test/groovy/bugs/Groovy7812Bug.groovy          | 30 ++++++++++++++++++++++
 3 files changed, 76 insertions(+)

diff --git a/src/test-resources/groovy/bugs/groovy7812/Main.groovy b/src/test-resources/groovy/bugs/groovy7812/Main.groovy
new file mode 100644
index 0000000..4242743
--- /dev/null
+++ b/src/test-resources/groovy/bugs/groovy7812/Main.groovy
@@ -0,0 +1,22 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs.groovy7812
+
+assert new Outer()
+assert new Outer.Inner()
diff --git a/src/test-resources/groovy/bugs/groovy7812/Outer.groovy b/src/test-resources/groovy/bugs/groovy7812/Outer.groovy
new file mode 100644
index 0000000..ec2103b
--- /dev/null
+++ b/src/test-resources/groovy/bugs/groovy7812/Outer.groovy
@@ -0,0 +1,24 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs.groovy7812
+
+class Outer {
+    static class Inner {
+    }
+}
\ No newline at end of file
diff --git a/src/test/groovy/bugs/Groovy7812Bug.groovy b/src/test/groovy/bugs/Groovy7812Bug.groovy
new file mode 100644
index 0000000..2960af6
--- /dev/null
+++ b/src/test/groovy/bugs/Groovy7812Bug.groovy
@@ -0,0 +1,30 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package groovy.bugs
+
+import org.codehaus.groovy.tools.GroovyStarter
+import org.junit.Ignore
+
+@Ignore('To be fixed')
+class Groovy7812Bug extends GroovyTestCase {
+    void test() {
+        def mainScriptPath = new File(this.getClass().getResource('/groovy/bugs/groovy7812/Main.groovy').toURI()).absolutePath
+        new GroovyStarter().main(["--main", "groovy.ui.GroovyMain", mainScriptPath] as String[])
+    }
+}