Package com.alibaba.dubbo.common

Examples of com.alibaba.dubbo.common.URL.addParameter()


    }
   
    @Test(expected = RpcException.class)
    public void testFail() throws Exception {
        URL url = URL.valueOf("test://test");
        url = url.addParameter(Constants.INTERFACE_KEY,
                               "com.alibaba.dubbo.rpc.file.TpsService");
        url = url.addParameter(Constants.TPS_LIMIT_RATE_KEY, 5);
        Invoker<TpsLimitFilterTest> invoker = new MyInvoker<TpsLimitFilterTest>(url);
        Invocation invocation = new MockInvocation();
        for (int i = 0; i < 10; i++) {
View Full Code Here


    @Test(expected = RpcException.class)
    public void testFail() throws Exception {
        URL url = URL.valueOf("test://test");
        url = url.addParameter(Constants.INTERFACE_KEY,
                               "com.alibaba.dubbo.rpc.file.TpsService");
        url = url.addParameter(Constants.TPS_LIMIT_RATE_KEY, 5);
        Invoker<TpsLimitFilterTest> invoker = new MyInvoker<TpsLimitFilterTest>(url);
        Invocation invocation = new MockInvocation();
        for (int i = 0; i < 10; i++) {
            try {
                filter.invoke(invoker, invocation);
View Full Code Here

    public void test_NotifiedDubbo1() {
        URL             errorPathUrl            = URL.valueOf("notsupport:/" + "xxx"+"?refer=" + URL.encode("interface="+service));
        RegistryDirectory registryDirectory = getRegistryDirectory(errorPathUrl);
        List<URL> serviceUrls = new ArrayList<URL>();
        URL Dubbo1URL = URL.valueOf("dubbo://127.0.0.1:9098?lazy=true");
        serviceUrls.add(Dubbo1URL.addParameter("methods", "getXXX"));
        registryDirectory.notify(serviceUrls);
        Assert.assertEquals(true, registryDirectory.isAvailable());

        invocation = new RpcInvocation();
View Full Code Here

        List<URL> serviceUrls = new ArrayList<URL>();
        // without ROUTER_KEY, the first router should not be created.
        serviceUrls.add(routerurl.addParameter(Constants.CATEGORY_KEY, Constants.ROUTERS_CATEGORY).addParameter(Constants.TYPE_KEY, "javascript").addParameter(Constants.ROUTER_KEY,
                                                                                                 "notsupported").addParameter(Constants.RULE_KEY,
                                                                                                                              "function test1(){}"));
        serviceUrls.add(routerurl2.addParameter(Constants.CATEGORY_KEY, Constants.ROUTERS_CATEGORY).addParameter(Constants.TYPE_KEY, "javascript").addParameter(Constants.ROUTER_KEY,
                                                                                                  ScriptRouterFactory.NAME).addParameter(Constants.RULE_KEY,
                                                                                                                                         "function test1(){}"));

        registryDirectory.notify(serviceUrls);
        List<Router> routers = registryDirectory.getRouters();
View Full Code Here

        registryDirectory.notify(serviceUrls);
        List routers = registryDirectory.getRouters();
        Assert.assertEquals(1 + 1, routers.size());

        serviceUrls.clear();
        serviceUrls.add(routerurl.addParameter(Constants.ROUTER_KEY, Constants.ROUTER_TYPE_CLEAR));
        registryDirectory.notify(serviceUrls);
        routers = registryDirectory.getRouters();
        Assert.assertEquals(0 + 1, routers.size());
    }
View Full Code Here

            url += parameters.trim();
        }
       
        URL u = URL.valueOf(url);
        if(group != null) {
            u.addParameter("group", group);
        }
       
        if(version != null) u.addParameter("version", version);
       
        List<URL> lookup = registryService.lookup(u);
View Full Code Here

        URL u = URL.valueOf(url);
        if(group != null) {
            u.addParameter("group", group);
        }
       
        if(version != null) u.addParameter("version", version);
       
        List<URL> lookup = registryService.lookup(u);
       
        Map<String, Map<String, String>> serviceUrl = new HashMap<String, Map<String,String>>();
        Map<String, String> urls = new HashMap<String, String>();
View Full Code Here

       
        url = url.addParameters(serviceName2Map);
       
        boolean dynamic = isDynamic();
        if(!dynamic) {
            url = url.addParameter(Constants.DYNAMIC_KEY, false);
        }
        boolean enabled = isEnabled();
        if(enabled != url.getParameter("enabled", true)) {
            if(enabled) {
                url = url.removeParameter("enabled");
View Full Code Here

        if(enabled != url.getParameter("enabled", true)) {
            if(enabled) {
                url = url.removeParameter("enabled");
            }
            else {
                url = url.addParameter("enabled", false);
            }
        }
       
        return url;
    }
View Full Code Here

        exporters.add(exporter);

        url = url.setProtocol("dubbo");
        assertTrue(InjvmProtocol.getInjvmProtocol().isInjvmRefer(url));

        url = url.addParameter(Constants.GROUP_KEY, "*")
            .addParameter(Constants.VERSION_KEY, "*");
        assertTrue(InjvmProtocol.getInjvmProtocol().isInjvmRefer(url));
    }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.