Fix more copyright citations
[neutron.git] / neutron-spi / src / test / java / org / opendaylight / neutron / spi / NeutronVPNIKEPolicyJAXBTest.java
1 /*
2  * Copyright Tata Consultancy Services, 2015.  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
9 package org.opendaylight.neutron.spi;
10
11 import org.junit.Assert;
12 import org.junit.Test;
13
14 import org.opendaylight.neutron.spi.NeutronVPNIKEPolicy;
15
16 public class NeutronVPNIKEPolicyJAXBTest {
17     private static final String NeutronVPNIKEPolicy_sourceJson = "{" +
18         "\"id\": \"5522aff7-1b3c-48dd-9c3c-b50f016b73db\", " +
19         "\"tenant_id\": \"ccb81365fe36411a9011e90491fe1330\", " +
20         "\"name\": \"ikepolicy1\", " +
21         "\"description\": \"updated description\", " +
22         "\"auth_algorithm\": \"sha1\", " +
23         "\"encryption_algorithm\": \"aes-256\", " +
24         "\"phase1_negotiation_mode\": \"main\", " +
25         "\"ike_version\": \"v1\", " +
26         "\"pfs\": \"group5\", " +
27         "\"lifetime\": { " + "\"units\": \"seconds\", " + "\"value\": 3600 " + "} }";
28
29     @Test
30     public void test_NeutronVPNIKEPolicy_JAXB() {
31         NeutronVPNIKEPolicy dummyObject = new NeutronVPNIKEPolicy();
32         try {
33             NeutronVPNIKEPolicy testObject = (NeutronVPNIKEPolicy) JaxbTestHelper.jaxbUnmarshall(dummyObject, NeutronVPNIKEPolicy_sourceJson);
34             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 1: Testing id failed",
35                   "5522aff7-1b3c-48dd-9c3c-b50f016b73db", testObject.getID());
36
37             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 2: Testing tenant id failed",
38                   "ccb81365fe36411a9011e90491fe1330", testObject.getTenantID());
39
40             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 3: Testing name failed",
41                   "ikepolicy1", testObject.getName());
42
43             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 4: Testing description failed",
44                   "updated description", testObject.getDescription());
45
46             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 5: Testing auth algorithm failed",
47                   "sha1", testObject.getAuthAlgorithm());
48
49             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 6: Testing Encryption algorithm failed",
50                   "aes-256", testObject.getEncryptionAlgorithm());
51
52             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 7: Testing phase1 negotiation mode failed",
53                   "main", testObject.getPhase1NegotiationMode());
54
55             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 8: Testing ike version failed",
56                   "v1", testObject.getIkeVersion());
57
58             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 9: Testing pfs failed",
59                   "group5", testObject.getPerfectForwardSecrecy());
60
61             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 10.1: Testing lifetime units value failed",
62                   "seconds", testObject.getLifetime().getUnits());
63             
64             Assert.assertEquals("NeutronVPNIKEPolicy JAXB Test 10.2: Testing lifetime values failed",
65                     new Integer(3600), testObject.getLifetime().getValue());
66         } catch (Exception e) {
67             Assert.fail("Tests failed");
68         }
69     }
70 }