Search in sources :

Example 1 with SessionManager

use of oap.ws.SessionManager in project oap by oaplatform.

the class WsFileUploaderTest method beforeMethod.

@BeforeMethod
@Override
public void beforeMethod() throws Exception {
    Env.resetPorts();
    super.beforeMethod();
    kernel = new Kernel(Lists.empty());
    kernel.start();
    path = Env.tmpPath("/tmp");
    Files.ensureDirectory(path);
    medias.clear();
    server = new Server(100);
    ws = new WebServices(server, new SessionManager(10, null, "/"), GenericCorsPolicy.DEFAULT, WsConfig.CONFIGURATION.fromResource(getClass(), "ws-multipart.conf"));
    WsFileUploader service = new WsFileUploader(path, 1024 * 1024, -1, singletonList(new VastMediaProcessing(shell("ffprobe -v quiet -print_format xml -show_format -sexagesimal -show_streams {FILE}"), 10000L)));
    service.addListener((media, mediaInfo, mediaContext) -> WsFileUploaderTest.this.medias.add(__(media, mediaInfo)));
    kernel.register("upload", service);
    ws.start();
    listener = new SynchronizedThread(new PlainHttpListener(server, Env.port()));
    listener.start();
    Cuid.reset("p", 1);
}
Also used : VastMediaProcessing(oap.media.postprocessing.VastMediaProcessing) Server(oap.http.Server) WebServices(oap.ws.WebServices) SessionManager(oap.ws.SessionManager) SynchronizedThread(oap.concurrent.SynchronizedThread) PlainHttpListener(oap.http.PlainHttpListener) Kernel(oap.application.Kernel) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

Kernel (oap.application.Kernel)1 SynchronizedThread (oap.concurrent.SynchronizedThread)1 PlainHttpListener (oap.http.PlainHttpListener)1 Server (oap.http.Server)1 VastMediaProcessing (oap.media.postprocessing.VastMediaProcessing)1 SessionManager (oap.ws.SessionManager)1 WebServices (oap.ws.WebServices)1 BeforeMethod (org.testng.annotations.BeforeMethod)1