test_class.declarator: LOCAL_HOST = "127.0.0.1"
test_class.modifier: private static final
test_class.original_string: private static final String LOCAL_HOST = "127.0.0.1";
test_class.type: String
test_class.var_name: LOCAL_HOST
test_class.declarator: SCRIPT_URL = URL.valueOf("condition://0.0.0.0/com.foo.BarService")
test_class.modifier: private
test_class.original_string: private URL SCRIPT_URL = URL.valueOf("condition://0.0.0.0/com.foo.BarService");
test_class.type: URL
test_class.var_name: SCRIPT_URL
test_class.file: dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouterTest.java
test_class.identifier: ConditionRouterTest
test_case.body: @Test
      public void testRoute_matchWhen() {
          Invocation invocation = new RpcInvocation();
  
          Router router = new ConditionRouterFactory().getRouter(getRouteUrl(" => host = 1.2.3.4"));
          boolean matchWhen = ((ConditionRouter) router).matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService"), invocation);
          Assertions.assertTrue(matchWhen);
  
          router = new ConditionRouterFactory().getRouter(getRouteUrl("host = 2.2.2.2,1.1.1.1,3.3.3.3 => host = 1.2.3.4"));
          matchWhen = ((ConditionRouter) router).matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService"), invocation);
          Assertions.assertTrue(matchWhen);
  
          router = new ConditionRouterFactory().getRouter(getRouteUrl("host = 2.2.2.2,1.1.1.1,3.3.3.3 & host !=1.1.1.1 => host = 1.2.3.4"));
          matchWhen = ((ConditionRouter) router).matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService"), invocation);
          Assertions.assertFalse(matchWhen);
  
          router = new ConditionRouterFactory().getRouter(getRouteUrl("host !=4.4.4.4 & host = 2.2.2.2,1.1.1.1,3.3.3.3 => host = 1.2.3.4"));
          matchWhen = ((ConditionRouter) router).matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService"), invocation);
          Assertions.assertTrue(matchWhen);
  
          router = new ConditionRouterFactory().getRouter(getRouteUrl("host !=4.4.4.* & host = 2.2.2.2,1.1.1.1,3.3.3.3 => host = 1.2.3.4"));
          matchWhen = ((ConditionRouter) router).matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService"), invocation);
          Assertions.assertTrue(matchWhen);
  
          router = new ConditionRouterFactory().getRouter(getRouteUrl("host = 2.2.2.2,1.1.1.*,3.3.3.3 & host != 1.1.1.1 => host = 1.2.3.4"));
          matchWhen = ((ConditionRouter) router).matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService"), invocation);
          Assertions.assertFalse(matchWhen);
  
          router = new ConditionRouterFactory().getRouter(getRouteUrl("host = 2.2.2.2,1.1.1.*,3.3.3.3 & host != 1.1.1.2 => host = 1.2.3.4"));
          matchWhen = ((ConditionRouter) router).matchWhen(URL.valueOf("consumer://1.1.1.1/com.foo.BarService"), invocation);
          Assertions.assertTrue(matchWhen);
      }
test_case.class_method_signature: ConditionRouterTest.testRoute_matchWhen()
test_case.full_signature: @Test public void testRoute_matchWhen()
test_case.identifier: testRoute_matchWhen
test_case.invocations: getRouter getRouteUrl matchWhen valueOf assertTrue getRouter getRouteUrl matchWhen valueOf assertTrue getRouter getRouteUrl matchWhen valueOf assertFalse getRouter getRouteUrl matchWhen valueOf assertTrue getRouter getRouteUrl matchWhen valueOf assertTrue getRouter getRouteUrl matchWhen valueOf assertFalse getRouter getRouteUrl matchWhen valueOf assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRoute_matchWhen()
focal_class.declarator: NAME = "condition"
focal_class.modifier: public static final
focal_class.original_string: public static final String NAME = "condition";
focal_class.type: String
focal_class.var_name: NAME
focal_class.declarator: logger = LoggerFactory.getLogger(ConditionRouter.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger(ConditionRouter.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: ROUTE_PATTERN = Pattern.compile("([&!=,]*)\\s*([^&!=,\\s]+)")
focal_class.modifier: protected static final
focal_class.original_string: protected static final Pattern ROUTE_PATTERN = Pattern.compile("([&!=,]*)\\s*([^&!=,\\s]+)");
focal_class.type: Pattern
focal_class.var_name: ROUTE_PATTERN
focal_class.declarator: whenCondition
focal_class.modifier: protected
focal_class.original_string: protected Map<String, MatchPair> whenCondition;
focal_class.type: Map<String, MatchPair>
focal_class.var_name: whenCondition
focal_class.declarator: thenCondition
focal_class.modifier: protected
focal_class.original_string: protected Map<String, MatchPair> thenCondition;
focal_class.type: Map<String, MatchPair>
focal_class.var_name: thenCondition
focal_class.declarator: enabled
focal_class.modifier: private
focal_class.original_string: private boolean enabled;
focal_class.type: boolean
focal_class.var_name: enabled
focal_class.file: dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/ConditionRouter.java
focal_class.identifier: ConditionRouter
focal_class.class_method_signature: ConditionRouter.ConditionRouter(String rule, boolean force, boolean enabled)
focal_class.full_signature: public  ConditionRouter(String rule, boolean force, boolean enabled)
focal_class.identifier: ConditionRouter
focal_class.modifiers: public
focal_class.parameters: (String rule, boolean force, boolean enabled)
focal_class.signature:  ConditionRouter(String rule, boolean force, boolean enabled)
focal_class.class_method_signature: ConditionRouter.ConditionRouter(URL url)
focal_class.full_signature: public  ConditionRouter(URL url)
focal_class.identifier: ConditionRouter
focal_class.modifiers: public
focal_class.parameters: (URL url)
focal_class.signature:  ConditionRouter(URL url)
focal_class.class_method_signature: ConditionRouter.init(String rule)
focal_class.full_signature: public void init(String rule)
focal_class.identifier: init
focal_class.modifiers: public
focal_class.parameters: (String rule)
focal_class.return: void
focal_class.signature: void init(String rule)
focal_class.class_method_signature: ConditionRouter.parseRule(String rule)
focal_class.full_signature: private static Map<String, MatchPair> parseRule(String rule)
focal_class.identifier: parseRule
focal_class.modifiers: private static
focal_class.parameters: (String rule)
focal_class.return: Map<String, MatchPair>
focal_class.signature: Map<String, MatchPair> parseRule(String rule)
focal_class.class_method_signature: ConditionRouter.route(List<Invoker<T>> invokers, URL url, Invocation invocation)
focal_class.full_signature: @Override public List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation)
focal_class.identifier: route
focal_class.modifiers: @Override public
focal_class.parameters: (List<Invoker<T>> invokers, URL url, Invocation invocation)
focal_class.return: List<Invoker<T>>
focal_class.signature: List<Invoker<T>> route(List<Invoker<T>> invokers, URL url, Invocation invocation)
focal_class.class_method_signature: ConditionRouter.isRuntime()
focal_class.full_signature: @Override public boolean isRuntime()
focal_class.identifier: isRuntime
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isRuntime()
focal_class.class_method_signature: ConditionRouter.getUrl()
focal_class.full_signature: @Override public URL getUrl()
focal_class.identifier: getUrl
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getUrl()
focal_class.class_method_signature: ConditionRouter.matchWhen(URL url, Invocation invocation)
focal_class.full_signature:  boolean matchWhen(URL url, Invocation invocation)
focal_class.identifier: matchWhen
focal_class.parameters: (URL url, Invocation invocation)
focal_class.return: boolean
focal_class.signature: boolean matchWhen(URL url, Invocation invocation)
focal_class.class_method_signature: ConditionRouter.matchThen(URL url, URL param)
focal_class.full_signature: private boolean matchThen(URL url, URL param)
focal_class.identifier: matchThen
focal_class.modifiers: private
focal_class.parameters: (URL url, URL param)
focal_class.return: boolean
focal_class.signature: boolean matchThen(URL url, URL param)
focal_class.class_method_signature: ConditionRouter.matchCondition(Map<String, MatchPair> condition, URL url, URL param, Invocation invocation)
focal_class.full_signature: private boolean matchCondition(Map<String, MatchPair> condition, URL url, URL param, Invocation invocation)
focal_class.identifier: matchCondition
focal_class.modifiers: private
focal_class.parameters: (Map<String, MatchPair> condition, URL url, URL param, Invocation invocation)
focal_class.return: boolean
focal_class.signature: boolean matchCondition(Map<String, MatchPair> condition, URL url, URL param, Invocation invocation)
focal_class.superclass: extends AbstractRouter
focal_method.body: boolean matchWhen(URL url, Invocation invocation) {
          return CollectionUtils.isEmptyMap(whenCondition) || matchCondition(whenCondition, url, null, invocation);
      }
focal_method.class_method_signature: ConditionRouter.matchWhen(URL url, Invocation invocation)
focal_method.full_signature:  boolean matchWhen(URL url, Invocation invocation)
focal_method.identifier: matchWhen
focal_method.invocations: isEmptyMap matchCondition
focal_method.parameters: (URL url, Invocation invocation)
focal_method.return: boolean
focal_method.signature: boolean matchWhen(URL url, Invocation invocation)