X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-batch%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Fhelpers%2Ftest%2FJU_MonthData.java;fp=auth%2Fauth-batch%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fbatch%2Fhelpers%2Ftest%2FJU_MonthData.java;h=0000000000000000000000000000000000000000;hb=d86e3224e6a5af2bd2b713f93bea5e6677d3ebc2;hp=d9d9d018db2997b58b8b54ad4b22792c09ab067b;hpb=e3163b2d5609753f874e2f52fd5ef67fa063af7a;p=aaf%2Fauthz.git diff --git a/auth/auth-batch/src/test/java/org/onap/aaf/auth/batch/helpers/test/JU_MonthData.java b/auth/auth-batch/src/test/java/org/onap/aaf/auth/batch/helpers/test/JU_MonthData.java deleted file mode 100644 index d9d9d018..00000000 --- a/auth/auth-batch/src/test/java/org/onap/aaf/auth/batch/helpers/test/JU_MonthData.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - * ============LICENSE_START==================================================== - * org.onap.aaf - * =========================================================================== - * Copyright (c) 2018 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.batch.helpers.test; - -import static org.junit.Assert.*; -import org.junit.After; -import org.junit.Before; -import org.junit.Test; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.onap.aaf.auth.batch.helpers.MonthData; -import org.onap.aaf.auth.batch.helpers.MonthData.Row; - -import junit.framework.Assert; - -import static org.mockito.Mockito.*; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -import org.junit.Test; - -public class JU_MonthData { - - File f; - MonthData mData; - Row row; - BufferedWriter bw = null; - FileWriter fw = null; - - @Before - public void setUp() throws IOException { - mData = new MonthData("env"); - row = new Row("target", 10,2,1); - f = new File("Monthlyenv.dat"); - f.createNewFile(); - bw = new BufferedWriter(new FileWriter(f)); - bw.write("#test"+ "\n"); - bw.write("long,tester"+ "\n"); - bw.write("1,2,3,4,5"+ "\n"); - bw.close(); - - mData = new MonthData("env"); - } - - @Test - public void testAdd() { - mData.add(2, "target", 10, 1, 1); - } - - @Test - public void testNotExists() { - mData.notExists(2); - } - - @Test - public void testWrite() throws IOException { - mData.write(); - } - - @Test - public void testCompareTo() { - Row testrow = new Row("testtar",1,1,1); - Assert.assertEquals(-4, row.compareTo(testrow)); - Assert.assertEquals(0, row.compareTo(row)); - } - - @Test - public void testToString() { - Assert.assertEquals("target|10|1|2", row.toString()); - } - - @After - public void cleanUp() { - File g = new File("Monthlyenv.dat.bak"); - if (f.exists()) { - f.delete(); - } - if (g.exists()) { - g.delete(); - } - } - -}