Advertisement
Guest User

Untitled

a guest
Feb 4th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. </activity>
  2. <activity android:name=".ResetActivity"
  3. android:label="Reset Password"
  4. >
  5. <intent-filter>
  6. <action android:name="android.intent.action.VIEW" />
  7. <category android:name="android.intent.category.VIEW"/>
  8. <category android:name="android.intent.category.DEFAULT"></category>
  9. <category android:name="android.intent.category.BROWSABLE"></category>
  10. <data
  11. android:host="sample-app-123.appspot.com"
  12. android:scheme="https"
  13. android:pathPattern=".*reset_password.*"
  14. />
  15. </intent-filter>
  16. </activity>
  17.  
  18. public void testPatternMatcher() throws Exception {
  19. PatternMatcher mPatternMatcher;
  20.  
  21. mPatternMatcher = new PatternMatcher("https://sample-app-123.appspot.com/backoffice\/#\/user_create_password.*", PatternMatcher.PATTERN_SIMPLE_GLOB);
  22. assertTrue(mPatternMatcher.match("https://sample-app-123.appspot.com/backoffice/#/user_create_password?email=abc@gmail.com"));
  23. assertFalse(mPatternMatcher.match("https://sample-app-123.appspot.com/backoffice/#/user_reset_password?email=abc@gmail.com"));
  24.  
  25. mPatternMatcher = new PatternMatcher(".*user_create_password.*", PatternMatcher.PATTERN_SIMPLE_GLOB);
  26. assertTrue(mPatternMatcher.match("https://sample-app-123.appspot.com/backoffice/#/user_create_password?email=abc@gmail.com"));
  27. assertFalse(mPatternMatcher.match("https://sample-app-123.appspot.com/backoffice/#/user_reset_password?email=abc@gmail.com"));
  28.  
  29. mPatternMatcher = new PatternMatcher(".*user_reset_password.*", PatternMatcher.PATTERN_SIMPLE_GLOB);
  30. assertFalse(mPatternMatcher.match("/backoffice/#/user_create_password?email=abc@gmail.com"));
  31. assertTrue(mPatternMatcher.match("/backoffice/#/user_reset_password?email=abc@gmail.com"));
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement