Introduce top-level pom file.
[mdsal.git] / code-generator / binding-generator-util / src / test / java / org / opendaylight / yangtools / binding / generator / util / generated / type / builder / GeneratedPropertyTest.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.yangtools.binding.generator.util.generated.type.builder;
9
10 import static org.junit.Assert.assertEquals;
11 import static org.junit.Assert.assertNotNull;
12 import static org.junit.Assert.assertTrue;
13
14 import org.junit.Test;
15 import org.opendaylight.yangtools.sal.binding.model.api.AccessModifier;
16 import org.opendaylight.yangtools.sal.binding.model.api.GeneratedProperty;
17
18 public class GeneratedPropertyTest {
19
20     @Test
21     public void testMethodsForGeneratedPropertyBuilderImpl() {
22         final GeneratedPropertyBuilderImpl propertyBuilderImpl = new GeneratedPropertyBuilderImpl("testProperty");
23
24         propertyBuilderImpl.setValue("new value");
25         propertyBuilderImpl.setReadOnly(true);
26
27         final GeneratedProperty genProperty = propertyBuilderImpl.toInstance(null);
28         assertNotNull(genProperty);
29
30         assertNotNull(propertyBuilderImpl.toString());
31     }
32
33     @Test
34     public void testMethodsForGeneratedPropertyImpl() {
35         final GeneratedPropertyImpl propertyImpl = new GeneratedPropertyImpl(null, "Test", null, "test property", AccessModifier.PRIVATE, null, true, true, true, "test value");
36
37         assertEquals("test value", propertyImpl.getValue());
38         assertTrue(propertyImpl.isReadOnly());
39         assertNotNull(propertyImpl.toString());
40     }
41 }