Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

HttpMaxFrameSizeTest.sendOversizedMessageTest() passes silently when maxFrameSize is not enforced

Đang mở Phù hợp với người mới
#2,706 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
90/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java
Lĩnh vực
testing

Hướng nghiên cứu

Đọc activemq-http/src/test/java/org/apache/activemq/transport/http/HttpMaxFrameSizeTest.java, đặc biệt là sendOversizedMessageTest(). Chạy kiểm thử đó và kiểm tra rằng nó thất bại nếu send(5000) trả về bình thường; hoàn thành khi kiểm thử yêu cầu một JMSException và xác minh thông báo của ngoại lệ chứa “405 Method Not Allowed”.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Component: activemq-http (test)
Version: present on main as of 2026-10-19, commit 644cf4fd

Description

HttpMaxFrameSizeTest.sendOversizedMessageTest() sends a 5000-byte message to a connector configured with maxFrameSize=4000 and asserts on the resulting JMSException, but nothing fails the test when no exception is thrown:

try {
      send(5000);
} catch (JMSException jmsException) {
     Assert.assertTrue(jmsException.getMessage().contains("405 Method Not Allowed"));
}

If the frame-size limit stops being enforced, send(5000) returns normally, the
catch block never runs, and the test passes. The assertion inside the catch is the
only check in the method.

Impact

Test-only: no runtime effect. The cost is lost regression coverage; this test is what guards the behaviour added in AMQ-7327 and refined in AMQ-7419 (405 instead of 500 on oversized frames), and in its current form it cannot fail when that behaviour regresses.

Proposed fix

     public void sendOversizedMessageTest() throws Exception {
         try {
             send(5000);
+          Assert.fail("Expected JMSException: maxFrameSize should have been enforced");
         } catch (JMSException jmsException) {
             Assert.assertTrue(jmsException.getMessage().contains("405 Method Not Allowed"));
         }
     }

I searched the open and closed issues and found no existing report. Happy to open a PR with the fix if it is welcomed. 
Ngôn ngữ chính
Java
Star
2.5k
Fork
1.5k
Merge trung bình
1 ngày 1 giờ
Pull request đã merge (30 ngày)
73

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/activemq

Tất cả issue của apache/activemq

Issue tương tự

Thêm issue về Java

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.