예제 #1
0
  /** Sets up a server state. */
  @BeforeMethod
  void beforeMethod() throws Throwable {
    serializer = new Serializer();
    serializer.resolve(new ServiceLoaderTypeResolver());

    storage = new Storage(StorageLevel.MEMORY);
    storage.serializer().resolve(new ServiceLoaderTypeResolver());

    log = storage.open("test");
    stateMachine = new TestStateMachine();
    members = createMembers(3);
    transport = new LocalTransport(new LocalServerRegistry());

    serverCtx = new SingleThreadContext("test-server", serializer);
    serverState =
        new ServerState(
            members.get(0),
            members,
            log,
            stateMachine,
            new ConnectionManager(transport.client()),
            serverCtx);
  }