File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
main/java/com/rallydev/rest/util
test/java/com/rallydev/rest/util Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ public class Ref {
2323 Pattern .compile (".*?/(\\ w+/-?\\ d+)/(\\ w+)(?:\\ .js\\ ??.*)*$" ),
2424
2525 //basic ref (/defect/1234)
26- Pattern .compile (".*?/(\\ w+)/(\\ d+)(?:\\ .js\\ ??.*)*$" ),
26+ Pattern .compile (".*?/(\\ w+)/(-? \\ d+)(?:\\ .js\\ ??.*)*$" ),
2727
2828 //permission ref (/workspacepermission/123u456w1)
2929 Pattern .compile (".*?/(\\ w+)/(\\ d+u\\ d+[pw]\\ d+)(?:\\ .js\\ ??.*)*$" )
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ public class RefTest {
99 public void shouldDetectValidRefs () {
1010 Assert .assertTrue (Ref .isRef ("/defect/1234" ), "Valid relative ref" );
1111 Assert .assertTrue (Ref .isRef ("/defect/1234.js" ), "Valid relative ref w/ extension" );
12+ Assert .assertTrue (Ref .isRef ("/typedefinition/-1234.js" ), "Valid relative built-in typedef ref" );
1213 Assert .assertTrue (Ref .isRef ("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234" ), "Valid absolute ref" );
1314 Assert .assertTrue (Ref .isRef ("http://rally1.rallydev.com/slm/webservice/1.32/defect/1234.js" ), "Valid absolute ref w/ extension" );
1415 }
@@ -75,6 +76,7 @@ public void shouldReturnNullTypesFromRefs() {
7576 public void shouldReturnOidsFromRefs () {
7677 Assert .assertEquals (Ref .getOidFromRef ("/defect/1234" ), "1234" , "Relative ref" );
7778 Assert .assertEquals (Ref .getOidFromRef ("/defect/1234.js" ), "1234" , "Relative ref with extension" );
79+ Assert .assertEquals (Ref .getOidFromRef ("/typedefinition/-1234.js" ), "-1234" , "Relative built-in typedef ref" );
7880 Assert .assertEquals (Ref .getOidFromRef ("https://rally1.rallydev.com/slm/webservice/1.32/defect/1234" ), "1234" , "Valid absolute ref" );
7981 }
8082
You can’t perform that action at this time.
0 commit comments