1 package org.apache.maven.surefire.booter;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import org.junit.Test;
23
24 import java.io.IOException;
25 import java.io.InputStream;
26 import java.io.StringBufferInputStream;
27
28 import static org.apache.maven.surefire.booter.BooterConstants.PROCESS_CHECKER;
29 import static org.apache.maven.surefire.booter.BooterConstants.PROVIDER_CONFIGURATION;
30 import static org.apache.maven.surefire.booter.BooterConstants.USESYSTEMCLASSLOADER;
31 import static org.apache.maven.surefire.booter.ProcessCheckerType.ALL;
32 import static org.fest.assertions.Assertions.assertThat;
33
34
35
36
37 public class BooterDeserializerTest
38 {
39 @Test
40 public void testStartupConfiguration() throws IOException
41 {
42 InputStream is = new StringBufferInputStream( PROCESS_CHECKER + "=all\n"
43 + USESYSTEMCLASSLOADER + "=true\n"
44 + PROVIDER_CONFIGURATION + "=abc.MyProvider" );
45
46 BooterDeserializer deserializer = new BooterDeserializer( is );
47
48 assertThat( deserializer.getStartupConfiguration().getProcessChecker() )
49 .isEqualTo( ALL );
50
51 assertThat( deserializer.getStartupConfiguration().getClassLoaderConfiguration().isUseSystemClassLoader() )
52 .isTrue();
53
54 assertThat( deserializer.getStartupConfiguration().getProviderClassName() )
55 .isEqualTo( "abc.MyProvider" );
56 }
57 }