1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package test.de.smartics.properties.spi.config.proxy;
17
18 import java.io.IOException;
19
20 import org.junit.BeforeClass;
21 import org.junit.experimental.theories.DataPoint;
22
23 import test.de.smartics.properties.spi.config.proxy.examples.MoreProperties;
24 import test.de.smartics.properties.spi.config.proxy.examples.TestProperties;
25 import de.smartics.properties.api.config.domain.key.ApplicationId;
26 import de.smartics.properties.api.config.domain.key.ConfigurationKey;
27 import de.smartics.properties.api.config.domain.key.EnvironmentId;
28 import de.smartics.properties.impl.config.properties.PropertiesConfigurationProperties;
29 import de.smartics.properties.spi.config.proxy.PropertyConfigurationObjectBuilder;
30 import de.smartics.testdoc.annotations.Uut;
31 import de.smartics.util.test.theories.SerializationTheory;
32
33
34
35
36 @Uut(type = MoreProperties.class)
37 public class PropertiesSerializableTest extends SerializationTheory
38 {
39
40
41
42
43
44
45
46
47
48
49
50 private static PropertyConfigurationObjectBuilder builder;
51
52 private static PropertiesConfigurationProperties configurationProperties;
53
54 @BeforeClass
55 public static void setUpClass()
56 {
57 final EnvironmentId environmentId = new EnvironmentId("test");
58 final ApplicationId applicationId =
59 new ApplicationId("groupId", "artefactId", "version");
60 final ConfigurationKey key =
61 new ConfigurationKey(environmentId, applicationId);
62 configurationProperties = new PropertiesConfigurationProperties(key);
63
64 configurationProperties.addClassPathProperties(TestProperties.class);
65
66 builder = new PropertyConfigurationObjectBuilder();
67
68 }
69
70
71
72
73
74 @DataPoint
75 public MoreProperties allProxyImplementationsOfAPropertyInterfaceAreSerializable() throws IOException,
76 ClassNotFoundException
77 {
78 final MoreProperties properties =
79 builder.build(MoreProperties.class, configurationProperties);
80 return properties;
81 }
82
83 }