summaryrefslogtreecommitdiffstats
path: root/luni/src/test/etc/loading-test-jar
diff options
context:
space:
mode:
authorDan Bornstein <danfuzz@android.com>2011-01-11 15:27:41 -0800
committerDan Bornstein <danfuzz@android.com>2011-01-11 15:27:41 -0800
commitbd376ac95341920be51709e97789177159f04e5f (patch)
tree4413467ee6ca5db1b29905c4ccb855e09493c303 /luni/src/test/etc/loading-test-jar
parenta28b4cea38c9ea8e710404bb1e7593c8ca7ad5cd (diff)
downloadlibcore-bd376ac95341920be51709e97789177159f04e5f.zip
libcore-bd376ac95341920be51709e97789177159f04e5f.tar.gz
libcore-bd376ac95341920be51709e97789177159f04e5f.tar.bz2
Add a dex-containing jar file to the luni test resources.
This is meant to be used in the class loading tests. This change doesn't include any such tests, but they'll be coming soon! Change-Id: Ic02a9d0faa572745d1485d6b5c83e70303b31abb
Diffstat (limited to 'luni/src/test/etc/loading-test-jar')
-rw-r--r--luni/src/test/etc/loading-test-jar/README.txt8
-rw-r--r--luni/src/test/etc/loading-test-jar/Test1.java26
-rwxr-xr-xluni/src/test/etc/loading-test-jar/build.sh27
3 files changed, 61 insertions, 0 deletions
diff --git a/luni/src/test/etc/loading-test-jar/README.txt b/luni/src/test/etc/loading-test-jar/README.txt
new file mode 100644
index 0000000..d3afb1d
--- /dev/null
+++ b/luni/src/test/etc/loading-test-jar/README.txt
@@ -0,0 +1,8 @@
+This directory contains the source code for the loading-test.jar file,
+which is included as a resource in the luni tests. It is used for
+testing the various class loaders.
+
+The Android build system doesn't support dynamically producing
+resources in any sane way. To update the resource, use the script
+build.sh in this directory, and then copy the resulting jar file into
+the luni test resources directory.
diff --git a/luni/src/test/etc/loading-test-jar/Test1.java b/luni/src/test/etc/loading-test-jar/Test1.java
new file mode 100644
index 0000000..f91aa6c
--- /dev/null
+++ b/luni/src/test/etc/loading-test-jar/Test1.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package test;
+
+/**
+ * Class used as part of the class loading tests.
+ */
+public class Test1 {
+ static public String test() {
+ return "blort";
+ }
+}
diff --git a/luni/src/test/etc/loading-test-jar/build.sh b/luni/src/test/etc/loading-test-jar/build.sh
new file mode 100755
index 0000000..f14f27e
--- /dev/null
+++ b/luni/src/test/etc/loading-test-jar/build.sh
@@ -0,0 +1,27 @@
+#!/bin/bash -e
+#
+# Copyright (C) 2011 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+rm -rf classes
+rm -rf classes.dex
+rm -rf loading-test.jar
+
+mkdir classes
+javac -d classes *.java
+dx --dex --output=classes.dex classes
+jar cf loading-test.jar classes.dex
+
+rm -rf classes
+rm -rf classes.dex