• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Testing On Multiple Platforms

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Ranchers!

I've recently purchased my assignment, so you are going to see a lot of me here.

I have some questions about development of networking module and final testing:

1)I'm very new to networking and don't quite understand what physical infrastracture do I need to have in place in order to develop and test my code responsible for network connectivity. Do I need to physically connect 2 computers into a network for this project or can I simulate it on the same machine? It might sound as a silly question, but I would very much appreciate any help/suggestions.

2) How important is it to test the final deliverable on Unix, Linux, Mac etc? I saw that Andrew strongly recommends it in his book, but I did not see anything in the assingment that would suggest that this test is imperative. It may be too early for me to worry about this stuff, but all I have access to is Windows XP and Windows 2000. Did any of you who got their SCJD test on the platforms other than the one used for development?

Thanks a lot!
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Svitlana,

You can simulate the network connectivity on a single computer, and many candidates only test this way. It is much better if you can test with the client on one computer and the server on another (even if they are running the same operating system), as that way you can be sure it will work correctly in a proper network environment.

Page 243 in the book shows some examples of how changing the "look and feel" and/or the theme can change the size of your components. What is not shown there is how the same look and feel with the same theme may still use different sized components on different platforms. It is for that reason that we strongly recommend testing on as many different platforms as possible.

However, you are right in that it is not required for you to test on any platform other than the one you develop on. We even comment in the book that you have to indicate what your development environment was in your submission, so we assume that the assessors will test in the same environment. If you can test on other platforms then that is great, but don't loose sleep if you cant.

For what it's worth, I did test my submission under Windows 2000, Windows 95, Linux, and Solaris. I was going to test it on AIX as well, but I got sick of the whole process . I obviously have far too many computers at my disposal :roll: .

Regards, Andrew
 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't really need to test it on several platforms as this is not a requirement/key point that Sun wants to test you. But if you have machines that have different platforms available, you can test it.

If your machine is in a LAN, you may create server and run client on the same machine, the destination address is 127.0.0.1 or LocalHost.

I only tested my assignment on my Win 2000 machine and it goes well.

Yours Sincerely
Olnex
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Forgot to let you know, although Java announced "write once, run everywhere", but it performs slightly different on different platforms, I coded my assignment on Win 2000 machine, it runs well without any warning/error, but on Linux machine, the JVM tells me something about encoding, on Linux machine, it cannot find ISO-(something) encoding. But anyway, this won't affect your mark.
 
Svitlana Dukhovna
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Andrew and HaoZhe for your response!
I will try to test in a real network once I'm done, but it is nice to know that I don't have to worry about testing on multiple platforms.

One more question: what do I need to do to be able to simulate the network connectivity on a single computer? Where can I find more info about this?

Thanks again!
 
Andrew Monkhouse
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Svitlana,

what do I need to do to be able to simulate the network connectivity on a single computer?

All you need is a standard TCP/IP stack - something that is normally installed by default on most modern PCs. Then you can use one of the loopback addresses to simulate sending traffic over a network.

To see this in action right now, try opening a command prompt window, and typing in "ping 127.0.0.1" - 4 packets will be sent over the loopback address to your computer, and you should see 4 replies come back.

You can use this same address (127.0.0.1) in your RMI or Sockets solution to communicate via the loopback network device. You can also use the common loopback name (localhost) or any of the other loopback addresses (127.0.0.1 - 127.255.255.254 (127.255.255.255 is officially loopback, but it is the broadcast address)) to test your solution.

Regards, Andrew
 
Ranch Hand
Posts: 198
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just wanted to share with you a fix I put in yesterday !

When running my RMI server on Linux (Red Hat Enterprise Linux WS 4) the exported remote object creates a TCP endpoint on the loopback address (127.0.0.1). This is different from when I run my server on a Windows box. On windows the TCP endpoint is created on the correct IP address, something like 192.168.1.3, which is a LAN address.
The point is that when trying to connect from a client, on whatever operating system, to a server on a linux box, you will get a connection refused error because the client will try to connect to the address which got annotated to the stub of your remote object, which is the loopback address.
Obviously there is no rmi server listening on that address because that is your client box, not the server, hence the connection refused error.
To solve this problem I put some code when my server starts up that programmatically sets the java.rmi.server.hostname property to the valid IP address (LAN) of my server and not the loopback address before any remote object gets exported.
This makes sure that, even when running my server on a Linux box, the tcp endpoint that is created is valid and thus clients no longer get a connection refused error.
Bottom line, "write once, run anywere" is not absolute due to different implements of the JDK for different operating systems...

Regards,
Ronald Wouters
[ February 02, 2006: Message edited by: Ronald Wouters ]
 
Svitlana Dukhovna
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Andrew and Ronald! It is very helpful.
 
reply
    Bookmark Topic Watch Topic
  • New Topic