X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-cass%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Fdao%2FJU_Cached.java;h=f6bdf20a451e03c95008064ad3704f3aac90f086;hb=1296352d8eafee57f982a4342ad79ada4aa56d28;hp=7cc8bd67aa50da1a3bb24006cda243e1af45776c;hpb=7e966914050e66219689001ff4ab601a49eef0ac;p=aaf%2Fauthz.git diff --git a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_Cached.java b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_Cached.java index 7cc8bd67..f6bdf20a 100644 --- a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_Cached.java +++ b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_Cached.java @@ -7,9 +7,9 @@ * * 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. @@ -59,20 +59,20 @@ public class JU_Cached { @Mock CIDAO cidaoATMock; - + String name = "nameString"; @Before public void setUp(){ MockitoAnnotations.initMocks(this); } - + @Test public void testCachedIdx(){ Cached cached = new Cached(ciDaoMock, name, 1, 30000L); assertThat(cached.cacheIdx("1234567890"), is(0)); } - + @Test public void testInvalidate(){ Cached cached = new Cached(ciDaoMock, name, 5, 30000L); @@ -80,7 +80,9 @@ public class JU_Cached { cached.invalidate("test"); cached.invalidate("test1"); } - + +/* + * DO NOT ATTEMPT TO TEST Timer Threads in JUNIT!!!!! @SuppressWarnings("static-access") @Test public void testStopTimer(){ @@ -96,30 +98,31 @@ public class JU_Cached { cached.startRefresh(authzEnvMock, cidaoATMock); assertTrue(true); } +*/ // @Mock // Trans transMock; // @Mock // Getter getterMock; -// +// // @Test // public void testGet(){ // cached.get(transMock, name, getterMock); // fail("not implemented"); // } -// +// // @SuppressWarnings("unchecked") // public Result> get(TRANS trans, String key, Getter getter) { // List ld = null; // Result> rld = null; -// +// // int cacheIdx = cacheIdx(key); // Map map = ((Map)cache[cacheIdx]); -// +// // // Check for saved element in cache // Dated cached = map.get(key); // // Note: These Segment Timestamps are kept up to date with DB // Date dbStamp = info.get(trans, name,cacheIdx); -// +// // // Check for cache Entry and whether it is still good (a good Cache Entry is same or after DBEntry, so we use "before" syntax) // if (cached!=null && dbStamp.before(cached.timestamp)) { // ld = (List)cached.data;