diff --git a/.gitignore b/.gitignore
index df233383..735eba38 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,5 @@ atlassian-ide-plugin.xml
.idea/workspace.xml
.idea/tasks.xml
.idea/uiDesigner.xml
-.idea/libraries/
\ No newline at end of file
+.idea/libraries/
+**/build
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
index d8210482..0d832da5 100644
--- a/.idea/encodings.xml
+++ b/.idea/encodings.xml
@@ -1,4 +1,8 @@
-
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
index a2444c19..a6784935 100644
--- a/.idea/gradle.xml
+++ b/.idea/gradle.xml
@@ -12,7 +12,9 @@
+
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
index d982d6de..10ca2031 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -4,7 +4,9 @@
+
+
diff --git a/android-app-core-tests/android-app-core-tests.iml b/android-app-core-tests/android-app-core-tests.iml
new file mode 100644
index 00000000..ce839fb9
--- /dev/null
+++ b/android-app-core-tests/android-app-core-tests.iml
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app-core-tests/build.gradle b/android-app-core-tests/build.gradle
new file mode 100644
index 00000000..0cfd9e49
--- /dev/null
+++ b/android-app-core-tests/build.gradle
@@ -0,0 +1,49 @@
+/*
+ * Copyright 2014 serso aka se.solovyev
+ *
+ * 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.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * Contact details
+ *
+ * Email: se.solovyev@gmail.com
+ * Site: http://se.solovyev.org
+ */
+
+apply plugin: 'java'
+
+dependencies {
+ def androidModule = project(':android-app')
+ compile androidModule
+
+ testCompile androidModule.android.applicationVariants.toList().first().javaCompile.classpath
+ testCompile androidModule.android.applicationVariants.toList().first().javaCompile.outputs.files
+ testCompile files(androidModule.plugins.findPlugin("com.android.application").getBootClasspath())
+
+ testCompile 'junit:junit:4.+'
+ testCompile 'org.robolectric:robolectric:2.3'
+ testCompile "org.mockito:mockito-all:1.9.5"
+ testCompile "org.skyscreamer:jsonassert:1.2.3"
+}
+
+tasks.withType(Test) {
+ scanForTestClasses = false
+ include "**/*Test.class"
+ exclude "**/*AngleUnitsButtonTest*"
+ exclude "**/*NumeralBasesButtonTest*"
+}
+
+test {
+ maxParallelForks = 15
+ forkEvery = 1
+}
\ No newline at end of file
diff --git a/android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorBroadcasterTest.java b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorBroadcasterTest.java
similarity index 91%
rename from android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorBroadcasterTest.java
rename to android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorBroadcasterTest.java
index e5b8920f..cc2a3305 100644
--- a/android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorBroadcasterTest.java
+++ b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorBroadcasterTest.java
@@ -4,9 +4,6 @@ import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
-
-import javax.annotation.Nonnull;
-
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.junit.Before;
@@ -16,15 +13,15 @@ import org.mockito.Mockito;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
+import javax.annotation.Nonnull;
+
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.robolectric.Robolectric.application;
import static org.solovyev.android.calculator.CalculatorBroadcaster.ACTION_DISPLAY_STATE_CHANGED;
import static org.solovyev.android.calculator.CalculatorBroadcaster.ACTION_EDITOR_STATE_CHANGED;
-import static org.solovyev.android.calculator.CalculatorEventType.display_state_changed;
-import static org.solovyev.android.calculator.CalculatorEventType.editor_state_changed;
-import static org.solovyev.android.calculator.CalculatorEventType.editor_state_changed_light;
+import static org.solovyev.android.calculator.CalculatorEventType.*;
@Config(manifest = Config.NONE)
@RunWith(RobolectricTestRunner.class)
diff --git a/android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorReceiverTest.java b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorReceiverTest.java
similarity index 79%
rename from android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorReceiverTest.java
rename to android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorReceiverTest.java
index e3a8f642..8a6a1d2b 100644
--- a/android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorReceiverTest.java
+++ b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorReceiverTest.java
@@ -1,22 +1,16 @@
package org.solovyev.android.calculator;
import android.content.Intent;
-
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
-import org.robolectric.Robolectric;
import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.times;
-import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.*;
import static org.robolectric.Robolectric.application;
import static org.solovyev.android.calculator.CalculatorButton.four;
-import static org.solovyev.android.calculator.CalculatorReceiver.ACTION_BUTTON_ID_EXTRA;
-import static org.solovyev.android.calculator.CalculatorReceiver.ACTION_BUTTON_PRESSED;
-import static org.solovyev.android.calculator.CalculatorReceiver.newButtonClickedIntent;
+import static org.solovyev.android.calculator.CalculatorReceiver.*;
@Config(manifest = Config.NONE)
@RunWith(RobolectricTestRunner.class)
diff --git a/android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorTestUtils.java b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java
similarity index 99%
rename from android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorTestUtils.java
rename to android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java
index 2ef54856..6730aa1b 100644
--- a/android-app-core/src/main/test/org/solovyev/android/calculator/CalculatorTestUtils.java
+++ b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java
@@ -24,14 +24,13 @@ package org.solovyev.android.calculator;
import android.content.Context;
import jscl.JsclMathEngine;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import org.mockito.Mockito;
import org.solovyev.android.calculator.history.CalculatorHistory;
import org.solovyev.android.calculator.plot.CalculatorPlotter;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
/**
* User: serso
* Date: 10/7/12
diff --git a/android-app-core/src/main/test/org/solovyev/android/calculator/view/AngleUnitsButtonTest.java b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/view/AngleUnitsButtonTest.java
similarity index 85%
rename from android-app-core/src/main/test/org/solovyev/android/calculator/view/AngleUnitsButtonTest.java
rename to android-app-core-tests/src/test/java/org/solovyev/android/calculator/view/AngleUnitsButtonTest.java
index 47006678..fa8a4b23 100644
--- a/android-app-core/src/main/test/org/solovyev/android/calculator/view/AngleUnitsButtonTest.java
+++ b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/view/AngleUnitsButtonTest.java
@@ -1,11 +1,6 @@
package org.solovyev.android.calculator.view;
import android.app.Activity;
-import jscl.AngleUnit;
-
-import java.util.ArrayList;
-
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -15,14 +10,10 @@ import org.robolectric.RobolectricTestRunner;
import org.robolectric.res.Attribute;
import org.robolectric.shadows.ShadowActivity;
-import static jscl.AngleUnit.deg;
-import static jscl.AngleUnit.grad;
-import static jscl.AngleUnit.rad;
-import static jscl.AngleUnit.turns;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
+import java.util.ArrayList;
+
+import static jscl.AngleUnit.*;
+import static org.junit.Assert.*;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.solovyev.android.calculator.CalculatorTestUtils.staticSetUp;
diff --git a/android-app-core/src/main/test/org/solovyev/android/calculator/view/NumeralBasesButtonTest.java b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/view/NumeralBasesButtonTest.java
similarity index 84%
rename from android-app-core/src/main/test/org/solovyev/android/calculator/view/NumeralBasesButtonTest.java
rename to android-app-core-tests/src/test/java/org/solovyev/android/calculator/view/NumeralBasesButtonTest.java
index cb97783d..23f3f0ff 100644
--- a/android-app-core/src/main/test/org/solovyev/android/calculator/view/NumeralBasesButtonTest.java
+++ b/android-app-core-tests/src/test/java/org/solovyev/android/calculator/view/NumeralBasesButtonTest.java
@@ -1,10 +1,6 @@
package org.solovyev.android.calculator.view;
import android.app.Activity;
-import jscl.NumeralBase;
-
-import java.util.ArrayList;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -14,16 +10,10 @@ import org.robolectric.RobolectricTestRunner;
import org.robolectric.res.Attribute;
import org.robolectric.shadows.ShadowActivity;
-import static jscl.AngleUnit.deg;
-import static jscl.AngleUnit.rad;
-import static jscl.NumeralBase.bin;
-import static jscl.NumeralBase.dec;
-import static jscl.NumeralBase.hex;
-import static jscl.NumeralBase.oct;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotSame;
-import static org.junit.Assert.assertTrue;
+import java.util.ArrayList;
+
+import static jscl.NumeralBase.*;
+import static org.junit.Assert.*;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.solovyev.android.calculator.CalculatorTestUtils.staticSetUp;
diff --git a/android-app-core/android-app-core.iml b/android-app-core/android-app-core.iml
index a4cbb48c..7a8b4b93 100644
--- a/android-app-core/android-app-core.iml
+++ b/android-app-core/android-app-core.iml
@@ -86,6 +86,7 @@
+
@@ -97,8 +98,8 @@
-
+
diff --git a/android-app-core/build.gradle b/android-app-core/build.gradle
index 5113aadd..2cf84a17 100644
--- a/android-app-core/build.gradle
+++ b/android-app-core/build.gradle
@@ -34,12 +34,16 @@ android {
versionCode version_code()
versionName version_name()
}
+ lintOptions {
+ abortOnError false
+ }
}
dependencies {
compile project(':core')
compile 'org.solovyev:common-core:1.0.7'
compile 'org.solovyev:common-text:1.0.7'
+ compile 'org.solovyev:common-security:1.0.7'
compile 'org.solovyev.android:android-common-views:1.1.18@aar'
compile 'org.solovyev.android:android-common-menus:1.1.18@aar'
compile 'org.solovyev.android:android-common-core:1.1.18@aar'
diff --git a/android-app-core/src/main/assets/Roboto-Regular.ttf b/android-app-core/src/main/assets/Roboto-Regular.ttf
deleted file mode 100644
index 0ba95c98..00000000
Binary files a/android-app-core/src/main/assets/Roboto-Regular.ttf and /dev/null differ
diff --git a/android-app-core/src/main/assets/fonts/Roboto-Regular.ttf b/android-app-core/src/main/assets/fonts/Roboto-Regular.ttf
new file mode 100644
index 00000000..73b23abb
Binary files /dev/null and b/android-app-core/src/main/assets/fonts/Roboto-Regular.ttf differ
diff --git a/android-app-onscreen/android-app-onscreen.iml b/android-app-onscreen/android-app-onscreen.iml
index 3b5c4eea..97c0c905 100644
--- a/android-app-onscreen/android-app-onscreen.iml
+++ b/android-app-onscreen/android-app-onscreen.iml
@@ -86,6 +86,7 @@
+
@@ -97,8 +98,8 @@
-
+
diff --git a/android-app-onscreen/build.gradle b/android-app-onscreen/build.gradle
index 615aaccf..d33bc15a 100644
--- a/android-app-onscreen/build.gradle
+++ b/android-app-onscreen/build.gradle
@@ -34,6 +34,9 @@ android {
versionCode version_code()
versionName version_name()
}
+ lintOptions {
+ abortOnError false
+ }
}
dependencies {
diff --git a/android-app-tests/android-app-tests.iml b/android-app-tests/android-app-tests.iml
new file mode 100644
index 00000000..acf62b1f
--- /dev/null
+++ b/android-app-tests/android-app-tests.iml
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android-app-tests/build.gradle b/android-app-tests/build.gradle
new file mode 100644
index 00000000..2108f5c0
--- /dev/null
+++ b/android-app-tests/build.gradle
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2014 serso aka se.solovyev
+ *
+ * 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.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * Contact details
+ *
+ * Email: se.solovyev@gmail.com
+ * Site: http://se.solovyev.org
+ */
+
+apply plugin: 'java'
+
+dependencies {
+ def androidModule = project(':android-app')
+ compile androidModule
+
+ testCompile androidModule.android.applicationVariants.toList().first().javaCompile.classpath
+ testCompile androidModule.android.applicationVariants.toList().first().javaCompile.outputs.files
+ testCompile files(androidModule.plugins.findPlugin("com.android.application").getBootClasspath())
+
+ testCompile 'junit:junit:4.11'
+ testCompile 'org.robolectric:robolectric:2.3'
+ testCompile "org.mockito:mockito-all:1.9.5"
+ testCompile "org.skyscreamer:jsonassert:1.2.3"
+}
+
+tasks.withType(Test) {
+ scanForTestClasses = false
+ include "**/*Test.class"
+ exclude "**/*AndroidCalculatorEditorViewTest*"
+ exclude "**/*CalculatorWizardActivityTest*"
+ exclude "**/*OnScreenCalculatorWizardStepTest*"
+ exclude "**/*CalculatorWizardTest*"
+ exclude "**/*WizardStepTest*"
+}
+
+test {
+ maxParallelForks = 15
+ forkEvery = 1
+}
\ No newline at end of file
diff --git a/android-app/src/test/java/org/solovyev/android/AndroidNumeralBaseTest.java b/android-app-tests/src/test/java/org/solovyev/android/AndroidNumeralBaseTest.java
similarity index 97%
rename from android-app/src/test/java/org/solovyev/android/AndroidNumeralBaseTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/AndroidNumeralBaseTest.java
index 112f692f..4e8196d0 100644
--- a/android-app/src/test/java/org/solovyev/android/AndroidNumeralBaseTest.java
+++ b/android-app-tests/src/test/java/org/solovyev/android/AndroidNumeralBaseTest.java
@@ -1,97 +1,97 @@
-/*
- * Copyright 2013 serso aka se.solovyev
- *
- * 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.
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * Contact details
- *
- * Email: se.solovyev@gmail.com
- * Site: http://se.solovyev.org
- */
-
-package org.solovyev.android;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.solovyev.android.calculator.units.CalculatorNumeralBase;
-import org.solovyev.common.units.Unit;
-import org.solovyev.common.units.UnitConverter;
-
-import javax.annotation.Nonnull;
-
-import java.util.Date;
-import java.util.Random;
-
-import static org.junit.Assert.assertTrue;
-
-/**
- * User: serso
- * Date: 4/21/12
- * Time: 8:24 PM
- */
-public class AndroidNumeralBaseTest {
-
- @Nonnull
- private final UnitConverter c = CalculatorNumeralBase.getConverter();
-
- @Test
- public void testIsSupported() throws Exception {
- assertTrue(c.isSupported(CalculatorNumeralBase.bin, CalculatorNumeralBase.dec));
- }
-
- @Test
- public void testConvertFromDec() throws Exception {
-
- Assert.assertEquals("101", c.convert(CalculatorNumeralBase.dec.createUnit("5"), CalculatorNumeralBase.bin).getValue());
- Assert.assertEquals("1", c.convert(CalculatorNumeralBase.dec.createUnit("1"), CalculatorNumeralBase.bin).getValue());
- Assert.assertEquals("0", c.convert(CalculatorNumeralBase.dec.createUnit("0"), CalculatorNumeralBase.bin).getValue());
- Assert.assertEquals("1111100111", c.convert(CalculatorNumeralBase.dec.createUnit("999"), CalculatorNumeralBase.bin).getValue());
-
- Assert.assertEquals("A23", c.convert(CalculatorNumeralBase.dec.createUnit("2595"), CalculatorNumeralBase.hex).getValue());
- Assert.assertEquals("AEE", c.convert(CalculatorNumeralBase.dec.createUnit("2798"), CalculatorNumeralBase.hex).getValue());
- Assert.assertEquals("15", c.convert(CalculatorNumeralBase.dec.createUnit("21"), CalculatorNumeralBase.hex).getValue());
- Assert.assertEquals("0", c.convert(CalculatorNumeralBase.dec.createUnit("0"), CalculatorNumeralBase.hex).getValue());
- Assert.assertEquals("3E7", c.convert(CalculatorNumeralBase.dec.createUnit("999"), CalculatorNumeralBase.hex).getValue());
-
- Assert.assertEquals("76", c.convert(CalculatorNumeralBase.dec.createUnit("62"), CalculatorNumeralBase.oct).getValue());
- Assert.assertEquals("12", c.convert(CalculatorNumeralBase.dec.createUnit("10"), CalculatorNumeralBase.oct).getValue());
- Assert.assertEquals("15", c.convert(CalculatorNumeralBase.dec.createUnit("13"), CalculatorNumeralBase.oct).getValue());
- Assert.assertEquals("0", c.convert(CalculatorNumeralBase.dec.createUnit("0"), CalculatorNumeralBase.oct).getValue());
- Assert.assertEquals("10445", c.convert(CalculatorNumeralBase.dec.createUnit("4389"), CalculatorNumeralBase.oct).getValue());
- }
-
- @Test
- public void testRandomConvert() throws Exception {
- final Random random = new Random(new Date().getTime());
- for (int i = 0; i < 100000; i++) {
- final String value = String.valueOf(random.nextInt());
- Assert.assertEquals(value, convertChain(value, CalculatorNumeralBase.dec, CalculatorNumeralBase.oct, CalculatorNumeralBase.oct, CalculatorNumeralBase.bin, CalculatorNumeralBase.dec));
- Assert.assertEquals(value, convertChain(value, CalculatorNumeralBase.dec, CalculatorNumeralBase.bin, CalculatorNumeralBase.hex, CalculatorNumeralBase.dec, CalculatorNumeralBase.dec));
- Assert.assertEquals(value, convertChain(value, CalculatorNumeralBase.dec, CalculatorNumeralBase.dec, CalculatorNumeralBase.hex, CalculatorNumeralBase.oct, CalculatorNumeralBase.dec));
- Assert.assertEquals(value, convertChain(value, CalculatorNumeralBase.dec, CalculatorNumeralBase.hex, CalculatorNumeralBase.bin, CalculatorNumeralBase.oct, CalculatorNumeralBase.dec));
-
- }
- }
-
- @Nonnull
- private String convertChain(@Nonnull String value, @Nonnull CalculatorNumeralBase baseAndroid, @Nonnull CalculatorNumeralBase... typeAndroids) {
- Unit unit = baseAndroid.createUnit(value);
-
- for (CalculatorNumeralBase typeAndroid : typeAndroids) {
- unit = CalculatorNumeralBase.getConverter().convert(unit, typeAndroid);
- }
-
- return unit.getValue();
- }
-}
+/*
+ * Copyright 2013 serso aka se.solovyev
+ *
+ * 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.
+ *
+ * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ * Contact details
+ *
+ * Email: se.solovyev@gmail.com
+ * Site: http://se.solovyev.org
+ */
+
+package org.solovyev.android;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.solovyev.android.calculator.units.CalculatorNumeralBase;
+import org.solovyev.common.units.Unit;
+import org.solovyev.common.units.UnitConverter;
+
+import javax.annotation.Nonnull;
+
+import java.util.Date;
+import java.util.Random;
+
+import static org.junit.Assert.assertTrue;
+
+/**
+ * User: serso
+ * Date: 4/21/12
+ * Time: 8:24 PM
+ */
+public class AndroidNumeralBaseTest {
+
+ @Nonnull
+ private final UnitConverter c = CalculatorNumeralBase.getConverter();
+
+ @Test
+ public void testIsSupported() throws Exception {
+ assertTrue(c.isSupported(CalculatorNumeralBase.bin, CalculatorNumeralBase.dec));
+ }
+
+ @Test
+ public void testConvertFromDec() throws Exception {
+
+ Assert.assertEquals("101", c.convert(CalculatorNumeralBase.dec.createUnit("5"), CalculatorNumeralBase.bin).getValue());
+ Assert.assertEquals("1", c.convert(CalculatorNumeralBase.dec.createUnit("1"), CalculatorNumeralBase.bin).getValue());
+ Assert.assertEquals("0", c.convert(CalculatorNumeralBase.dec.createUnit("0"), CalculatorNumeralBase.bin).getValue());
+ Assert.assertEquals("1111100111", c.convert(CalculatorNumeralBase.dec.createUnit("999"), CalculatorNumeralBase.bin).getValue());
+
+ Assert.assertEquals("A23", c.convert(CalculatorNumeralBase.dec.createUnit("2595"), CalculatorNumeralBase.hex).getValue());
+ Assert.assertEquals("AEE", c.convert(CalculatorNumeralBase.dec.createUnit("2798"), CalculatorNumeralBase.hex).getValue());
+ Assert.assertEquals("15", c.convert(CalculatorNumeralBase.dec.createUnit("21"), CalculatorNumeralBase.hex).getValue());
+ Assert.assertEquals("0", c.convert(CalculatorNumeralBase.dec.createUnit("0"), CalculatorNumeralBase.hex).getValue());
+ Assert.assertEquals("3E7", c.convert(CalculatorNumeralBase.dec.createUnit("999"), CalculatorNumeralBase.hex).getValue());
+
+ Assert.assertEquals("76", c.convert(CalculatorNumeralBase.dec.createUnit("62"), CalculatorNumeralBase.oct).getValue());
+ Assert.assertEquals("12", c.convert(CalculatorNumeralBase.dec.createUnit("10"), CalculatorNumeralBase.oct).getValue());
+ Assert.assertEquals("15", c.convert(CalculatorNumeralBase.dec.createUnit("13"), CalculatorNumeralBase.oct).getValue());
+ Assert.assertEquals("0", c.convert(CalculatorNumeralBase.dec.createUnit("0"), CalculatorNumeralBase.oct).getValue());
+ Assert.assertEquals("10445", c.convert(CalculatorNumeralBase.dec.createUnit("4389"), CalculatorNumeralBase.oct).getValue());
+ }
+
+ @Test
+ public void testRandomConvert() throws Exception {
+ final Random random = new Random(new Date().getTime());
+ for (int i = 0; i < 100000; i++) {
+ final String value = String.valueOf(random.nextInt());
+ Assert.assertEquals(value, convertChain(value, CalculatorNumeralBase.dec, CalculatorNumeralBase.oct, CalculatorNumeralBase.oct, CalculatorNumeralBase.bin, CalculatorNumeralBase.dec));
+ Assert.assertEquals(value, convertChain(value, CalculatorNumeralBase.dec, CalculatorNumeralBase.bin, CalculatorNumeralBase.hex, CalculatorNumeralBase.dec, CalculatorNumeralBase.dec));
+ Assert.assertEquals(value, convertChain(value, CalculatorNumeralBase.dec, CalculatorNumeralBase.dec, CalculatorNumeralBase.hex, CalculatorNumeralBase.oct, CalculatorNumeralBase.dec));
+ Assert.assertEquals(value, convertChain(value, CalculatorNumeralBase.dec, CalculatorNumeralBase.hex, CalculatorNumeralBase.bin, CalculatorNumeralBase.oct, CalculatorNumeralBase.dec));
+
+ }
+ }
+
+ @Nonnull
+ private String convertChain(@Nonnull String value, @Nonnull CalculatorNumeralBase baseAndroid, @Nonnull CalculatorNumeralBase... typeAndroids) {
+ Unit unit = baseAndroid.createUnit(value);
+
+ for (CalculatorNumeralBase typeAndroid : typeAndroids) {
+ unit = CalculatorNumeralBase.getConverter().convert(unit, typeAndroid);
+ }
+
+ return unit.getValue();
+ }
+}
diff --git a/android-app-tests/src/test/java/org/solovyev/android/CalculatorTestRunner.java b/android-app-tests/src/test/java/org/solovyev/android/CalculatorTestRunner.java
new file mode 100644
index 00000000..d1ea2cd1
--- /dev/null
+++ b/android-app-tests/src/test/java/org/solovyev/android/CalculatorTestRunner.java
@@ -0,0 +1,27 @@
+package org.solovyev.android;
+
+import org.junit.runners.model.InitializationError;
+import org.robolectric.AndroidManifest;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.annotation.Config;
+import org.robolectric.res.Fs;
+
+public class CalculatorTestRunner extends RobolectricTestRunner {
+ private static final int MAX_SDK_SUPPORTED_BY_ROBOLECTRIC = 18;
+
+ public CalculatorTestRunner(Class> testClass) throws InitializationError {
+ super(testClass);
+ }
+
+ @Override
+ protected AndroidManifest getAppManifest(Config config) {
+ final String manifestFilePath = "../android-app/src/main/AndroidManifest.xml";
+ final String resourcesFilePath = "../android-app-core/src/main/res";
+ return new AndroidManifest(Fs.fileFromPath(manifestFilePath), Fs.fileFromPath(resourcesFilePath)) {
+ @Override
+ public int getTargetSdkVersion() {
+ return MAX_SDK_SUPPORTED_BY_ROBOLECTRIC;
+ }
+ };
+ }
+}
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/AndroidCalculatorEditorViewTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/AndroidCalculatorEditorViewTest.java
similarity index 96%
rename from android-app/src/test/java/org/solovyev/android/calculator/AndroidCalculatorEditorViewTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/AndroidCalculatorEditorViewTest.java
index 1afc8854..b81aa5c9 100644
--- a/android-app/src/test/java/org/solovyev/android/calculator/AndroidCalculatorEditorViewTest.java
+++ b/android-app-tests/src/test/java/org/solovyev/android/calculator/AndroidCalculatorEditorViewTest.java
@@ -22,26 +22,26 @@
package org.solovyev.android.calculator;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.solovyev.android.CalculatorTestRunner;
+import org.solovyev.common.text.Strings;
+
import java.util.Date;
import java.util.Random;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.robolectric.RobolectricTestRunner;
-import org.solovyev.common.text.Strings;
-
/**
* User: serso
* Date: 10/13/12
* Time: 1:11 PM
*/
-@RunWith(value = RobolectricTestRunner.class)
+@RunWith(value = CalculatorTestRunner.class)
public class AndroidCalculatorEditorViewTest {
@BeforeClass
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java
similarity index 100%
rename from android-app/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/CalculatorTestUtils.java
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/TextHighlighterTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/TextHighlighterTest.java
similarity index 100%
rename from android-app/src/test/java/org/solovyev/android/calculator/TextHighlighterTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/TextHighlighterTest.java
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/history/HistoryUtilsTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/history/HistoryUtilsTest.java
similarity index 100%
rename from android-app/src/test/java/org/solovyev/android/calculator/history/HistoryUtilsTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/history/HistoryUtilsTest.java
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/model/VarTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/model/VarTest.java
similarity index 100%
rename from android-app/src/test/java/org/solovyev/android/calculator/model/VarTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/model/VarTest.java
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/plot/CalculatorGraph2dViewTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/plot/CalculatorGraph2dViewTest.java
similarity index 100%
rename from android-app/src/test/java/org/solovyev/android/calculator/plot/CalculatorGraph2dViewTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/plot/CalculatorGraph2dViewTest.java
index 63bbe14c..d09133f5 100644
--- a/android-app/src/test/java/org/solovyev/android/calculator/plot/CalculatorGraph2dViewTest.java
+++ b/android-app-tests/src/test/java/org/solovyev/android/calculator/plot/CalculatorGraph2dViewTest.java
@@ -22,11 +22,11 @@
package org.solovyev.android.calculator.plot;
+import org.junit.Test;
+
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
-import org.junit.Test;
-
import static org.junit.Assert.assertEquals;
/**
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardActivityTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardActivityTest.java
similarity index 95%
rename from android-app/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardActivityTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardActivityTest.java
index ac7a0596..54063ff4 100644
--- a/android-app/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardActivityTest.java
+++ b/android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardActivityTest.java
@@ -26,33 +26,27 @@ import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
-import org.robolectric.RobolectricTestRunner;
import org.robolectric.shadows.ShadowActivity;
import org.robolectric.util.ActivityController;
+import org.solovyev.android.CalculatorTestRunner;
import org.solovyev.android.wizard.BaseWizardActivity;
import org.solovyev.android.wizard.Wizard;
import org.solovyev.android.wizard.WizardUi;
import org.solovyev.android.wizard.Wizards;
import javax.annotation.Nonnull;
-
import java.lang.reflect.Field;
import static android.view.View.GONE;
import static android.view.View.VISIBLE;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.choose_mode;
-@RunWith(value = RobolectricTestRunner.class)
+@RunWith(value = CalculatorTestRunner.class)
public class CalculatorWizardActivityTest {
private ActivityController controller;
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardTest.java
similarity index 90%
rename from android-app/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardTest.java
index 39700e64..272048f7 100644
--- a/android-app/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardTest.java
+++ b/android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/CalculatorWizardTest.java
@@ -4,7 +4,7 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
-import org.robolectric.RobolectricTestRunner;
+import org.solovyev.android.CalculatorTestRunner;
import org.solovyev.android.wizard.Wizard;
import org.solovyev.android.wizard.WizardFlow;
import org.solovyev.android.wizard.Wizards;
@@ -12,11 +12,9 @@ import org.solovyev.android.wizard.Wizards;
import javax.annotation.Nonnull;
import static org.junit.Assert.*;
-import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.choose_mode;
-import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.last;
-import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.welcome;
+import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.*;
-@RunWith(value = RobolectricTestRunner.class)
+@RunWith(value = CalculatorTestRunner.class)
public class CalculatorWizardTest {
@Nonnull
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStepTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStepTest.java
similarity index 94%
rename from android-app/src/test/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStepTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStepTest.java
index 7b41ffd7..3ec291b8 100644
--- a/android-app/src/test/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStepTest.java
+++ b/android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/OnScreenCalculatorWizardStepTest.java
@@ -24,26 +24,22 @@ package org.solovyev.android.calculator.wizard;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
-
-import javax.annotation.Nonnull;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
-import org.robolectric.RobolectricTestRunner;
import org.robolectric.util.ActivityController;
+import org.solovyev.android.CalculatorTestRunner;
import org.solovyev.android.calculator.CalculatorPreferences;
import org.solovyev.android.wizard.BaseWizardActivity;
import org.solovyev.android.wizard.WizardUi;
+import javax.annotation.Nonnull;
import java.lang.reflect.Field;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
-@RunWith(RobolectricTestRunner.class)
+@RunWith(CalculatorTestRunner.class)
public class OnScreenCalculatorWizardStepTest {
@Nonnull
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/wizard/WizardStepTest.java b/android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/WizardStepTest.java
similarity index 95%
rename from android-app/src/test/java/org/solovyev/android/calculator/wizard/WizardStepTest.java
rename to android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/WizardStepTest.java
index b0e4087f..f9e3cd29 100644
--- a/android-app/src/test/java/org/solovyev/android/calculator/wizard/WizardStepTest.java
+++ b/android-app-tests/src/test/java/org/solovyev/android/calculator/wizard/WizardStepTest.java
@@ -30,8 +30,8 @@ import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.Robolectric;
-import org.robolectric.RobolectricTestRunner;
import org.robolectric.annotation.Config;
+import org.solovyev.android.CalculatorTestRunner;
import org.solovyev.android.calculator.CalculatorPreferences;
import static org.junit.Assert.*;
@@ -45,14 +45,12 @@ import static org.solovyev.android.calculator.wizard.CalculatorLayout.big_button
import static org.solovyev.android.calculator.wizard.CalculatorLayout.optimized;
import static org.solovyev.android.calculator.wizard.CalculatorMode.engineer;
import static org.solovyev.android.calculator.wizard.CalculatorMode.simple;
+import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.*;
import static org.solovyev.android.calculator.wizard.ChooseLayoutWizardStep.LAYOUT;
import static org.solovyev.android.calculator.wizard.ChooseModeWizardStep.MODE;
import static org.solovyev.android.calculator.wizard.OnScreenCalculatorWizardStep.ONSCREEN_CALCULATOR_ENABLED;
-import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.choose_layout;
-import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.choose_mode;
-import static org.solovyev.android.calculator.wizard.CalculatorWizardStep.on_screen_calculator;
-@RunWith(RobolectricTestRunner.class)
+@RunWith(CalculatorTestRunner.class)
public class WizardStepTest {
private FragmentActivity activity;
diff --git a/android-app-widget/android-app-widget.iml b/android-app-widget/android-app-widget.iml
index a601f1dc..a9a4eee6 100644
--- a/android-app-widget/android-app-widget.iml
+++ b/android-app-widget/android-app-widget.iml
@@ -86,6 +86,7 @@
+
@@ -97,8 +98,8 @@
-
+
diff --git a/android-app-widget/build.gradle b/android-app-widget/build.gradle
index f9f1f2d3..93395b30 100644
--- a/android-app-widget/build.gradle
+++ b/android-app-widget/build.gradle
@@ -34,6 +34,9 @@ android {
versionCode version_code()
versionName version_name()
}
+ lintOptions {
+ abortOnError false
+ }
}
dependencies {
diff --git a/android-app/android-app.iml b/android-app/android-app.iml
index 2ddf52fc..397bc169 100644
--- a/android-app/android-app.iml
+++ b/android-app/android-app.iml
@@ -83,12 +83,14 @@
-
+
+
+
diff --git a/android-app/build.gradle b/android-app/build.gradle
index 2a1a0862..3937d838 100644
--- a/android-app/build.gradle
+++ b/android-app/build.gradle
@@ -40,12 +40,15 @@ android {
zipAlignEnabled true
}
}
+ lintOptions {
+ abortOnError false
+ }
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:21.0.3'
- compile ('ch.acra:acra:4.3.0') {
+ compile ('ch.acra:acra:4.5.0') {
exclude group: 'org.json'
}
compile 'org.solovyev.android:android-common-ads:1.1.18@aar'
@@ -56,6 +59,7 @@ dependencies {
compile 'org.solovyev.android:android-common-core:1.1.18@aar'
compile 'org.solovyev.android:android-common-other:1.1.18@aar'
compile 'org.solovyev.android:android-common-db:1.1.18@aar'
+ compile 'org.solovyev.android:android-common-security:1.1.18@aar'
compile project(':android-app-core')
compile project(':android-app-widget')
compile project(':android-app-onscreen')
diff --git a/android-app/proguard.cfg b/android-app/proguard.cfg
index 6a5edb80..41fe669b 100644
--- a/android-app/proguard.cfg
+++ b/android-app/proguard.cfg
@@ -62,6 +62,8 @@
-dontwarn jscl.mathml.**
-dontwarn com.google.common.collect.MinMaxPriorityQueue
-dontwarn com.google.ads.**
+-dontwarn com.sun.org.apache.xerces.internal.impl.dv.util.Base64
+-dontwarn com.actionbarsherlock.BuildConfig
-keep class org.simpleframework.xml.** { *; }
-keep class * implements org.solovyev.android.calculator.model.MathPersistenceEntity
diff --git a/android-app/src/main/java/org/solovyev/android/calculator/CalculatorApplication.java b/android-app/src/main/java/org/solovyev/android/calculator/CalculatorApplication.java
index 08caac29..2147abee 100644
--- a/android-app/src/main/java/org/solovyev/android/calculator/CalculatorApplication.java
+++ b/android-app/src/main/java/org/solovyev/android/calculator/CalculatorApplication.java
@@ -139,7 +139,9 @@ public class CalculatorApplication extends android.app.Application implements Sh
public void onCreate() {
ACRA.init(this);
- App.init(this);
+ if (!App.isInitialized()) {
+ App.init(this);
+ }
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);
CalculatorPreferences.setDefaultValues(preferences);
diff --git a/android-app/src/main/java/org/solovyev/android/calculator/history/AndroidCalculatorHistory.java b/android-app/src/main/java/org/solovyev/android/calculator/history/AndroidCalculatorHistory.java
index 24733ca3..1102127c 100644
--- a/android-app/src/main/java/org/solovyev/android/calculator/history/AndroidCalculatorHistory.java
+++ b/android-app/src/main/java/org/solovyev/android/calculator/history/AndroidCalculatorHistory.java
@@ -26,16 +26,13 @@ import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
-
-import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
-
import org.solovyev.android.calculator.Calculator;
import org.solovyev.android.calculator.CalculatorEventData;
import org.solovyev.android.calculator.CalculatorEventType;
-import org.solovyev.android.calculator.R;
import org.solovyev.common.history.HistoryAction;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
import java.util.List;
/**
@@ -60,7 +57,7 @@ public class AndroidCalculatorHistory implements CalculatorHistory {
public void load() {
final SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context);
if (preferences != null) {
- final String value = preferences.getString(context.getString(R.string.p_calc_history), null);
+ final String value = preferences.getString("org.solovyev.android.calculator.CalculatorModel_history", null);
if (value != null) {
calculatorHistory.fromXml(value);
}
@@ -71,7 +68,7 @@ public class AndroidCalculatorHistory implements CalculatorHistory {
final SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);
final SharedPreferences.Editor editor = settings.edit();
- editor.putString(context.getString(R.string.p_calc_history), calculatorHistory.toXml());
+ editor.putString("org.solovyev.android.calculator.CalculatorModel_history", calculatorHistory.toXml());
editor.commit();
}
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/TestCalculatorApplication.java b/android-app/src/test/java/org/solovyev/android/calculator/TestCalculatorApplication.java
deleted file mode 100644
index 5adc6baf..00000000
--- a/android-app/src/test/java/org/solovyev/android/calculator/TestCalculatorApplication.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright 2013 serso aka se.solovyev
- *
- * 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.
- *
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- * Contact details
- *
- * Email: se.solovyev@gmail.com
- * Site: http://se.solovyev.org
- */
-
-package org.solovyev.android.calculator;
-
-/**
- * User: serso
- * Date: 6/18/13
- * Time: 8:45 PM
- */
-public class TestCalculatorApplication extends CalculatorApplication {
-
- private static volatile boolean initialized = false;
-
- public TestCalculatorApplication() {
- super(false);
- }
-
- @Override
- public void onCreate() {
- synchronized (TestCalculatorApplication.class) {
- if (!initialized) {
- super.onCreate();
- initialized = true;
- }
- }
- }
-}
diff --git a/android-app/src/test/java/org/solovyev/android/calculator/matrix/MatrixViewTest.java b/android-app/src/test/java/org/solovyev/android/calculator/matrix/MatrixViewTest.java
deleted file mode 100644
index 721d90a9..00000000
--- a/android-app/src/test/java/org/solovyev/android/calculator/matrix/MatrixViewTest.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.solovyev.android.calculator.matrix;
-
-/**
- * User: serso
- * Date: 7/11/13
- * Time: 4:56 PM
- */
-public class MatrixViewTest {
-}
diff --git a/settings.gradle b/settings.gradle
index 972a1afb..14f05a24 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1 +1,2 @@
include ':core', ':android-app-core', ':android-app-widget', ':android-app-onscreen', ':android-app'
+include ':android-app-core-tests', ':android-app-tests'