StoreBackedTypeCache extends DefaultTypeCache { public boolean isCachedInMemory(String typeName) throws AtlasException { return super.has(typeName); } @Inject  StoreBackedTypeCache(final ITypeStore typeStore); boolean isCachedInMemory(String typeName); @Override IDataType onTypeFault(String typeName);  }
@Test public void testGetClassType() throws Exception { for (Map.Entry<String, ClassType> typeEntry : classTypesToTest.entrySet()) { Assert.assertFalse(typeCache.isCachedInMemory(typeEntry.getKey())); IDataType dataType = ts.getDataType(IDataType.class, typeEntry.getKey()); Assert.assertTrue(typeCache.isCachedInMemory(typeEntry.getKey())); Assert.assertTrue(dataType instanceof ClassType); ClassType cachedType = (ClassType)dataType; verifyHierarchicalType(cachedType, typeEntry.getValue()); } }
@Test public void testGetTraitType() throws Exception { ImmutableList<String> traitNames = ts.getTypeNamesByCategory(TypeCategory.TRAIT); for (String traitTypeName : traitNames) { Assert.assertFalse(typeCache.isCachedInMemory(traitTypeName)); IDataType dataType = typeCache.get(traitTypeName); Assert.assertTrue(typeCache.isCachedInMemory(traitTypeName)); Assert.assertTrue(dataType instanceof TraitType); TraitType cachedType = (TraitType)dataType; verifyHierarchicalType(cachedType, ts.getDataType(TraitType.class, traitTypeName)); } }