Skip to content

Commit 42425d3

Browse files
committed
Updated Robotium version to 4.2
Updated integration tests Changed integration test target to usb device from emulator
1 parent 8ede19f commit 42425d3

11 files changed

Lines changed: 363 additions & 240 deletions

File tree

app/src/org/gnucash/android/db/AccountsDbAdapter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public String getAccountUID(long id){
262262
DatabaseHelper.KEY_ROW_ID + "=" + id,
263263
null, null, null, null);
264264
if (c != null && c.moveToFirst()){
265-
uid = c.getString(1);
265+
uid = c.getString(c.getColumnIndexOrThrow(DatabaseHelper.KEY_UID));
266266
c.close();
267267
}
268268
return uid;
@@ -348,7 +348,7 @@ public Cursor fetchAllRecords(){
348348
Cursor cursor = mDb.query(DatabaseHelper.ACCOUNTS_TABLE_NAME,
349349
null,
350350
selection,
351-
new String[]{AccountType.ROOT.toString()},
351+
new String[]{AccountType.ROOT.name()},
352352
null, null,
353353
DatabaseHelper.KEY_NAME + " ASC");
354354
return cursor;

app/src/org/gnucash/android/ui/accounts/AccountsListFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ protected void onPostExecute(Money balance) {
655655
balanceTextView.setTextColor(fontColor);
656656
}
657657
}
658+
accountsDbAdapter.close();
658659
}
659660
}
660661

app/src/org/gnucash/android/ui/transactions/TransactionsActivity.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,15 @@ public void updateNavigationSelection() {
211211
// set the selected item in the spinner
212212
int i = 0;
213213
Cursor accountsCursor = mAccountsDbAdapter.fetchAllRecords();
214-
accountsCursor.moveToFirst();
215-
do {
216-
long id = accountsCursor.getLong(DatabaseAdapter.COLUMN_ROW_ID);
217-
if (mAccountId == id) {
218-
getSupportActionBar().setSelectedNavigationItem(i);
219-
break;
220-
}
221-
++i;
222-
} while (accountsCursor.moveToNext());
214+
// boolean cursorMoved = accountsCursor.moveToFirst();
215+
while (accountsCursor.moveToNext()) {
216+
long id = accountsCursor.getLong(DatabaseAdapter.COLUMN_ROW_ID);
217+
if (mAccountId == id) {
218+
getSupportActionBar().setSelectedNavigationItem(i);
219+
break;
220+
}
221+
++i;
222+
}
223223
accountsCursor.close();
224224
}
225225

-40.9 KB
Binary file not shown.
-56.7 KB
Binary file not shown.

integration-tests/pom.xml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
<description>Instrumentation tests for Gnucash for Android</description>
2828

2929
<properties>
30-
<robotium.version>3.4.1</robotium.version>
31-
<android.device>emulator</android.device>
30+
<robotium.version>4.2</robotium.version>
31+
<spoon-client.version>1.0.5</spoon-client.version>
32+
<fest-android.version>1.0.6</fest-android.version>
33+
<android.device>usb</android.device>
3234
</properties>
3335

3436
<dependencies>
@@ -50,13 +52,17 @@
5052
<scope>provided</scope>
5153
<version>${android.version}</version>
5254
</dependency>
53-
55+
<dependency>
56+
<groupId>com.squareup</groupId>
57+
<artifactId>fest-android</artifactId>
58+
<version>${fest-android.version}</version>
59+
</dependency>
5460
<dependency>
5561
<!-- the target apk, which we will test. will automatically be deployed to device in pre-integration-test
5662
phase. -->
5763
<groupId>org.gnucash.android</groupId>
5864
<artifactId>gnucash-android</artifactId>
59-
<version>1.1.3-SNAPSHOT</version>
65+
<version>${project.version}</version>
6066
<type>apk</type>
6167
<scope>provided</scope>
6268
</dependency>
@@ -65,7 +71,7 @@
6571
<!-- optional: compile time dependency, in this case so that we can read from the R.java for example. -->
6672
<groupId>org.gnucash.android</groupId>
6773
<artifactId>gnucash-android</artifactId>
68-
<version>1.2.4-SNAPSHOT</version>
74+
<version>${project.version}</version>
6975
<scope>provided</scope>
7076
<type>jar</type>
7177
</dependency>
@@ -77,7 +83,7 @@
7783
<plugin>
7884
<groupId>com.jayway.maven.plugins.android.generation2</groupId>
7985
<artifactId>android-maven-plugin</artifactId>
80-
<extensions>true</extensions>
86+
<extensions>true</extensions>
8187
</plugin>
8288
</plugins>
8389
</build>

0 commit comments

Comments
 (0)