Search in sources :

Example 1 with Executed

use of org.fagu.fmv.soft.SoftExecutor.Executed in project fmv by f-agu.

the class SoftTestCase method test2.

@Test
@Ignore
public void test2() throws Exception {
    Soft soft = Soft.withExecFile("cmd");
    System.out.println(soft);
    System.out.println(soft.getFounds());
    ExecutorService executorService = Executors.newSingleThreadExecutor();
    System.out.println(1);
    soft.withoutParameter().ifExceptionDo(e -> {
        System.out.println("error exec");
    }).execute();
    System.out.println(2);
    Future<Executed> future = soft.withoutParameter().ifExceptionDo(e -> {
        System.out.println("error exec bg");
    }).executeInBackground(executorService);
    System.out.println(new Date());
    System.out.println(future.get());
}
Also used : SoftFoundFactory(org.fagu.fmv.soft.find.SoftFoundFactory) Arrays(java.util.Arrays) ExecSoftFoundFactory(org.fagu.fmv.soft.find.ExecSoftFoundFactory) Date(java.util.Date) SoftFound(org.fagu.fmv.soft.find.SoftFound) IOException(java.io.IOException) Test(org.junit.Test) StringUtils(org.apache.commons.lang3.StringUtils) Executors(java.util.concurrent.Executors) Future(java.util.concurrent.Future) Executed(org.fagu.fmv.soft.SoftExecutor.Executed) Parser(org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser) Ignore(org.junit.Ignore) ExecutorService(java.util.concurrent.ExecutorService) ExecutorService(java.util.concurrent.ExecutorService) Date(java.util.Date) Executed(org.fagu.fmv.soft.SoftExecutor.Executed) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

IOException (java.io.IOException)1 Arrays (java.util.Arrays)1 Date (java.util.Date)1 ExecutorService (java.util.concurrent.ExecutorService)1 Executors (java.util.concurrent.Executors)1 Future (java.util.concurrent.Future)1 StringUtils (org.apache.commons.lang3.StringUtils)1 Executed (org.fagu.fmv.soft.SoftExecutor.Executed)1 ExecSoftFoundFactory (org.fagu.fmv.soft.find.ExecSoftFoundFactory)1 Parser (org.fagu.fmv.soft.find.ExecSoftFoundFactory.Parser)1 SoftFound (org.fagu.fmv.soft.find.SoftFound)1 SoftFoundFactory (org.fagu.fmv.soft.find.SoftFoundFactory)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1