1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-10 18:15:58 +01:00

Remove unused errors and add missing ones

This commit is contained in:
vanitasvitae 2017-06-13 23:57:59 +02:00
parent acc98b4b2f
commit 4ae8434852
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
2 changed files with 12 additions and 12 deletions

View file

@ -28,11 +28,11 @@ public final class JingleError implements ExtensionElement {
public static final JingleError OUT_OF_ORDER = new JingleError("out-of-order"); public static final JingleError OUT_OF_ORDER = new JingleError("out-of-order");
public static final JingleError TIE_BREAK = new JingleError("tie-break");
public static final JingleError UNKNOWN_SESSION = new JingleError("unknown-session"); public static final JingleError UNKNOWN_SESSION = new JingleError("unknown-session");
public static final JingleError UNSUPPORTED_CONTENT = new JingleError("unsupported-content"); public static final JingleError UNSUPPORTED_INFO = new JingleError("unsupported-info");
public static final JingleError UNSUPPORTED_TRANSPORTS = new JingleError("unsupported-transports");
private final String errorName; private final String errorName;
@ -71,10 +71,10 @@ public final class JingleError implements ExtensionElement {
return OUT_OF_ORDER; return OUT_OF_ORDER;
case "unknown-session": case "unknown-session":
return UNKNOWN_SESSION; return UNKNOWN_SESSION;
case "unsupported-content": case "tie-break":
return UNSUPPORTED_CONTENT; return TIE_BREAK;
case "unsupported-transports": case "unsupported-info":
return UNSUPPORTED_TRANSPORTS; return UNSUPPORTED_INFO;
default: default:
throw new IllegalArgumentException(); throw new IllegalArgumentException();
} }

View file

@ -24,7 +24,7 @@ import static junit.framework.TestCase.assertEquals;
import static junit.framework.TestCase.fail; import static junit.framework.TestCase.fail;
/** /**
* Test the JingleError class. TODO: Uncomment missing tests once implemented. * Test the JingleError class.
*/ */
public class JingleErrorTest extends SmackTestSuite { public class JingleErrorTest extends SmackTestSuite {
@ -32,12 +32,12 @@ public class JingleErrorTest extends SmackTestSuite {
public void parserTest() { public void parserTest() {
assertEquals("<out-of-order xmlns='urn:xmpp:jingle:errors:1'/>", assertEquals("<out-of-order xmlns='urn:xmpp:jingle:errors:1'/>",
JingleError.fromString("out-of-order").toXML().toString()); JingleError.fromString("out-of-order").toXML().toString());
//assertEquals("<tie-break xmlns='urn:xmpp:jingle:errors:1'/>", assertEquals("<tie-break xmlns='urn:xmpp:jingle:errors:1'/>",
// JingleError.fromString("tie-break").toXML().toString()); JingleError.fromString("tie-break").toXML().toString());
assertEquals("<unknown-session xmlns='urn:xmpp:jingle:errors:1'/>", assertEquals("<unknown-session xmlns='urn:xmpp:jingle:errors:1'/>",
JingleError.fromString("unknown-session").toXML().toString()); JingleError.fromString("unknown-session").toXML().toString());
//assertEquals("<unsupported-info xmlns='urn:xmpp:jingle:errors:1'/>", assertEquals("<unsupported-info xmlns='urn:xmpp:jingle:errors:1'/>",
// JingleError.fromString("unsupported-info").toXML().toString()); JingleError.fromString("unsupported-info").toXML().toString());
assertEquals("unknown-session", JingleError.fromString("unknown-session").getMessage()); assertEquals("unknown-session", JingleError.fromString("unknown-session").getMessage());
try { try {