Permalink
Browse files

use list_all convention

  • Loading branch information...
1 parent b98f566 commit 4fc05169a0695022e55fbf08b1df0f30b54e6807 Kyle Maxwell committed Dec 16, 2010
@@ -33,11 +33,11 @@ class ShardManagerService[S <: shards.Shard, J <: JsonJob](nameServer: NameServe
nameServer.listHostnames.toJavaList
}
- def list_shards() = wrapWithThriftExceptions {
+ def list_all_shards() = wrapWithThriftExceptions {
nameServer.listShards.map(_.toThrift).toJavaList
}
- def list_links() = wrapWithThriftExceptions {
+ def list_all_links() = wrapWithThriftExceptions {
nameServer.listLinks.map(_.toThrift).toJavaList
}
@@ -96,6 +96,7 @@ class ShardManagerService[S <: shards.Shard, J <: JsonJob](nameServer: NameServe
def get_forwardings(): java.util.List[Forwarding] = wrapWithThriftExceptions {
nameServer.getForwardings().map(_.toThrift).toJavaList
}
+ def list_all_forwardings = get_forwardings
def reload_forwardings() = wrapWithThriftExceptions {
log.info("Reloading forwardings...")
@@ -41,8 +41,9 @@ service ShardManager {
list<LinkInfo> list_upward_links(1: ShardId id) throws(1: ShardException ex)
list<LinkInfo> list_downward_links(1: ShardId id) throws(1: ShardException ex)
- list<LinkInfo> list_links() throws(1: ShardException ex)
- list<ShardInfo> list_shards() throws(1: ShardException ex)
+ list<LinkInfo> list_all_links() throws(1: ShardException ex)
+ list<ShardInfo> list_all_shards() throws(1: ShardException ex)
+ list<Forwarding> list_all_forwardings() throws(1: ShardException ex)
list<ShardInfo> get_child_shards_of_class(1: ShardId parent_id, 2: string class_name) throws(1: ShardException ex)
@@ -60,18 +60,25 @@ object ShardManagerServiceSpec extends ConfiguredSpecification with JMocker with
manager.create_shard(thriftShardInfo1)
}
- "list_links" in {
+ "list_all_links" in {
expect {
one(nameServer).listLinks() willReturn List(shards.LinkInfo(shardInfo1.id, shardInfo2.id, 1))
}
- manager.list_links() mustEqual List(new thrift.LinkInfo(thriftShardInfo1.id, thriftShardInfo2.id, 1)).toJavaList
+ manager.list_all_links() mustEqual List(new thrift.LinkInfo(thriftShardInfo1.id, thriftShardInfo2.id, 1)).toJavaList
}
- "list_shards" in {
+ "list_all_shards" in {
expect {
one(nameServer).listShards() willReturn List(shardInfo1)
}
- manager.list_shards mustEqual List(thriftShardInfo1).toJavaList
+ manager.list_all_shards() mustEqual List(thriftShardInfo1).toJavaList
+ }
+
+ "list_all_forwardings" in {
+ expect {
+ one(nameServer).getForwardings() willReturn List(forwarding)
+ }
+ manager.list_all_forwardings() mustEqual List(thriftForwarding).toJavaList
}
"get_shard" in {

0 comments on commit 4fc0516

Please sign in to comment.