Search in sources :

Example 96 with Disabled

use of org.junit.jupiter.api.Disabled in project dubbo by alibaba.

the class DubboProtocolTest method testDubboProtocolWithMina.

@Disabled("Mina has been moved to a separate project")
@Test
public void testDubboProtocolWithMina() throws Exception {
    DemoService service = new DemoServiceImpl();
    int port = NetUtils.getAvailablePort();
    protocol.export(proxy.getInvoker(service, DemoService.class, URL.valueOf("dubbo://127.0.0.1:" + port + "/" + DemoService.class.getName()).addParameter(Constants.SERVER_KEY, "mina")));
    service = proxy.getProxy(protocol.refer(DemoService.class, URL.valueOf("dubbo://127.0.0.1:" + port + "/" + DemoService.class.getName()).addParameter(Constants.CLIENT_KEY, "mina").addParameter("timeout", 3000L)));
    for (int i = 0; i < 10; i++) {
        assertEquals(service.enumlength(new Type[] {}), Type.Lower);
        assertEquals(service.getSize(null), -1);
        assertEquals(service.getSize(new String[] { "", "", "" }), 3);
    }
    Map<String, String> map = new HashMap<String, String>();
    map.put("aa", "bb");
    for (int i = 0; i < 10; i++) {
        Set<String> set = service.keys(map);
        assertEquals(set.size(), 1);
        assertEquals(set.iterator().next(), "aa");
        service.invoke("dubbo://127.0.0.1:" + port + "/" + DemoService.class.getName() + "", "invoke");
    }
    service = proxy.getProxy(protocol.refer(DemoService.class, URL.valueOf("dubbo://127.0.0.1:" + port + "/" + DemoService.class.getName() + "?client=mina").addParameter("timeout", 3000L)));
    // test netty client
    StringBuilder buf = new StringBuilder();
    for (int i = 0; i < 1024 * 32 + 32; i++) buf.append('A');
    System.out.println(service.stringLength(buf.toString()));
    // cast to EchoService
    EchoService echo = proxy.getProxy(protocol.refer(EchoService.class, URL.valueOf("dubbo://127.0.0.1:" + port + "/" + DemoService.class.getName() + "?client=mina").addParameter("timeout", 3000L)));
    for (int i = 0; i < 10; i++) {
        assertEquals(echo.$echo(buf.toString()), buf.toString());
        assertEquals(echo.$echo("test"), "test");
        assertEquals(echo.$echo("abcdefg"), "abcdefg");
        assertEquals(echo.$echo(1234), 1234);
    }
}
Also used : Type(org.apache.dubbo.rpc.protocol.dubbo.support.Type) HashMap(java.util.HashMap) EchoService(org.apache.dubbo.rpc.service.EchoService) DemoService(org.apache.dubbo.rpc.protocol.dubbo.support.DemoService) DemoServiceImpl(org.apache.dubbo.rpc.protocol.dubbo.support.DemoServiceImpl) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 97 with Disabled

use of org.junit.jupiter.api.Disabled in project dubbo by alibaba.

the class EnumBak method testEnumCompat.

// verify compatibility when 2.0.5 invokes 2.0.3
@Disabled
@Test
public void testEnumCompat() {
    int port = NetUtils.getAvailablePort();
    URL consumerurl = URL.valueOf("dubbo://127.0.0.1:" + port + "/test?timeout=" + Integer.MAX_VALUE);
    ApplicationModel.getServiceRepository().registerService(DemoService.class);
    Invoker<DemoService> reference = protocol.refer(DemoService.class, consumerurl);
    DemoService demoProxy = (DemoService) proxy.getProxy(reference);
    Type type = demoProxy.enumlength(Type.High);
    System.out.println(type);
    Assertions.assertEquals(Type.High, type);
    reference.destroy();
}
Also used : URL(org.apache.dubbo.common.URL) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 98 with Disabled

use of org.junit.jupiter.api.Disabled in project dubbo by alibaba.

the class EnumBak method testExportService.

@Disabled
@Test
public void testExportService() throws InterruptedException {
    int port = NetUtils.getAvailablePort();
    URL serviceurl = URL.valueOf("dubbo://127.0.0.1:" + port + "/test?proxy=jdk&timeout=" + Integer.MAX_VALUE);
    DemoService demo = new DemoServiceImpl();
    Invoker<DemoService> invoker = proxy.getInvoker(demo, DemoService.class, serviceurl);
    protocol.export(invoker);
    synchronized (EnumBak.class) {
        EnumBak.class.wait();
    }
// URL consumerurl = serviceurl;
// Invoker<DemoService> reference = protocol.refer(DemoService.class, consumerurl);
// DemoService demoProxy = (DemoService)proxyFactory.createProxy(reference);
// //        System.out.println(demoProxy.getThreadName());
// System.out.println("byte:"+demoProxy.getbyte((byte)-128));
// 
// invoker.destroy();
// reference.destroy();
}
Also used : URL(org.apache.dubbo.common.URL) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 99 with Disabled

use of org.junit.jupiter.api.Disabled in project dubbo by alibaba.

the class ReferenceConfigTest method testInjvm.

@Test
@Disabled("Disabled due to Github Actions environment")
public void testInjvm() throws Exception {
    ApplicationConfig application = new ApplicationConfig();
    application.setName("test-protocol-random-port");
    RegistryConfig registry = new RegistryConfig();
    registry.setAddress(registryUrl);
    ProtocolConfig protocol = new ProtocolConfig();
    protocol.setName("dubbo");
    ServiceConfig<DemoService> demoService;
    demoService = new ServiceConfig<DemoService>();
    demoService.setInterface(DemoService.class);
    demoService.setRef(new DemoServiceImpl());
    demoService.setApplication(application);
    demoService.setRegistry(registry);
    demoService.setProtocol(protocol);
    ReferenceConfig<DemoService> rc = new ReferenceConfig<DemoService>();
    rc.setApplication(application);
    rc.setRegistry(registry);
    rc.setInterface(DemoService.class.getName());
    rc.setScope(SCOPE_REMOTE);
    try {
        System.setProperty("java.net.preferIPv4Stack", "true");
        demoService.export();
        rc.get();
        Assertions.assertTrue(!LOCAL_PROTOCOL.equalsIgnoreCase(rc.getInvoker().getUrl().getProtocol()));
    } finally {
        System.clearProperty("java.net.preferIPv4Stack");
        rc.destroy();
        demoService.unexport();
    }
    // Manually trigger dubbo resource recycling.
    DubboBootstrap.getInstance().destroy();
}
Also used : DemoService(org.apache.dubbo.config.api.DemoService) DemoServiceImpl(org.apache.dubbo.config.provider.impl.DemoServiceImpl) Test(org.junit.jupiter.api.Test) Disabled(org.junit.jupiter.api.Disabled)

Example 100 with Disabled

use of org.junit.jupiter.api.Disabled in project dubbo by alibaba.

the class ZookeeperRegistryTest method testStatusChecker.

@Disabled
@Test
public /*
      This UT is unstable, consider remove it later.
      @see https://github.com/apache/dubbo/issues/1787
     */
void testStatusChecker() {
    RegistryStatusChecker registryStatusChecker = new RegistryStatusChecker();
    Status status = registryStatusChecker.check();
    assertThat(status.getLevel(), is(Status.Level.UNKNOWN));
    Registry registry = zookeeperRegistryFactory.getRegistry(registryUrl);
    assertThat(registry, not(nullValue()));
    status = registryStatusChecker.check();
    assertThat(status.getLevel(), is(Status.Level.ERROR));
    registry.register(serviceUrl);
    status = registryStatusChecker.check();
    assertThat(status.getLevel(), is(Status.Level.OK));
}
Also used : Status(org.apache.dubbo.common.status.Status) Registry(org.apache.dubbo.registry.Registry) RegistryStatusChecker(org.apache.dubbo.registry.status.RegistryStatusChecker) 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