Home | History | Annotate | Download | only in manifest
      1 package org.robolectric.manifest;
      2 
      3 import static org.assertj.core.api.Assertions.assertThat;
      4 
      5 import java.util.ArrayList;
      6 import java.util.HashMap;
      7 import org.junit.Test;
      8 import org.junit.runner.RunWith;
      9 import org.junit.runners.JUnit4;
     10 
     11 @RunWith(JUnit4.class)
     12 public class ActivityDataTest {
     13 
     14   @Test
     15   public void test_non_android_namespace() {
     16     HashMap<String, String> attrs = new HashMap<>();
     17     attrs.put("testns:name", ".test.TestActivity");
     18     ActivityData activityData = new ActivityData("testns", attrs, new ArrayList<IntentFilterData>());
     19 
     20     assertThat(activityData.getName()).isEqualTo(".test.TestActivity");
     21     assertThat(activityData.getAllAttributes().get("android:name")).isNull();
     22   }
     23 
     24   @Test
     25   public void test_config_changes() {
     26     HashMap<String, String> attrs = new HashMap<>();
     27     attrs.put("android:configChanges", "mcc|screenLayout|orientation");
     28     ActivityData activityData = new ActivityData(attrs, new ArrayList<IntentFilterData>());
     29 
     30     assertThat(activityData.getConfigChanges()).isEqualTo("mcc|screenLayout|orientation");
     31   }
     32 }
     33