mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-27 14:47:59 +01:00
Adds XMPPAdress parsing tests
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2178 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
a4eef67896
commit
0e33590936
1 changed files with 15 additions and 0 deletions
|
@ -206,4 +206,19 @@ public class StringUtilsTest extends TestCase {
|
|||
result = StringUtils.randomString(128);
|
||||
assertTrue(result.length() == 128);
|
||||
}
|
||||
|
||||
public void testParsing() {
|
||||
String error = "Error parsing node name";
|
||||
assertEquals(error, StringUtils.parseName("yahoo.myjabber.net"), "");
|
||||
assertEquals(error, StringUtils.parseName("yahoo.myjabber.net/registred"), "");
|
||||
assertEquals(error, StringUtils.parseName("user@yahoo.myjabber.net/registred"), "user");
|
||||
assertEquals(error, StringUtils.parseName("user@yahoo.myjabber.net"), "user");
|
||||
|
||||
error = "Error parsing server name";
|
||||
String result = "yahoo.myjabber.net";
|
||||
assertEquals(error, StringUtils.parseServer("yahoo.myjabber.net"), result);
|
||||
assertEquals(error, StringUtils.parseServer("yahoo.myjabber.net/registred"), result);
|
||||
assertEquals(error, StringUtils.parseServer("user@yahoo.myjabber.net/registred"), result);
|
||||
assertEquals(error, StringUtils.parseServer("user@yahoo.myjabber.net"), result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue