Search in sources :

Example 86 with Disabled

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());
}
Also used : Message(org.jivesoftware.smack.packet.Message) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) Disabled(org.junit.jupiter.api.Disabled)

Example 87 with Disabled

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();
}
Also used : EchoService(org.apache.dubbo.rpc.service.EchoService) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 88 with Disabled

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());
}
Also used : ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) GHRequest(com.graphhopper.GHRequest) JsonNode(com.fasterxml.jackson.databind.JsonNode) GHResponse(com.graphhopper.GHResponse) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 89 with Disabled

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());
}
Also used : RegistryDirectory(org.apache.dubbo.registry.integration.RegistryDirectory) RpcInvocation(org.apache.dubbo.rpc.RpcInvocation) ArrayList(java.util.ArrayList) List(java.util.List) ArrayList(java.util.ArrayList) URL(org.apache.dubbo.common.URL) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 90 with Disabled

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");
}
Also used : ArrayList(java.util.ArrayList) ServerCnxnFactory(org.apache.zookeeper.server.ServerCnxnFactory) File(java.io.File) ZooKeeperServer(org.apache.zookeeper.server.ZooKeeperServer) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Aggregations

Disabled (org.junit.jupiter.api.Disabled)228 Test (org.junit.jupiter.api.Test)214 File (java.io.File)13 TransactionalIntegrationTest (org.hisp.dhis.TransactionalIntegrationTest)13 NoGood (at.ac.tuwien.kr.alpha.core.common.NoGood)10 ArrayList (java.util.ArrayList)10 HashMap (java.util.HashMap)9 NAR (nars.NAR)9 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)9 BaseDataTest (org.apache.ibatis.BaseDataTest)8 TestNAR (nars.test.TestNAR)7 URL (org.apache.dubbo.common.URL)7 SqlSession (org.apache.ibatis.session.SqlSession)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 AnswerSet (at.ac.tuwien.kr.alpha.api.AnswerSet)6 ASPCore2Program (at.ac.tuwien.kr.alpha.api.programs.ASPCore2Program)6 FieldValueModel (com.synopsys.integration.alert.common.rest.model.FieldValueModel)6 IntegrationPerformanceTestRunner (com.synopsys.integration.alert.performance.utility.IntegrationPerformanceTestRunner)6 List (java.util.List)6 RectDouble2D (jcog.tree.rtree.rect.RectDouble2D)6