mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-23 20:42:06 +01:00
Merge master
This commit is contained in:
commit
a3bb7e3f59
5 changed files with 51 additions and 14 deletions
|
@ -91,6 +91,7 @@ public final class JingleTransportMethodManager extends Manager {
|
|||
return getTransportManager(transport.getNamespace());
|
||||
}
|
||||
|
||||
|
||||
public static JingleTransportManager<?> getBestAvailableTransportManager(XMPPConnection connection) {
|
||||
return getInstanceFor(connection).getBestAvailableTransportManager();
|
||||
}
|
||||
|
|
|
@ -30,6 +30,8 @@ import java.net.Socket;
|
|||
import java.net.SocketException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
|
||||
import org.jivesoftware.smack.util.StringUtils;
|
||||
|
@ -102,13 +104,11 @@ public class Socks5ProxyTest {
|
|||
@Test
|
||||
public void shouldPreserveAddressOrderOnInsertions() {
|
||||
Socks5Proxy proxy = Socks5Proxy.getSocks5Proxy();
|
||||
List<String> addresses = new ArrayList<>(proxy.getLocalAddresses());
|
||||
|
||||
LinkedHashSet<String> addresses = new LinkedHashSet<>(proxy.getLocalAddresses());
|
||||
|
||||
for (int i = 1 ; i <= 3; i++) {
|
||||
String addr = Integer.toString(i);
|
||||
if (!addresses.contains(addr)) {
|
||||
addresses.add(addr);
|
||||
}
|
||||
addresses.add(Integer.toString(i));
|
||||
}
|
||||
|
||||
for (String address : addresses) {
|
||||
|
@ -116,8 +116,10 @@ public class Socks5ProxyTest {
|
|||
}
|
||||
|
||||
List<String> localAddresses = proxy.getLocalAddresses();
|
||||
|
||||
Iterator<String> iterator = addresses.iterator();
|
||||
for (int i = 0; i < addresses.size(); i++) {
|
||||
assertEquals(addresses.get(i), localAddresses.get(i));
|
||||
assertEquals(iterator.next(), localAddresses.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -249,7 +251,7 @@ public class Socks5ProxyTest {
|
|||
|
||||
// send valid SOCKS5 message
|
||||
out.write(new byte[] { (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x01,
|
||||
(byte) 0xAA, (byte) 0x00, (byte) 0x00 });
|
||||
(byte) 0xAA, (byte) 0x00, (byte) 0x00 });
|
||||
|
||||
// verify error message
|
||||
assertEquals((byte) 0x05, (byte) in.read());
|
||||
|
@ -297,7 +299,7 @@ public class Socks5ProxyTest {
|
|||
|
||||
// send valid SOCKS5 message
|
||||
out.write(new byte[] { (byte) 0x05, (byte) 0x00, (byte) 0x00, (byte) 0x03, (byte) 0x01,
|
||||
(byte) 0xAA, (byte) 0x00, (byte) 0x00 });
|
||||
(byte) 0xAA, (byte) 0x00, (byte) 0x00 });
|
||||
|
||||
// verify response
|
||||
assertEquals((byte) 0x05, (byte) in.read());
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017 Paul Schaub
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import static junit.framework.TestCase.assertEquals;
|
||||
|
|
|
@ -1,3 +1,19 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2017 Paul Schaub
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jivesoftware.smackx.jingle;
|
||||
|
||||
import static junit.framework.TestCase.assertEquals;
|
||||
|
|
|
@ -32,6 +32,7 @@ import org.jxmpp.jid.FullJid;
|
|||
import org.jxmpp.jid.impl.JidCreate;
|
||||
import org.jxmpp.stringprep.XmppStringprepException;
|
||||
|
||||
|
||||
/**
|
||||
* Test the JingleUtil class.
|
||||
*/
|
||||
|
@ -45,6 +46,7 @@ public class JingleUtilTest extends SmackTestSuite {
|
|||
|
||||
@Before
|
||||
public void setup() throws XmppStringprepException {
|
||||
|
||||
connection = new DummyConnection(
|
||||
DummyConnection.getDummyConfigurationBuilder()
|
||||
.setUsernameAndPassword("romeo@montague.lit",
|
||||
|
|
Loading…
Reference in a new issue