diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..56fb545fa --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +build.properties diff --git a/.project b/.project index 00d97a63a..7c0afa57a 100644 --- a/.project +++ b/.project @@ -30,4 +30,11 @@ com.android.ide.eclipse.adt.AndroidNature org.eclipse.jdt.core.javanature + + + build.xml + 1 + /home/bpellin/src/workspace/KeePassDroid/build.xml + + diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 000000000..edfcb72f1 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1 @@ +[^.] diff --git a/build.xml b/build.xml new file mode 100644 index 000000000..ba4bbe329 --- /dev/null +++ b/build.xml @@ -0,0 +1,313 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Creating output directories if needed... + + + + + + + Generating R.java / Manifest.java from the resources... + + + + + + + + + + + + + + + + + Compiling aidl files into Java classes... + + + + + + + + + + + + + + + + + + + + + Converting compiled files and external libraries into ${outdir}/${dex-file}... + + + + + + + + + + + Packaging resources and assets... + + + + + + + + + + + + + + + + + + + Packaging resources... + + + + + + + + + + + + + + + + + + + + + + + + + + Packaging ${out-debug-package}, and signing it with a debug key... + + + + + + + + + + + + + + + + + + Packaging ${out-unsigned-package} for release... + + + + + + + + + + + + + + + It will need to be signed with jarsigner before being published. + + + + + Installing ${out-debug-package} onto default emulator... + + + + + + + + + Installing ${out-debug-package} onto default emulator... + + + + + + + + + + + Uninstalling ${application-package} from the default emulator... + + + + + + + + + Building and installing tests.. + + + + + + + + + + + + diff --git a/libs/.gitignore b/libs/.gitignore new file mode 100644 index 000000000..edfcb72f1 --- /dev/null +++ b/libs/.gitignore @@ -0,0 +1 @@ +[^.] diff --git a/tests/.classpath b/tests/.classpath new file mode 100644 index 000000000..f7a656193 --- /dev/null +++ b/tests/.classpath @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/tests/.gitignore b/tests/.gitignore new file mode 100644 index 000000000..56fb545fa --- /dev/null +++ b/tests/.gitignore @@ -0,0 +1 @@ +build.properties diff --git a/tests/.project b/tests/.project new file mode 100644 index 000000000..bed5ba0be --- /dev/null +++ b/tests/.project @@ -0,0 +1,33 @@ + + + KeePassDroidTests + + + + + + com.android.ide.eclipse.adt.ResourceManagerBuilder + + + + + com.android.ide.eclipse.adt.PreCompilerBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + com.android.ide.eclipse.adt.ApkBuilder + + + + + + com.android.ide.eclipse.adt.AndroidNature + org.eclipse.jdt.core.javanature + + diff --git a/tests/AndroidManifest.xml b/tests/AndroidManifest.xml new file mode 100644 index 000000000..64d795e07 --- /dev/null +++ b/tests/AndroidManifest.xml @@ -0,0 +1,11 @@ + + + + + + + + \ No newline at end of file diff --git a/tests/bin/.gitignore b/tests/bin/.gitignore new file mode 100644 index 000000000..edfcb72f1 --- /dev/null +++ b/tests/bin/.gitignore @@ -0,0 +1 @@ +[^.] diff --git a/tests/res/drawable/icon.png b/tests/res/drawable/icon.png new file mode 100644 index 000000000..75024841d Binary files /dev/null and b/tests/res/drawable/icon.png differ diff --git a/tests/res/layout/main.xml b/tests/res/layout/main.xml new file mode 100644 index 000000000..3a5f117d3 --- /dev/null +++ b/tests/res/layout/main.xml @@ -0,0 +1,12 @@ + + + + diff --git a/tests/res/values/strings.xml b/tests/res/values/strings.xml new file mode 100644 index 000000000..f03d01b2f --- /dev/null +++ b/tests/res/values/strings.xml @@ -0,0 +1,5 @@ + + + Hello World, Dummy + Dummy + diff --git a/tests/src/com/android/keepass/tests/.gitignore b/tests/src/com/android/keepass/tests/.gitignore new file mode 100644 index 000000000..48c029696 --- /dev/null +++ b/tests/src/com/android/keepass/tests/.gitignore @@ -0,0 +1 @@ +R.java diff --git a/tests/src/com/android/keepass/tests/AllTests.java b/tests/src/com/android/keepass/tests/AllTests.java new file mode 100644 index 000000000..90f475019 --- /dev/null +++ b/tests/src/com/android/keepass/tests/AllTests.java @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2008 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 com.android.keepass.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +import android.test.suitebuilder.TestSuiteBuilder; + +/** + * A test suite containing all tests for ApiDemos. + * + * To run all suites found in this apk: + * $ adb shell am instrument -w \ + * com.example.android.apis.tests/android.test.InstrumentationTestRunner + * + * To run just this suite from the command line: + * $ adb shell am instrument -w \ + * -e class com.example.android.apis.AllTests \ + * com.example.android.apis.tests/android.test.InstrumentationTestRunner + * + * To run an individual test case, e.g. {@link com.example.android.apis.os.MorseCodeConverterTest}: + * $ adb shell am instrument -w \ + * -e class com.example.android.apis.os.MorseCodeConverterTest \ + * com.example.android.apis.tests/android.test.InstrumentationTestRunner + * + * To run an individual test, e.g. {@link com.example.android.apis.os.MorseCodeConverterTest#testCharacterS()}: + * $ adb shell am instrument -w \ + * -e class com.example.android.apis.os.MorseCodeConverterTest#testCharacterS \ + * com.example.android.apis.tests/android.test.InstrumentationTestRunner + */ +public class AllTests extends TestSuite { + + public static Test suite() { + return new TestSuiteBuilder(AllTests.class) + .includeAllPackagesUnderHere() + .build(); + } +} diff --git a/tests/src/com/android/keepass/tests/TypesTest.java b/tests/src/com/android/keepass/tests/TypesTest.java new file mode 100644 index 000000000..f01224209 --- /dev/null +++ b/tests/src/com/android/keepass/tests/TypesTest.java @@ -0,0 +1,34 @@ +package com.android.keepass.tests; + +import junit.framework.TestCase; +import org.phoneid.keepassj2me.Types; +import static org.junit.Assert.*; + +public class TypesTest extends TestCase { + + public void testReadWriteInt() { + byte[] orig = new byte[8]; + byte[] dest = new byte[8]; + + for (int i = 0; i < 4; i++ ) { + orig[i] = 0; + } + + for (int i = 4; i < 8; i++ ) { + orig[4] = Byte.MAX_VALUE; + + } + + int one = Types.readInt(orig, 0); + int two = Types.readInt(orig, 4); + + Types.writeInt(one, dest, 0); + Types.writeInt(two, dest, 4); + + assertArrayEquals(orig, dest); + + } + + +} + \ No newline at end of file