diff options
author | Piotr Dorobisz <[email protected]> | 2011-03-28 08:59:27 +0200 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2011-08-30 15:22:19 +0200 |
commit | 871839b699bcb9b9b6bdbdcb01aa272bdf049882 (patch) | |
tree | ec2c279d52542b343c2c09a26a6936848b2cb801 /lib/observer/test/client.erl | |
parent | 7e3bbc9f57bab238d04545bc0cda70ca0bb0b9f8 (diff) | |
download | otp-871839b699bcb9b9b6bdbdcb01aa272bdf049882.tar.gz otp-871839b699bcb9b9b6bdbdcb01aa272bdf049882.tar.bz2 otp-871839b699bcb9b9b6bdbdcb01aa272bdf049882.zip |
new tests for ttb module
Diffstat (limited to 'lib/observer/test/client.erl')
-rw-r--r-- | lib/observer/test/client.erl | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/observer/test/client.erl b/lib/observer/test/client.erl new file mode 100644 index 0000000000..5d8f0b30df --- /dev/null +++ b/lib/observer/test/client.erl @@ -0,0 +1,29 @@ +-module(client). +-compile(export_all). + +init(Node) -> + io:format(user, "Initing~p~n", [Node]), + application:start(runtime_tools), + net_kernel:connect_node(Node). + +init() -> + init(server_node()). + +restart() -> + init:restart(). + +server_node() -> + {ok,HostName} = inet:gethostname(), + list_to_atom("server@" ++ HostName). + +get() -> + erlang:send({server,server_node()}, {get,self()}), + receive Data -> Data + after 1000 -> no_reply + end. + +put(Thing) -> + erlang:send({server,server_node()}, {put,self(),Thing}), + receive ok -> ok + after 1000 -> no_reply + end. |