English 中文(简体)
Framework or tool for "distributed unit testing"? [closed]
原标题:

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 5 years ago.

Is there any tool or framework able to make it easier to test distributed software written in Java? My system under test is a peer-to-peer software, and I d like to perform testing using something like PNUnit, but with Java instead of .Net.

The system under test is a framework I m developing to build P2P applications. It uses JXTA as a lower subsystem, trying to hide some complexities of it. It s currently an academic project, so I m pursuing simplicity at this moment.

In my test, I want to demonstrate that a peer (running in its own process, possibly with multiple threads) can discover another one (running in another process or even another machine) and that they can exchange a few messages. I m not using mocks nor stubs because I need to see both sides working simultaneously. I realize that some kind of coordination mechanism is needed, and PNUnit seems to be able to do that.

I ve bumped into some initiatives like Pisces, which "aims to provide a distributed testing environment that extends JUnit, giving the developer/tester an ability to run remote JUnits and create complex test suites that are composed of several remote JUnit tests running in parallel or serially", but this project and a few others I have found seem to be long dead.

问题回答

Testing distributed software depends greatly on what type of software it is, so for a complete answer I will need to know what your software does. However looking at PNUnit it seams that most of what it does is allow for synchronization, ordering and parallel execution of tests. TestNG also supports this, for instance, you can do:

@Test(threadPoolSize = 3, invocationCount = 10,  timeOut = 10000)
public void testServer() {
   :
}

which will invoke the function testServer ten times from three different threads. The change-log of TestNG 4.5 also hints at the possibility of running remote tests, more info is available in this blog post.

Alternatively you can checkout IBM s ConTest software for testing parallel and distributed software (there is a great description of how to use it here). I have had great success using it to expose bugs in my concurrent applications.

Well, there is a way which is very simple and does not require to learn any new framework. You can test the logs produced by the applications across your distributed environment using grep4j. Have a look here and here for more info.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签