Project

General

Profile

« Previous | Next » 

Revision 7422

In migrating to Hazelcast 2.4.x, replace deprecated methods.

View differences:

test/edu/ucsb/nceas/metacat/dataone/hazelcast/HazelcastServiceTest.java
39 39
import org.dataone.service.types.v1.SystemMetadata;
40 40

  
41 41
import com.hazelcast.core.Hazelcast;
42
import com.hazelcast.core.HazelcastInstance;
42 43
import com.hazelcast.core.IMap;
43 44

  
44 45
import edu.ucsb.nceas.MCTestCase;
......
51 52
 */
52 53
public class HazelcastServiceTest extends MCTestCase {   
53 54
    
55
	private static HazelcastInstance hzMember;
54 56
	static {
55 57
	
56 58
		try {
57 59
			// initialize the configuration
58
			HazelcastService.getInstance();
60
			hzMember = HazelcastService.getInstance().getHazelcastInstance();
59 61
			
60 62
		} catch (Exception e) {
61 63
			e.printStackTrace();
......
98 100
			pid = cnst.testRegisterSystemMetadata();
99 101
			assertNotNull(pid);
100 102
			// look it up from the "shared" map
101
			IMap<Object, Object> systemMetadataMap = Hazelcast.getMap(PropertyService.getProperty("dataone.hazelcast.storageCluster.systemMetadataMap"));
103
			IMap<Object, Object> systemMetadataMap = hzMember.getMap(PropertyService.getProperty("dataone.hazelcast.storageCluster.systemMetadataMap"));
102 104
			SystemMetadata sm = (SystemMetadata) systemMetadataMap.get(pid);
103 105
			assertNotNull(sm);
104 106
		} catch (Exception e) {
......
119 121
			assertNotNull(sysmeta);
120 122
			// put it in the "shared" map
121 123
			System.out.println("Saving System Metadata to in-memory shared map: " + guid.getValue());
122
			IMap<Identifier, SystemMetadata> systemMetadataMap = Hazelcast.getMap(PropertyService.getProperty("dataone.hazelcast.storageCluster.systemMetadataMap"));
124
			IMap<Identifier, SystemMetadata> systemMetadataMap = hzMember.getMap(PropertyService.getProperty("dataone.hazelcast.storageCluster.systemMetadataMap"));
123 125
			systemMetadataMap.put(guid, sysmeta);
124 126
			
125 127
			// get it from the store

Also available in: Unified diff