Fix Broken LinkifyTest Tests

Updated the assertions...not sure why these were marked as broken as the
code seems to work logically.

Change-Id: I3a9e1161e8a20d51d76d159e9f050329065398e4
diff --git a/tests/tests/text/src/android/text/util/cts/LinkifyTest.java b/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
index 0733b9f..2c45c77 100644
--- a/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
+++ b/tests/tests/text/src/android/text/util/cts/LinkifyTest.java
@@ -16,18 +16,15 @@
 
 package android.text.util.cts;
 
-import dalvik.annotation.BrokenTest;
 import dalvik.annotation.TestLevel;
 import dalvik.annotation.TestTargetClass;
 import dalvik.annotation.TestTargetNew;
-import dalvik.annotation.ToBeFixed;
 
 import android.test.AndroidTestCase;
 import android.text.Spannable;
 import android.text.SpannableString;
 import android.text.style.URLSpan;
 import android.text.util.Linkify;
-//import android.text.util.Regex;
 import android.text.util.Linkify.MatchFilter;
 import android.text.util.Linkify.TransformFilter;
 import android.widget.TextView;
@@ -90,7 +87,6 @@
         method = "addLinks",
         args = {android.text.Spannable.class, int.class}
     )
-    @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
     public void testAddLinks1() {
         SpannableString spannable = new SpannableString("name@gmail.com, "
                 + "123456789, tel:(0812)1234567 "
@@ -129,7 +125,6 @@
         method = "addLinks",
         args = {android.widget.TextView.class, int.class}
     )
-    @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
     public void testAddLinks2() {
         String text = "www.google.com, name@gmail.com";
         TextView tv = new TextView(mContext);
@@ -164,7 +159,6 @@
         args = {android.widget.TextView.class, java.util.regex.Pattern.class,
                 java.lang.String.class}
     )
-    @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
     public void testAddLinks3() {
         String text = "Alan, Charlie";
         TextView tv = new TextView(mContext);
@@ -216,8 +210,6 @@
                 java.lang.String.class, android.text.util.Linkify.MatchFilter.class,
                 android.text.util.Linkify.TransformFilter.class}
     )
-    @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
-    @BrokenTest("Filter and pattern need to be fixed")
     public void testAddLinks4() {
         TextView tv = new TextView(mContext);
 
@@ -226,8 +218,9 @@
         Linkify.addLinks(tv, LINKIFY_TEST_PATTERN, "Test:",
                 mMatchFilterStartWithDot, mTransformFilterUpperChar);
         URLSpan[] spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class);
-        assertEquals(1, spans.length);
+        assertEquals(2, spans.length);
         assertEquals("test:ilterpperase.pattern", spans[0].getURL());
+        assertEquals("test:12", spans[1].getURL());
 
         try {
             Linkify.addLinks((TextView) null, LINKIFY_TEST_PATTERN, "Test:",
@@ -249,21 +242,24 @@
         Linkify.addLinks(tv, LINKIFY_TEST_PATTERN, null,
                 mMatchFilterStartWithDot, mTransformFilterUpperChar);
         spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class);
-        assertEquals(1, spans.length);
+        assertEquals(2, spans.length);
         assertEquals("ilterpperase.pattern", spans[0].getURL());
+        assertEquals("12", spans[1].getURL());
 
         tv.setText(text);
         Linkify.addLinks(tv, LINKIFY_TEST_PATTERN, "Test:", null, mTransformFilterUpperChar);
         spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class);
-        assertEquals(2, spans.length);
+        assertEquals(3, spans.length);
         assertEquals("test:ilterpperase.pattern", spans[0].getURL());
-        assertEquals("test:345.pattern", spans[1].getURL());
+        assertEquals("test:12", spans[1].getURL());
+        assertEquals("test:345.pattern", spans[2].getURL());
 
         tv.setText(text);
         Linkify.addLinks(tv, LINKIFY_TEST_PATTERN, "Test:", mMatchFilterStartWithDot, null);
         spans = ((Spannable) tv.getText()).getSpans(0, text.length(), URLSpan.class);
-        assertEquals(1, spans.length);
+        assertEquals(2, spans.length);
         assertEquals("test:FilterUpperCase.pattern", spans[0].getURL());
+        assertEquals("test:12", spans[1].getURL());
     }
 
     @TestTargetNew(
@@ -272,7 +268,6 @@
         method = "addLinks",
         args = {android.text.Spannable.class, java.util.regex.Pattern.class, java.lang.String.class}
     )
-    @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
     public void testAddLinks5() {
         String text = "google.pattern, test:AZ0101.pattern";
 
@@ -312,8 +307,6 @@
                 android.text.util.Linkify.MatchFilter.class,
                 android.text.util.Linkify.TransformFilter.class}
     )
-    @ToBeFixed(bug = "1417734", explanation = "NullPointerException issue")
-    @BrokenTest("Filter and pattern need to be fixed")
     public void testAddLinks6() {
         String text = "FilterUpperCase.pattern, 12.345.pattern";
 
@@ -321,8 +314,9 @@
         Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:",
                 mMatchFilterStartWithDot, mTransformFilterUpperChar);
         URLSpan[] spans = (spannable.getSpans(0, spannable.length(), URLSpan.class));
-        assertEquals(1, spans.length);
+        assertEquals(2, spans.length);
         assertEquals("test:ilterpperase.pattern", spans[0].getURL());
+        assertEquals("test:12", spans[1].getURL());
 
         try {
             Linkify.addLinks((Spannable)null, LINKIFY_TEST_PATTERN, "Test:",
@@ -344,20 +338,23 @@
         Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, null, mMatchFilterStartWithDot,
                 mTransformFilterUpperChar);
         spans = (spannable.getSpans(0, spannable.length(), URLSpan.class));
-        assertEquals(1, spans.length);
+        assertEquals(2, spans.length);
         assertEquals("ilterpperase.pattern", spans[0].getURL());
+        assertEquals("12", spans[1].getURL());
 
         spannable = new SpannableString(text);
         Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:", null, mTransformFilterUpperChar);
         spans = (spannable.getSpans(0, spannable.length(), URLSpan.class));
-        assertEquals(2, spans.length);
+        assertEquals(3, spans.length);
         assertEquals("test:ilterpperase.pattern", spans[0].getURL());
-        assertEquals("test:345.pattern", spans[1].getURL());
+        assertEquals("test:12", spans[1].getURL());
+        assertEquals("test:345.pattern", spans[2].getURL());
 
         spannable = new SpannableString(text);
         Linkify.addLinks(spannable, LINKIFY_TEST_PATTERN, "Test:", mMatchFilterStartWithDot, null);
         spans = (spannable.getSpans(0, spannable.length(), URLSpan.class));
-        assertEquals(1, spans.length);
+        assertEquals(2, spans.length);
         assertEquals("test:FilterUpperCase.pattern", spans[0].getURL());
+        assertEquals("test:12", spans[1].getURL());
     }
 }