You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@usergrid.apache.org by gr...@apache.org on 2015/11/12 18:35:15 UTC
[4/4] usergrid git commit: Cleanup tests for unique index cleanup
Cleanup tests for unique index cleanup
Project: http://git-wip-us.apache.org/repos/asf/usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/usergrid/commit/b141565e
Tree: http://git-wip-us.apache.org/repos/asf/usergrid/tree/b141565e
Diff: http://git-wip-us.apache.org/repos/asf/usergrid/diff/b141565e
Branch: refs/heads/readRepairForIndexValues
Commit: b141565e3740b3ef52e7ca115479f2f4f3297cf1
Parents: a12fddc
Author: George Reyes <gr...@apache.org>
Authored: Thu Nov 12 09:35:10 2015 -0800
Committer: George Reyes <gr...@apache.org>
Committed: Thu Nov 12 09:35:10 2015 -0800
----------------------------------------------------------------------
.../usergrid/tools/UniqueIndexCleanupTest.java | 60 +-------------------
1 file changed, 2 insertions(+), 58 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/usergrid/blob/b141565e/stack/tools/src/test/java/org/apache/usergrid/tools/UniqueIndexCleanupTest.java
----------------------------------------------------------------------
diff --git a/stack/tools/src/test/java/org/apache/usergrid/tools/UniqueIndexCleanupTest.java b/stack/tools/src/test/java/org/apache/usergrid/tools/UniqueIndexCleanupTest.java
index e016284..25dd888 100644
--- a/stack/tools/src/test/java/org/apache/usergrid/tools/UniqueIndexCleanupTest.java
+++ b/stack/tools/src/test/java/org/apache/usergrid/tools/UniqueIndexCleanupTest.java
@@ -86,24 +86,6 @@ public class UniqueIndexCleanupTest {
@org.junit.Test
public void testBasicOperation() throws Exception {
-
- String rand = RandomStringUtils.randomAlphanumeric( 10 );
-
- // create app with some data
-
- String orgName = "org_" + rand;
- String appName = "app_" + rand;
- //
- // ExportDataCreator creator = new ExportDataCreator();
- // creator.startTool( new String[] {
- // "-organization", orgName,
- // "-application", appName,
- // "-host", "localhost:9160" //+ ServiceITSuite.cassandraResource.getRpcPort()
- // }, false);
-
- long start = System.currentTimeMillis();
-
-
UniqueIndexCleanup uniqueIndexCleanup = new UniqueIndexCleanup();
uniqueIndexCleanup.startTool( new String[] {
"-host", "localhost:9160"
@@ -230,9 +212,6 @@ public class UniqueIndexCleanupTest {
//verify it returns null.
assertNull(entityManager.get( testEntityUUID ));
- //the below works but not needed for this test.
- //assertNull( entityManager.getAlias("user",username));
-
//verify that we cannot recreate the entity due to duplicate unique property exception
Entity entityToBeCorrupted = null;
try {
@@ -326,8 +305,6 @@ public class UniqueIndexCleanupTest {
}
-
-
//run the cleanup
UniqueIndexCleanup uniqueIndexCleanup = new UniqueIndexCleanup();
uniqueIndexCleanup.startTool( new String[] {
@@ -389,9 +366,6 @@ public class UniqueIndexCleanupTest {
//verify it returns null.
assertNull(entityManager.get( testEntityUUID ));
- //the below works but not needed for this test.
- //assertNull( entityManager.getAlias("user",username));
-
//verify that we cannot recreate the entity due to duplicate unique property exception
Entity entityToBeCorrupted = null;
try {
@@ -404,12 +378,6 @@ public class UniqueIndexCleanupTest {
fail("shouldn't throw something else i think");
}
- //should return null since we have duplicate alias. Will Cause index corruptions to be thrown.
- //TODO: fix the below so that it fails everytime.
- //50/50 chance to succeed or fail
-// assertNull( entityManager
-// .get( entityManager.getAlias( applicationInfo.getId(), collectionName, username ).getUuid() ) );
-
//run the cleanup
UniqueIndexCleanup uniqueIndexCleanup = new UniqueIndexCleanup();
@@ -490,9 +458,6 @@ public class UniqueIndexCleanupTest {
//verify it returns null.
assertNull(entityManager.get( testEntityUUID ));
- //the below works but not needed for this test.
- //assertNull( entityManager.getAlias("user",username));
-
//verify that we cannot recreate the entity due to duplicate unique property exception
Entity entityToBeCorrupted = null;
try {
@@ -501,15 +466,10 @@ public class UniqueIndexCleanupTest {
}catch(DuplicateUniquePropertyExistsException dup){
}
- catch(Exception e){
- fail("shouldn't throw something else i think");
+ catch(Exception e) {
+ fail( "shouldn't throw something else i think" );
}
- //should return null since we have duplicate alias. Will Cause index corruptions to be thrown.
-// assertNull( entityManager
-// .get( entityManager.getAlias( applicationInfo.getId(), collectionName, username ).getUuid() ) );
-
-
//NEED TO FAIL MORE GRACEFULLY
//run the cleanup
UniqueIndexCleanup uniqueIndexCleanup = new UniqueIndexCleanup();
@@ -526,21 +486,5 @@ public class UniqueIndexCleanupTest {
.get( entityManager.getAlias( applicationInfo.getId(), collectionName, username ).getUuid() ) );
}
-
- @Test
- public void errorchecker(){
- System.out.println( "Started" );
-
- UniqueIndexCleanup uniqueIndexCleanup = new UniqueIndexCleanup();
- uniqueIndexCleanup.startTool( new String[] {
- "-host", "localhost:9160",
- "-col","users",
- "-app","00000000-0000-0000-0000-000000000001",
- "-property","username",
- "-value","jromero"
- }, false );
- System.out.println( "Finished" );
- }
-
}