Jonathan MBaker

+ Follow
since Jul 08, 2003
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jonathan MBaker

Another alternative for testing that I don't think I've seen mentioned on this thread are automated system tests. Since the application you are testing is a web application, you should be able to use a tool like selenium to build a nice suite of tests at the application layer.

Selenium has a firefox plugin that allows you to record user actions (ie. login, click button a, type into box b, etc). Once those actions are recorded, you can save those recordings as junit tests that you can setup to run nightly or hourly, etc.

I have used this technique when given a large legacy code base that had no real tests, and was architected in such a way as it was very difficult to test (for all of the reasons that you cite above - tight coupling, numerous dependencies, etc)

The framework works with ajax-enabled interfaces in addition to standard interfaces. It took a minimal amount of modification to the recorded scripts to get them to be re-runnable, and the benefit was tremendous. In my case we ran a suite of read-only actions in production as part of our install procedure to verify our install was correct. (Not what I would recommend, but I wasn't the boss) If you have a test environment available, then read and write actions could be run in that environment at whatever frequency is good for your situation.

I did this over two years ago, so the feature set of selenium could be even richer now.

I'm currently wondering what's to stop Groovy from implementing them though.

I believe that there are several attempts to do just that.

I have never used any of these libraries, so I cannot vouch for them.

We do a lot of groovy development where I work. There are two developers that I know of that are currently investigating Scala. We have some performance issues that we believe could be solved best with concurrency.

I plan on bringing these groovy libraries to their attention.

Also, while I was in Seattle last summer, I saw a presentation on Kilim ( which was a project to bring erlang-like actors to java. I don't know the status of this project either, but it might be worth checking out if it is still alive.
12 years ago
This is a known limitation of the oracle jdbc driver as listed in the release notes for version

This known limitation has been fixed according to the release notes of Oracle JDBC Driver release
We are trying to populate a domain object from an oracle 10g database. The field in question is defined as a string in the domain object with the following constraints.


The size of the data is approximately 70K of XML.

The table definition looks like this:


We are using the grails generated getter to access the table:

reportData = ReportData.get(reportDataId)

When making this call we are getting a null pointer exception. Here is a portion of our stack trace. java.lang.NullPointerException at java.lang.String.( at oracle.sql.CharacterSet.AL32UTF8ToString( at oracle.jdbc.driver.DBConversion.CharBytesToString( at oracle.jdbc.driver.DBConversion.CharBytesToString( at oracle.jdbc.driver.LongAccessor.getString( at oracle.jdbc.driver.T4CLongAccessor.getString( at oracle.jdbc.driver.OracleResultSetImpl.getString( at oracle.jdbc.driver.OracleResultSet.getString( at org.apache.commons.dbcp.DelegatingResultSet.getString( at org.hibernate.type.StringType.get( at org.hibernate.type.NullableType.nullSafeGet( at org.hibernate.type.NullableType.nullSafeGet( at org.hibernate.loader.hql.QueryLoader.getResultColumnOrRow( at org.hibernate.loader.Loader.getRowFromResultSet( at org.hibernate.loader.Loader.doQuery( at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections( at org.hibernate.loader.Loader.doList( at org.hibernate.loader.Loader.listIgnoreQueryCache( at org.hibernate.loader.Loader.list( at org.hibernate.loader.hql.QueryLoader.list( at org.hibernate.hql.ast.QueryTranslatorImpl.list( at org.hibernate.engine.query.HQLQueryPlan.performList( at org.hibernate.impl.SessionImpl.list( at org.hibernate.impl.QueryImpl.list( at
We have a new developer on our team who just graduated from college. She is just beginning to learn the ins and outs of java. I suggested that as she is working her way through tutorials that she also be learning groovy. After a day or so of this, she came to me very excited, and wanted to know why she should continue to learn java when a language such as Groovy existed.

I explained about the higher overhead when using groovy as the class files generated are bigger than the corresponding java class files, but I wasn't really secure in my answer. Obviously, since there are many products at our company written in java, she will need to learn java to help maintain existing apps, and such. With the continued rise of ruby and rails, I think that maybe there is no driving reason that she couldn't learn groovy as her primary language.

Do you think you could explain the main advantages and disadvantages of using groovy over core java.
14 years ago
I know that HashMap and Hashtable are vritually identical except that Hashtable is synchronized. This causes Hashtable to perform slower than Hashmap. Does anyone know if there is any performance difference between a Hashtable and the object that is returned from Collections.getSynchronizedMap(HashMap)?
18 years ago
I recently had to evaluate Eclipse( and Intellij Idea( for my team.(we develop only in Java) I came to prefer Idea (probably because I used it first and got used to all of the shortcuts), but I can break down some of the differences and similarities. The first major difference is cost. Eclipse is free. Idea costs around $400 a seat. Eclipse has really good integration with JUnit. It will generate test cases for you, and the run right inside of the IDE. Idea supports JUnit integration, but it isn't as good as Eclipse. It basically just pops up the JUnit GUI window and runs the tests that you want it to run. I'm sure you could create a file template to generate your tests for you, I just haven;t done that yet. Both IDEs support various automatic refactorings, but the number that Idea supported was much larger. Both IDEs supported code completion, and will highlight errors and warnings. You can fully customize the coding style (where to place braces, etc.) in both IDEs. You can automatically view parameter lists, or automatically jump to javadoc, or actual code in both IDE's as well. Idea has this wonderful thing called code inspection that will scan your entire code base and tell you when files, or functions or variables arent being used, or if you should change access modifiers, and things like that. That feature is really good to use along with the refactorings to clean up existing code. There are some other things that they both do, such as built in support for ant and cvs. I would really reccomend either of them, but it is best to just download them both and see which one you like.