Run multiple java main methods in eclipse

后端 未结 5 1585
天涯浪人
天涯浪人 2020-12-31 07:22

I\'m running Eclipse 3.5 and I have a frequent problem that in order to test my program, I have to do about 6-7 clicks as opposed to one click on the play button.

Th

5条回答
  •  臣服心动
    2020-12-31 07:42

    Well, why not write a test case using JUnit. I mean,

    • Prepare 2 properties file, one for the server and another for the client
    • Write a test fixture, which starts a server and multiple clients in order to run the test
    • Then write your test cases based on that

    I know that we should not call it a unit test, as it would be depending on network IO. So, call it whatever feels appropriate. My suggestion is just to use JUnit for this.

提交回复
热议问题