Added oparent to sdc main
[sdc.git] / catalog-dao / src / test / java / org / openecomp / sdc / be / resources / data / ComponentCacheDataTest.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2019 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 package org.openecomp.sdc.be.resources.data;
22
23 import org.junit.Test;
24
25 import java.nio.ByteBuffer;
26 import java.util.Date;
27
28
29 public class ComponentCacheDataTest {
30
31         private ComponentCacheData createTestSubject() {
32                 return new ComponentCacheData();
33         }
34         
35         @Test
36         public void testCtor() throws Exception {
37                 new ComponentCacheData("mock");
38                 new ComponentCacheData("mock", new byte[0]);
39                 new ComponentCacheData("mock", new byte[0], new Date(), "mock", true, true);
40         }
41         
42         @Test
43         public void testGetDataAsArray() throws Exception {
44                 ComponentCacheData testSubject;
45                 byte[] result;
46
47                 // default test
48                 testSubject = createTestSubject();
49                 result = testSubject.getDataAsArray();
50         }
51
52         
53         @Test
54         public void testSetDataAsArray() throws Exception {
55                 ComponentCacheData testSubject;
56                 byte[] data = new byte[] { ' ' };
57
58                 // test 1
59                 testSubject = createTestSubject();
60                 data = null;
61                 testSubject.setDataAsArray(data);
62
63                 // test 2
64                 testSubject = createTestSubject();
65                 data = new byte[] { ' ' };
66                 testSubject.setDataAsArray(data);
67         }
68
69         
70         @Test
71         public void testGetData() throws Exception {
72                 ComponentCacheData testSubject ;
73                 
74                 testSubject = createTestSubject();
75                 
76                 testSubject.getData();
77         }
78
79         @Test
80         public void testSetData() throws Exception {
81                 ComponentCacheData testSubject ;
82                 
83                 testSubject = createTestSubject();
84                 
85                 ByteBuffer data = ByteBuffer.allocate(0);
86                 testSubject.setData(data);
87         }
88         
89         @Test
90         public void testGetId() throws Exception {
91                 ComponentCacheData testSubject;
92                 String result;
93
94                 // default test
95                 testSubject = createTestSubject();
96                 result = testSubject.getId();
97         }
98
99         
100         @Test
101         public void testSetId() throws Exception {
102                 ComponentCacheData testSubject;
103                 String id = "";
104
105                 // default test
106                 testSubject = createTestSubject();
107                 testSubject.setId(id);
108         }
109
110         
111         @Test
112         public void testGetModificationTime() throws Exception {
113                 ComponentCacheData testSubject;
114                 Date result;
115
116                 // default test
117                 testSubject = createTestSubject();
118                 result = testSubject.getModificationTime();
119         }
120
121         
122         @Test
123         public void testSetModificationTime() throws Exception {
124                 ComponentCacheData testSubject;
125                 Date modificationTime = null;
126
127                 // default test
128                 testSubject = createTestSubject();
129                 testSubject.setModificationTime(modificationTime);
130         }
131
132         
133         @Test
134         public void testGetType() throws Exception {
135                 ComponentCacheData testSubject;
136                 String result;
137
138                 // default test
139                 testSubject = createTestSubject();
140                 result = testSubject.getType();
141         }
142
143         
144         @Test
145         public void testSetType() throws Exception {
146                 ComponentCacheData testSubject;
147                 String type = "";
148
149                 // default test
150                 testSubject = createTestSubject();
151                 testSubject.setType(type);
152         }
153
154         
155         @Test
156         public void testGetIsDirty() throws Exception {
157                 ComponentCacheData testSubject;
158                 boolean result;
159
160                 // default test
161                 testSubject = createTestSubject();
162                 result = testSubject.getIsDirty();
163         }
164
165         
166         @Test
167         public void testSetIsDirty() throws Exception {
168                 ComponentCacheData testSubject;
169                 boolean isDirty = false;
170
171                 // default test
172                 testSubject = createTestSubject();
173                 testSubject.setIsDirty(isDirty);
174         }
175
176         
177         @Test
178         public void testGetIsZipped() throws Exception {
179                 ComponentCacheData testSubject;
180                 boolean result;
181
182                 // default test
183                 testSubject = createTestSubject();
184                 result = testSubject.getIsZipped();
185         }
186
187         
188         @Test
189         public void testSetIsZipped() throws Exception {
190                 ComponentCacheData testSubject;
191                 boolean isZipped = false;
192
193                 // default test
194                 testSubject = createTestSubject();
195                 testSubject.setIsZipped(isZipped);
196         }
197 }