Ejemplo n.º 1
0
"""

"""

import support

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

support.runJava("test253c", classpath="jpywork")
Ejemplo n.º 2
0
"""

"""

import support

support.compileJPythonc("test194c.py",
                        jar="test194.jar",
                        core=1,
                        package="foo.bar",
                        output="test194.err")
Ejemplo n.º 3
0
"""

"""

import support

support.compileJPythonc("test169c.py",
                        core=1,
                        jar="test169c.jar",
                        output="test169.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 4
0
"""

"""

import support

support.compileJPythonc("test192c.py", jar="test192.jar", core=1, output="test192.err")

Ejemplo n.º 5
0
"""

"""

import support

support.compileJPythonc("test190c.py", output="test190.err")

if support.grep("jpywork/test190c.java", "SubDate extends .*Date", count=1) != 1:
   raise support.TestError("SubDate should extends java.util.Date")
Ejemplo n.º 6
0
"""

import support

f = open("test257s1.py", "w")
f.write("""
import java, sys
class test257s1(java.lang.Object):
   pass

foo = 1
""")
f.close()

support.compileJPythonc("test257s1.py", output="test255s1.err")

import os
os.remove("test257s1.py")

import sys, types
sys.path[:0] = ['jpywork']

import test257s1

if type(test257s1) != types.ModuleType:
    raise support.TestWarning, "a compiled module should still be a module"


if type(test257s1.test257s1) != types.ClassType:
    raise support.TestError, "a compiled class should still be a class"
Ejemplo n.º 7
0
"""

"""

import support

support.compileJPythonc("test186a.py",
                        core=1,
                        package="com.mycompany.mypackage",
                        jar="test186.jar",
                        output="test186.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 8
0
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")
Ejemplo n.º 9
0
"""

"""

import support

support.compileJPythonc("test185a.py",
                        core=1,
                        jar="test185.jar",
                        output="test185.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 10
0
"""
[ #451746 ] jythonc --deep jpy$packages problem

"""

import support

support.compileJPythonc("test341c1.py", deep=1, output="test341.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 11
0
import support

support.compileJava("classes/test246p/test246j.java")

support.compileJPythonc("test246c.py", package="test246p", output="test246.err")


#
# This will f**k up the remaining tests if this test is aborted midways.
#
import sys
sys.path[:0] = ["jpywork"]

# make the test246 a package. Hmm.
open("jpywork/test246p/__init__.py", "w").close()

from test246c import testStatic
#from test246p.test246c import testStatic

v = testStatic.staticMethode('test')
if v != "staticMethode called in testStaticBase":
   raise support.TestError, "wrong result #1: %s" % v

t=testStatic()

v = t.staticMethode('test')
if v != "staticMethode called in testStaticBase":
   raise support.TestError, "wrong result #2: %s" % v

v = t.notStaticMethode('test')
Ejemplo n.º 12
0
import support

support.compileJPythonc("test237m2.py", output="test237.err", deep=1)

Ejemplo n.º 13
0
"""

"""

import support

import test228s

support.compileJPythonc("test228s.py", deep=1, output="test228.err")

support.runJava("test228s", classpath="jpywork")
Ejemplo n.º 14
0
"""

"""

import support

support.compileJPythonc("test254c.py", deep=1, core=1, jar="test254.jar", output="test254.err")

Ejemplo n.º 15
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")
Ejemplo n.º 16
0
"""

"""

import support

support.compileJPythonc("test187c.py", output="test187.err")

Ejemplo n.º 17
0
"""

"""

import support

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

support.runJava("test249c", classpath="jpywork")
Ejemplo n.º 18
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")



Ejemplo n.º 19
0
"""

"""

import support

support.compileJPythonc("test199c.py", deep=1, output="test199.err")

support.runJava("test199c", classpath="jpywork")
Ejemplo n.º 20
0
"""

"""

import support

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

support.runJava("test255s2", classpath="jpywork")
Ejemplo n.º 21
0
"""

"""

import support

support.compileJPythonc("test185a.py", core=1, jar="test185.jar", output="test185.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 22
0
"""

"""

import support

support.compileJPythonc("test256a.py",
                        core=1,
                        jar="test256.jar",
                        output="test256.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 23
0
"""

"""

import support

support.compileJPythonc("test193c.py", jar="test193.jar", core=1, output="test193.err")

Ejemplo n.º 24
0
"""

"""

import support

support.compileJPythonc("test184s1.py", "test184s2.py", deep=1, output="test184.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 25
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")

Ejemplo n.º 26
0
"""

"""

import support

try:
   import test224s
except SyntaxError:
   pass
else:
   raise support.TestError('Should raise SyntaxError #1')

ret = support.compileJPythonc("test224s.py", output="test224.err",
                              expectError=1)

if ret == 0:
   raise support.TestError('Should raise SyntaxError #2')
 
Ejemplo n.º 27
0
import java
class test260s1(java.util.Vector):
   def foo(self):
       pass

class P(java.awt.Panel):
   pass

class foo:
   pass

""")
f.close()

support.compileJPythonc("test260s1.py", output="test260.err")



import os
os.remove("test260s1.py")

import sys, types
sys.path[:0] = ['jpywork']

import test260s1

#print dir(test260s1)
#print test260s1.P, type(test260s1.P)
#print test260s1.foo, type(test260s1.foo)
Ejemplo n.º 28
0
"""
[ #449956 ] jythonc 2.1a3 --package problem

"""

import support

support.compileJPythonc("test339c.py", package="test339p", output="test339.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 29
0
"""

"""

import support

support.compileJPythonc("test218c.py", output="test218.err")

support.runJava("test218c", classpath="jpywork")
Ejemplo n.º 30
0
"""

"""

import support

support.compileJPythonc("test214a.py", core=1, jar="test214.jar", output="test214.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 31
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)


Ejemplo n.º 32
0
"""

"""

import support

try:
    import test222s
except SyntaxError:
    pass
else:
    raise support.TestError('Should raise SyntaxError #1')

ret = support.compileJPythonc("test222s.py",
                              output="test222.err",
                              expectError=1)

if ret == 0:
    raise support.TestError('Should raise SyntaxError #2')
Ejemplo n.º 33
0
if ret != 42:
    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:
Ejemplo n.º 34
0
"""

"""

import support

support.compileJPythonc("test190c.py", output="test190.err")

if support.grep("jpywork/test190c.java", "SubDate extends .*Date",
                count=1) != 1:
    raise support.TestError("SubDate should extends java.util.Date")
Ejemplo n.º 35
0
"""

"""

import support

support.compileJPythonc("test272c.py", core=1, jar="test27c.jar", output="test272.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 36
0
"""

"""

import support

support.compileJPythonc("test297c.py", output="test297.err")

if support.grep("jpywork/test297c.java",
             r'TestFactory extends .*HTMLFactory', count=1) != 1:
    raise support.TestError('Subclassing an inner class should be possible')
Ejemplo n.º 37
0
"""

"""

import support

support.compileJPythonc("test226c.py", output="test226.err")

support.runJava("test226c", classpath="jpywork")
Ejemplo n.º 38
0
"""

"""

import support

support.compileJPythonc("test201c.py", jar="test201.jar", core=1, package="foo.bar",output="test201.err")

Ejemplo n.º 39
0
"""

"""

import support

support.compileJPythonc("test199c.py", deep=1, output="test199.err")

support.runJava("test199c", classpath="jpywork")
Ejemplo n.º 40
0
"""

"""

import support

support.compileJPythonc("test254c.py",
                        deep=1,
                        core=1,
                        jar="test254.jar",
                        output="test254.err")
Ejemplo n.º 41
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)
Ejemplo n.º 42
0
"""

"""

import support

support.compileJPythonc("test169c.py", core=1, jar="test169c.jar", output="test169.err")

#raise support.TestError("" + `x`)
Ejemplo n.º 43
0
"""

"""

import support

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

support.runJava("test249c", classpath="jpywork")
Ejemplo n.º 44
0
import java
class test260s1(java.util.Vector):
   def foo(self):
       pass

class P(java.awt.Panel):
   pass

class foo:
   pass

"""
)
f.close()

support.compileJPythonc("test260s1.py", output="test260.err")


import os

os.remove("test260s1.py")

import sys, types

sys.path[:0] = ["jpywork"]

import test260s1

# print dir(test260s1)
# print test260s1.P, type(test260s1.P)
# print test260s1.foo, type(test260s1.foo)
Ejemplo n.º 45
0
"""

"""

import support

support.compileJPythonc("test189c.py", output="test189.err")

if support.grep("jpywork/test189c.java", r'makeClass\("test189c".* test189c.class\)', count=1) != 1:
    raise support.TestError("test189c should use test189c.class as proxy")

if support.grep("jpywork/test189c.java", r'makeClass\("test189c2".* test189c2.class\)', count=1) != 1:
    raise support.TestError("test189c2 should use test189c.class as proxy")
Ejemplo n.º 46
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")
Ejemplo n.º 47
0
"""
[ 508111 ] jythonc generates invalid statements
"""

import support

support.compileJPythonc("test365c.py", output="test365.err")

#raise support.TestWarning('A test of TestWarning. It is not an error')
Ejemplo n.º 48
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")
Ejemplo n.º 49
0
"""
[ #451746 ] jythonc --deep jpy$packages problem

"""

import support

support.compileJPythonc("test341c1.py", deep=1 , output="test341.err")

#raise support.TestError("" + `x`)