[Bps-public-commit] r11342 - in SVN-PropDB: .

jesse at bestpractical.com jesse at bestpractical.com
Tue Apr 1 19:35:40 EDT 2008


Author: jesse
Date: Tue Apr  1 19:35:40 2008
New Revision: 11342

Modified:
   SVN-PropDB/   (props changed)
   SVN-PropDB/t/real-conflicting-merge.t

Log:
 r28911 at 70-5-79-205:  jesse | 2008-04-01 13:34:41 -1000
  bob's final state now checked


Modified: SVN-PropDB/t/real-conflicting-merge.t
==============================================================================
--- SVN-PropDB/t/real-conflicting-merge.t	(original)
+++ SVN-PropDB/t/real-conflicting-merge.t	Tue Apr  1 19:35:40 2008
@@ -4,7 +4,7 @@
 use strict;
 use Test::Exception;
 
-use Prophet::Test tests => 17;
+use Prophet::Test tests => 19;
 
 as_alice {
     run_ok( 'prophet-node-create', [qw(--type Bug --status new --from alice )], "Created a record as alice" );
@@ -81,8 +81,9 @@
 
     #    diag `svn log -v $repo`;
 
-};
 
+    check_bob_final_state_ok(@changesets);
+};
 as_alice {
     my $source = Prophet::Sync::Source->new( { url => repo_uri_for('bob') } );
     my $target = Prophet::Sync::Source->new( { url => repo_uri_for('alice') } );
@@ -119,5 +120,92 @@
 
     };
 
+
+    check_bob_final_state_ok(fetch_newest_changesets(3));
+
+
 };
 
+our $ALICE_LAST_REV_CACHE;
+
+sub check_bob_final_state_ok {
+    my (@changesets) = (@_);
+
+    $ALICE_LAST_REV_CACHE ||= as_alice { replica_last_rev()};
+
+    my @hashes = map { $_->as_hash} @changesets;
+    is_deeply(
+        \@hashes,
+        [   {   changes =>{ 
+                    $record_id => {
+                        change_type  => 'update_file',
+                        node_type    => 'Bug',
+                        prop_changes => {
+                            status => {
+                                old_value => 'stalled',
+                                new_value => 'new'
+                            }
+                        }
+                    }
+                },
+                is_empty             => 0,
+                is_nullification     => 1,
+                is_resolution        => undef,
+                sequence_no          => (replica_last_rev()-2),
+                original_sequence_no => (replica_last_rev() -2),
+                source_uuid          =>  replica_uuid(),
+                original_source_uuid =>  replica_uuid(),
+            },
+            {   is_empty             => 0,
+                is_nullification     => undef,
+                is_resolution        => undef,
+                sequence_no          => (replica_last_rev()-1),
+                original_sequence_no => $ALICE_LAST_REV_CACHE,
+                source_uuid          => replica_uuid(),
+                original_source_uuid => as_alice{replica_uuid()},
+                changes              => {
+                    $record_id => {
+                        node_type    => 'Bug',
+                        change_type  => 'update_file',
+                        prop_changes => {
+                            status => { old_value => 'new', new_value => 'open' }
+
+                            }
+
+                    },
+                    as_alice { replica_uuid() } => {
+                        node_type => '_merge_tickets',
+                        change_type => 'update_file',
+                        prop_changes => {
+                            'last-changeset' => { old_value => $ALICE_LAST_REV_CACHE-1, new_value => $ALICE_LAST_REV_CACHE
+                            }
+                        }
+
+                    }
+                }
+            },
+
+            {   is_empty             => 0,
+                is_nullification     => undef,
+                is_resolution        => 1,
+                sequence_no          => replica_last_rev(),
+                original_sequence_no => replica_last_rev(),
+                source_uuid          => replica_uuid(),
+                original_source_uuid => replica_uuid(),
+                changes              => {
+                    $record_id => {
+                        node_type    => 'Bug',
+                        change_type  => 'update_file',
+                        prop_changes => {
+                            status => { old_value => 'open', new_value => 'stalled' }
+
+
+                            }
+
+                    }
+                }
+
+            }
+        ],
+    "Bob's final state is as we expect");
+}



More information about the Bps-public-commit mailing list