File: test386.py

package info (click to toggle)
jython 2.5.3-3%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 43,404 kB
  • ctags: 105,521
  • sloc: python: 351,322; java: 216,346; xml: 1,547; sh: 330; perl: 124; ansic: 102; makefile: 101
file content (37 lines) | stat: -rw-r--r-- 1,007 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
Test the standalone starting (java -jar jython.jar some.py)
"""

import support
import sys
import os

import support_config as cfg

from java.io import File

TESTDIR = "test386jar"
JYTHON_DEV_JAR = "jython-dev.jar"
TEST_PY_NAME = TESTDIR +"/test386called.py"

def checkTestDir():
  if not os.path.exists(TESTDIR):
    raise AssertionError, TESTDIR + " does not exist"
  if not os.path.exists(TEST_PY_NAME):
    raise AssertionError, TEST_PY_NAME + " does not exist"
    
# create a jython standalone jar file:
# add the contents of jython-dev.jar and /Lib files to a new jython-dev.jar
def mkjar():
  jarFile = File(TESTDIR, JYTHON_DEV_JAR)
  jarPacker = support.JarPacker(jarFile)
  jarPacker.addJarFile(File(cfg.jython_home + "/%s" % JYTHON_DEV_JAR))
  jarPacker.addDirectory(File(cfg.jython_home + "/Lib"))
  jarPacker.close()
  return jarFile


checkTestDir()
mkjar()
jarFileName = "%s/%s" % (TESTDIR, JYTHON_DEV_JAR)
support.runJavaJar(jarFileName, TEST_PY_NAME)