1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-30 02:02:06 +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:
Gaston Dombiak 2003-12-17 13:55:28 +00:00 committed by gdombiak
parent a4eef67896
commit 0e33590936

View file

@ -206,4 +206,19 @@ public class StringUtilsTest extends TestCase {
result = StringUtils.randomString(128); result = StringUtils.randomString(128);
assertTrue(result.length() == 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);
}
} }