[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
An author with a Doctorate in cs and published author in aw professional suggests doing private static final boolean debug; at the top of (each) file and then doing if(debug){}
The others have to do database programming, I do not
Originally posted by Doug Slattery:
is right in line with what I need to do to the database code to get me to my unit testing point. However, I also would like the propertyFileSetToTestMode field in your example to be set at compile time, preferably by the compiler.
without having to remember to change a test/production flag in some master class
@whoever moved my original post. Thanks for letting me know. A courtesy post would've been nice since I've been F5'ing the original post all afternoon (and the redirect message at the top of the page was scrolled off).
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Why? In Java, property files are a pretty standard way of doing things. What benefit does a compile time setting give you that a property file does not?
That was me...
Originally posted by Doug Slattery:
That way, all I have to pay attention to is the type of distro I'm building (by only the command line) and not having to worry about changing things here and there in the project or worse, in the code. Visual C/C++ has a similar thing in their ide, and you just need to create two projects to do it this way. Nothing to remember (or forget) at build time. Once the build is done, everything is done. Nothing to set or worry about in the runtime environment.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
SCJP 1.4, SCWCD 1.3, SCBCD 1.3
ps - I like your signature!
Originally posted by Doug Slattery:
Thanks for the replies vu & Jeanne.....( snip )...
Aloha,
Doug
-- Nothing is impossible if I'mPossible
I took a look at EasyMock and jMock, but it's not really what I need. I probably should've mentioned in my first post this is a web app (my bad). The code I want to dummy up (the database code) I don't care about. I need to get around it so I can get to the code I want to test without the database code failing and stopping me from getting there.
As an example, suppose I want to check some behaviorism of the browser by selecting a link to another page. This behaviorism doesn't access the database, but the user needs to be logged in. For the user to be logged in, they would have accessed the database at the login screen. The steps to get to where I need to be would fill in session information and other things, so I can't just go to the page and click it. Only when I get around the database problem will I be ready for unit testing (which I want to do locally). The dummy database code will just fill in values along the way so the app doesn't get derailed.
It would be great if there's something in Eclipse/javac that can be done through the project properties or environment without having to remember to change a test/production flag in some master class.
@Jeanne: Your example
is right in line with what I need to do to the database code to get me to my unit testing point. However, I also would like the propertyFileSetToTestMode field in your example to be set at compile time, preferably by the compiler.
I'm still kind of green when it comes to things like this in Java.
Neither do I, but it's in the way
.
"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
Consider Paul's rocket mass heater. |