AT&T 2.0.19 Code drop, stage 3
[aaf/authz.git] / auth / auth-core / src / test / java / org / onap / aaf / auth / local / test / JU_TextIndex.java
1 /*******************************************************************************
2  * ============LICENSE_START====================================================
3  * * org.onap.aaf
4  * * ===========================================================================
5  * * Copyright © 2017 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 org.onap.aaf.auth.local.test;
23
24 import static org.junit.Assert.*;
25 import static org.mockito.Matchers.*;
26 import static org.mockito.Mockito.*;
27
28 import java.io.BufferedWriter;
29 import java.io.File;
30 import java.io.FileOutputStream;
31 import java.io.IOException;
32 import java.io.OutputStreamWriter;
33 import java.io.Writer;
34
35 import org.junit.Before;
36 import org.junit.Test;
37 import org.junit.runner.RunWith;
38 import org.mockito.Mock;
39 import org.mockito.Mockito;
40 import org.mockito.runners.MockitoJUnitRunner;
41 import org.onap.aaf.auth.local.DataFile;
42 import org.onap.aaf.auth.local.TextIndex;
43 import org.onap.aaf.misc.env.TimeTaken;
44 import org.onap.aaf.misc.env.Trans;
45
46 @RunWith(MockitoJUnitRunner.class)
47 public class JU_TextIndex {
48         TextIndex textIndex;
49         Trans trans;
50         DataFile datefile;
51         @Mock
52         File file;
53         
54         @Before
55         public void setUp() throws IOException{                 //TODO: AAF-111 fix once actual input is known.
56                 char character = 'a';
57                 String filePath = "test/output_key";
58                 File keyfile = new File(filePath);
59                 FileOutputStream is = new FileOutputStream(keyfile);
60         OutputStreamWriter osw = new OutputStreamWriter(is);    
61         Writer w = new BufferedWriter(osw);
62         w.write("asdfasdfasdf");
63         w.close();
64                 datefile = new DataFile(keyfile, "test");
65                 trans = mock(Trans.class);
66                 textIndex = new TextIndex(keyfile);
67                 //textIndex.create(trans, datefile, 20, character, 2, 2);
68                 keyfile.delete();
69         }
70
71         @Test
72         public void testOpen() throws IOException {
73                 //textIndex.open();
74         }
75
76 }