continuum-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brill Pappin <br...@pappin.ca>
Subject unit testing headache
Date Thu, 31 Aug 2006 00:33:19 GMT
all I want to do it write a regression test for some code before I make 
any changes...
But I seem to be unable to inject my fakes into the code under test 
(members not exposed).

So I took a look at some of the other test that use an abstract base 
test... however it initializes a whole in memory database.

it also doesn't seem to work as I keep getting a jpox error about bad 
mappings:

org.jpox.metadata.InvalidMetaDataException: Error in MetaData for field 
"projectGroup" in class "Project" : this is declared as 
org.apache.maven.continuum.model.project.ProjectGroup with 
"persistence-modifier=none" yet has either "default-fetch-group=true" or 
"primary-key=true" specified! These should be false.
    at 
org.jpox.metadata.AbstractPropertyMetaData.populate(AbstractPropertyMetaData.java:818)
    at 
org.jpox.metadata.ClassMetaData.populatePropertyMetaData(ClassMetaData.java:418)
    at org.jpox.metadata.ClassMetaData.populate(ClassMetaData.java:238)
    at 
org.jpox.metadata.MetaDataManager.populateClassesInterfacesInFile(MetaDataManager.java:1308)
    at 
org.jpox.metadata.MetaDataManager.loadMetaDataForClass(MetaDataManager.java:1430)
    at 
org.jpox.metadata.MetaDataManager.getMetaDataForClassOrInterface(MetaDataManager.java:544)
    at 
org.jpox.metadata.MetaDataManager.getMetaDataForClassInternal(MetaDataManager.java:509)
    at 
org.jpox.metadata.MetaDataManager.getMetaDataForClass(MetaDataManager.java:392)
    at 
org.jpox.metadata.MetaDataManager.getMetaDataForClass(MetaDataManager.java:378)
    at 
org.jpox.store.rdbms.RDBMSManager$ClassAdder.getReferencedClasses(RDBMSManager.java:2852)
    at 
org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTables(RDBMSManager.java:2603)
    at 
org.jpox.store.rdbms.RDBMSManager$ClassAdder.addClassTablesAndValidate(RDBMSManager.java:2915)
    at 
org.jpox.store.rdbms.RDBMSManager$ClassAdder.run(RDBMSManager.java:2540)
    at 
org.jpox.store.rdbms.RDBMSManager$MgmtTransaction.execute(RDBMSManager.java:2397)
    at org.jpox.store.rdbms.RDBMSManager.addClasses(RDBMSManager.java:603)
    at org.jpox.SchemaTool.createSchemaTables(SchemaTool.java:279)
    at 
org.apache.maven.continuum.AbstractContinuumTest.getStore(AbstractContinuumTest.java:132)
    at 
org.apache.maven.continuum.AbstractContinuumTest.setUp(AbstractContinuumTest.java:62)
    at 
org.apache.maven.continuum.buildcontroller.DefaultBuildControllerTest.setUp(DefaultBuildControllerTest.java:26)
  

If i fix the jdo file manually, I get another one just like this for 
another mapping... and so on, and so on...

Do I really need to use this base test, or does someone have a way to 
write a simple unit test?

- Brill Pappin



Mime
View raw message