summaryrefslogtreecommitdiffstats
path: root/test/Java
diff options
context:
space:
mode:
authorGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
committerGreg Noel <GregNoel@tigris.org>2010-03-25 04:14:28 (GMT)
commit22d352500f1cd6bd0c53d788a5dc44a1fefa676e (patch)
tree0984fd581082c27cfbfbb7f94d5751b0e6fd2741 /test/Java
parent75ac32ac8e32076e25b72a19eb56340cc585fa4e (diff)
downloadSCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.zip
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.gz
SCons-22d352500f1cd6bd0c53d788a5dc44a1fefa676e.tar.bz2
Move 2.0 changes collected in branches/pending back to trunk for further
development. Note that this set of changes is NOT backward-compatible; the trunk no longer works with Python 1.5.2, 2.0, or 2.1.
Diffstat (limited to 'test/Java')
-rw-r--r--test/Java/JAR.py13
-rw-r--r--test/Java/JARCHDIR.py3
-rw-r--r--test/Java/JARCOM.py2
-rw-r--r--test/Java/JARCOMSTR.py2
-rw-r--r--test/Java/JARFLAGS.py3
-rw-r--r--test/Java/JAVABOOTCLASSPATH.py3
-rw-r--r--test/Java/JAVACCOM.py2
-rw-r--r--test/Java/JAVACCOMSTR.py2
-rw-r--r--test/Java/JAVACFLAGS.py3
-rw-r--r--test/Java/JAVAH.py8
-rw-r--r--test/Java/JAVAHCOM.py2
-rw-r--r--test/Java/JAVAHCOMSTR.py2
-rw-r--r--test/Java/Java-1.4.py3
-rw-r--r--test/Java/Java-1.5.py3
-rw-r--r--test/Java/Java-1.6.py3
-rw-r--r--test/Java/RMIC.py11
-rw-r--r--test/Java/RMICCOM.py2
-rw-r--r--test/Java/RMICCOMSTR.py2
18 files changed, 30 insertions, 39 deletions
diff --git a/test/Java/JAR.py b/test/Java/JAR.py
index b0b193e..81664dc 100644
--- a/test/Java/JAR.py
+++ b/test/Java/JAR.py
@@ -25,7 +25,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import string
import TestSCons
@@ -89,9 +88,8 @@ line 3
test.write('myjar2.py', r"""
import sys
-import string
f=open(sys.argv[2], 'wb')
-f.write(string.join(sys.argv[1:]))
+f.write(" ".join(sys.argv[1:]))
f.write("\n")
f.close()
sys.exit(0)
@@ -128,11 +126,10 @@ where_jar = test.java_where_jar()
test.write("wrapper.py", """\
import os
-import string
import sys
-open('%s', 'ab').write("wrapper.py %%s\\n" %% string.join(sys.argv[1:]))
-os.system(string.join(sys.argv[1:], " "))
-""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
+open('%s', 'ab').write("wrapper.py %%s\\n" %% " ".join(sys.argv[1:]))
+os.system(" ".join(sys.argv[1:]))
+""" % test.workpath('wrapper.out').replace('\\', '\\\\'))
test.write('SConstruct', """
foo = Environment(tools = ['javac', 'jar'],
@@ -238,7 +235,7 @@ public class Example6
test.run(arguments = '.')
expected_wrapper_out = "wrapper.py %(where_jar)s cf bar.jar classes/com/sub/bar\n"
-expected_wrapper_out = string.replace(expected_wrapper_out, '/', os.sep)
+expected_wrapper_out = expected_wrapper_out.replace('/', os.sep)
test.must_match('wrapper.out',
expected_wrapper_out % locals())
diff --git a/test/Java/JARCHDIR.py b/test/Java/JARCHDIR.py
index e3f22db..d574fe7 100644
--- a/test/Java/JARCHDIR.py
+++ b/test/Java/JARCHDIR.py
@@ -34,7 +34,6 @@ ${TARGET} or ${SOURCE} work.
"""
import os
-import string
import TestSCons
@@ -100,7 +99,7 @@ test.write(['in', 's.class'], "s.class\n")
# env.subst() in the code that handle jar).
p = test.workpath('out')
-for d in string.split(test.workpath('in'), os.sep):
+for d in test.workpath('in').split(os.sep):
p = p + d
test.subdir(p)
p = p + os.sep
diff --git a/test/Java/JARCOM.py b/test/Java/JARCOM.py
index a51ea5a..9d93ba5 100644
--- a/test/Java/JARCOM.py
+++ b/test/Java/JARCOM.py
@@ -41,7 +41,7 @@ import sys
outfile = open(sys.argv[1], 'wb')
for f in sys.argv[2:]:
infile = open(f, 'rb')
- for l in filter(lambda l: l != '/*jar*/\n', infile.readlines()):
+ for l in [l for l in infile.readlines() if l != '/*jar*/\n']:
outfile.write(l)
sys.exit(0)
""")
diff --git a/test/Java/JARCOMSTR.py b/test/Java/JARCOMSTR.py
index 4358f6b..069587f 100644
--- a/test/Java/JARCOMSTR.py
+++ b/test/Java/JARCOMSTR.py
@@ -42,7 +42,7 @@ import sys
outfile = open(sys.argv[1], 'wb')
for f in sys.argv[2:]:
infile = open(f, 'rb')
- for l in filter(lambda l: l != '/*jar*/\n', infile.readlines()):
+ for l in [l for l in infile.readlines() if l != '/*jar*/\n']:
outfile.write(l)
sys.exit(0)
""")
diff --git a/test/Java/JARFLAGS.py b/test/Java/JARFLAGS.py
index 7306426..c0ae627 100644
--- a/test/Java/JARFLAGS.py
+++ b/test/Java/JARFLAGS.py
@@ -25,7 +25,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import string
import TestSCons
@@ -69,7 +68,7 @@ expect = test.wrap_stdout("""\
adding: src/Example1\.class.*
""" % locals())
-expect = string.replace(expect, '/', os.sep)
+expect = expect.replace('/', os.sep)
test.run(arguments = '.',
match=TestSCons.match_re_dotall,
diff --git a/test/Java/JAVABOOTCLASSPATH.py b/test/Java/JAVABOOTCLASSPATH.py
index e448165..6913c6a 100644
--- a/test/Java/JAVABOOTCLASSPATH.py
+++ b/test/Java/JAVABOOTCLASSPATH.py
@@ -30,7 +30,6 @@ on javac compilations.
"""
import os
-import string
import TestSCons
@@ -83,7 +82,7 @@ public class Example2
# we'll just take the easy way out and examine the -n output to see if
# the expected option shows up on the command line.
-bootclasspath = string.join(['dir1', 'dir2'], os.pathsep)
+bootclasspath = os.pathsep.join(['dir1', 'dir2'])
expect = """\
%(where_javac)s -bootclasspath %(bootclasspath)s -d class -sourcepath com com/Example1.java
diff --git a/test/Java/JAVACCOM.py b/test/Java/JAVACCOM.py
index c4eaa92..064feed 100644
--- a/test/Java/JAVACCOM.py
+++ b/test/Java/JAVACCOM.py
@@ -43,7 +43,7 @@ import sys
outfile = open(sys.argv[1], 'wb')
for f in sys.argv[2:]:
infile = open(f, 'rb')
- for l in filter(lambda l: l != '/*javac*/\n', infile.readlines()):
+ for l in [l for l in infile.readlines() if l != '/*javac*/\n']:
outfile.write(l)
sys.exit(0)
""")
diff --git a/test/Java/JAVACCOMSTR.py b/test/Java/JAVACCOMSTR.py
index 23e7dfb..6440283 100644
--- a/test/Java/JAVACCOMSTR.py
+++ b/test/Java/JAVACCOMSTR.py
@@ -46,7 +46,7 @@ import sys
outfile = open(sys.argv[1], 'wb')
for f in sys.argv[2:]:
infile = open(f, 'rb')
- for l in filter(lambda l: l != '/*javac*/\n', infile.readlines()):
+ for l in [l for l in infile.readlines() if l != '/*javac*/\n']:
outfile.write(l)
sys.exit(0)
""")
diff --git a/test/Java/JAVACFLAGS.py b/test/Java/JAVACFLAGS.py
index d86c267..6afd1b9 100644
--- a/test/Java/JAVACFLAGS.py
+++ b/test/Java/JAVACFLAGS.py
@@ -25,7 +25,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import string
import TestSCons
@@ -57,7 +56,7 @@ public class Example1
""")
expected_wrapper_out = "%(where_javac)s -O -d classes -sourcepath src src/Example1.java\n"
-expected_wrapper_out = string.replace(expected_wrapper_out, '/', os.sep)
+expected_wrapper_out = expected_wrapper_out.replace('/', os.sep)
test.run(arguments = '.',
stdout = test.wrap_stdout(expected_wrapper_out % locals()))
diff --git a/test/Java/JAVAH.py b/test/Java/JAVAH.py
index 2518928..f7c9dcc 100644
--- a/test/Java/JAVAH.py
+++ b/test/Java/JAVAH.py
@@ -25,7 +25,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import string
import TestSCons
@@ -105,11 +104,10 @@ if java_version:
test.write("wrapper.py", """\
import os
-import string
import sys
-open('%s', 'ab').write("wrapper.py %%s\\n" %% string.join(sys.argv[1:]))
-os.system(string.join(sys.argv[1:], " "))
-""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
+open('%s', 'ab').write("wrapper.py %%s\\n" %% " ".join(sys.argv[1:]))
+os.system(" ".join(sys.argv[1:]))
+""" % test.workpath('wrapper.out').replace('\\', '\\\\'))
test.write('SConstruct', """
foo = Environment(tools = ['javac', 'javah', 'install'],
diff --git a/test/Java/JAVAHCOM.py b/test/Java/JAVAHCOM.py
index 1030380..9db897a 100644
--- a/test/Java/JAVAHCOM.py
+++ b/test/Java/JAVAHCOM.py
@@ -41,7 +41,7 @@ import sys
outfile = open(sys.argv[1], 'wb')
for f in sys.argv[2:]:
infile = open(f, 'rb')
- for l in filter(lambda l: l != '/*javah*/\n', infile.readlines()):
+ for l in [l for l in infile.readlines() if l != '/*javah*/\n']:
outfile.write(l)
sys.exit(0)
""")
diff --git a/test/Java/JAVAHCOMSTR.py b/test/Java/JAVAHCOMSTR.py
index f318524..f8120d6 100644
--- a/test/Java/JAVAHCOMSTR.py
+++ b/test/Java/JAVAHCOMSTR.py
@@ -52,7 +52,7 @@ import sys
outfile = open(sys.argv[1], 'wb')
for f in sys.argv[2:]:
infile = open(f, 'rb')
- for l in filter(lambda l: l != '/*javah*/\n', infile.readlines()):
+ for l in [l for l in infile.readlines() if l != '/*javah*/\n']:
outfile.write(l)
sys.exit(0)
""")
diff --git a/test/Java/Java-1.4.py b/test/Java/Java-1.4.py
index f0f5a93..9cc1d96 100644
--- a/test/Java/Java-1.4.py
+++ b/test/Java/Java-1.4.py
@@ -21,6 +21,7 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
@@ -361,7 +362,7 @@ def classes_must_match(dir, expect):
def classes_must_not_exist(dir, expect):
global failed
- present = filter(os.path.exists, expect)
+ present = list(filter(os.path.exists, expect))
if present:
sys.stderr.write("Found the following unexpected class files in '%s' after cleaning:\n" % dir)
for c in present:
diff --git a/test/Java/Java-1.5.py b/test/Java/Java-1.5.py
index e769c22..ca9cbce 100644
--- a/test/Java/Java-1.5.py
+++ b/test/Java/Java-1.5.py
@@ -21,6 +21,7 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
@@ -357,7 +358,7 @@ def classes_must_match(dir, expect):
def classes_must_not_exist(dir, expect):
global failed
- present = filter(os.path.exists, expect)
+ present = list(filter(os.path.exists, expect))
if present:
sys.stderr.write("Found the following unexpected class files in '%s' after cleaning:\n" % dir)
for c in present:
diff --git a/test/Java/Java-1.6.py b/test/Java/Java-1.6.py
index d107e32..ec6df54 100644
--- a/test/Java/Java-1.6.py
+++ b/test/Java/Java-1.6.py
@@ -21,6 +21,7 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
+from __future__ import generators ### KEEP FOR COMPATIBILITY FIXERS
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
@@ -357,7 +358,7 @@ def classes_must_match(dir, expect):
def classes_must_not_exist(dir, expect):
global failed
- present = filter(os.path.exists, expect)
+ present = list(filter(os.path.exists, expect))
if present:
sys.stderr.write("Found the following unexpected class files in '%s' after cleaning:\n" % dir)
for c in present:
diff --git a/test/Java/RMIC.py b/test/Java/RMIC.py
index f08186e..f88dd14 100644
--- a/test/Java/RMIC.py
+++ b/test/Java/RMIC.py
@@ -25,7 +25,6 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os
-import string
import TestSCons
@@ -97,14 +96,12 @@ where_rmic = test.java_where_rmic()
test.write("wrapper.py", """\
import os
-import string
import sys
-open('%s', 'ab').write("wrapper.py %%s\\n" %% string.join(sys.argv[1:]))
-os.system(string.join(sys.argv[1:], " "))
-""" % string.replace(test.workpath('wrapper.out'), '\\', '\\\\'))
+open('%s', 'ab').write("wrapper.py %%s\\n" %% " ".join(sys.argv[1:]))
+os.system(" ".join(sys.argv[1:]))
+""" % test.workpath('wrapper.out').replace('\\', '\\\\'))
test.write('SConstruct', """
-import string
foo = Environment(tools = ['javac', 'rmic'],
JAVAC = r'%(where_javac)s',
RMIC = r'%(where_rmic)s')
@@ -120,7 +117,7 @@ bar_classes = bar.Java(target = 'class2', source = 'com/sub/bar')
# XXX This is kind of a Python brute-force way to do what Ant
# does with its "excludes" attribute. We should probably find
# a similar friendlier way to do this.
-bar_classes = filter(lambda c: string.find(str(c), 'Hello') == -1, bar_classes)
+bar_classes = [c for c in bar_classes if str(c).find('Hello') == -1]
bar.RMIC(target = Dir('outdir2'), source = bar_classes)
""" % locals() )
diff --git a/test/Java/RMICCOM.py b/test/Java/RMICCOM.py
index 6bc50da..ba7f965 100644
--- a/test/Java/RMICCOM.py
+++ b/test/Java/RMICCOM.py
@@ -51,7 +51,7 @@ import sys
outfile = open(sys.argv[1], 'wb')
for f in sys.argv[2:]:
infile = open(f, 'rb')
- for l in filter(lambda l: l != '/*rmic*/\n', infile.readlines()):
+ for l in [l for l in infile.readlines() if l != '/*rmic*/\n']:
outfile.write(l)
sys.exit(0)
""")
diff --git a/test/Java/RMICCOMSTR.py b/test/Java/RMICCOMSTR.py
index 8981ed7..8fe535a 100644
--- a/test/Java/RMICCOMSTR.py
+++ b/test/Java/RMICCOMSTR.py
@@ -52,7 +52,7 @@ import sys
outfile = open(sys.argv[1], 'wb')
for f in sys.argv[2:]:
infile = open(f, 'rb')
- for l in filter(lambda l: l != '/*rmic*/\n', infile.readlines()):
+ for l in [l for l in infile.readlines() if l != '/*rmic*/\n']:
outfile.write(l)
sys.exit(0)
""")