Issue 11287

registry-ws-client: failing test

11287
Reporter: kbraak
Assignee: jcuadra
Type: Bug
Summary: registry-ws-client: failing test
Priority: Blocker
Resolution: Fixed
Status: Closed
Created: 2012-06-01 18:45:41.013
Updated: 2013-12-16 17:50:55.91
Resolved: 2012-07-05 18:29:01.419
        
Description: We have one failing test on registry-ws-client

http://builds.gbif.org/view/Registry/job/registry-ws-client/org.gbif$registry-ws-client/698/testReport/

Appears the testGenericInsert fails, when it comes to an assertion about whether or not the Dataset retrieved should NOT have its modified timestamp set. Wouldn't the modified timestamp never be null? ]]>
    


Author: trobertson@gbif.org
Comment: Confirmed that it does actually get the "before" as the modified value.  If modified is set, it should be set to the same as created()
Created: 2012-06-02 11:04:59.735
Updated: 2012-06-02 11:04:59.735


Author: trobertson@gbif.org
Created: 2012-06-02 11:27:46.7
Updated: 2012-06-02 11:27:46.7
        
I have done the following.
i) reworked the test to show what I *think* should happen, refactoring a bit for readability
ii) @ignore the test

Note that @ignore is only picked up on @overrides methods when there is also a @Test annotation
    


Author: kbraak@gbif.org
Comment: Thanks Tim. Thanks also for pointing out that note with the annotations, I was indeed surprised when the Ignore instruction wasn't picked up.
Created: 2012-06-04 09:28:15.959
Updated: 2012-06-04 09:28:15.959


Author: trobertson@gbif.org
Comment: Bumping to 0.2, raising to blocker
Created: 2012-06-26 14:00:33.309
Updated: 2012-06-26 14:00:33.309


Author: jcuadra@gbif.org
Created: 2012-07-05 11:19:08.086
Updated: 2012-07-05 11:19:08.086
        
I have run this test and I can't get the problem locally.
When an entity (Org/Dataset/Network/Tech Install) gets persisted, its created&modified timestamp gets generated automatically - see http://code.google.com/p/gbif-registry/source/browse/registry/trunk/registry-persistence-service/src/main/java/org/gbif/registry/service/impl/EntityManager.java#198

When I run the test, the value I get is

create: Thu Jul 05 11:12:41 CEST 2012
modified: Thu Jul 05 11:12:41 CEST 2012
beforeSave: Thu Jul 05 11:12:38 CEST 2012

so

    assertTrue(obj.getCreated().after(beforeSave));
    assertTrue(obj.getModified().after(beforeSave));

always passes sucessfully on my machine.

Was there any other variable I am not considering when running this test? Or maybe somebody modified some code that solved this issue but didn't mark the issue as fixed? If you agree, I will go ahead and remove the @Ignore annotation.

    


Author: jcuadra@gbif.org
Comment: Ah, didnt saw this issue is unassigned. I will just assign it to me and resolve it.
Created: 2012-07-05 11:26:12.776
Updated: 2012-07-05 11:26:12.776


Author: trobertson@gbif.org
Created: 2012-07-05 11:27:57.739
Updated: 2012-07-05 11:27:57.739
        
Hi Jose.  I simply did a check out and ran the test.  There has been a lot of commits since, so could be already fixed!

If you can uncomment that, and it works, then it's fixed.