use of org.junit.jupiter.api.Disabled in project Smack by igniterealtime.
the class PacketParserUtilsTest method duplicateMessageBodiesTest.
// TODO: Re-enable once we throw an exception on duplicate body elements.
@Disabled
@Test
public void duplicateMessageBodiesTest() throws FactoryConfigurationError, XmlPullParserException, IOException, Exception {
String defaultLanguage = Stanza.getDefaultLanguage();
// message has default language, first body no language, second body default language
String control = XMLBuilder.create("message").namespace(StreamOpen.CLIENT_NAMESPACE).a("from", "romeo@montague.lit/orchard").a("to", "juliet@capulet.lit/balcony").a("id", "zid615d9").a("type", "chat").a("xml:lang", defaultLanguage).e("body").t(defaultLanguage).up().e("body").a("xml:lang", defaultLanguage).t(defaultLanguage + "2").asString(outputProperties);
Message message = PacketParserUtils.parseMessage(PacketParserUtils.getParserFor(control));
assertEquals(defaultLanguage, message.getBody());
assertEquals(defaultLanguage, message.getBody(defaultLanguage));
assertEquals(1, message.getBodies().size());
assertEquals(0, message.getBodyLanguages().size());
assertXmlNotSimilar(control, message.toXML().toString());
}
use of org.junit.jupiter.api.Disabled in project dubbo by alibaba.
the class RmiProtocolTest method testRmiProtocol_echoService.
// FIXME RMI protocol doesn't support casting to EchoService yet.
@Disabled
@Test
public void testRmiProtocol_echoService() throws Exception {
int availablePort = NetUtils.getAvailablePort();
DemoService service = new DemoServiceImpl();
Exporter<?> rpcExporter = protocol.export(proxy.getInvoker(service, DemoService.class, URL.valueOf("rmi://127.0.0.1:" + availablePort + "/TestService")));
// cast to EchoService
EchoService echo = proxy.getProxy(protocol.refer(EchoService.class, URL.valueOf("rmi://127.0.0.1:" + availablePort + "/TestService")));
assertEquals(echo.$echo("test"), "test");
assertEquals(echo.$echo("abcdefg"), "abcdefg");
assertEquals(echo.$echo(1234), 1234);
rpcExporter.unexport();
availablePort = NetUtils.getAvailablePort();
RemoteService remoteService = new RemoteServiceImpl();
rpcExporter = protocol.export(proxy.getInvoker(remoteService, RemoteService.class, URL.valueOf("rmi://127.0.0.1:" + availablePort + "/remoteService")));
// cast to EchoService
echo = proxy.getProxy(protocol.refer(EchoService.class, URL.valueOf("rmi://127.0.0.1:" + availablePort + "/remoteService")));
assertEquals(echo.$echo("test"), "test");
assertEquals(echo.$echo("abcdefg"), "abcdefg");
assertEquals(echo.$echo(1234), 1234);
rpcExporter.unexport();
}
use of org.junit.jupiter.api.Disabled in project graphhopper by graphhopper.
the class NavigateResponseConverterTest method alternativeRoutesTest.
@Test
@Disabled
public void alternativeRoutesTest() {
GHResponse rsp = hopper.route(new GHRequest(42.554851, 1.536198, 42.510071, 1.548128).setProfile(profile).setAlgorithm(Parameters.Algorithms.ALT_ROUTE));
assertEquals(2, rsp.getAll().size());
ObjectNode json = NavigateResponseConverter.convertFromGHResponse(rsp, trMap, Locale.ENGLISH, distanceConfig);
JsonNode routes = json.get("routes");
assertEquals(2, routes.size());
assertEquals("GraphHopper Route 0", routes.get(0).get("legs").get(0).get("summary").asText());
assertEquals("Avinguda Sant Antoni, CG-3", routes.get(1).get("legs").get(0).get("summary").asText());
}
use of org.junit.jupiter.api.Disabled in project dubbo by alibaba.
the class RegistryDirectoryTest method testParmeterRoute.
/**
* When the first arg of a method is String or Enum, Registry server can do parameter-value-based routing.
*/
@Disabled("Parameter routing is not available at present.")
@Test
public void testParmeterRoute() {
RegistryDirectory registryDirectory = getRegistryDirectory();
List<URL> serviceUrls = new ArrayList<URL>();
serviceUrls.add(SERVICEURL.addParameter("methods", "getXXX1.napoli"));
serviceUrls.add(SERVICEURL2.addParameter("methods", "getXXX1.MORGAN,getXXX2"));
serviceUrls.add(SERVICEURL3.addParameter("methods", "getXXX1.morgan,getXXX2,getXXX3"));
registryDirectory.notify(serviceUrls);
invocation = new RpcInvocation($INVOKE, GenericService.class.getName(), "", new Class[] { String.class, String[].class, Object[].class }, new Object[] { "getXXX1", new String[] { "Enum" }, new Object[] { Param.MORGAN } });
List invokers = registryDirectory.list(invocation);
Assertions.assertEquals(1, invokers.size());
}
use of org.junit.jupiter.api.Disabled in project zookeeper by apache.
the class OOMTest method testOOM.
@Test
@Disabled
public void testOOM() throws IOException, InterruptedException, KeeperException {
File tmpDir = ClientBase.createTmpDir();
// Grab some memory so that it is easier to cause an
// OOM condition;
List<byte[]> hog = new ArrayList<>();
while (true) {
try {
hog.add(new byte[1024 * 1024 * 2]);
} catch (OutOfMemoryError e) {
hog.remove(0);
break;
}
}
ClientBase.setupTestEnv();
ZooKeeperServer zks = new ZooKeeperServer(tmpDir, tmpDir, 3000);
final int PORT = PortAssignment.unique();
ServerCnxnFactory f = ServerCnxnFactory.createFactory(PORT, -1);
f.startup(zks);
assertTrue(ClientBase.waitForServerUp("127.0.0.1:" + PORT, CONNECTION_TIMEOUT), "waiting for server up");
System.err.println("OOM Stage 0");
utestPrep(PORT);
System.out.println("Free = " + Runtime.getRuntime().freeMemory() + " total = " + Runtime.getRuntime().totalMemory() + " max = " + Runtime.getRuntime().maxMemory());
System.err.println("OOM Stage 1");
for (int i = 0; i < 1000; i++) {
System.out.println(i);
utestExists(PORT);
}
System.out.println("Free = " + Runtime.getRuntime().freeMemory() + " total = " + Runtime.getRuntime().totalMemory() + " max = " + Runtime.getRuntime().maxMemory());
System.err.println("OOM Stage 2");
for (int i = 0; i < 1000; i++) {
System.out.println(i);
utestGet(PORT);
}
System.out.println("Free = " + Runtime.getRuntime().freeMemory() + " total = " + Runtime.getRuntime().totalMemory() + " max = " + Runtime.getRuntime().maxMemory());
System.err.println("OOM Stage 3");
for (int i = 0; i < 1000; i++) {
System.out.println(i);
utestChildren(PORT);
}
System.out.println("Free = " + Runtime.getRuntime().freeMemory() + " total = " + Runtime.getRuntime().totalMemory() + " max = " + Runtime.getRuntime().maxMemory());
hog.get(0)[0] = (byte) 1;
f.shutdown();
zks.shutdown();
assertTrue(ClientBase.waitForServerDown("127.0.0.1:" + PORT, CONNECTION_TIMEOUT), "waiting for server down");
}
Aggregations