1 /*******************************************************************************
2 * ============LICENSE_START====================================================
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
11 * * http://www.apache.org/licenses/LICENSE-2.0
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====================================================
21 ******************************************************************************/
22 package org.onap.aaf.auth.local.test;
24 import static org.junit.Assert.*;
25 import static org.mockito.Matchers.*;
26 import static org.mockito.Mockito.*;
28 import java.io.BufferedWriter;
30 import java.io.FileOutputStream;
31 import java.io.IOException;
32 import java.io.OutputStreamWriter;
33 import java.io.Writer;
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;
46 @RunWith(MockitoJUnitRunner.class)
47 public class JU_TextIndex {
55 public void setUp() throws IOException{ //TODO: AAF-111 fix once actual input is known.
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");
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);
72 public void testOpen() throws IOException {