hqtc
V2EX  ›  Java

如何 Mock 一个 SipServletRequest 对象

  •  
  •   hqtc · Oct 6, 2017 · 2709 views
    This topic created in 3144 days ago, the information mentioned may be changed or developed.

    如题, 现在的项目使用了 mobicents 的 Sip 协议 Java 实现,需要进行单元测试。但是怎么 mock 一个请求对象呢,使用 jMOckit 搞不出来。mobisents 提供了一个依赖:

    http://www.mobicents.org/mss/ssf/sf-api/site/en/mock-test.html

    <dependency>
            <groupId>org.mobicents.ssf</groupId>
            <artifactId>sf-mock</artifactId>
            <version>1.0.0-SNAPSHOT</version>
            <scope>test</scope>
            <optional>false</optional>
    </dependency>
    

    但是 Maven 仓库中找不到这个 jar 了,有谁搞过这个或者有办法搞到 jar ?

    3 replies    2017-10-06 12:31:04 +08:00
    hqtc
        1
    hqtc  
    OP
       Oct 6, 2017
    算了,玛德我自己搞一个!

    ```
    public class HqSipRequest implements SipServletRequest
    ```
    6IbA2bj5ip3tK49j
        2
    6IbA2bj5ip3tK49j  
       Oct 6, 2017
    应该要把 snapshot 去掉吧。
    或者添加一下仓库。一般 snapshot 都不在主仓库里。
    6IbA2bj5ip3tK49j
        3
    6IbA2bj5ip3tK49j  
       Oct 6, 2017   ❤️ 1
    查了一下。
    http://www.mobicents.org/community.html
    点 Forums 进去就会发现
    ```
    Mobicents was rebranded to RestComm. Read more at http://www.telestax.com/restcomm-developer-mobicents/.

    As such there is a new Google Group at http://www.telestax.com/restcomm-developer-mobicents/ or you can also use http://stackoverflow.com/questions/tagged/restcomm
    ```
    所以 lz 的这些资料应该是很久以前的了。
    可以去
    https://github.com/RestComm/sip-servlets
    看看新的。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2994 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 13:12 · PVG 21:12 · LAX 06:12 · JFK 09:12
    ♥ Do have faith in what you're doing.