summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDwayne Boone <dwayne@zeroc.com>2009-04-27 15:49:43 -0230
committerDwayne Boone <dwayne@zeroc.com>2009-04-27 15:49:43 -0230
commitda70a70f566d97bd1db90c5791e0e74477e12a5f (patch)
treeecd5d7f3a39da44d142fe7653aaa4ffa679891cc
parentBug 3138 - remove object adapter map (diff)
downloadice-da70a70f566d97bd1db90c5791e0e74477e12a5f.tar.bz2
ice-da70a70f566d97bd1db90c5791e0e74477e12a5f.tar.xz
ice-da70a70f566d97bd1db90c5791e0e74477e12a5f.zip
Bug 3917 - added list-generated test
-rwxr-xr-xjava/allTests.py1
-rw-r--r--java/test/Slice/generation/.gitignore1
-rw-r--r--java/test/Slice/generation/File1.ice19
-rw-r--r--java/test/Slice/generation/File2.ice19
-rw-r--r--java/test/Slice/generation/list-generated.out33
-rwxr-xr-xjava/test/Slice/generation/run.py49
6 files changed, 122 insertions, 0 deletions
diff --git a/java/allTests.py b/java/allTests.py
index 452280c9c36..ce66a6a833a 100755
--- a/java/allTests.py
+++ b/java/allTests.py
@@ -29,6 +29,7 @@ from scripts import *
# List of all basic tests.
#
tests = [
+ ("Slice/generation", ["once"]),
("Slice/keyword", ["once"]),
("IceUtil/inputUtil", ["once"]),
("Ice/proxy", ["core"]),
diff --git a/java/test/Slice/generation/.gitignore b/java/test/Slice/generation/.gitignore
new file mode 100644
index 00000000000..90b07e9d451
--- /dev/null
+++ b/java/test/Slice/generation/.gitignore
@@ -0,0 +1 @@
+classes
diff --git a/java/test/Slice/generation/File1.ice b/java/test/Slice/generation/File1.ice
new file mode 100644
index 00000000000..a39f65740f6
--- /dev/null
+++ b/java/test/Slice/generation/File1.ice
@@ -0,0 +1,19 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+[["java:package:test.Slice.generation"]]
+module Test
+{
+
+interface Interface1
+{
+ void method();
+};
+
+};
diff --git a/java/test/Slice/generation/File2.ice b/java/test/Slice/generation/File2.ice
new file mode 100644
index 00000000000..a5de7878ea5
--- /dev/null
+++ b/java/test/Slice/generation/File2.ice
@@ -0,0 +1,19 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+[["java:package:test.Slice.generation"]]
+module Test
+{
+
+interface Interface2
+{
+ void method();
+};
+
+};
diff --git a/java/test/Slice/generation/list-generated.out b/java/test/Slice/generation/list-generated.out
new file mode 100644
index 00000000000..afa35770456
--- /dev/null
+++ b/java/test/Slice/generation/list-generated.out
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<generated>
+ <source name="File1.ice">
+ <file name="classes/test/Slice/generation/Test/_Interface1Operations.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface1OperationsNC.java"/>
+ <file name="classes/test/Slice/generation/Test/_Marker.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface1.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface1Holder.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface1PrxHolder.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface1PrxHelper.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface1Prx.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface1Del.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface1DelM.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface1DelD.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface1Disp.java"/>
+ <output></output>
+ </source>
+ <source name="File2.ice">
+ <file name="classes/test/Slice/generation/Test/_Interface2Operations.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface2OperationsNC.java"/>
+ <file name="classes/test/Slice/generation/Test/_Marker.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface2.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface2Holder.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface2PrxHolder.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface2PrxHelper.java"/>
+ <file name="classes/test/Slice/generation/Test/Interface2Prx.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface2Del.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface2DelM.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface2DelD.java"/>
+ <file name="classes/test/Slice/generation/Test/_Interface2Disp.java"/>
+ <output></output>
+ </source>
+</generated>
diff --git a/java/test/Slice/generation/run.py b/java/test/Slice/generation/run.py
new file mode 100755
index 00000000000..52857bf95b1
--- /dev/null
+++ b/java/test/Slice/generation/run.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+# **********************************************************************
+#
+# Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+import os, sys, re
+
+path = [ ".", "..", "../..", "../../..", "../../../.." ]
+head = os.path.dirname(sys.argv[0])
+if len(head) > 0:
+ path = [os.path.join(head, p) for p in path]
+path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ]
+if len(path) == 0:
+ raise "can't find toplevel os.getcwd()!"
+sys.path.append(os.path.join(path[0]))
+from scripts import *
+
+print "testing list-generated...",
+
+slice2java = os.path.join(TestUtil.getCppBinDir(), "slice2java")
+if not os.path.exists("classes"):
+ os.mkdir("classes")
+
+command = slice2java + " --list-generated --output-dir classes File1.ice File2.ice"
+stdin, stdout, stderr = os.popen3(command)
+lines1 = stdout.readlines()
+lines2 = open(os.path.join(os.getcwd(), "list-generated.out"), "r").readlines()
+if len(lines1) != len(lines2):
+ print "failed!"
+ sys.exit(1)
+
+i = 0
+while i < len(lines1):
+ line1 = lines1[i].strip()
+ line2 = lines2[i].strip()
+ if line1 != line2:
+ print "failed!"
+ sys.exit(1)
+ i = i + 1
+else:
+ print "ok"
+
+TestUtil.cleanup()
+sys.exit(0)