incubator-accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vi...@apache.org
Subject svn commit: r1230107 - in /incubator/accumulo/trunk/test/system/auto: TestCombinerX.jar TestCombinerY.jar simple/combiner.py
Date Wed, 11 Jan 2012 15:52:02 GMT
Author: vines
Date: Wed Jan 11 15:52:02 2012
New Revision: 1230107

URL: http://svn.apache.org/viewvc?rev=1230107&view=rev
Log:
fixes ACCUMULO-188


Added:
    incubator/accumulo/trunk/test/system/auto/TestCombinerX.jar
      - copied unchanged from r1230104, incubator/accumulo/branches/1.4/test/system/auto/TestCombinerX.jar
    incubator/accumulo/trunk/test/system/auto/TestCombinerY.jar
      - copied unchanged from r1230104, incubator/accumulo/branches/1.4/test/system/auto/TestCombinerY.jar
Modified:
    incubator/accumulo/trunk/test/system/auto/simple/combiner.py

Modified: incubator/accumulo/trunk/test/system/auto/simple/combiner.py
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/test/system/auto/simple/combiner.py?rev=1230107&r1=1230106&r2=1230107&view=diff
==============================================================================
--- incubator/accumulo/trunk/test/system/auto/simple/combiner.py (original)
+++ incubator/accumulo/trunk/test/system/auto/simple/combiner.py Wed Jan 11 15:52:02 2012
@@ -14,6 +14,8 @@
 # limitations under the License.
 
 import os
+import sys
+import shutil
 
 import logging
 import unittest
@@ -61,7 +63,51 @@ class CombinerTest(TestUtilsMixin, unitt
         self.start_accumulo()
         self.checkSum()
 
+class ClassLoaderTest(TestUtilsMixin, unittest.TestCase):
+    "Start a clean accumulo, ingest one data, read it, set a combiner, read it again, change
the combiner jar, read it again" 
+    order = 26
+
+    def checkSum(self, val):
+        # check the scan
+        out, err, code = self.shell(self.masterHost(), "table test\nscan\n")
+        self.assert_(code == 0)
+        for line in out.split('\n'):
+            if line.find('row1') == 0:
+                self.assert_(line.split()[-1] == val)
+                break
+        else:
+            self.fail("Unable to find needed output in %r" % out)
+
+    def runTest(self):
+        jarPath = os.environ['ACCUMULO_HOME']+"/lib/ext/TestCombiner.jar"
+        # make sure the combiner is not there
+        if os.path.exists(jarPath):
+            os.remove(jarPath)
+        # initialize the database
+        out, err, code = self.rootShell(self.masterHost(), "createtable test\n")
+        self.assert_(code == 0)
+
+        # insert some rows
+        log.info("Starting Test Ingester")
+        
+        out, err, code = self.rootShell(self.masterHost(), "table test\ninsert row1 cf col1
Test\n")
+        self.assert_(code == 0)
+        self.checkSum("Test")
+        
+        shutil.copy(sys.path[0]+"/TestCombinerX.jar", jarPath)
+        out, err, code = self.rootShell(self.masterHost(), "setiter -t test -scan -p 10 -n
TestCombiner -class org.apache.accumulo.server.test.functional.TestCombiner\ncf\n")
+        self.assert_(code == 0)
+        self.checkSum("TestX")
+        
+        shutil.copy(sys.path[0]+"/TestCombinerY.jar", jarPath)
+        time.sleep(1)
+        self.checkSum("TestY")
+        
+        os.remove(jarPath)
+        
+
 def suite():
     result = unittest.TestSuite()
     result.addTest(CombinerTest())
+    result.addTest(ClassLoaderTest())
     return result



Mime
View raw message