View Javadoc

1   /*
2    * Copyright 2012-2013 smartics, Kronseder & Reiner GmbH
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package test.de.smartics.properties.spi.config.support;
17  
18  import org.junit.experimental.categories.Category;
19  import org.junit.experimental.theories.DataPoint;
20  
21  import de.smartics.properties.api.config.domain.key.ApplicationId;
22  import de.smartics.properties.api.config.domain.key.ConfigurationKey;
23  import de.smartics.properties.api.config.domain.key.EnvironmentId;
24  import de.smartics.properties.api.core.domain.PropertyDescriptorRegistry;
25  import de.smartics.properties.spi.config.support.AbstractConfigurationProperties;
26  import de.smartics.properties.spi.core.registry.InMemoryPropertyDescriptorRegistry;
27  import de.smartics.testdoc.annotations.Uut;
28  import de.smartics.testdoc.categories.type.ObjectBasics;
29  import de.smartics.util.test.theories.SerializationTheory;
30  
31  /**
32   * Tests serialization of {@link AbstractConfigurationProperties}.
33   */
34  @Category(ObjectBasics.class)
35  @Uut(type = AbstractConfigurationProperties.class)
36  public class AbstractConfigurationPropertiesSerializableTest extends
37      SerializationTheory
38  {
39    public static final EnvironmentId ENV = new EnvironmentId("test");
40  
41    public static final ApplicationId APP = new ApplicationId("group",
42        "artifactId", "1.0");
43  
44    public static final ConfigurationKey KEY = new ConfigurationKey(ENV, APP);
45  
46    public static final PropertyDescriptorRegistry REGISTRY =
47        new InMemoryPropertyDescriptorRegistry();
48  
49    @DataPoint
50    public static final AbstractConfigurationProperties DEFAULT =
51        new DummyConfigurationProperties(KEY, REGISTRY);
52  }