Examples of Route


Examples of br.com.caelum.vraptor.http.route.Route

    String[] urIsFor = super.getURIsFor(javaMethod, type);
   
    for (int i = 0; i < urIsFor.length; i++) {
      for (ResourceBundle bundle : routesResource.getAvailableBundles()) {
        if(bundle.containsKey(urIsFor[i])) {
          Route translatedRouteWithLocalePrefix = buildWithLocalePrefix(javaMethod, type, bundle.getString(urIsFor[i]), bundle.getLocale());
          routes.add(translatedRouteWithLocalePrefix);
        }
      }
     
      Route defaultRouteWithLocalePrefix = buildWithLocalePrefix(javaMethod, type, urIsFor[i], Locale.getDefault());
      routes.add(defaultRouteWithLocalePrefix);
    }
   
    return urIsFor;
  }
View Full Code Here

Examples of br.com.six2six.fixturefactory.model.Route

    FixtureFactoryLoader.loadTemplates("br.com.six2six.template");
  }
 
  @Test
  public void shouldBuildRouteWithTwoDifferentCitiesTemplates() {
    Route route = Fixture.from(Route.class).gimme("routeWithDifferentCities");
    assertEquals("São Paulo", route.getCities().get(0).getName());
    assertEquals("Rio de Janeiro", route.getCities().get(1).getName());
  }
View Full Code Here

Examples of ca.simplegames.micro.Route

  private void load(SiteContext site, List<Map<String, Object>> routeMaps) {
    if (!CollectionUtils.isEmpty(routeMaps)) {
      for (Map<String, Object> routeMap : routeMaps) {
        try {
          String routePath = (String) routeMap.get("route");
          Route route = new RouteWrapper(routePath, routeMap);
          add(route);
        } catch (Exception e) {
          log.error("cannot load the following router for: " + routeMaps);
          e.printStackTrace();
        }
View Full Code Here

Examples of ch.fork.AdHocRailway.domain.routes.Route

        public void valueChanged(ListSelectionEvent e) {
            if (e.getValueIsAdjusting())
                return;
            if (routesList.getSelectedIndex() == -1)
                routesList.setSelectedIndex(0);
            Route selectedRoute = (Route) routesList.getSelectedValue();
            if (selectedRoute == null)
                return;
        }
View Full Code Here

Examples of com.alibaba.dubbo.registry.common.domain.Route

        }
    }
   
    @Test
    public void test_previewRoute() throws Exception {
        Route route = new Route();
        route.setId(1L);
        route.setService("hello.HelloService");
        route.setMatchRule("consumer.host=1.1.2.2,2.2.2.3");
        route.setFilterRule("provider.host=3.3.4.4&provider.application=morgan");
       
        {
            // no methods
            Map<String, String> preview = RouteUtils.previewRoute("hello.HelloService", "1.1.2.2:20880", "application=morgan", serviceUrls, route, clusters, null);
            Map<String, String> expected = new HashMap<String, String>();
            expected.put("dubbo://3.3.4.4:20880/hello.HelloService", "dubbo=2.0.0&version=1.0.0&revision=1.1.1&methods=*&application=morgan");
            assertEquals(expected, preview);
           
            // 2 methods
            preview = RouteUtils.previewRoute("hello.HelloService", "1.1.2.2", "application=morgan&methods=getPort,say", serviceUrls, route, clusters, null);
            expected = new HashMap<String, String>();
            expected.put("dubbo://3.3.4.4:20880/hello.HelloService", "dubbo=2.0.0&version=1.0.0&revision=1.1.1&methods=getPort,say&application=morgan");
            assertEquals(expected, preview);
           
            // ghost methods
            preview = RouteUtils.previewRoute("hello.HelloService", "1.1.2.2", "application=morgan&methods=getPort,say,ghostMethod", serviceUrls, route, clusters, null);
            expected = new HashMap<String, String>();
            expected.put("dubbo://3.3.4.4:20880/hello.HelloService", "dubbo=2.0.0&version=1.0.0&revision=1.1.1&methods=getPort,say,ghostMethod&application=morgan");
            assertEquals(expected, preview);
           
            // no route
            preview = RouteUtils.previewRoute("hello.HelloService", "1.2.3.4", "application=morgan", serviceUrls, route, clusters, null);
            assertEquals(serviceUrls_starMethods, preview);
           
            // no route, 2 methods
            preview = RouteUtils.previewRoute("hello.HelloService", "1.2.3.4", "application=morgan&methods=getPort,say", serviceUrls, route, clusters, null);
            assertEquals(serviceUrls, preview);
           
            // no route, ghost methods
            preview = RouteUtils.previewRoute("hello.HelloService", "1.2.3.4", "application=morgan&methods=getPort,say,ghostMethod", serviceUrls, route, clusters, null);
            assertEquals(serviceUrls_ghostMethods, preview);
        }
       
        // with cluster
        {
            route.setMatchRule("consumer.cluster = cluster1");
           
            // no method
            Map<String, String> preview = RouteUtils.previewRoute("hello.HelloService", "7.7.7.7:20880", "application=morgan", serviceUrls, route, clusters, null);
            Map<String, String> expected = new HashMap<String, String>();
            expected.put("dubbo://3.3.4.4:20880/hello.HelloService", "dubbo=2.0.0&version=1.0.0&revision=1.1.1&methods=*&application=morgan");
 
View Full Code Here

Examples of com.bastengao.struts2.freeroute.annotation.Route

        if (methods == null) {
            return routes;
        }

        ContentBase contentBase = ReflectUtil.getAnnotation(controller, ContentBase.class);
        Route controllerRoute = ReflectUtil.getAnnotation(controller, Route.class);
        for (Method method : methods) {
            //查看是否有 @Route 注解, 如果有则加到路由列表中
            if (method.isAnnotationPresent(Route.class)) {
                Route methodRoute = method.getAnnotation(Route.class);
                RouteMapping routeMapping = new RouteMapping(contentBase, controllerRoute, methodRoute, controller, method);
                routes.add(routeMapping);

                if (log.isTraceEnabled()) {
                    log.trace("route: {}", routeMapping.prettyPath());
View Full Code Here

Examples of com.cedarsoft.commons.struct.Route

    try {
      if ( route == null ) {
        try {
          route = pageStructureProvider.getPageStructure().getRoute( getPath() );
        } catch ( Exception ignore ) {
          route = new Route( Collections.singletonList( pageStructureProvider.getPageStructure().getRootNode() ) );
        }
      }
      return route;
    } finally {
      lock.writeLock().unlock();
View Full Code Here

Examples of com.dubture.symfony.index.model.Route

  public String getInfo(IProgressMonitor monitor) {
    try {
     
      RouteSource routeSource = (RouteSource) getModelElement();
      Route route = routeSource.getRoute();
      return HTMLUtils.route2Html(route);
     
     
    } catch (Exception e) {
      e.printStackTrace();
View Full Code Here

Examples of com.elibom.jogger.middleware.router.Route

        input = input.trim();

        // only parse line if it is not empty and not a comment
        if (!input.equals("") && !input.startsWith("#")) {
          Route route = parse(input, line);
          routes.add(route);
        }
      }

    } finally {
View Full Code Here

Examples of com.nabalive.framework.web.Route

* Unit test for simple App.
*/
public class AppTest {
    @Test
    public void testRouteMatcher() {
        final Route route = new Route("/api/:name/:id");
        final Map<String, String> rez = route.parse("/api/julien/123", null);
        System.out.println(rez);
        assertEquals("should contain julien", rez.get("name"), "julien");
        assertEquals("should contain 123", rez.get("id"), "123");
    }
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.