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);
}
}
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();
}
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();
}
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();
}
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));
}
Aggregations