accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r1397114 - in /accumulo/trunk: ./ core/ core/src/test/java/org/apache/accumulo/core/client/mock/ fate/src/main/java/org/apache/accumulo/fate/ server/ server/src/test/java/org/apache/accumulo/server/master/balancer/ src/
Date Thu, 11 Oct 2012 15:39:34 GMT
Author: ecn
Date: Thu Oct 11 15:39:34 2012
New Revision: 1397114

URL: http://svn.apache.org/viewvc?rev=1397114&view=rev
Log:
ACCUMULO-770 ACCUMULO-752 fix unit tests

Modified:
    accumulo/trunk/   (props changed)
    accumulo/trunk/core/   (props changed)
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
    accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java   (props changed)
    accumulo/trunk/server/   (props changed)
    accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
    accumulo/trunk/src/   (props changed)

Propchange: accumulo/trunk/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1397113
  Merged /accumulo/branches/1.4:r1397113

Propchange: accumulo/trunk/core/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/core:r1397113
  Merged /accumulo/branches/1.4/src/core:r1397113

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java?rev=1397114&r1=1397113&r2=1397114&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/mock/MockTableOperationsTest.java
Thu Oct 11 15:39:34 2012
@@ -133,7 +133,7 @@ public class MockTableOperationsTest {
 
   private ImportTestFilesAndData prepareTestFiles() throws Throwable {
     Configuration defaultConf = new Configuration();
-    Path tempFile = new Path("target/accumulo-test/import/sample.map");
+    Path tempFile = new Path("target/accumulo-test/import/sample.rf");
     Path failures = new Path("target/accumulo-test/failures/");
     FileSystem fs = FileSystem.get(new URI("file:///"), defaultConf);
     fs.deleteOnExit(tempFile);
@@ -144,6 +144,7 @@ public class MockTableOperationsTest {
     FileSKVWriter writer = FileOperations.getInstance().openWriter(
         tempFile.toString(), fs, defaultConf,
         AccumuloConfiguration.getDefaultConfiguration());
+    writer.startDefaultLocalityGroup();
     List<Pair<Key, Value>> keyVals = new ArrayList<Pair<Key, Value>>();
     for (int i = 0; i < 5; i++) {
       keyVals.add(new Pair<Key, Value>(new Key("a" + i, "b" + i, "c" + i,

Propchange: accumulo/trunk/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1397113
  Merged /accumulo/branches/1.4/src/fate/src/main/java/org/apache/accumulo/fate/ZooStore.java:r1397113

Propchange: accumulo/trunk/server/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/server:r1397113
  Merged /accumulo/branches/1.4/src/server:r1397113

Modified: accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java?rev=1397114&r1=1397113&r2=1397114&view=diff
==============================================================================
--- accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
(original)
+++ accumulo/trunk/server/src/test/java/org/apache/accumulo/server/master/balancer/DefaultLoadBalancerTest.java
Thu Oct 11 15:39:34 2012
@@ -138,9 +138,7 @@ public class DefaultLoadBalancerTest {
     
     // reassign offline extents
     assignTablets(remove.extents, servers, current, balancer);
-    
-    expectedCounts.put("t3", 3);
-    checkBalance(metadataTable, servers, expectedCounts);
+    checkBalance(metadataTable, servers, null);
   }
   
   private void assignTablets(List<KeyExtent> metadataTable, Map<TServerInstance,FakeTServer>
servers, SortedMap<TServerInstance,TabletServerStatus> status,
@@ -259,16 +257,18 @@ public class DefaultLoadBalancerTest {
         fail("average number of tablets is " + average + " but a server has " + server.extents.size());
     }
     
-    for (FakeTServer server : servers.values()) {
-      Map<String,Integer> counts = new HashMap<String,Integer>();
-      for (KeyExtent extent : server.extents) {
-        String t = extent.getTableId().toString();
-        if (counts.get(t) == null)
-          counts.put(t, 0);
-        counts.put(t, counts.get(t) + 1);
-      }
-      for (Entry<String,Integer> entry : counts.entrySet()) {
-        assertEquals(expectedCounts.get(entry.getKey()), counts.get(entry.getKey()));
+    if (expectedCounts != null) {
+      for (FakeTServer server : servers.values()) {
+        Map<String,Integer> counts = new HashMap<String,Integer>();
+        for (KeyExtent extent : server.extents) {
+          String t = extent.getTableId().toString();
+          if (counts.get(t) == null)
+            counts.put(t, 0);
+          counts.put(t, counts.get(t) + 1);
+        }
+        for (Entry<String,Integer> entry : counts.entrySet()) {
+          assertEquals(expectedCounts.get(entry.getKey()), counts.get(entry.getKey()));
+        }
       }
     }
   }

Propchange: accumulo/trunk/src/
------------------------------------------------------------------------------
  Merged /accumulo/branches/1.4/src:r1397113
  Merged /accumulo/branches/1.4/src/src:r1397113



Mime
View raw message