Add test api to return dummy identities

This commit is contained in:
Jeremy Lakeman 2016-06-22 14:18:03 +09:30
parent bdc1db0090
commit 82ad628c50

View File

@ -29,6 +29,8 @@ import org.servalproject.servaldna.SubscriberId;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import java.util.Map;
@ -80,6 +82,25 @@ public class KeyringIdentityList {
}
}
public static List<KeyringIdentity> getTestIdentities() {
try {
List<KeyringIdentity> ret = new ArrayList<>();
byte[] sid = new byte[SubscriberId.BINARY_SIZE];
for (int i = 0; i < 10; i++) {
sid[0]=(byte)i;
ret.add(new KeyringIdentity(
i,
new SubscriberId(sid),
"555000" + i,
"Agent " + i));
}
return ret;
}catch (Exception e){
throw new IllegalStateException(e);
}
}
public KeyringIdentity nextIdentity() throws ServalDInterfaceException, IOException
{
try {