• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: Unix testing or not, portability tips

 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally I was hoping to be able to test my submission in a straight Unix environment. Now it is looking like I won't be able to.
1. Has anyone else also been in this situation?
2. What precautions can I take to ensure portability?
The one thing I am currently doing is being sure to use the Systems path separator rather than hardcoding the slash when generating my properties file name. i.e. System.getProperty("file.separator")
Thanks.
TJ
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Terry,
This isn't a problem I expected. Can you tell me a bit about what happens?
M
 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Max - my problem is just that I don't have access to test my submission on any environment but my home Windows XP environment.
If the graders only have some type of Unix environment, I want to make sure that my application will still work fine.
Paranoia!!! What do you think?
TJ
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a pretty real concern, IMO. I actually thought about setting up a service where people could do exactly this. Do you have any friends who go to school?
M
 
Terry Martinson
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I'm too old for that unfortunately.
Do you know of any other gotchas besides the path separator?
TJ
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Terry,
Using different operating systems (even on the same hardware) can have different effects on your GUI layouts. This is most noticable when people use exact positioning for their components (nobody does that in this forum I hope), but can sometimes get you even when you use the proper layout managers.
I don't think there is much you can do about this if you don't have access to different operating systems - that is one of the reasons why you have to mention your development environment in your submission. As long as you coded your GUI correctly then you should only have to prove that it works on your OS. (Make sure it handles resizes correctly).
Also it is probably best to go with the default port for RMI (1099) or go with a default port above 1024 if you are using sockets. Ports below 1024 are protected in most operating systems (Microsoft being a notable exception), and you will get an exception if you try to open a port below 1024 as a non root user under Unix.
Regards, Andrew
 
John Smith
Ranch Hand
Posts: 2937
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally I was hoping to be able to test my submission in a straight Unix environment. Now it is looking like I won't be able to.
I installed Linux Red Hat on my Windows machine (dual boot up) and tested my program under it. That gave me enough confidence that it would behave as expected under Unix.
 
Javini Javono
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Concerning different operating systems and the user interface, am I correct in
coming to the conclusion that Andrew is taking the client computer's default
look and feel?
I've decided to use Sun's default Metal look and feel, regardless of the client
computer's default look and feel. Theoretically, the results should look very,
very similar on different computers.
I've decided on this approach in that the Mac OS X look and feel and all the
other look and feels are sometimes surprisingly and markedly different;
thus, to literally cover all run-time environments, I thought using Sun's
Metal was the best solution.
Concerning Unix: do you have a friend with Mac OS X? If so, you've got
Unix next door. I don't know what it means that Sun asks what environment
you developed and tested on; perhaps it matters if that particular environment
was particularly buggy; perhaps it always matters; or perhaps it doesn't
really matter much, assuming there aren't many JVM bugs, and Sun really
does expect your code to run on any environment. For instance, was there
not a posting in this group from Sun look for people to presumably work from
home to grade these types of exams? Will that person have a Mac OS X or
a Windows Machine? Will Sun look at your read me file before deciding who
to send your stuff to based upon the hardware of the grader? All these are
unknowns. Maybe your local Mac store will let you bring in your system on
a CD-ROM and run it.
As a side note, if it should be true that you have not been able to test your
program on different operating systems, then, and this is just my opinion,
you are definitely missing out on the emotional fun of this, if nothing else;
for it is really cool to see your program pleasantly run as you would expect it
on diverse operating systems.
Thanks,
Javini Javono
[ February 03, 2004: Message edited by: Javini Javono ]
 
Ulrich Heeger
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Andrew wrote:

Using different operating systems (even on the same hardware) can have different effects on your GUI layouts. This is most noticable when people use exact positioning for their components (nobody does that in this forum I hope), but can sometimes get you even when you use the proper layout managers.
I don't think there is much you can do about this if you don't have access to different operating systems - that is one of the reasons why you have to mention your development environment in your submission. As long as you coded your GUI correctly then you should only have to prove that it works on your OS. (Make sure it handles resizes correctly).

Because I use GridBagLayout to be able to better adjust my GUI, the core content doesn't change its size. I mean, if I drag the frame to make my GUI bigger, then my tablePanel and the other content panels don't get bigger, only the edges are getting larger. But the size of the content is proportional to the screen resolution. Further the size of each table column can be individually made bigger. Thus, if needed, the table will display a horizontal scrollbar due to following call:

The initial size of each column is determined by the maximum of its value lengths or the length of the header value.
Do you think I have my View flexible enough to be displayed correctly at each OS?
I have tested also in Linux and there it's fine too.
Greetings
Ulrich
[ February 04, 2004: Message edited by: Ulrich Heeger ]
 
Xie Ruchang
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I developed and test my project in Windows XP and I got superb thread performance. When I tested my assignment in Solaris, some threading problem occur as described in this thread.
This thread
Also, the sizing of the windows and components will be slightly different. So IMO it is good to test it out in Unix as those SUN fellows will be using that to grade the assignment.
Best Regards.
 
Bharat Ruparel
Ranch Hand
Posts: 493
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I lost 15 points in the GUI section. Although, I couln't answer a question on the TableModel class in the essay section well enough, I was still puzzled by how many points did I loose over it.
One of the problems might have been that I didn't test my application under Unix environment and I might have a bug similar to what Frankie Cha is describing in this thread.
Bharat
 
Ulrich Heeger
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frankie,
thanks for your informations. The problem is that I won't be able to test my application under Solaris, I don't know anybody who uses this platform.
Concerning your ArrayIndexOutOfBoundsException, I had the same problem when I test my application on my old computer with Windows 98. Similar to you, to solve the problem, I just instatiate the GUI with the invokeLater-method:

Greetings
Ulrich
[ February 04, 2004: Message edited by: Ulrich Heeger ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic