Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Formatting changes like tab=4 for the unit-test code

  • Loading branch information...
commit 5a5f0a7660a03b880cbfde97e69f155c9723d635 1 parent f457225
Krishna Gade authored
View
2  src/jvm/trident/memcached/MemcachedState.java
@@ -175,7 +175,7 @@ static String getHostPortWeightTuples(List<InetSocketAddress> endpoints) throws
private final Serializer<T> _serializer;
public MemcachedState(Client client, Serializer<T> serializer) {
- _client = client;
+ _client = Preconditions.checkNotNull(client);
_serializer = Preconditions.checkNotNull(serializer);
}
View
28 test/jvm/trident/memcached/MemcachedStateTest.java
@@ -38,15 +38,15 @@ public void testCache() throws Exception {
// Build the cache client.
Client client = MemcachedState.Factory.makeMemcachedClient(Arrays.asList(new InetSocketAddress("localhost", PORT)));
MemcachedState<Integer> state = new MemcachedState<Integer>(client, new Serializer<Integer>() {
- @Override
- public byte[] serialize(Integer integer) {
- return Ints.toByteArray(integer);
- }
+ @Override
+ public byte[] serialize(Integer integer) {
+ return Ints.toByteArray(integer);
+ }
- @Override
- public Object deserialize(byte[] bytes) {
- return Ints.fromByteArray(bytes);
- }
+ @Override
+ public Object deserialize(byte[] bytes) {
+ return Ints.fromByteArray(bytes);
+ }
});
// Insert some kv pairs.
@@ -54,18 +54,18 @@ public Object deserialize(byte[] bytes) {
List<Integer> vals = Lists.newArrayList();
List<List<Object>> keyList = Lists.newArrayList();
for (String key : keys) {
- List<Object> l = Lists.newArrayList();
- l.add(key);
- keyList.add(l);
- vals.add(RANDOM.nextInt());
+ List<Object> l = Lists.newArrayList();
+ l.add(key);
+ keyList.add(l);
+ vals.add(RANDOM.nextInt());
}
state.multiPut(keyList, vals);
- // Verify if the retrieval of the kv pairs.
+ // Verify the retrieval of the kv pairs.
List<Integer> actualVals = state.multiGet(keyList);
assertEquals(vals.size(), actualVals.size());
for (int i = 0; i < vals.size(); i++) {
- assertEquals(vals.get(i), actualVals.get(i));
+ assertEquals(vals.get(i), actualVals.get(i));
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.