summaryrefslogtreecommitdiffstats
path: root/luni/src
diff options
context:
space:
mode:
Diffstat (limited to 'luni/src')
-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
-rw-r--r--luni/src/test/resources/dalvik/system/loading-test.jarbin0 -> 754 bytes
4 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
diff --git a/luni/src/test/resources/dalvik/system/loading-test.jar b/luni/src/test/resources/dalvik/system/loading-test.jar
new file mode 100644
index 0000000..fd6f7de
--- /dev/null
+++ b/luni/src/test/resources/dalvik/system/loading-test.jar
Binary files differ