diff options
author | Xavier Ducrohet <xav@android.com> | 2012-03-02 13:57:08 -0800 |
---|---|---|
committer | Xavier Ducrohet <xav@android.com> | 2012-03-02 14:19:12 -0800 |
commit | 35803ee3b4362248489db1dd1fc6d483f3c3ee65 (patch) | |
tree | bd26c3f561390247b9af0eac7b26ff3c947d5502 /testapps/basicJar | |
parent | 81c5fb5448a6342cb3bb29ea501fccf95573288c (diff) | |
download | sdk-35803ee3b4362248489db1dd1fc6d483f3c3ee65.zip sdk-35803ee3b4362248489db1dd1fc6d483f3c3ee65.tar.gz sdk-35803ee3b4362248489db1dd1fc6d483f3c3ee65.tar.bz2 |
More fixes to the test projects.
- add eclipse files for a bunch of them
- package name refactoring to match the folder structure somehow (more
need this)
- updated the javaproject to have an extra java project and to have
code that access java resources to test packaging too.
Change-Id: Ie13842c1b891e495e04d8a157a12cac9db13f30e
Diffstat (limited to 'testapps/basicJar')
-rw-r--r-- | testapps/basicJar/.classpath | 6 | ||||
-rw-r--r-- | testapps/basicJar/.project | 17 | ||||
-rw-r--r-- | testapps/basicJar/src/com/android/tests/basicjar/BasicJar.java | 30 | ||||
-rw-r--r-- | testapps/basicJar/src/com/android/tests/basicjar/Foo.java | 16 | ||||
-rw-r--r-- | testapps/basicJar/src/com/android/tests/basicjar/basicJar.txt | 1 |
5 files changed, 54 insertions, 16 deletions
diff --git a/testapps/basicJar/.classpath b/testapps/basicJar/.classpath new file mode 100644 index 0000000..11a4c98 --- /dev/null +++ b/testapps/basicJar/.classpath @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> + <classpathentry kind="output" path="bin/classes"/> +</classpath> diff --git a/testapps/basicJar/.project b/testapps/basicJar/.project new file mode 100644 index 0000000..b7bfb91 --- /dev/null +++ b/testapps/basicJar/.project @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>basicJar</name> + <comment></comment> + <projects> + </projects> + <buildSpec> + <buildCommand> + <name>org.eclipse.jdt.core.javabuilder</name> + <arguments> + </arguments> + </buildCommand> + </buildSpec> + <natures> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/testapps/basicJar/src/com/android/tests/basicjar/BasicJar.java b/testapps/basicJar/src/com/android/tests/basicjar/BasicJar.java new file mode 100644 index 0000000..3347951 --- /dev/null +++ b/testapps/basicJar/src/com/android/tests/basicjar/BasicJar.java @@ -0,0 +1,30 @@ +package com.android.tests.basicjar; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; + +public class BasicJar { + + public static String getContent() { + InputStream input = BasicJar.class.getResourceAsStream("basicJar.txt"); + + BufferedReader reader = null; + try { + reader = new BufferedReader(new InputStreamReader(input, "UTF-8")); + + return reader.readLine(); + } catch (IOException e) { + } finally { + if (reader != null) { + try { + reader.close(); + } catch (IOException e) { + } + } + } + + return "FAILED TO READ CONTENT"; + } +}
\ No newline at end of file diff --git a/testapps/basicJar/src/com/android/tests/basicjar/Foo.java b/testapps/basicJar/src/com/android/tests/basicjar/Foo.java deleted file mode 100644 index 6a9536f..0000000 --- a/testapps/basicJar/src/com/android/tests/basicjar/Foo.java +++ /dev/null @@ -1,16 +0,0 @@ -package com.android.tests.basicjar; - -import java.util.Random; - -public class Foo { - public static int FOO = 42; - - public int getFoo() { - return FOO; - } - - public int getRandomFoo() { - Random r = new Random(System.currentTimeMillis()); - return r.nextInt(FOO); - } -}
\ No newline at end of file diff --git a/testapps/basicJar/src/com/android/tests/basicjar/basicJar.txt b/testapps/basicJar/src/com/android/tests/basicjar/basicJar.txt new file mode 100644 index 0000000..d5a8285 --- /dev/null +++ b/testapps/basicJar/src/com/android/tests/basicjar/basicJar.txt @@ -0,0 +1 @@ +SUCCESS from basicJar.jar
\ No newline at end of file |