Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All CheckTxLogs checks compare !inUse records only by id
Used records are compared by all other record-specific fields.
- Loading branch information
Showing
10 changed files
with
267 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
tools/src/test/java/org/neo4j/tools/txlog/checktypes/NeoStoreCheckTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.tools.txlog.checktypes; | ||
|
||
import org.junit.Test; | ||
|
||
import org.neo4j.kernel.impl.store.record.NeoStoreRecord; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
public class NeoStoreCheckTypeTest | ||
{ | ||
@Test | ||
public void inUseRecordEquality() | ||
{ | ||
NeoStoreRecord record1 = new NeoStoreRecord(); | ||
record1.initialize( true, 1 ); | ||
|
||
NeoStoreRecord record2 = record1.clone(); | ||
|
||
NeoStoreCheckType check = new NeoStoreCheckType(); | ||
|
||
assertTrue( check.equal( record1, record2 ) ); | ||
} | ||
|
||
@Test | ||
public void notInUseRecordEquality() | ||
{ | ||
NeoStoreRecord record1 = new NeoStoreRecord(); | ||
record1.initialize( false, 1 ); | ||
|
||
NeoStoreRecord record2 = new NeoStoreRecord(); | ||
record2.initialize( false, 11 ); | ||
|
||
NeoStoreCheckType check = new NeoStoreCheckType(); | ||
|
||
assertTrue( check.equal( record1, record2 ) ); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
tools/src/test/java/org/neo4j/tools/txlog/checktypes/NodeCheckTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.tools.txlog.checktypes; | ||
|
||
import org.junit.Test; | ||
|
||
import org.neo4j.kernel.impl.store.record.NodeRecord; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
public class NodeCheckTypeTest | ||
{ | ||
@Test | ||
public void inUseRecordEquality() | ||
{ | ||
NodeRecord record1 = new NodeRecord( 1 ); | ||
record1.initialize( true, 1, false, 2, 3 ); | ||
record1.setSecondaryUnitId( 42 ); | ||
|
||
NodeRecord record2 = record1.clone(); | ||
|
||
NodeCheckType check = new NodeCheckType(); | ||
|
||
assertTrue( check.equal( record1, record2 ) ); | ||
} | ||
|
||
@Test | ||
public void notInUseRecordEquality() | ||
{ | ||
NodeRecord record1 = new NodeRecord( 1 ); | ||
record1.initialize( false, 1, true, 2, 3 ); | ||
record1.setSecondaryUnitId( 42 ); | ||
|
||
NodeRecord record2 = new NodeRecord( 1 ); | ||
record2.initialize( false, 11, true, 22, 33 ); | ||
record2.setSecondaryUnitId( 24 ); | ||
|
||
NodeCheckType check = new NodeCheckType(); | ||
|
||
assertTrue( check.equal( record1, record2 ) ); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
tools/src/test/java/org/neo4j/tools/txlog/checktypes/PropertyCheckTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright (c) 2002-2016 "Neo Technology," | ||
* Network Engine for Objects in Lund AB [http://neotechnology.com] | ||
* | ||
* This file is part of Neo4j. | ||
* | ||
* Neo4j is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package org.neo4j.tools.txlog.checktypes; | ||
|
||
import org.junit.Test; | ||
|
||
import org.neo4j.kernel.impl.store.record.PropertyRecord; | ||
|
||
import static org.junit.Assert.assertTrue; | ||
|
||
public class PropertyCheckTypeTest | ||
{ | ||
@Test | ||
public void inUseRecordEquality() | ||
{ | ||
PropertyRecord record1 = new PropertyRecord( 1 ); | ||
record1.initialize( true, 1, 2 ); | ||
record1.setSecondaryUnitId( 42 ); | ||
|
||
PropertyRecord record2 = record1.clone(); | ||
|
||
PropertyCheckType check = new PropertyCheckType(); | ||
|
||
assertTrue( check.equal( record1, record2 ) ); | ||
} | ||
|
||
@Test | ||
public void notInUseRecordEquality() | ||
{ | ||
PropertyRecord record1 = new PropertyRecord( 1 ); | ||
record1.initialize( false, 1, 2 ); | ||
record1.setSecondaryUnitId( 42 ); | ||
|
||
PropertyRecord record2 = new PropertyRecord( 1 ); | ||
record2.initialize( false, 11, 22 ); | ||
record2.setSecondaryUnitId( 24 ); | ||
|
||
PropertyCheckType check = new PropertyCheckType(); | ||
|
||
assertTrue( check.equal( record1, record2 ) ); | ||
} | ||
} |
Oops, something went wrong.