Beispiel #1
0
"""

"""

import support

support.compileJPythonc("test249c.py",
                        jar="test249.jar",
                        core=1,
                        output="test249.err")

support.runJava("test249c", classpath="jpywork")
Beispiel #2
0
"""
[ #489836 ] Private names is not mangled
"""

import support

support.compileJPythonc("test345c.py", jar="test345.jar", core=1,
                        output="test345.out")
support.runJava("-jar test345.jar")
Beispiel #3
0
import support

support.compileJava("test245j.java")

# import test245j
# test245j.main([])

support.runJava("test245j", classpath=".")
Beispiel #4
0
"""
Basic test, just raises an TestError
"""

import support
support.compileJPythonc("test315c.py", output="test315.err",
                        jar="test315.jar", core=1)
support.runJava("test315c", classpath="test315.jar")



Beispiel #5
0
"""

"""

import support

support.compileJPythonc("test281c.py", core=1, jar="test281c.jar", output="test281.err")
support.runJava("test281c", classpath="test281c.jar")

# raise support.TestError("" + `x`)
Beispiel #6
0
"""
[ #475445 ] incompatibility with python

Check comment handling when reading source from stdin.
"""

import support

support.runJava("org.python.util.jython -S < test329s1.py > test329.out")
support.runJava("org.python.util.jython -S < test329s2.py > test329.out")
support.runJava("org.python.util.jython -S < test329s3.py > test329.out")
Beispiel #7
0
support.runJython("test333s3.py",
                  output="test333s3.out",
                  error="test333s3.err",
                  expectError=1)
check("test333s3.out", ["myfunc\n"])
check("test333s3.err", [
    'Traceback (innermost last):\n',
    '  File "test333s3.py", line 8, in ?\n',
    'Exc\n',
])

# Different exit situations in compiled applications.

support.compileJPythonc("test333s1.py", output="test333s1.err")
support.runJava("test333s1", classpath="jpywork", output="test333s1.out")
check("test333s1.out", ["myfunc\n"])

support.compileJPythonc("test333s1.py", output="test333s3.err")
support.runJava("test333s1", classpath="jpywork", output="test333s1.out")
check("test333s1.out", ["myfunc\n"])

support.compileJPythonc("test333s3.py", output="test333s3.err")
support.runJava("test333s3",
                classpath="jpywork",
                output="test333s3.out",
                error="test333s3.err",
                expectError=1)
check("test333s3.out", ["myfunc\n"])
f = open("test333s3.err")
lines = f.readlines()
Beispiel #8
0
"""
[ #434324 ] jythonc -A and dead java vars
"""

import support

support.compileJava("classes/test301p/B.java")
support.compileJava("classes/test301p/A.java")
support.compileJPythonc("test301c.py", jar="test301.jar", core=1,
                                       addpackages="test301p",
                                       output="test301.err")

support.runJava("test301c", classpath="test301.jar", output="test301c.err")

Beispiel #9
0
"""

"""

import os
import support
support.compileJava("classes/test217p/test217i.java")

support.compileJPythonc("test217c.py", output="test217.err")
support.compileJava("test217t.java", classpath="jpywork")
support.runJava("test217t", classpath="jpywork" + os.pathsep + ".")
Beispiel #10
0

import support

support.compileJava("test245j.java")

#import test245j
#test245j.main([])

support.runJava("test245j", classpath=".")

Beispiel #11
0
"""
Test that non-public classes gets loaded with dir() when respectJavaAcc is
false.
Feature request [ #428582 ] Access to non-public classes
"""

import support

support.runJava("org.python.util.jython " +
                "-Dpython.security.respectJavaAccessibility=false test304m.py", pass_jython_home=1)

Beispiel #12
0
"""
[ #489836 ] Private names is not mangled
"""

import support

support.compileJPythonc("test345c.py",
                        jar="test345.jar",
                        core=1,
                        output="test345.out")
support.runJava("-jar test345.jar")
Beispiel #13
0
"""
Test sys.path import when a security profile prevents
creating classloaders.
"""

import support, java

support.compileJava("classes/test292j.java")

home = java.lang.System.getProperty("python.home")
cmd = """\
-Djava.security.manager -Djava.security.policy=test292.policy \
-Dpython.home=%s test292j""" % home

support.runJava(cmd)

Beispiel #14
0
"""

"""

import support

support.compileJava("classes/test288j.java")

support.compileJPythonc("test289c.py", output="test289.err")
support.runJava("test289c", classpath="jpywork", pass_jython_home=1)
Beispiel #15
0
"""
Test that non-public classes gets loaded with dir() when respectJavaAcc is
false.
Feature request [ #428582 ] Access to non-public classes
"""

import support

support.runJava("org.python.util.jython " +
                "-Dpython.security.respectJavaAccessibility=false test304m.py",
                pass_jython_home=1)
Beispiel #16
0
"""

"""

import support

support.compileJPythonc("test227c.py", output="test227.err")

support.runJava("test227c", classpath="jpywork", output="test227.out")
Beispiel #17
0
"""

"""

import support

support.compileJPythonc("test253c.py", deep=1, output="test253.err")

support.runJava("test253c", classpath="jpywork")
Beispiel #18
0
"""
[ #480390 ] main() does not throw exceptions
"""

import support

support.compileJPythonc("test340c.py", core=1, jar="test340.jar",
                        output="test340.err")
support.compileJava("test340j.java")

rc = support.runJava("test340j", classpath=".", expectError=1)
if rc != 42:
     support.TestError("Did not catch exception correctly %d" % rc)


Beispiel #19
0
"""
[ #475445 ] incompatibility with python

Check comment handling when reading source from stdin.
"""

import support

support.runJava("org.python.util.jython -S < test329s1.py > test329.out")
support.runJava("org.python.util.jython -S < test329s2.py > test329.out")
support.runJava("org.python.util.jython -S < test329s3.py > test329.out")

Beispiel #20
0
    raise support.TestError("Return code was wrong: %d" % ret)
check("test333s2.out", [ "myfunc\n" ])

support.runJython("test333s3.py",
        output="test333s3.out", error="test333s3.err", expectError=1)
check("test333s3.out", [ "myfunc\n" ])
check("test333s3.err", [
    'Traceback (innermost last):\n',
    '  File "test333s3.py", line 8, in ?\n',
    'Exc\n',
])

# Different exit situations in compiled applications.

support.compileJPythonc("test333s1.py", output="test333s1.err")
support.runJava("test333s1", classpath="jpywork", output="test333s1.out")
check("test333s1.out", [ "myfunc\n" ])

support.compileJPythonc("test333s1.py", output="test333s3.err")
support.runJava("test333s1", classpath="jpywork", output="test333s1.out")
check("test333s1.out", [ "myfunc\n" ])

support.compileJPythonc("test333s3.py", output="test333s3.err")
support.runJava("test333s3", classpath="jpywork", output="test333s3.out",
                error="test333s3.err", expectError=1)
check("test333s3.out", [ "myfunc\n" ])
f = open("test333s3.err")
lines = f.readlines();
f.close()
if "Exc\n" not in lines:
    raise support.TestError("Should raise a 'Exc' exception")
Beispiel #21
0
"""

"""

import support

support.compileJPythonc("test281c.py",
                        core=1,
                        jar="test281c.jar",
                        output="test281.err")
support.runJava("test281c", classpath="test281c.jar")

#raise support.TestError("" + `x`)
Beispiel #22
0
"""
[ #480017 ] Proxy supers are loaded from syspath
Running test338j will throw a ClassCastException if a proxy's superclass is loaded
by the syspath classloader.
"""

import support

support.compileJava("test338cl.java", classpath=".")
support.compileJava("test338j1.java", classpath=".")
support.compileJava("test338j.java", classpath=".")

support.runJava("test338j", classpath=".")

Beispiel #23
0
"""
[ #448485 ] Tuple unpacking raises KeyError
"""

import support

import string
s = "elem1 elem2"
try:
   (a, b, c) = string.split(s)
except ValueError:
   pass
else:
   print support.TestError("Should raise a ValueError")

support.compileJPythonc("test314c.py", output="test314.err",
                        jar="test314.jar", core=1)
support.runJava("test314c", classpath="test314.jar")

Beispiel #24
0
"""
[ #480390 ] main() does not throw exceptions
"""

import support

support.compileJPythonc("test340c.py",
                        core=1,
                        jar="test340.jar",
                        output="test340.err")
support.compileJava("test340j.java")

rc = support.runJava("test340j", classpath=".", expectError=1)
if rc != 42:
    support.TestError("Did not catch exception correctly %d" % rc)
Beispiel #25
0
"""

"""

import support

support.compileJPythonc("test255s1.py", output="test255s1.err")
support.compileJPythonc("test255s2.py", output="test255s2.err", keep=1)

support.runJava("test255s2", classpath="jpywork")
Beispiel #26
0
"""

"""

import support

support.compileJava("classes/test182j.java")

support.compileJPythonc("test182c.py", core=1, jar="test182c.jar", output="test182.err")
support.runJava("test182c", classpath="test182c.jar")

#raise support.TestError("" + `x`)
Beispiel #27
0
"""
[ 631017 ] Private fields mismangled
"""

import support

support.compileJPythonc("test375c.py", output="test375.err",
                        jar="test375.jar", core=1)
support.runJava("test375c", classpath="test375.jar")
Beispiel #28
0
"""
[ #434324 ] jythonc -A and dead java vars
"""

import support

support.compileJava("classes/test301p/B.java")
support.compileJava("classes/test301p/A.java")
support.compileJPythonc("test301c.py",
                        jar="test301.jar",
                        core=1,
                        addpackages="test301p",
                        output="test301.err")

support.runJava("test301c", classpath="test301.jar", output="test301c.err")