2013-05-20 7 views
1

mbassador을 사용 중이며 인터페이스 게시가 작동하지 않는 것 같습니다. 아래는 JUnit을 사용하는 sscce입니다. 나는이 프로그램이 hello world을 인쇄 할 것으로 기대하지만, 그렇게하지는 않는다. 이것에MBassador는 인터페이스 메시지를 지원하지 않습니다.

public void handleFoo(FooInterface f) { 

: :이 줄을 변경하는 경우에는

public void handleFoo(FooImpl f) { 

이 프로그램은 완벽하게 작동합니다. 이것은 버그입니까, 아니면 제가 잘못하고있는 것입니까? 참고 : public void handleFoo(Object o)도 작동합니다.

import net.engio.mbassy.bus.BusConfiguration; 
import net.engio.mbassy.bus.MBassador; 
import net.engio.mbassy.listener.Handler; 

import org.junit.Test; 

public class MBassadorTest { 
    @Test 
    public void testMBassador() { 
     MBassador<FooInterface> bus = new MBassador<>(BusConfiguration.Default()); 
     bus.subscribe(this); 
     FooInterface myFoo = new FooImpl(); 
     bus.publish(myFoo); 
    } 

    public static interface FooInterface { 
     String doSomething(); 
    } 

    public static class FooImpl implements FooInterface { 
     public String doSomething() { 
      return "hello world"; 
     } 
    } 

    @Handler(rejectSubtypes = false) 
    public void handleFoo(FooInterface f) { 
     System.out.println(f.doSomething()); 
    } 
} 
+0

이제 1.1.7로 고정되었습니다. 문제가 발생하면 다시 확인하고보고하십시오. – bennidi

답변

4

나는 MBassador의 저자 해요 그리고 말씀 durron597 사실이다. 인터페이스의 누락 된 인식은 버그 (엉뚱한 것입니다, 나는 인정합니다)하지만 쉽게 고칠 수 있습니다. 그것은 이미 내 코드베이스에서 고쳐졌으며 현재 나는 더 많은 테스트를 포함하고 있습니다. 더 많은 버그 수정을 포함하기를 원하기 때문에 아직 릴리스가 대기 중이지만 며칠 이상 걸리지는 않습니다.

불편을 끼쳐 드려 죄송합니다.

+0

bennidi, 나는 지난 밤에 풀 요청을했습니다. – durron597

+0

감사합니다. 너무 늦었습니다. :) – bennidi

+0

오, 하하, 내 요청은 어쨌든 작동하지 않습니다. 그래도 내 테스트 케이스와 다른 픽스가 도움이 될지도 모른다. :) – durron597