[infinispan-commits] Infinispan SVN: r1435 - trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud.

infinispan-commits at lists.jboss.org infinispan-commits at lists.jboss.org
Tue Feb 2 09:48:49 EST 2010


Author: manik.surtani at jboss.com
Date: 2010-02-02 09:48:49 -0500 (Tue, 02 Feb 2010)
New Revision: 1435

Modified:
   trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreFunctionalIntegrationTest.java
   trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreIntegrationTest.java
   trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreIntegrationVamTest.java
Log:
Disabled tests

Modified: trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreFunctionalIntegrationTest.java
===================================================================
--- trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreFunctionalIntegrationTest.java	2010-02-02 14:34:35 UTC (rev 1434)
+++ trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreFunctionalIntegrationTest.java	2010-02-02 14:48:49 UTC (rev 1435)
@@ -28,54 +28,57 @@
 import org.testng.annotations.Parameters;
 import org.testng.annotations.Test;
 
- at Test(groups = "unit", sequential = true, testName = "loaders.cloud.CloudCacheStoreFunctionalIntegrationTest", enabled = false)
-public class CloudCacheStoreFunctionalIntegrationTest extends BaseCacheStoreFunctionalTest {
+// TODO figure out why a disabled test is still run in Hudson!!
+public class CloudCacheStoreFunctionalIntegrationTest {}
 
-   private String proxyHost;
-   private String proxyPort = "-1";
-   private int maxConnections = 20;
-   private boolean isSecure = false;
-   private String csBucket;
-   private String accessKey;
-   private String secretKey;
-   private String cs;
-
-   private static final String sysUsername = System.getProperty("infinispan.jclouds.username");
-   private static final String sysPassword = System.getProperty("infinispan.jclouds.password");
-   private static final String sysService = System.getProperty("infinispan.jclouds.service");
-
-   @BeforeTest
-   @Parameters({"infinispan.jclouds.username", "infinispan.jclouds.password", "infinispan.jclouds.service"})
-   protected void setUpClient(@Optional String JcloudsUsername,
-                              @Optional String JcloudsPassword,
-                              @Optional String JcloudsService) throws Exception {
-
-      accessKey = (JcloudsUsername == null) ? sysUsername : JcloudsUsername;
-      secretKey = (JcloudsPassword == null) ? sysPassword : JcloudsPassword;
-      cs = (JcloudsService == null) ? sysService : JcloudsService;
-
-      if (accessKey == null || accessKey.trim().equals("") || secretKey == null || secretKey.trim().equals("")) {
-         accessKey = "dummy";
-         secretKey = "dummy";
-      }
-      csBucket = (System.getProperty("user.name") + "." + this.getClass().getSimpleName()).toLowerCase().replace('.', '-'); // azure limitation on no periods
-      csBucket = csBucket.length() > 32 ? csBucket.substring(0, 32): csBucket;//azure limitation on length
-      System.out.printf("accessKey: %1$s, bucket: %2$s%n", accessKey, csBucket);
-   }
-
-
-   @Override
-   protected CacheStoreConfig createCacheStoreConfig() throws Exception {
-      CloudCacheStoreConfig cfg = new CloudCacheStoreConfig();
-      cfg.setCloudService(cs);
-      cfg.setBucketPrefix(csBucket);
-      cfg.setIdentity(accessKey);
-      cfg.setPassword(secretKey);
-      cfg.setProxyHost(proxyHost);
-      cfg.setProxyPort(proxyPort);
-      cfg.setSecure(isSecure);
-      cfg.setMaxConnections(maxConnections);
-      cfg.setPurgeSynchronously(true); // for more accurate unit testing
-      return cfg;
-   }
-}
+//@Test(groups = "unit", sequential = true, testName = "loaders.cloud.CloudCacheStoreFunctionalIntegrationTest", enabled = false)
+//public class CloudCacheStoreFunctionalIntegrationTest extends BaseCacheStoreFunctionalTest {
+//
+//   private String proxyHost;
+//   private String proxyPort = "-1";
+//   private int maxConnections = 20;
+//   private boolean isSecure = false;
+//   private String csBucket;
+//   private String accessKey;
+//   private String secretKey;
+//   private String cs;
+//
+//   private static final String sysUsername = System.getProperty("infinispan.jclouds.username");
+//   private static final String sysPassword = System.getProperty("infinispan.jclouds.password");
+//   private static final String sysService = System.getProperty("infinispan.jclouds.service");
+//
+//   @BeforeTest
+//   @Parameters({"infinispan.jclouds.username", "infinispan.jclouds.password", "infinispan.jclouds.service"})
+//   protected void setUpClient(@Optional String JcloudsUsername,
+//                              @Optional String JcloudsPassword,
+//                              @Optional String JcloudsService) throws Exception {
+//
+//      accessKey = (JcloudsUsername == null) ? sysUsername : JcloudsUsername;
+//      secretKey = (JcloudsPassword == null) ? sysPassword : JcloudsPassword;
+//      cs = (JcloudsService == null) ? sysService : JcloudsService;
+//
+//      if (accessKey == null || accessKey.trim().equals("") || secretKey == null || secretKey.trim().equals("")) {
+//         accessKey = "dummy";
+//         secretKey = "dummy";
+//      }
+//      csBucket = (System.getProperty("user.name") + "." + this.getClass().getSimpleName()).toLowerCase().replace('.', '-'); // azure limitation on no periods
+//      csBucket = csBucket.length() > 32 ? csBucket.substring(0, 32): csBucket;//azure limitation on length
+//      System.out.printf("accessKey: %1$s, bucket: %2$s%n", accessKey, csBucket);
+//   }
+//
+//
+//   @Override
+//   protected CacheStoreConfig createCacheStoreConfig() throws Exception {
+//      CloudCacheStoreConfig cfg = new CloudCacheStoreConfig();
+//      cfg.setCloudService(cs);
+//      cfg.setBucketPrefix(csBucket);
+//      cfg.setIdentity(accessKey);
+//      cfg.setPassword(secretKey);
+//      cfg.setProxyHost(proxyHost);
+//      cfg.setProxyPort(proxyPort);
+//      cfg.setSecure(isSecure);
+//      cfg.setMaxConnections(maxConnections);
+//      cfg.setPurgeSynchronously(true); // for more accurate unit testing
+//      return cfg;
+//   }
+//}

Modified: trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreIntegrationTest.java
===================================================================
--- trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreIntegrationTest.java	2010-02-02 14:34:35 UTC (rev 1434)
+++ trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreIntegrationTest.java	2010-02-02 14:48:49 UTC (rev 1435)
@@ -26,192 +26,191 @@
 
 import static org.testng.Assert.assertEquals;
 
-/**
- * @author Adrian Cole
- * @since 4.0
- */
- at Test(groups = "unit", sequential = true, testName = "loaders.cloud.CloudCacheStoreIntegrationTest", enabled = false)
-public class CloudCacheStoreIntegrationTest extends BaseCacheStoreTest {
+// TODO figure out why a disabled test is still run in Hudson!!
+public class CloudCacheStoreIntegrationTest{}
 
-   private String proxyHost;
-   private String proxyPort = "-1";
-   private int maxConnections = 20;
-   private boolean isSecure = false;
-   private String csBucket;
-   private String cs2Bucket;
-   private String accessKey;
-   private String secretKey;
-   private String service;
-
-   private static final String sysUsername = System.getProperty("infinispan.jclouds.username");
-   private static final String sysPassword = System.getProperty("infinispan.jclouds.password");
-   private static final String sysService = System.getProperty("infinispan.jclouds.service");
-
-   @BeforeTest
-   @Parameters({"infinispan.jclouds.username", "infinispan.jclouds.password", "infinispan.jclouds.service"})
-   protected void setUpClient(@Optional String JcloudsUsername,
-                              @Optional String JcloudsPassword,
-                              @Optional String JcloudsService) throws Exception {
-
-      accessKey = (JcloudsUsername == null) ? sysUsername : JcloudsUsername;
-      secretKey = (JcloudsPassword == null) ? sysPassword : JcloudsPassword;
-      service = (JcloudsService == null) ? sysService : JcloudsService;
-
-      if (accessKey == null || accessKey.trim().equals("") || secretKey == null || secretKey.trim().equals("")) {
-         accessKey = "dummy";
-         secretKey = "dummy";
-      }
-      csBucket = (System.getProperty("user.name")
-            + "." + this.getClass().getSimpleName()).toLowerCase();
-      System.out.printf("accessKey: %1$s, bucket: %2$s%n", accessKey, csBucket);
-
-      cs2Bucket = csBucket + "2";
-   }
-
-   protected CacheStore createCacheStore() throws Exception {
-      return createAndStartCacheStore(csBucket);
-   }
-
-   protected CacheStore createAnotherCacheStore() throws Exception {
-      return createAndStartCacheStore(cs2Bucket);
-   }
-
-   private CacheStore createAndStartCacheStore(String bucket) throws Exception {
-      CloudCacheStore cs = new CloudCacheStore();
-      CloudCacheStoreConfig cfg = new CloudCacheStoreConfig();
-      cfg.setBucketPrefix(bucket);
-      cfg.setCloudService(service);
-      cfg.setIdentity(accessKey);
-      cfg.setPassword(secretKey);
-      cfg.setProxyHost(proxyHost);
-      cfg.setProxyPort(proxyPort);
-      cfg.setSecure(isSecure);
-      cfg.setMaxConnections(maxConnections);
-      cfg.setPurgeSynchronously(true); // for more accurate unit testing
-      cs.init(cfg, new CacheDelegate("aName"), getMarshaller());
-      cs.start();
-      return cs;
-   }
-
-   /*  Changes below are needed to support testing of multiple cache stores */
-
-   protected CacheStore cs2;
-
-   @BeforeMethod
-   @Override
-   public void setUp() throws Exception {
-      super.setUp();
-      cs.clear();
-      Set entries = cs.loadAll();
-      assert entries.size() == 0;
-      cs2 = createAnotherCacheStore();
-      cs2.clear();
-      entries = cs2.loadAll();
-      assert entries.size() == 0;
-   }
-
-
-   @AfterMethod
-   @Override
-   public void tearDown() throws CacheLoaderException {
-      if (cs != null) {
-         cs.clear();
-         cs.stop();
-
-      }
-      cs = null;
-      if (cs2 != null) {
-         cs2.clear();
-
-         cs2.stop();
-      }
-      cs2 = null;
-   }
-
-
-   @SuppressWarnings("unchecked")
-   @Override
-   public void testStreamingAPI() throws IOException, ClassNotFoundException, CacheLoaderException {
-      cs.store(InternalEntryFactory.create("k1", "v1", -1, -1));
-      cs.store(InternalEntryFactory.create("k2", "v2", -1, -1));
-      cs.store(InternalEntryFactory.create("k3", "v3", -1, -1));
-
-      Marshaller marshaller = getMarshaller();
-      ByteArrayOutputStream out = new ByteArrayOutputStream();
-      ObjectOutput oo = marshaller.startObjectOutput(out, false);
-      try {
-         cs.toStream(new UnclosableObjectOutputStream(oo));
-      } finally {
-         marshaller.finishObjectOutput(oo);
-         out.close();
-      }
-
-      ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-      ObjectInput oi = marshaller.startObjectInput(in, false);
-      try {
-         cs2.fromStream(new UnclosableObjectInputStream(oi));         
-      } finally {
-         marshaller.finishObjectInput(oi);
-         in.close();
-      }
-      
-      Set<InternalCacheEntry> set = cs2.loadAll();
-      assertEquals(set.size(), 3);
-      Set expected = new HashSet();
-      expected.add("k1");
-      expected.add("k2");
-      expected.add("k3");
-      for (InternalCacheEntry se : set) assert expected.remove(se.getKey());
-      assert expected.isEmpty();
-   }
-
-
-   @SuppressWarnings("unchecked")
-   @Override
-   public void testStreamingAPIReusingStreams() throws IOException, ClassNotFoundException, CacheLoaderException {
-      cs.store(InternalEntryFactory.create("k1", "v1", -1, -1));
-      cs.store(InternalEntryFactory.create("k2", "v2", -1, -1));
-      cs.store(InternalEntryFactory.create("k3", "v3", -1, -1));
-
-      Marshaller marshaller = getMarshaller();
-      ByteArrayOutputStream out = new ByteArrayOutputStream();
-      byte[] dummyStartBytes = {1, 2, 3, 4, 5, 6, 7, 8};
-      byte[] dummyEndBytes = {8, 7, 6, 5, 4, 3, 2, 1};      
-      ObjectOutput oo = marshaller.startObjectOutput(out, false);
-      try {
-         oo.write(dummyStartBytes);
-         cs.toStream(new UnclosableObjectOutputStream(oo));
-         oo.flush();
-         oo.write(dummyEndBytes);
-      } finally {
-         marshaller.finishObjectOutput(oo);
-         out.close();         
-      }
-
-      // first pop the start bytes
-      byte[] dummy = new byte[8];
-      ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
-      ObjectInput oi = marshaller.startObjectInput(in, false);
-      try {
-         int bytesRead = oi.read(dummy, 0, 8);
-         assert bytesRead == 8;
-         for (int i = 1; i < 9; i++) assert dummy[i - 1] == i : "Start byte stream corrupted!";      
-         cs2.fromStream(new UnclosableObjectInputStream(oi));
-         bytesRead = oi.read(dummy, 0, 8);
-         assert bytesRead == 8;
-         for (int i = 8; i > 0; i--) assert dummy[8 - i] == i : "Start byte stream corrupted!";                  
-      } finally {
-         marshaller.finishObjectInput(oi);
-         in.close();
-      }
-
-      Set<InternalCacheEntry> set = cs2.loadAll();
-      assertEquals(set.size(), 3);
-      Set expected = new HashSet();
-      expected.add("k1");
-      expected.add("k2");
-      expected.add("k3");
-      for (InternalCacheEntry se : set) assert expected.remove(se.getKey());
-      assert expected.isEmpty();
-   }
-}
\ No newline at end of file
+//@Test(groups = "unit", sequential = true, testName = "loaders.cloud.CloudCacheStoreIntegrationTest", enabled = false)
+//public class CloudCacheStoreIntegrationTest extends BaseCacheStoreTest {
+//
+//   private String proxyHost;
+//   private String proxyPort = "-1";
+//   private int maxConnections = 20;
+//   private boolean isSecure = false;
+//   private String csBucket;
+//   private String cs2Bucket;
+//   private String accessKey;
+//   private String secretKey;
+//   private String service;
+//
+//   private static final String sysUsername = System.getProperty("infinispan.jclouds.username");
+//   private static final String sysPassword = System.getProperty("infinispan.jclouds.password");
+//   private static final String sysService = System.getProperty("infinispan.jclouds.service");
+//
+//   @BeforeTest
+//   @Parameters({"infinispan.jclouds.username", "infinispan.jclouds.password", "infinispan.jclouds.service"})
+//   protected void setUpClient(@Optional String JcloudsUsername,
+//                              @Optional String JcloudsPassword,
+//                              @Optional String JcloudsService) throws Exception {
+//
+//      accessKey = (JcloudsUsername == null) ? sysUsername : JcloudsUsername;
+//      secretKey = (JcloudsPassword == null) ? sysPassword : JcloudsPassword;
+//      service = (JcloudsService == null) ? sysService : JcloudsService;
+//
+//      if (accessKey == null || accessKey.trim().equals("") || secretKey == null || secretKey.trim().equals("")) {
+//         accessKey = "dummy";
+//         secretKey = "dummy";
+//      }
+//      csBucket = (System.getProperty("user.name")
+//            + "." + this.getClass().getSimpleName()).toLowerCase();
+//      System.out.printf("accessKey: %1$s, bucket: %2$s%n", accessKey, csBucket);
+//
+//      cs2Bucket = csBucket + "2";
+//   }
+//
+//   protected CacheStore createCacheStore() throws Exception {
+//      return createAndStartCacheStore(csBucket);
+//   }
+//
+//   protected CacheStore createAnotherCacheStore() throws Exception {
+//      return createAndStartCacheStore(cs2Bucket);
+//   }
+//
+//   private CacheStore createAndStartCacheStore(String bucket) throws Exception {
+//      CloudCacheStore cs = new CloudCacheStore();
+//      CloudCacheStoreConfig cfg = new CloudCacheStoreConfig();
+//      cfg.setBucketPrefix(bucket);
+//      cfg.setCloudService(service);
+//      cfg.setIdentity(accessKey);
+//      cfg.setPassword(secretKey);
+//      cfg.setProxyHost(proxyHost);
+//      cfg.setProxyPort(proxyPort);
+//      cfg.setSecure(isSecure);
+//      cfg.setMaxConnections(maxConnections);
+//      cfg.setPurgeSynchronously(true); // for more accurate unit testing
+//      cs.init(cfg, new CacheDelegate("aName"), getMarshaller());
+//      cs.start();
+//      return cs;
+//   }
+//
+//   /*  Changes below are needed to support testing of multiple cache stores */
+//
+//   protected CacheStore cs2;
+//
+//   @BeforeMethod
+//   @Override
+//   public void setUp() throws Exception {
+//      super.setUp();
+//      cs.clear();
+//      Set entries = cs.loadAll();
+//      assert entries.size() == 0;
+//      cs2 = createAnotherCacheStore();
+//      cs2.clear();
+//      entries = cs2.loadAll();
+//      assert entries.size() == 0;
+//   }
+//
+//
+//   @AfterMethod
+//   @Override
+//   public void tearDown() throws CacheLoaderException {
+//      if (cs != null) {
+//         cs.clear();
+//         cs.stop();
+//
+//      }
+//      cs = null;
+//      if (cs2 != null) {
+//         cs2.clear();
+//
+//         cs2.stop();
+//      }
+//      cs2 = null;
+//   }
+//
+//
+//   @SuppressWarnings("unchecked")
+//   @Override
+//   public void testStreamingAPI() throws IOException, ClassNotFoundException, CacheLoaderException {
+//      cs.store(InternalEntryFactory.create("k1", "v1", -1, -1));
+//      cs.store(InternalEntryFactory.create("k2", "v2", -1, -1));
+//      cs.store(InternalEntryFactory.create("k3", "v3", -1, -1));
+//
+//      Marshaller marshaller = getMarshaller();
+//      ByteArrayOutputStream out = new ByteArrayOutputStream();
+//      ObjectOutput oo = marshaller.startObjectOutput(out, false);
+//      try {
+//         cs.toStream(new UnclosableObjectOutputStream(oo));
+//      } finally {
+//         marshaller.finishObjectOutput(oo);
+//         out.close();
+//      }
+//
+//      ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+//      ObjectInput oi = marshaller.startObjectInput(in, false);
+//      try {
+//         cs2.fromStream(new UnclosableObjectInputStream(oi));
+//      } finally {
+//         marshaller.finishObjectInput(oi);
+//         in.close();
+//      }
+//
+//      Set<InternalCacheEntry> set = cs2.loadAll();
+//      assertEquals(set.size(), 3);
+//      Set expected = new HashSet();
+//      expected.add("k1");
+//      expected.add("k2");
+//      expected.add("k3");
+//      for (InternalCacheEntry se : set) assert expected.remove(se.getKey());
+//      assert expected.isEmpty();
+//   }
+//
+//
+//   @SuppressWarnings("unchecked")
+//   @Override
+//   public void testStreamingAPIReusingStreams() throws IOException, ClassNotFoundException, CacheLoaderException {
+//      cs.store(InternalEntryFactory.create("k1", "v1", -1, -1));
+//      cs.store(InternalEntryFactory.create("k2", "v2", -1, -1));
+//      cs.store(InternalEntryFactory.create("k3", "v3", -1, -1));
+//
+//      Marshaller marshaller = getMarshaller();
+//      ByteArrayOutputStream out = new ByteArrayOutputStream();
+//      byte[] dummyStartBytes = {1, 2, 3, 4, 5, 6, 7, 8};
+//      byte[] dummyEndBytes = {8, 7, 6, 5, 4, 3, 2, 1};
+//      ObjectOutput oo = marshaller.startObjectOutput(out, false);
+//      try {
+//         oo.write(dummyStartBytes);
+//         cs.toStream(new UnclosableObjectOutputStream(oo));
+//         oo.flush();
+//         oo.write(dummyEndBytes);
+//      } finally {
+//         marshaller.finishObjectOutput(oo);
+//         out.close();
+//      }
+//
+//      // first pop the start bytes
+//      byte[] dummy = new byte[8];
+//      ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
+//      ObjectInput oi = marshaller.startObjectInput(in, false);
+//      try {
+//         int bytesRead = oi.read(dummy, 0, 8);
+//         assert bytesRead == 8;
+//         for (int i = 1; i < 9; i++) assert dummy[i - 1] == i : "Start byte stream corrupted!";
+//         cs2.fromStream(new UnclosableObjectInputStream(oi));
+//         bytesRead = oi.read(dummy, 0, 8);
+//         assert bytesRead == 8;
+//         for (int i = 8; i > 0; i--) assert dummy[8 - i] == i : "Start byte stream corrupted!";
+//      } finally {
+//         marshaller.finishObjectInput(oi);
+//         in.close();
+//      }
+//
+//      Set<InternalCacheEntry> set = cs2.loadAll();
+//      assertEquals(set.size(), 3);
+//      Set expected = new HashSet();
+//      expected.add("k1");
+//      expected.add("k2");
+//      expected.add("k3");
+//      for (InternalCacheEntry se : set) assert expected.remove(se.getKey());
+//      assert expected.isEmpty();
+//   }
+//}
\ No newline at end of file

Modified: trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreIntegrationVamTest.java
===================================================================
--- trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreIntegrationVamTest.java	2010-02-02 14:34:35 UTC (rev 1434)
+++ trunk/cachestore/cloud/src/test/java/org/infinispan/loaders/cloud/CloudCacheStoreIntegrationVamTest.java	2010-02-02 14:48:49 UTC (rev 1435)
@@ -26,19 +26,23 @@
 import org.infinispan.marshall.VersionAwareMarshaller;
 import org.testng.annotations.Test;
 
+// TODO figure out why a disabled test is still run in Hudson!!
+public class CloudCacheStoreIntegrationVamTest{}
+
+
 /**
  * CloudCacheStoreIntegrationTest using production level marshaller.
  * 
  * @author Galder Zamarreño
  * @since 4.0
  */
- at Test(groups = "unit", sequential = true, testName = "loaders.cloud.CloudCacheStoreIntegrationVamTest", enabled = false)
-public class CloudCacheStoreIntegrationVamTest extends CloudCacheStoreIntegrationTest {
-   @Override
-   protected Marshaller getMarshaller() {
-      VersionAwareMarshaller marshaller = new VersionAwareMarshaller();
-      marshaller.inject(Thread.currentThread().getContextClassLoader(), new RemoteCommandsFactory());
-      marshaller.start();
-      return marshaller;
-   }
-}
+//@Test(groups = "unit", sequential = true, testName = "loaders.cloud.CloudCacheStoreIntegrationVamTest", enabled = false)
+//public class CloudCacheStoreIntegrationVamTest extends CloudCacheStoreIntegrationTest {
+//   @Override
+//   protected Marshaller getMarshaller() {
+//      VersionAwareMarshaller marshaller = new VersionAwareMarshaller();
+//      marshaller.inject(Thread.currentThread().getContextClassLoader(), new RemoteCommandsFactory());
+//      marshaller.start();
+//      return marshaller;
+//   }
+//}



More information about the infinispan-commits mailing list