コード例 #1
0
  public void test_createFunctionHolder() throws Exception {
    PreferencesForTesting pref =
        new PreferencesForTesting() {

          @Override
          public FunctionHolder getFunctionHolder() {
            return myFunctionHolder;
          }
        };
    assertSame(pref.getFunctionHolder(), pref.createFunctionHolder(new Context()));
  }
コード例 #2
0
  public void test_getOrderByFields() throws Exception {
    Preferences pref = PreferencesForTesting.buildPreferences();
    assertEquals(0, pref.getOrderByFields().length);

    PreferencesForTesting prefWithOrderBy =
        new PreferencesForTesting() {
          @Override
          public OrderByField[] getOrderByFields() {
            return new OrderByField[] {
              new OrderByField("AP_FOO", "COL1"),
              new OrderByField("PM_TOTO", "COL2"),
              new OrderByField("AP_PIPO", "COLOSCOPIE")
            };
          }
        };

    AssertUtil.assertEquals(
        new OrderByField[] {
          new OrderByField("AP_FOO", "COL1"),
          new OrderByField("PM_TOTO", "COL2"),
          new OrderByField("AP_PIPO", "COLOSCOPIE")
        },
        prefWithOrderBy.getConfig().getOrderByFields());
  }
コード例 #3
0
 public void test_getConfig() throws Exception {
   PreferencesForTesting pref = new PreferencesForTesting();
   assertNotNull(pref.getConfig());
   assertSame(pref.getConfig(), pref.getConfig());
 }