mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +01:00
Fix compile errors in jingle code
Which where introduced by merging20eabca1b3
afterb14aca744f
This commit is contained in:
parent
1d53889874
commit
541c9ecfdd
4 changed files with 26 additions and 25 deletions
|
@ -70,7 +70,7 @@ public abstract class JingleContentTransport implements ExtensionElement {
|
||||||
XmlStringBuilder xml = new XmlStringBuilder(this);
|
XmlStringBuilder xml = new XmlStringBuilder(this);
|
||||||
addExtraAttributes(xml);
|
addExtraAttributes(xml);
|
||||||
|
|
||||||
if (candidates.isEmpty() && infos.isEmpty()) {
|
if (candidates.isEmpty() && info == null) {
|
||||||
xml.closeEmptyElement();
|
xml.closeEmptyElement();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -39,8 +39,8 @@ public class JingleS5BTransport extends JingleContentTransport {
|
||||||
private final String dstAddr;
|
private final String dstAddr;
|
||||||
private final Bytestream.Mode mode;
|
private final Bytestream.Mode mode;
|
||||||
|
|
||||||
protected JingleS5BTransport(List<JingleContentTransportCandidate> candidates, List<JingleContentTransportInfo> infos, String streamId, String dstAddr, Bytestream.Mode mode) {
|
protected JingleS5BTransport(List<JingleContentTransportCandidate> candidates, JingleContentTransportInfo info, String streamId, String dstAddr, Bytestream.Mode mode) {
|
||||||
super(candidates, infos);
|
super(candidates, info);
|
||||||
StringUtils.requireNotNullOrEmpty(streamId, "sid MUST be neither null, nor empty.");
|
StringUtils.requireNotNullOrEmpty(streamId, "sid MUST be neither null, nor empty.");
|
||||||
this.streamId = streamId;
|
this.streamId = streamId;
|
||||||
this.dstAddr = dstAddr;
|
this.dstAddr = dstAddr;
|
||||||
|
@ -94,7 +94,7 @@ public class JingleS5BTransport extends JingleContentTransport {
|
||||||
private String dstAddr;
|
private String dstAddr;
|
||||||
private Bytestream.Mode mode;
|
private Bytestream.Mode mode;
|
||||||
private ArrayList<JingleContentTransportCandidate> candidates = new ArrayList<>();
|
private ArrayList<JingleContentTransportCandidate> candidates = new ArrayList<>();
|
||||||
private ArrayList<JingleContentTransportInfo> infos = new ArrayList<>();
|
private JingleContentTransportInfo info;
|
||||||
|
|
||||||
public Builder setStreamId(String sid) {
|
public Builder setStreamId(String sid) {
|
||||||
this.streamId = sid;
|
this.streamId = sid;
|
||||||
|
@ -116,29 +116,29 @@ public class JingleS5BTransport extends JingleContentTransport {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder addTransportInfo(JingleContentTransportInfo info) {
|
public Builder setTransportInfo(JingleContentTransportInfo info) {
|
||||||
this.infos.add(info);
|
this.info = info;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setCandidateUsed(String candidateId) {
|
public Builder setCandidateUsed(String candidateId) {
|
||||||
return addTransportInfo(JingleS5BTransportInfo.CandidateUsed(candidateId));
|
return setTransportInfo(JingleS5BTransportInfo.CandidateUsed(candidateId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setCandidateActivated(String candidateId) {
|
public Builder setCandidateActivated(String candidateId) {
|
||||||
return addTransportInfo(JingleS5BTransportInfo.CandidateActivated(candidateId));
|
return setTransportInfo(JingleS5BTransportInfo.CandidateActivated(candidateId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setCandidateError() {
|
public Builder setCandidateError() {
|
||||||
return addTransportInfo(JingleS5BTransportInfo.CandidateError());
|
return setTransportInfo(JingleS5BTransportInfo.CandidateError());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Builder setProxyError() {
|
public Builder setProxyError() {
|
||||||
return addTransportInfo(JingleS5BTransportInfo.ProxyError());
|
return setTransportInfo(JingleS5BTransportInfo.ProxyError());
|
||||||
}
|
}
|
||||||
|
|
||||||
public JingleS5BTransport build() {
|
public JingleS5BTransport build() {
|
||||||
return new JingleS5BTransport(candidates, infos, streamId, dstAddr, mode);
|
return new JingleS5BTransport(candidates, info, streamId, dstAddr, mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,23 +83,23 @@ public class JingleS5BTransportProvider extends JingleContentTransportProvider<J
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JingleS5BTransportInfo.CandidateActivated.ELEMENT:
|
case JingleS5BTransportInfo.CandidateActivated.ELEMENT:
|
||||||
builder.addTransportInfo(JingleS5BTransportInfo.CandidateActivated(
|
builder.setTransportInfo(JingleS5BTransportInfo.CandidateActivated(
|
||||||
parser.getAttributeValue(null,
|
parser.getAttributeValue(null,
|
||||||
JingleS5BTransportInfo.CandidateActivated.ATTR_CID)));
|
JingleS5BTransportInfo.CandidateActivated.ATTR_CID)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JingleS5BTransportInfo.CandidateUsed.ELEMENT:
|
case JingleS5BTransportInfo.CandidateUsed.ELEMENT:
|
||||||
builder.addTransportInfo(JingleS5BTransportInfo.CandidateUsed(
|
builder.setTransportInfo(JingleS5BTransportInfo.CandidateUsed(
|
||||||
parser.getAttributeValue(null,
|
parser.getAttributeValue(null,
|
||||||
JingleS5BTransportInfo.CandidateUsed.ATTR_CID)));
|
JingleS5BTransportInfo.CandidateUsed.ATTR_CID)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JingleS5BTransportInfo.CandidateError.ELEMENT:
|
case JingleS5BTransportInfo.CandidateError.ELEMENT:
|
||||||
builder.addTransportInfo(JingleS5BTransportInfo.CandidateError());
|
builder.setTransportInfo(JingleS5BTransportInfo.CandidateError());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case JingleS5BTransportInfo.ProxyError.ELEMENT:
|
case JingleS5BTransportInfo.ProxyError.ELEMENT:
|
||||||
builder.addTransportInfo(JingleS5BTransportInfo.ProxyError());
|
builder.setTransportInfo(JingleS5BTransportInfo.ProxyError());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ package org.jivesoftware.smackx.jingle.transports.jingle_s5b;
|
||||||
|
|
||||||
import static junit.framework.TestCase.assertNull;
|
import static junit.framework.TestCase.assertNull;
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertNotNull;
|
||||||
|
|
||||||
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
import org.jivesoftware.smack.test.util.SmackTestSuite;
|
||||||
import org.jivesoftware.smack.test.util.TestUtils;
|
import org.jivesoftware.smack.test.util.TestUtils;
|
||||||
|
@ -114,10 +115,10 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
||||||
JingleS5BTransport candidateErrorTransport = new JingleS5BTransportProvider()
|
JingleS5BTransport candidateErrorTransport = new JingleS5BTransportProvider()
|
||||||
.parse(TestUtils.getParser(candidateError));
|
.parse(TestUtils.getParser(candidateError));
|
||||||
assertNull(candidateErrorTransport.getDestinationAddress());
|
assertNull(candidateErrorTransport.getDestinationAddress());
|
||||||
assertEquals(1, candidateErrorTransport.getInfos().size());
|
assertNotNull(candidateErrorTransport.getInfo());
|
||||||
assertEquals("vj3hs98y", candidateErrorTransport.getStreamId());
|
assertEquals("vj3hs98y", candidateErrorTransport.getStreamId());
|
||||||
assertEquals(JingleS5BTransportInfo.CandidateError(),
|
assertEquals(JingleS5BTransportInfo.CandidateError(),
|
||||||
candidateErrorTransport.getInfos().get(0));
|
candidateErrorTransport.getInfo());
|
||||||
assertEquals(candidateError, candidateErrorTransport.toXML().toString());
|
assertEquals(candidateError, candidateErrorTransport.toXML().toString());
|
||||||
|
|
||||||
String proxyError =
|
String proxyError =
|
||||||
|
@ -127,10 +128,10 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
||||||
JingleS5BTransport proxyErrorTransport = new JingleS5BTransportProvider()
|
JingleS5BTransport proxyErrorTransport = new JingleS5BTransportProvider()
|
||||||
.parse(TestUtils.getParser(proxyError));
|
.parse(TestUtils.getParser(proxyError));
|
||||||
assertNull(proxyErrorTransport.getDestinationAddress());
|
assertNull(proxyErrorTransport.getDestinationAddress());
|
||||||
assertEquals(1, proxyErrorTransport.getInfos().size());
|
assertNotNull(candidateErrorTransport.getInfo());
|
||||||
assertEquals("vj3hs98y", proxyErrorTransport.getStreamId());
|
assertEquals("vj3hs98y", proxyErrorTransport.getStreamId());
|
||||||
assertEquals(JingleS5BTransportInfo.ProxyError(),
|
assertEquals(JingleS5BTransportInfo.ProxyError(),
|
||||||
proxyErrorTransport.getInfos().get(0));
|
proxyErrorTransport.getInfo());
|
||||||
assertEquals(proxyError, proxyErrorTransport.toXML().toString());
|
assertEquals(proxyError, proxyErrorTransport.toXML().toString());
|
||||||
|
|
||||||
String candidateUsed =
|
String candidateUsed =
|
||||||
|
@ -139,12 +140,12 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
||||||
"</transport>";
|
"</transport>";
|
||||||
JingleS5BTransport candidateUsedTransport = new JingleS5BTransportProvider()
|
JingleS5BTransport candidateUsedTransport = new JingleS5BTransportProvider()
|
||||||
.parse(TestUtils.getParser(candidateUsed));
|
.parse(TestUtils.getParser(candidateUsed));
|
||||||
assertEquals(1, candidateUsedTransport.getInfos().size());
|
assertNotNull(candidateErrorTransport.getInfo());
|
||||||
assertEquals(JingleS5BTransportInfo.CandidateUsed("hr65dqyd"),
|
assertEquals(JingleS5BTransportInfo.CandidateUsed("hr65dqyd"),
|
||||||
candidateUsedTransport.getInfos().get(0));
|
candidateUsedTransport.getInfo());
|
||||||
assertEquals("hr65dqyd",
|
assertEquals("hr65dqyd",
|
||||||
((JingleS5BTransportInfo.CandidateUsed)
|
((JingleS5BTransportInfo.CandidateUsed)
|
||||||
candidateUsedTransport.getInfos().get(0)).getCandidateId());
|
candidateUsedTransport.getInfo()).getCandidateId());
|
||||||
assertEquals(candidateUsed, candidateUsedTransport.toXML().toString());
|
assertEquals(candidateUsed, candidateUsedTransport.toXML().toString());
|
||||||
|
|
||||||
String candidateActivated =
|
String candidateActivated =
|
||||||
|
@ -153,12 +154,12 @@ public class JingleS5BTransportTest extends SmackTestSuite {
|
||||||
"</transport>";
|
"</transport>";
|
||||||
JingleS5BTransport candidateActivatedTransport = new JingleS5BTransportProvider()
|
JingleS5BTransport candidateActivatedTransport = new JingleS5BTransportProvider()
|
||||||
.parse(TestUtils.getParser(candidateActivated));
|
.parse(TestUtils.getParser(candidateActivated));
|
||||||
assertEquals(1, candidateActivatedTransport.getInfos().size());
|
assertNotNull(candidateErrorTransport.getInfo());
|
||||||
assertEquals(JingleS5BTransportInfo.CandidateActivated("hr65dqyd"),
|
assertEquals(JingleS5BTransportInfo.CandidateActivated("hr65dqyd"),
|
||||||
candidateActivatedTransport.getInfos().get(0));
|
candidateActivatedTransport.getInfo());
|
||||||
assertEquals("hr65dqyd",
|
assertEquals("hr65dqyd",
|
||||||
((JingleS5BTransportInfo.CandidateActivated)
|
((JingleS5BTransportInfo.CandidateActivated)
|
||||||
candidateActivatedTransport.getInfos().get(0)).getCandidateId());
|
candidateActivatedTransport.getInfo()).getCandidateId());
|
||||||
assertEquals(candidateActivated, candidateActivatedTransport.toXML().toString());
|
assertEquals(candidateActivated, candidateActivatedTransport.toXML().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue