Package java.util.concurrent

Examples of java.util.concurrent.ConcurrentMap.clear()


      Class<?> clazz = Class.forName("java.io.ObjectStreamClass$Caches");
      Field localDescsField = clazz.getDeclaredField("localDescs");
      localDescsField.setAccessible(true);
      ConcurrentMap cm = (ConcurrentMap)localDescsField.get(null);
      // TODO [serialization] a bit extreme to wipe out everything
      cm.clear();
      // For some reason clearing the reflectors damages serialization - is it not a true cache?
//      Field reflectorsField = clazz.getDeclaredField("reflectors");
//      reflectorsField.setAccessible(true);
//      cm = (ConcurrentMap)reflectorsField.get(null);
//      cm.clear();
View Full Code Here


    expect(mockIterator.hasNext()).andReturn(true).times(2).andReturn(false).once();
    expect(mockIterator.next()).andReturn(mockStatement).anyTimes();
    mockStatement.close();
    expectLastCall().once().andThrow(new SQLException()).once();
   
    mockCache.clear();
    expectLastCall().once();
    replay(mockCache, mockStatementCollections, mockIterator,mockStatement);
   
    testClass.clear();
    verify(mockCache, mockStatement);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.