/******************************************************************************* * ============LICENSE_START==================================================== * * org.onap.aaf * * =========================================================================== * * Copyright © 2017 AT&T Intellectual Property. All rights reserved. * * =========================================================================== * * Licensed under the Apache License, Version 2.0 (the "License"); * * you may not use this file except in compliance with the License. * * You may obtain a copy of the License at * * * * http://www.apache.org/licenses/LICENSE-2.0 * * * * Unless required by applicable law or agreed to in writing, software * * distributed under the License is distributed on an "AS IS" BASIS, * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * * See the License for the specific language governing permissions and * * limitations under the License. * * ============LICENSE_END==================================================== * * * * ******************************************************************************/ package org.onap.aaf.auth.local.test; import static org.junit.Assert.*; import static org.mockito.Matchers.*; import static org.mockito.Mockito.*; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.Writer; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.runners.MockitoJUnitRunner; import org.onap.aaf.auth.local.DataFile; import org.onap.aaf.auth.local.TextIndex; import org.onap.aaf.misc.env.TimeTaken; import org.onap.aaf.misc.env.Trans; @RunWith(MockitoJUnitRunner.class) public class JU_TextIndex { TextIndex textIndex; Trans trans; DataFile datefile; @Mock File file; @Before public void setUp() throws IOException{ //TODO: AAF-111 fix once actual input is known. char character = 'a'; String filePath = "test/output_key"; File keyfile = new File(filePath); FileOutputStream is = new FileOutputStream(keyfile); OutputStreamWriter osw = new OutputStreamWriter(is); Writer w = new BufferedWriter(osw); w.write("asdfasdfasdf"); w.close(); datefile = new DataFile(keyfile, "test"); trans = mock(Trans.class); textIndex = new TextIndex(keyfile); //textIndex.create(trans, datefile, 20, character, 2, 2); keyfile.delete(); } @Test public void testOpen() throws IOException { //textIndex.open(); } }