Jonathan MBaker

Greenhorn
+ Follow
since Jul 08, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
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.

http://groovy.dzone.com/news/event-based-actors-groovy
http://www.groovyactors.org

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 (http://www.malhar.net/sriram/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 10.2.0.1.0.

This known limitation has been fixed according to the release notes of Oracle JDBC Driver release 11.1.0.7.0
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.

zdata(blank:false,maxSize:3000000)

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

The table definition looks like this:

ZDATA NOT NULL LONG()

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.(String.java:176) at oracle.sql.CharacterSet.AL32UTF8ToString(CharacterSet.java:1518) at oracle.jdbc.driver.DBConversion.CharBytesToString(DBConversion.java:610) at oracle.jdbc.driver.DBConversion.CharBytesToString(DBConversion.java:555) at oracle.jdbc.driver.LongAccessor.getString(LongAccessor.java:217) at oracle.jdbc.driver.T4CLongAccessor.getString(T4CLongAccessor.java:426) at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:403) at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1515) at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:224) at org.hibernate.type.StringType.get(StringType.java:18) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:163) at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:154) at org.hibernate.loader.hql.QueryLoader.getResultColumnOrRow(QueryLoader.java:333) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:606) at org.hibernate.loader.Loader.doQuery(Loader.java:701) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) at org.hibernate.loader.Loader.doList(Loader.java:2220) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) at org.hibernate.loader.Loader.list(Loader.java:2099) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) 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(www.eclipse.org) and Intellij Idea(www.intellij.com/jetbrains) 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.