Skip to content
This repository was archived by the owner on Aug 13, 2026. It is now read-only.
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
99d5a41
Update powermock / junit versions. Move junit usages from old namespa…
alexmoore Feb 9, 2016
0a48790
Fix ordering of tests for DefaultCharsetTest.java
alexmoore Feb 9, 2016
09b32fb
Fix errors from junit/powermock upgrade
alexmoore Feb 9, 2016
9a7ec8b
Rework DefaultCharset tests to not use test ordering
alexmoore Feb 10, 2016
a699e88
Use different buckets for each 2i test.
alexmoore Feb 17, 2016
2b8caf9
Make ListKeys a little faster
alexmoore Feb 17, 2016
1099aae
Make ListBuckets tests a little faster
alexmoore Feb 17, 2016
fd37d95
Remove security tests from buildbot runs
alexmoore Feb 17, 2016
ab44c27
Add riak-client-tools as submodule
alexmoore Feb 18, 2016
2de703e
Updating tools submodule
alexmoore Feb 18, 2016
f046253
Bump tools version again to use leveldb-only version
alexmoore Feb 18, 2016
4473e78
Moving JKS and PEM Secured connection tests to use riak-client-tools …
alexmoore Feb 19, 2016
abd00b3
Re-enabling security tests for buildbot, fixing directions for local …
alexmoore Feb 19, 2016
0436c21
Clean up Secured Connection tests
alexmoore Feb 19, 2016
5ac9296
Pedantic formatting change
alexmoore Feb 19, 2016
90d9e95
Create resources directory in buildbot makefile
alexmoore Feb 19, 2016
7e5e08c
Fix path for project dir in buildbot makefile
alexmoore Feb 19, 2016
a3dea42
Pull tools submodule when building;
alexmoore Feb 19, 2016
f0b1eae
Pull tools submodule in for buildbot makefile
alexmoore Feb 19, 2016
e73640a
Fix bad revert
alexmoore Feb 19, 2016
677b5ae
Fix dirs again
alexmoore Feb 19, 2016
7f9c05b
Add .gitmodules to repo
alexmoore Feb 19, 2016
32d8b28
Fix dirs
alexmoore Feb 19, 2016
0fc35cc
Create resources directory if not present
alexmoore Feb 19, 2016
3e47f13
Fix security setup in general security tests
alexmoore Feb 19, 2016
fbfb0eb
Tweak timing on ClusterFixture Test
alexmoore Feb 19, 2016
5f87698
Adding more debug logging to ssl setup, cleanup security setup in tests.
alexmoore Feb 25, 2016
5b78b3f
Fix SSL Handler race condition
alexmoore Feb 26, 2016
736849e
Revert debug logging for makefile
alexmoore Feb 26, 2016
b3b0e7d
Enable debug logging to trace buildbot errors
alexmoore Feb 26, 2016
b4eeb47
take out test server host and port
alexmoore Feb 26, 2016
5a3bf0a
Make operation queue test more reliable.
alexmoore Feb 29, 2016
434437f
Enable debug logging to trace tests in buildbot
alexmoore Feb 29, 2016
8eac5c1
Switch buildbot setup script to use riak-client-tools for security se…
alexmoore Mar 1, 2016
d9a55e7
Fix maven run path
alexmoore Mar 1, 2016
9812d82
Fix maven run path
alexmoore Mar 1, 2016
5a7fe2c
Merge pull request #595 from basho/fix-security-tests
alexmoore Mar 1, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make ListBuckets tests a little faster
  • Loading branch information
alexmoore committed Feb 17, 2016
commit 1099aae6960a3b8ba6c6b28eb97fde0deff5b541
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,22 @@
import com.basho.riak.client.core.RiakFutureListener;
import com.basho.riak.client.core.operations.ListBucketsOperation;
import com.basho.riak.client.core.operations.StoreOperation;
import static com.basho.riak.client.core.operations.itest.ITestBase.bucketName;
import com.basho.riak.client.core.query.Location;
import com.basho.riak.client.core.query.Namespace;
import com.basho.riak.client.core.query.RiakObject;
import com.basho.riak.client.core.util.BinaryValue;
import org.junit.Test;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import static org.junit.Assert.*;

import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import org.junit.Test;

/**
*
Expand Down Expand Up @@ -107,7 +109,9 @@ private void testLargeBucketList(String bucketType) throws InterruptedException,
final String value = "{\"value\":\"value\"}";
final Semaphore semaphore = new Semaphore(10);
final CountDownLatch latch = new CountDownLatch(1);

final int bucketCount = 10;
final List<BinaryValue> bucketNames = new ArrayList<>();

RiakFutureListener<StoreOperation.Response, Location> listener =
new RiakFutureListener<StoreOperation.Response, Location>() {

Expand All @@ -120,27 +124,26 @@ public void handle(RiakFuture<StoreOperation.Response, Location> f)
{
f.get();
}
catch (InterruptedException ex)
{
throw new RuntimeException(ex);
}
catch (ExecutionException ex)
catch (InterruptedException | ExecutionException ex)
{
throw new RuntimeException(ex);
}

semaphore.release();
received.incrementAndGet();
if (received.intValue() == 1000)
if (received.intValue() == bucketCount)
{
latch.countDown();
}
}
};

for (int i = 0; i < 1000; i++)
for (int i = 0; i < bucketCount; i++)
{
Namespace ns = new Namespace(bucketType, bucketName.toString() + i);
String testBucketName = bucketName.toString() + i;
bucketNames.add(BinaryValue.create(testBucketName));

Namespace ns = new Namespace(bucketType, testBucketName);
RiakObject rObj = new RiakObject().setValue(BinaryValue.create(value));
Location location = new Location(ns, key);
StoreOperation storeOp =
Expand All @@ -159,11 +162,15 @@ public void handle(RiakFuture<StoreOperation.Response, Location> f)
.build();
cluster.execute(listOp);
List<BinaryValue> bucketList = listOp.get().getBuckets();
assertTrue(bucketList.size() >= 1000);

for (int i = 0; i < 1000; i++)

for (BinaryValue name : bucketNames)
{
assertTrue(bucketList.contains(name));
}

for (BinaryValue name : bucketNames)
{
Namespace ns = new Namespace(bucketType, bucketName.toString() + i);
Namespace ns = new Namespace(bucketType, name.toString());
resetAndEmptyBucket(ns);
}

Expand Down