daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Feb 4th, 2016 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <activity android:name=".CreateActivity"
  2.     android:label="Create Password"
  3.     >
  4.     <intent-filter>
  5.     <action android:name="android.intent.action.VIEW" />
  6.     <category android:name="android.intent.category.VIEW"/>
  7.     <category android:name="android.intent.category.DEFAULT"></category>
  8.     <category android:name="android.intent.category.BROWSABLE"></category>
  9.     <data
  10.         android:host="sample-app-123.appspot.com"
  11.         android:scheme="https"
  12.         android:pathPattern=".*create_password.*"
  13.         />
  14.     </intent-filter>
  15.  
  16. </activity>
  17. <activity android:name=".ResetActivity"
  18.     android:label="Reset Password"
  19.     >
  20.     <intent-filter>
  21.     <action android:name="android.intent.action.VIEW" />
  22.     <category android:name="android.intent.category.VIEW"/>
  23.     <category android:name="android.intent.category.DEFAULT"></category>
  24.     <category android:name="android.intent.category.BROWSABLE"></category>
  25.     <data
  26.         android:host="sample-app-123.appspot.com"
  27.         android:scheme="https"
  28.         android:pathPattern=".*reset_password.*"
  29.         />
  30.     </intent-filter>
  31. </activity>
  32.    
  33. public void testPatternMatcher() throws Exception {
  34.     PatternMatcher mPatternMatcher;
  35.  
  36.     mPatternMatcher = new PatternMatcher("https://sample-app-123.appspot.com/backoffice\/#\/user_create_password.*", PatternMatcher.PATTERN_SIMPLE_GLOB);
  37.     assertTrue(mPatternMatcher.match("https://sample-app-123.appspot.com/backoffice/#/user_create_password?email=abc@gmail.com"));
  38.     assertFalse(mPatternMatcher.match("https://sample-app-123.appspot.com/backoffice/#/user_reset_password?email=abc@gmail.com"));
  39.  
  40.     mPatternMatcher = new PatternMatcher(".*user_create_password.*", PatternMatcher.PATTERN_SIMPLE_GLOB);
  41.     assertTrue(mPatternMatcher.match("https://sample-app-123.appspot.com/backoffice/#/user_create_password?email=abc@gmail.com"));
  42.     assertFalse(mPatternMatcher.match("https://sample-app-123.appspot.com/backoffice/#/user_reset_password?email=abc@gmail.com"));
  43.  
  44.     mPatternMatcher = new PatternMatcher(".*user_reset_password.*", PatternMatcher.PATTERN_SIMPLE_GLOB);
  45.     assertFalse(mPatternMatcher.match("/backoffice/#/user_create_password?email=abc@gmail.com"));
  46.     assertTrue(mPatternMatcher.match("/backoffice/#/user_reset_password?email=abc@gmail.com"));
  47. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top