public void getMatched()
{
//-----------------------
// null
{
VariablePath matched=matcher.getMatched((String)null);
Assert.assertNull(matched);
}
{
VariablePath matched=matcher.getMatched((VariablePath)null);
Assert.assertNull(matched);
}
{
VariablePath matched=matcher.getMatched("/abc/def");
Assert.assertNull(matched);
}
{
VariablePath matched=matcher.getMatched("/abc/{def}");
Assert.assertNull(matched);
}
{
VariablePath matched=matcher.getMatched("/abc/def/ghi/sdf");
Assert.assertNull(matched);
}
//-----------------------
// "/abc"
{
VariablePath matched=matcher.getMatched("/abc");
Assert.assertEquals("/abc",matched.toString());
}
{
VariablePath matched=matcher.getMatched("/{abc}");
Assert.assertNull(matched);
}
//-----------------------
// "/{abc}/{def}/ghi"
{
VariablePath matched=matcher.getMatched("/{abc}/{def}/ghi");
Assert.assertEquals("/{abc}/{def}/ghi",matched.toString());
}
{
VariablePath matched=matcher.getMatched("/{3333}/{5555}/ghi");
Assert.assertEquals("/{abc}/{def}/ghi",matched.toString());
}
{
VariablePath matched=matcher.getMatched("/view/001/ghi");
Assert.assertEquals("/{abc}/{def}/ghi",matched.toString());
}
{
VariablePath matched=matcher.getMatched("/edit/001/ghi");
Assert.assertEquals("/{abc}/{def}/ghi",matched.toString());
}
//-----------------------
// "/{abc}/def/{ghi}"
{
VariablePath matched=matcher.getMatched("/{abc}/def/{ghi}");
Assert.assertEquals("/{abc}/def/{ghi}",matched.toString());
}
{
VariablePath matched=matcher.getMatched("/{ab342bc}/def/{gbsdhi}");
Assert.assertEquals("/{abc}/def/{ghi}",matched.toString());
}
{
VariablePath matched=matcher.getMatched("/query/def/0035");
Assert.assertEquals("/{abc}/def/{ghi}",matched.toString());
}
//-----------------------
// "/{abc}/def/ghi"
{
VariablePath matched=matcher.getMatched("/{abc}/def/ghi");
Assert.assertEquals("/{abc}/def/ghi",matched.toString());
}
{
VariablePath matched=matcher.getMatched("/{abdfewc}/def/ghi");
Assert.assertEquals("/{abc}/def/ghi",matched.toString());
}
{
VariablePath matched=matcher.getMatched("/hahaha003/def/ghi");
Assert.assertEquals("/{abc}/def/ghi",matched.toString());
}
//-----------------------
// "/abc/def/ghi"
{
VariablePath matched=matcher.getMatched("/abc/def/ghi");
Assert.assertEquals("/abc/def/ghi",matched.toString());
}
}