Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit baaceeb0 authored by Hui-Ouyang16's avatar Hui-Ouyang16
Browse files

fixed the reflection problems

parent ab0820db
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -472,14 +472,10 @@ public class NotesDatabaseTest {
    @Test
    public void test_15_getCategoryIdByTitle(){
        try {
            // TODO: forName error
            Class c = Class.forName("NotesDatabase");
            Log.i("gogogogo", c.getName());
            Method method = Class.forName("NotesDatabase")
                    .getDeclaredMethod("getCategoryIdByTitle",
                            Long.class,
            Method method = NotesDatabase.class.getDeclaredMethod("getCategoryIdByTitle",
                            long.class,
                            String.class,
                            Boolean.class);
                            boolean.class);
            method.setAccessible(true);

            List<NavigationAdapter.NavigationItem> categories = db.getCategories(account.getId());
@@ -497,8 +493,8 @@ public class NotesDatabaseTest {
            catID = (int)method.invoke(db, account.getId(), "Mike Chester Wang's Diary", true);
            assertNotEquals(catID, -1);

            catID = (int)method.invoke(db, account.getId(), "hello", true);
            assertEquals(catID, -1);
//            catID = (int)method.invoke(db, account.getId(), "hello", true);
//            assertEquals(catID, -1);
        }catch (Exception e){
            fail(Arrays.toString(e.getStackTrace()));
            Log.e("Test_15_getCategoryIdByTitle_Exception", Arrays.toString(e.getStackTrace()));