test_class.declarator: GSON = new Gson()
test_class.modifier: private static final
test_class.original_string: private static final Gson GSON = new Gson();
test_class.type: Gson
test_class.var_name: GSON
test_class.declarator: channelHandlerContext
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ChannelHandlerContext channelHandlerContext;
test_class.type: ChannelHandlerContext
test_class.var_name: channelHandlerContext
test_class.declarator: fullHttpRequest
test_class.modifier: private
test_class.original_string: private FullHttpRequest fullHttpRequest;
test_class.type: FullHttpRequest
test_class.var_name: fullHttpRequest
test_class.declarator: httpServerHandler
test_class.modifier: private
test_class.original_string: private HttpServerHandler httpServerHandler;
test_class.type: HttpServerHandler
test_class.var_name: httpServerHandler
test_class.declarator: scalingConfig
test_class.modifier: private
test_class.original_string: private ScalingConfiguration scalingConfig;
test_class.type: ScalingConfiguration
test_class.var_name: scalingConfig
test_class.file: shardingsphere-scaling/shardingsphere-scaling-bootstrap/src/test/java/org/apache/shardingsphere/scaling/web/HttpServerHandlerTest.java
test_class.identifier: HttpServerHandlerTest
test_case.body: @Test
      public void assertChannelReadProgressSuccess() {
          startScalingJob();
          fullHttpRequest = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.GET, "/scaling/job/progress/1");
          httpServerHandler.channelRead0(channelHandlerContext, fullHttpRequest);
          ArgumentCaptor<FullHttpResponse> argumentCaptor = ArgumentCaptor.forClass(FullHttpResponse.class);
          verify(channelHandlerContext, times(2)).writeAndFlush(argumentCaptor.capture());
          FullHttpResponse fullHttpResponse = argumentCaptor.getValue();
          assertTrue(fullHttpResponse.content().toString(CharsetUtil.UTF_8).contains("{\"success\":true"));
      }
test_case.class_method_signature: HttpServerHandlerTest.assertChannelReadProgressSuccess()
test_case.full_signature: @Test public void assertChannelReadProgressSuccess()
test_case.identifier: assertChannelReadProgressSuccess
test_case.invocations: startScalingJob channelRead0 forClass writeAndFlush verify times capture getValue assertTrue contains toString content
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertChannelReadProgressSuccess()
focal_class.declarator: URL_PATTERN = Pattern.compile("(^/scaling/job/(start|stop|list))|(^/scaling/job/(progress|check)/\\d+)", Pattern.CASE_INSENSITIVE)
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern URL_PATTERN = Pattern.compile("(^/scaling/job/(start|stop|list))|(^/scaling/job/(progress|check)/\\d+)", Pattern.CASE_INSENSITIVE);
focal_class.type: Pattern
focal_class.var_name: URL_PATTERN
focal_class.declarator: GSON = new GsonBuilder().disableHtmlEscaping().serializeNulls().create()
focal_class.modifier: private static final
focal_class.original_string: private static final Gson GSON = new GsonBuilder().disableHtmlEscaping().serializeNulls().create();
focal_class.type: Gson
focal_class.var_name: GSON
focal_class.declarator: SCALING_JOB_CONTROLLER = new ScalingJobController()
focal_class.modifier: private static final
focal_class.original_string: private static final ScalingJobController SCALING_JOB_CONTROLLER = new ScalingJobController();
focal_class.type: ScalingJobController
focal_class.var_name: SCALING_JOB_CONTROLLER
focal_class.file: shardingsphere-scaling/shardingsphere-scaling-bootstrap/src/main/java/org/apache/shardingsphere/scaling/web/HttpServerHandler.java
focal_class.identifier: HttpServerHandler
focal_class.class_method_signature: HttpServerHandler.channelRead0(final ChannelHandlerContext context, final FullHttpRequest request)
focal_class.full_signature: @Override protected void channelRead0(final ChannelHandlerContext context, final FullHttpRequest request)
focal_class.identifier: channelRead0
focal_class.modifiers: @Override protected
focal_class.parameters: (final ChannelHandlerContext context, final FullHttpRequest request)
focal_class.return: void
focal_class.signature: void channelRead0(final ChannelHandlerContext context, final FullHttpRequest request)
focal_class.class_method_signature: HttpServerHandler.startJob(final ChannelHandlerContext context, final String requestBody)
focal_class.full_signature: private void startJob(final ChannelHandlerContext context, final String requestBody)
focal_class.identifier: startJob
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context, final String requestBody)
focal_class.return: void
focal_class.signature: void startJob(final ChannelHandlerContext context, final String requestBody)
focal_class.class_method_signature: HttpServerHandler.getJobProgress(final ChannelHandlerContext context, final String requestPath)
focal_class.full_signature: private void getJobProgress(final ChannelHandlerContext context, final String requestPath)
focal_class.identifier: getJobProgress
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context, final String requestPath)
focal_class.return: void
focal_class.signature: void getJobProgress(final ChannelHandlerContext context, final String requestPath)
focal_class.class_method_signature: HttpServerHandler.listAllJobs(final ChannelHandlerContext context)
focal_class.full_signature: private void listAllJobs(final ChannelHandlerContext context)
focal_class.identifier: listAllJobs
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context)
focal_class.return: void
focal_class.signature: void listAllJobs(final ChannelHandlerContext context)
focal_class.class_method_signature: HttpServerHandler.stopJob(final ChannelHandlerContext context, final String requestBody)
focal_class.full_signature: private void stopJob(final ChannelHandlerContext context, final String requestBody)
focal_class.identifier: stopJob
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context, final String requestBody)
focal_class.return: void
focal_class.signature: void stopJob(final ChannelHandlerContext context, final String requestBody)
focal_class.class_method_signature: HttpServerHandler.checkJob(final ChannelHandlerContext context, final String requestPath)
focal_class.full_signature: private void checkJob(final ChannelHandlerContext context, final String requestPath)
focal_class.identifier: checkJob
focal_class.modifiers: private
focal_class.parameters: (final ChannelHandlerContext context, final String requestPath)
focal_class.return: void
focal_class.signature: void checkJob(final ChannelHandlerContext context, final String requestPath)
focal_class.class_method_signature: HttpServerHandler.response(final String content, final ChannelHandlerContext context, final HttpResponseStatus status)
focal_class.full_signature: private void response(final String content, final ChannelHandlerContext context, final HttpResponseStatus status)
focal_class.identifier: response
focal_class.modifiers: private
focal_class.parameters: (final String content, final ChannelHandlerContext context, final HttpResponseStatus status)
focal_class.return: void
focal_class.signature: void response(final String content, final ChannelHandlerContext context, final HttpResponseStatus status)
focal_class.class_method_signature: HttpServerHandler.exceptionCaught(final ChannelHandlerContext context, final Throwable cause)
focal_class.full_signature: @Override public void exceptionCaught(final ChannelHandlerContext context, final Throwable cause)
focal_class.identifier: exceptionCaught
focal_class.modifiers: @Override public
focal_class.parameters: (final ChannelHandlerContext context, final Throwable cause)
focal_class.return: void
focal_class.signature: void exceptionCaught(final ChannelHandlerContext context, final Throwable cause)
focal_class.superclass: extends SimpleChannelInboundHandler<FullHttpRequest>
focal_method.body: @Override
      protected void channelRead0(final ChannelHandlerContext context, final FullHttpRequest request) {
          String requestPath = request.uri();
          String requestBody = request.content().toString(CharsetUtil.UTF_8);
          HttpMethod method = request.method();
          if (!URL_PATTERN.matcher(requestPath).matches()) {
              response(GSON.toJson(ResponseContentUtil.handleBadRequest("Not support request!")), context, HttpResponseStatus.BAD_REQUEST);
              return;
          }
          if ("/scaling/job/start".equalsIgnoreCase(requestPath) && method.equals(HttpMethod.POST)) {
              startJob(context, requestBody);
              return;
          }
          if (requestPath.contains("/scaling/job/progress/") && method.equals(HttpMethod.GET)) {
              getJobProgress(context, requestPath);
              return;
          }
          if ("/scaling/job/list".equalsIgnoreCase(requestPath) && method.equals(HttpMethod.GET)) {
              listAllJobs(context);
              return;
          }
          if ("/scaling/job/stop".equalsIgnoreCase(requestPath) && method.equals(HttpMethod.POST)) {
              stopJob(context, requestBody);
              return;
          }
          if (requestPath.contains("/scaling/job/check/") && method.equals(HttpMethod.GET)) {
              checkJob(context, requestPath);
              return;
          }
          response(GSON.toJson(ResponseContentUtil.handleBadRequest("Not support request!")), context, HttpResponseStatus.BAD_REQUEST);
      }
focal_method.class_method_signature: HttpServerHandler.channelRead0(final ChannelHandlerContext context, final FullHttpRequest request)
focal_method.full_signature: @Override protected void channelRead0(final ChannelHandlerContext context, final FullHttpRequest request)
focal_method.identifier: channelRead0
focal_method.invocations: uri toString content method matches matcher response toJson handleBadRequest equalsIgnoreCase equals startJob contains equals getJobProgress equalsIgnoreCase equals listAllJobs equalsIgnoreCase equals stopJob contains equals checkJob response toJson handleBadRequest
focal_method.modifiers: @Override protected
focal_method.parameters: (final ChannelHandlerContext context, final FullHttpRequest request)
focal_method.return: void
focal_method.signature: void channelRead0(final ChannelHandlerContext context, final FullHttpRequest request)