Skip to content

Commit

Permalink
Merge branch 'feature/priority' into feature/priority-channel
Browse files Browse the repository at this point in the history
  • Loading branch information
jaeklim committed Oct 30, 2018
2 parents 908b4bb + ca051cf commit a5c0dc3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,17 @@ public void setUp() {
sContext.deleteDatabase(DatabasePersistence.DATABASE);
}

@NonNull
private ContentValues getContentValues(DatabasePersistence persistence, String group) {
SQLiteQueryBuilder builder = SQLiteUtils.newSQLiteQueryBuilder();
builder.appendWhere(DatabasePersistence.COLUMN_GROUP + " = ?");
String[] selectionArgs = new String[]{group};
Cursor cursor = persistence.mDatabaseManager.getCursor(builder, selectionArgs, false);
ContentValues values = persistence.mDatabaseManager.nextValues(cursor);
assertNotNull(values);
return values;
}

@Test
public void putLog() throws PersistenceException {

Expand Down Expand Up @@ -768,17 +779,6 @@ public void getLogsException() throws PersistenceException, JSONException {
}
}

@NonNull
private ContentValues getContentValues(DatabasePersistence persistence, String group) {
SQLiteQueryBuilder builder = SQLiteUtils.newSQLiteQueryBuilder();
builder.appendWhere(DatabasePersistence.COLUMN_GROUP + " = ?");
String[] selectionArgs = new String[]{group};
Cursor cursor = persistence.mDatabaseManager.getCursor(builder, selectionArgs, false);
ContentValues values = persistence.mDatabaseManager.nextValues(cursor);
assertNotNull(values);
return values;
}

@Test
public void upgradeFromVersion1to4() throws PersistenceException, JSONException {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ public final class Flags {
* Used for events that should be prioritized over non-critical events.
*/
public static final int PERSISTENCE_CRITICAL = 0x02;

/**
* Default combination of flags.
*/
public static final int DEFAULT_FLAGS = PERSISTENCE_NORMAL;
}
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ public boolean onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
*
* @param group The group of the storage for the log.
* @param logJ The JSON string for a log.
* @param targetToken target token if the log is common schema.
* @param targetKey project identifier part of the target token in clear text.
* @param priority priority.
* @param targetToken The target token if the log is common schema.
* @param targetKey The project identifier part of the target token in clear text.
* @param priority The persistence priority.
* @return A {@link ContentValues} instance.
*/
private static ContentValues getContentValues(@Nullable String group, @Nullable String logJ, String targetToken, String type, String targetKey, int priority) {
Expand Down

0 comments on commit a5c0dc3

Please sign in to comment.