usergrid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject [48/50] [abbrv] incubator-usergrid git commit: Adding some feedback so you can tell that test is running and not just hanging.
Date Thu, 26 Feb 2015 16:28:12 GMT
Adding some feedback so you can tell that test is running and not just hanging.


Project: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/commit/0b63317f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/tree/0b63317f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-usergrid/diff/0b63317f

Branch: refs/heads/two-dot-o
Commit: 0b63317f26cf5e694f5db071df1a7ee0f0b9e976
Parents: 04ff584
Author: Dave Johnson <snoopdave@apache.org>
Authored: Thu Feb 26 10:41:30 2015 -0500
Committer: Dave Johnson <snoopdave@apache.org>
Committed: Thu Feb 26 10:41:30 2015 -0500

----------------------------------------------------------------------
 .../apache/usergrid/utils/UUIDUtilsTest.java    | 76 +++++++++++---------
 1 file changed, 44 insertions(+), 32 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-usergrid/blob/0b63317f/stack/core/src/test/java/org/apache/usergrid/utils/UUIDUtilsTest.java
----------------------------------------------------------------------
diff --git a/stack/core/src/test/java/org/apache/usergrid/utils/UUIDUtilsTest.java b/stack/core/src/test/java/org/apache/usergrid/utils/UUIDUtilsTest.java
index 71777ae..e59dac8 100644
--- a/stack/core/src/test/java/org/apache/usergrid/utils/UUIDUtilsTest.java
+++ b/stack/core/src/test/java/org/apache/usergrid/utils/UUIDUtilsTest.java
@@ -43,39 +43,39 @@ import static org.junit.Assert.assertTrue;
 
 public class UUIDUtilsTest {
 
-    private static final Logger LOG = LoggerFactory.getLogger( UUIDUtilsTest.class );
+    private static final Logger logger = LoggerFactory.getLogger( UUIDUtilsTest.class );
 
 
     @Test
     public void testUUIDUtils() {
         UUID uuid = UUIDUtils.newTimeUUID();
-        LOG.info( "" + uuid );
-        LOG.info( "" + uuid.timestamp() );
-        LOG.info( "" + UUIDUtils.getTimestampInMillis( uuid ) );
-
-        LOG.info( "" + UUIDUtils.getTimestampInMillis( UUIDUtils.newTimeUUID() ) );
-        LOG.info( "" + System.currentTimeMillis() );
-
-        LOG.info( "" + UUIDUtils.getTimestampInMicros( UUIDUtils.newTimeUUID() ) );
-        LOG.info( "" + ( System.currentTimeMillis() * 1000 ) );
-
-        LOG.info( "" + UUIDUtils.MIN_TIME_UUID );
-        LOG.info( "" + UUIDUtils.MIN_TIME_UUID.variant() );
-        LOG.info( "" + UUIDUtils.MIN_TIME_UUID.version() );
-        LOG.info( "" + UUIDUtils.MIN_TIME_UUID.clockSequence() );
-        LOG.info( "" + UUIDUtils.MIN_TIME_UUID.timestamp() );
-
-        LOG.info( "" + UUIDUtils.MAX_TIME_UUID );
-        LOG.info( "" + UUIDUtils.MAX_TIME_UUID.variant() );
-        LOG.info( "" + UUIDUtils.MAX_TIME_UUID.version() );
-        LOG.info( "" + UUIDUtils.MAX_TIME_UUID.clockSequence() );
-        LOG.info( "" + UUIDUtils.MAX_TIME_UUID.timestamp() );
+        logger.info("" + uuid);
+        logger.info("" + uuid.timestamp());
+        logger.info("" + UUIDUtils.getTimestampInMillis(uuid));
+
+        logger.info("" + UUIDUtils.getTimestampInMillis(UUIDUtils.newTimeUUID()));
+        logger.info("" + System.currentTimeMillis());
+
+        logger.info("" + UUIDUtils.getTimestampInMicros(UUIDUtils.newTimeUUID()));
+        logger.info("" + (System.currentTimeMillis() * 1000));
+
+        logger.info("" + UUIDUtils.MIN_TIME_UUID);
+        logger.info("" + UUIDUtils.MIN_TIME_UUID.variant());
+        logger.info("" + UUIDUtils.MIN_TIME_UUID.version());
+        logger.info("" + UUIDUtils.MIN_TIME_UUID.clockSequence());
+        logger.info("" + UUIDUtils.MIN_TIME_UUID.timestamp());
+
+        logger.info("" + UUIDUtils.MAX_TIME_UUID);
+        logger.info("" + UUIDUtils.MAX_TIME_UUID.variant());
+        logger.info("" + UUIDUtils.MAX_TIME_UUID.version());
+        logger.info("" + UUIDUtils.MAX_TIME_UUID.clockSequence());
+        logger.info("" + UUIDUtils.MAX_TIME_UUID.timestamp());
     }
 
 
     @Test
     public void testAppProvidedTimestamp() {
-        LOG.info( "UUIDUtilsTest.testAppProvidedTimestamp" );
+        logger.info("UUIDUtilsTest.testAppProvidedTimestamp");
         long ts = System.currentTimeMillis();
         System.out.println( ts );
 
@@ -83,7 +83,7 @@ public class UUIDUtilsTest {
 
         int count = 1000000;
 
-        LOG.info( "Generating " + count + " UUIDs..." );
+        logger.info("Generating " + count + " UUIDs...");
         for ( int i = 0; i < count; i++ ) {
             UUID uuid = newTimeUUID( ts );
 
@@ -91,14 +91,18 @@ public class UUIDUtilsTest {
             uuids.add( uuid );
 
             assertEquals( "Incorrect UUID timestamp value", ts, getTimestampInMillis( uuid
) );
+
+            if ( i % 1000 == 0 ) {
+                logger.info("testAppProvidedTimestamp processed " + i);
+            }
         }
-        LOG.info( "UUIDs checked" );
+        logger.info("UUIDs checked");
     }
 
 
     @Test
     public void testAppProvidedTimestampOrdering() {
-        LOG.info( "UUIDUtilsTest.testAppProvidedTimestamp" );
+        logger.info("UUIDUtilsTest.testAppProvidedTimestamp");
         long ts = System.currentTimeMillis();
         System.out.println( ts );
 
@@ -119,13 +123,17 @@ public class UUIDUtilsTest {
 
         List<UUID> uuids = new ArrayList<UUID>( count );
 
-        LOG.info( "Generating " + count + " UUIDs..." );
+        logger.info("Generating " + count + " UUIDs...");
         for ( int i = 0; i < count; i++ ) {
             UUID uuid = newTimeUUID( ts, i );
 
             uuids.add( uuid );
 
             assertEquals( "Incorrect UUID timestamp value", ts, getTimestampInMillis( uuid
) );
+
+            if ( i % 1000 == 0 ) {
+                logger.info("timeUUIDOrdering processed " + i);
+            }
         }
 
         for ( int i = 0; i < count - 1; i++ ) {
@@ -174,7 +182,7 @@ public class UUIDUtilsTest {
 
         Set created = buildTsMicros( count );
 
-        LOG.info( "execution took {}", System.currentTimeMillis() - startTime );
+        logger.info("execution took {}", System.currentTimeMillis() - startTime);
         assertEquals( count, created.size() );
         assertTrue( created.size() > 0 );
     }
@@ -186,11 +194,11 @@ public class UUIDUtilsTest {
         List<Future> jobs = executeFrob();
 
         for ( Future f : jobs ) {
-            LOG.info( "waiting on job..." );
+            logger.info("waiting on job...");
             f.get();
         }
 
-        LOG.info( "execution took {}", System.currentTimeMillis() - startTime );
+        logger.info("execution took {}", System.currentTimeMillis() - startTime);
     }
 
 
@@ -202,7 +210,7 @@ public class UUIDUtilsTest {
             jobs.add( exec.submit( new Callable<Object>() {
                 @Override
                 public Object call() throws Exception {
-                    LOG.info( "call invoked" );
+                    logger.info("call invoked");
 
                     int count = 1000 * 100;
                     Set created = buildTsMicros( count );
@@ -210,7 +218,7 @@ public class UUIDUtilsTest {
                     assertEquals( count, created.size() );
                     assertTrue( created.size() > 0 );
 
-                    LOG.info( "run complete" );
+                    logger.info("run complete");
                     return null;
                 }
             } ) );
@@ -352,6 +360,10 @@ public class UUIDUtilsTest {
 
             assertEquals( -1, current.compareTo( previous ) );
 
+            if ( i % 1000 == 0 ) {
+                logger.info("testDecrement processed " + i);
+            }
+
             previous = current;
         }
     }


Mime
View raw message