We're open to suggestions on how to improve this. The reason we use negative ids is because if we don't, Oracle gets its sequences messed up. You could fix things in your project by modifying sample-data.xml to have positive keys and then run "appfuse:full-source" and modify all your tests. Or modify AMP to generate positive ids.
Matt On 11/29/07, Laith Al-Khateeb <[EMAIL PROTECTED]> wrote: > Yes you're right, that's because the ActionTest cases expect negative IDs > (-1, -2) to be in the database, which are used in sample-data.xml but that > I didn't specify in default-data.xml (which is used when prod is activated). > > Ok, to step back a bit. If I was not going to put any data for my tables in > default-data.xml, then the tests will still fail when activating the prod > profile and that's because the ActionTests always assume that there will be > records with negative IDs in the database. > > This is from action-test.ftl: > > public void testEdit() throws Exception { > log.debug("testing edit..."); > action.${setIdMethodName}(-1L); > assertNull(action.get${pojo.shortName} ()); > assertEquals("success", action.edit()); > assertNotNull(action.get${pojo.shortName}()); > assertFalse(action.hasActionErrors()); > } > > > So in effect, the line of "action.${setIdMethodName}(-1L);" > will always fail in prod. > > Now the question is whether this is a bug or whether it is there by design > (to prevent people from running tests in prod), in which case loading data > from default-data.xml becomes an unusable feature. > > Laith > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]