<commit_before>package im.actor.server

import java.net.InetSocketAddress

import akka.stream.ActorFlowMaterializer
import com.google.android.gcm.server.Sender
import com.relayrides.pushy.apns.util.{ SSLContextUtil, SimpleApnsPushNotification }
import com.relayrides.pushy.apns.{ ApnsEnvironment, PushManager, PushManagerConfiguration }

import im.actor.api.rpc.auth.{ RequestSendAuthCode, RequestSignUp, ResponseSendAuthCode }
import im.actor.api.rpc.codecs.RequestCodec
import im.actor.api.rpc.sequence.RequestGetDifference
import im.actor.api.rpc.{ Request, RpcOk, RpcResult }
import im.actor.server.api.frontend.{ Tcp => TcpFrontend }
import im.actor.server.api.rpc.RpcApiService.AttachService
import im.actor.server.api.rpc.service.auth.AuthServiceImpl
import im.actor.server.api.rpc.service.contacts.ContactsServiceImpl
import im.actor.server.api.rpc.service.groups.GroupsServiceImpl
import im.actor.server.api.rpc.service.messaging.MessagingServiceImpl
import im.actor.server.api.rpc.service.sequence.SequenceServiceImpl
import im.actor.server.api.rpc.{ RpcApiService, RpcResultCodec }
import im.actor.server.db.DbInit
import im.actor.server.mtproto.codecs.protocol._
import im.actor.server.mtproto.protocol._
import im.actor.server.mtproto.transport.{ MTPackage, ProtoPackage, TransportPackage }
import im.actor.server.presences.PresenceManager
import im.actor.server.push.{ SeqUpdatesManager, WeakUpdatesManager }
import im.actor.server.session.Session
import im.actor.server.social.SocialManager
import im.actor.util.testing._

class SimpleServerE2eSpec extends ActorFlatSuite with DbInit {
  behavior of "Server"

  it should "connect and Handshake" in e1

  it should "respond to RPC requests" in e2

  val serverConfig = system.settings.config
  val sqlConfig = serverConfig.getConfig("persist.sql")
  val ds = initDs(sqlConfig)

  implicit val db = initDb(ds)
  implicit val flowMaterializer = ActorFlowMaterializer()

  val gcmConfig = system.settings.config.getConfig("push.gcm")
  val apnsConfig = system.settings.config.getConfig("push.apns")

  implicit val gcmSender = new Sender(gcmConfig.getString("key"))

  implicit val apnsManager = new PushManager[SimpleApnsPushNotification](
    ApnsEnvironment.getProductionEnvironment,
    SSLContextUtil.createDefaultSSLContext(apnsConfig.getString("cert.path"), apnsConfig.getString("cert.password")),
    null,
    null,
    null,
    new PushManagerConfiguration(),
    "ActorPushManager"
  )

  implicit val seqUpdManagerRegion = SeqUpdatesManager.startRegion()
  implicit val weakUpdManagerRegion = WeakUpdatesManager.startRegion()
  implicit val presenceManagerRegion = PresenceManager.startRegion()
  implicit val socialManagerRegion = SocialManager.startRegion()
  val rpcApiService = system.actorOf(RpcApiService.props())
  implicit val sessionRegion = Session.startRegion(Some(Session.props(rpcApiService)))

  val services = Seq(
    new AuthServiceImpl,
    new ContactsServiceImpl,
    new MessagingServiceImpl,
    new GroupsServiceImpl,
    new SequenceServiceImpl
  )

  services foreach { service =>
    rpcApiService ! AttachService(service)
  }

  TcpFrontend.start(serverConfig, sessionRegion)
<commit_msg>tests(e2e): fixed e2e test compilation error<commit_after>package im.actor.server

import java.net.InetSocketAddress

import akka.stream.ActorFlowMaterializer
import com.google.android.gcm.server.Sender
import com.relayrides.pushy.apns.util.{ SSLContextUtil, SimpleApnsPushNotification }
import com.relayrides.pushy.apns.{ ApnsEnvironment, PushManager, PushManagerConfiguration }

import im.actor.api.rpc.auth.{ RequestSendAuthCode, RequestSignUp, ResponseSendAuthCode }
import im.actor.api.rpc.codecs.RequestCodec
import im.actor.api.rpc.sequence.RequestGetDifference
import im.actor.api.rpc.{ Request, RpcOk, RpcResult }
import im.actor.server.api.frontend.{ Tcp => TcpFrontend }
import im.actor.server.api.rpc.RpcApiService.AttachService
import im.actor.server.api.rpc.service.auth.AuthServiceImpl
import im.actor.server.api.rpc.service.contacts.ContactsServiceImpl
import im.actor.server.api.rpc.service.groups.GroupsServiceImpl
import im.actor.server.api.rpc.service.messaging.MessagingServiceImpl
import im.actor.server.api.rpc.service.sequence.SequenceServiceImpl
import im.actor.server.api.rpc.{ RpcApiService, RpcResultCodec }
import im.actor.server.db.DbInit
import im.actor.server.mtproto.codecs.protocol._
import im.actor.server.mtproto.protocol._
import im.actor.server.mtproto.transport.{ MTPackage, ProtoPackage, TransportPackage }
import im.actor.server.presences.PresenceManager
import im.actor.server.push.{ SeqUpdatesManager, WeakUpdatesManager }
import im.actor.server.session.Session
import im.actor.server.social.SocialManager
import im.actor.util.testing._

class SimpleServerE2eSpec extends ActorFlatSuite with DbInit {
  behavior of "Server"

  it should "connect and Handshake" in e1

  it should "respond to RPC requests" in e2

  val serverConfig = system.settings.config
  val sqlConfig = serverConfig.getConfig("persist.sql")
  val ds = initDs(sqlConfig)

  implicit val db = initDb(ds)
  implicit val flowMaterializer = ActorFlowMaterializer()

  val gcmConfig = system.settings.config.getConfig("push.gcm")
  val apnsConfig = system.settings.config.getConfig("push.apns")

  implicit val gcmSender = new Sender(gcmConfig.getString("key"))

  implicit val apnsManager = new PushManager[SimpleApnsPushNotification](
    ApnsEnvironment.getProductionEnvironment,
    SSLContextUtil.createDefaultSSLContext(apnsConfig.getString("cert.path"), apnsConfig.getString("cert.password")),
    null,
    null,
    null,
    new PushManagerConfiguration(),
    "ActorPushManager"
  )

  implicit val seqUpdManagerRegion = SeqUpdatesManager.startRegion()
  implicit val weakUpdManagerRegion = WeakUpdatesManager.startRegion()
  implicit val presenceManagerRegion = PresenceManager.startRegion()
  implicit val socialManagerRegion = SocialManager.startRegion()
  val rpcApiService = system.actorOf(RpcApiService.props())
  implicit val sessionRegion = Session.startRegion(Some(Session.props(rpcApiService)))

  val services = Seq(
    new AuthServiceImpl,
    new ContactsServiceImpl,
    new MessagingServiceImpl,
    new SequenceServiceImpl
  )

  services foreach { service =>
    rpcApiService ! AttachService(service)
  }

  TcpFrontend.start(serverConfig, sessionRegion)

{'fraction_non_alphanumeric': 0.09304511278195489, 'fraction_numerical': 0.0012531328320802004, 'mean_word_length': 5.542008196721311, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4824081', 'n_tokens_mistral': 1947, 'n_tokens_neox': 1919, 'n_words': 369}