Remove spaces from dockerbuild script
[aaf/authz.git] / auth / auth-cass / src / test / java / com / att / dao / aaf / test / JU_LocationContent.java
1 /**
2  * ============LICENSE_START====================================================
3  * org.onap.aaf
4  * ===========================================================================
5  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
6  * ===========================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END====================================================
19  *
20  */
21
22 package com.att.dao.aaf.test;
23
24 import org.junit.After;
25 import org.junit.AfterClass;
26 import org.junit.Before;
27 import org.junit.BeforeClass;
28 import org.junit.Test;
29 import org.onap.aaf.cadi.PropAccess;
30 import org.onap.aaf.misc.env.APIException;
31 import org.onap.aaf.misc.env.Data;
32 import org.onap.aaf.misc.env.Data.TYPE;
33 import org.onap.aaf.misc.rosetta.env.RosettaDF;
34 import org.onap.aaf.misc.rosetta.env.RosettaEnv;
35
36 import locate.v1_0.MgmtEndpoint;
37 import locate.v1_0.MgmtEndpoint.SpecialPorts;
38 import locate.v1_0.MgmtEndpoints;
39
40 public class JU_LocationContent {
41
42         @BeforeClass
43         public static void setUpBeforeClass() throws Exception {
44         }
45
46         @AfterClass
47         public static void tearDownAfterClass() throws Exception {
48         }
49
50         @Before
51         public void setUp() throws Exception {
52         }
53
54         @After
55         public void tearDown() throws Exception {
56         }
57
58         @Test
59         public void test() {
60                 PropAccess access = new PropAccess();
61                 RosettaEnv env = new RosettaEnv(access.getProperties());
62                 try {
63                         RosettaDF<MgmtEndpoints> medf = env.newDataFactory(MgmtEndpoints.class);
64                         medf.out(TYPE.JSON);
65                         medf.option(Data.PRETTY);
66                         MgmtEndpoint me = new MgmtEndpoint();
67                         me.setHostname("mithrilcsp.sbc.com");
68                         me.setLatitude(32);
69                         me.setLongitude(-90);
70                         me.setMajor(2);
71                         me.setMinor(0);
72                         me.setPatch(19);
73                         me.setPort(3312);
74                         me.setProtocol("http");
75                         me.getSubprotocol().add("TLS1.1");
76
77                         SpecialPorts sp = new SpecialPorts();
78                         sp.setName("debug");
79                         sp.setPort(9000);
80                         sp.setProtocol("java");
81                         me.getSpecialPorts().add(sp);
82                         
83                         MgmtEndpoints mes = new MgmtEndpoints();
84                         mes.getMgmtEndpoint().add(me);
85                         System.out.println(medf.newData().load(mes).asString());
86                         
87                 } catch (APIException e) {
88                         e.printStackTrace();
89                 }
90                 
91         }
92
93 }