--- /dev/null
+/*******************************************************************************\r
+ * ============LICENSE_START====================================================\r
+ * * org.onap.aaf\r
+ * * ===========================================================================\r
+ * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
+ * * ===========================================================================\r
+ * * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * * you may not use this file except in compliance with the License.\r
+ * * You may obtain a copy of the License at\r
+ * * \r
+ * * http://www.apache.org/licenses/LICENSE-2.0\r
+ * * \r
+ * * Unless required by applicable law or agreed to in writing, software\r
+ * * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * * See the License for the specific language governing permissions and\r
+ * * limitations under the License.\r
+ * * ============LICENSE_END====================================================\r
+ * *\r
+ * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
+ * *\r
+ ******************************************************************************/\r
+package org.onap.aaf.dao.aaf.test;\r
+\r
+import java.io.IOException;\r
+import java.util.Date;\r
+\r
+import org.junit.Test;\r
+import org.onap.aaf.authz.env.AuthzTrans;\r
+import org.onap.aaf.authz.layer.Result;\r
+import org.onap.aaf.dao.CIDAO;\r
+import org.onap.aaf.dao.DAOException;\r
+import org.onap.aaf.dao.aaf.cass.CacheInfoDAO;\r
+import org.onap.aaf.dao.aaf.cass.RoleDAO;\r
+import org.onap.aaf.dao.aaf.cass.Status;\r
+\r
+import org.onap.aaf.inno.env.APIException;\r
+import org.onap.aaf.inno.env.util.Chrono;\r
+\r
+import junit.framework.Assert;\r
+\r
+\r
+public class JU_CacheInfoDAO extends AbsJUCass {\r
+\r
+ @Test\r
+ public void test() throws DAOException, APIException, IOException {\r
+ CIDAO<AuthzTrans> id = new CacheInfoDAO(trans, cluster, AUTHZ);\r
+ Date date = new Date();\r
+ \r
+ id.touch(trans, RoleDAO.TABLE,1);\r
+ try {\r
+ Thread.sleep(3000);\r
+ } catch (InterruptedException e) {\r
+ }\r
+ Result<Void> rid = id.check(trans);\r
+ Assert.assertEquals(rid.status,Status.OK);\r
+ Date[] dates = CacheInfoDAO.info.get(RoleDAO.TABLE);\r
+ if(dates.length>0 && dates[1]!=null) {\r
+ System.out.println(Chrono.dateStamp(dates[1]));\r
+ System.out.println(Chrono.dateStamp(date));\r
+ Assert.assertTrue(Math.abs(dates[1].getTime() - date.getTime())<20000); // allow for 4 seconds, given Remote DB\r
+ }\r
+ }\r
+\r
+}\r