From: Scott L. <sl...@sl...> - 2002-04-15 22:14:52
|
I couldn't get mockobjects to compile under J2SE 1.4, so I looked in the com.mockobjects.sql.* classes and found that there's a lot of code that just does "throw new UnsupportedOperationException();". J2SE 1.4 has many more methods that require this repetitive code. Instead of adding new skeletons, I removed them all and added a new class InterfaceImplementor, based on some code by Dustin Sallings. It creates these skeleton methods automatically. This InterfaceImplementor is pretty untested - I tried to be more strict about catching errors than Dustin's code, so the result is different enough to have its own bugs. I might try writing tests for it later. But it works well enough that everything compiles and the current unit tests - which sort of check its output - pass. Now the com.mockobjects.sql.* classes are more terse and work with J2SE 1.4. They will compile against extended JDBC interfaces in the future. Hopefully InterfaceImplementor can be used for other classes as well. The diffstat: build.xml | 21 src/core/com/mockobjects/util/InterfaceImplementor.java | 361 ++++++++++ src/core/com/mockobjects/util/InterfaceImplementorTask.java | 113 +++ src/jdk/common/com/mockobjects/sql/MockConnection.java | 80 -- src/jdk/common/com/mockobjects/sql/MockPreparedStatement.java | 42 - src/jdk/common/com/mockobjects/sql/MockResultSet.java | 2 src/jdk/common/com/mockobjects/sql/MockStatement.java | 99 -- 7 files changed, 499 insertions(+), 219 deletions(-) -- Scott Lamb |