use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class TransactionImpl_OnePhaseTest method setup.
@Before
public void setup() {
HazelcastInstance hz = createHazelcastInstance();
operationService = getOperationService(hz);
logger = mock(ILogger.class);
txManagerService = mock(TransactionManagerServiceImpl.class);
txManagerService.commitCount = MwCounter.newMwCounter();
txManagerService.startCount = MwCounter.newMwCounter();
txManagerService.rollbackCount = MwCounter.newMwCounter();
nodeEngine = mock(NodeEngine.class);
when(nodeEngine.getOperationService()).thenReturn(operationService);
when(nodeEngine.getLocalMember()).thenReturn(new MemberImpl());
when(nodeEngine.getLogger(TransactionImpl.class)).thenReturn(logger);
options = new TransactionOptions().setTransactionType(ONE_PHASE);
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class TransactionImpl_TwoPhaseTest method setup.
@Before
public void setup() {
HazelcastInstance hz = createHazelcastInstance();
operationService = getOperationService(hz);
logger = mock(ILogger.class);
txManagerService = mock(TransactionManagerServiceImpl.class);
txManagerService.commitCount = MwCounter.newMwCounter();
txManagerService.startCount = MwCounter.newMwCounter();
txManagerService.rollbackCount = MwCounter.newMwCounter();
nodeEngine = mock(NodeEngine.class);
when(nodeEngine.getOperationService()).thenReturn(operationService);
when(nodeEngine.getLogger(TransactionImpl.class)).thenReturn(logger);
when(nodeEngine.getLocalMember()).thenReturn(new MemberImpl());
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberGroupFactoryTest method createMembersWithNoMetadata.
private Collection<Member> createMembersWithNoMetadata() throws UnknownHostException {
Collection<Member> members = new HashSet<Member>();
InetAddress fakeAddress = InetAddress.getLocalHost();
members.add(new MemberImpl(new Address("192.192.0.1", fakeAddress, 5701), VERSION, false));
members.add(new MemberImpl(new Address("192.192.0.1", fakeAddress, 5702), VERSION, false));
members.add(new MemberImpl(new Address("192.168.3.101", fakeAddress, 5701), VERSION, false));
return members;
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberGroupFactoryTest method createMembersWithRackAwareMetadata.
private Collection<Member> createMembersWithRackAwareMetadata() throws UnknownHostException {
Collection<Member> members = new HashSet<Member>();
InetAddress fakeAddress = InetAddress.getLocalHost();
MemberImpl member1 = new MemberImpl(new Address("192.192.0.1", fakeAddress, 5701), VERSION, true);
member1.setStringAttribute(PartitionGroupMetaData.PARTITION_GROUP_RACK, "rack-1");
MemberImpl member2 = new MemberImpl(new Address("192.192.0.2", fakeAddress, 5701), VERSION, true);
member2.setStringAttribute(PartitionGroupMetaData.PARTITION_GROUP_RACK, "rack-2");
MemberImpl member3 = new MemberImpl(new Address("192.192.0.3", fakeAddress, 5701), VERSION, true);
member3.setStringAttribute(PartitionGroupMetaData.PARTITION_GROUP_RACK, "rack-3");
members.add(member1);
members.add(member2);
members.add(member3);
return members;
}
use of com.hazelcast.instance.MemberImpl in project hazelcast by hazelcast.
the class MemberGroupFactoryTest method createMembersWithZoneAwareMetadata.
private Collection<Member> createMembersWithZoneAwareMetadata() throws UnknownHostException {
Collection<Member> members = new HashSet<Member>();
InetAddress fakeAddress = InetAddress.getLocalHost();
MemberImpl member1 = new MemberImpl(new Address("192.192.0.1", fakeAddress, 5701), VERSION, true);
member1.setStringAttribute(PartitionGroupMetaData.PARTITION_GROUP_ZONE, "us-east-1");
MemberImpl member2 = new MemberImpl(new Address("192.192.0.2", fakeAddress, 5701), VERSION, true);
member2.setStringAttribute(PartitionGroupMetaData.PARTITION_GROUP_ZONE, "us-west-1");
MemberImpl member3 = new MemberImpl(new Address("192.192.0.3", fakeAddress, 5701), VERSION, true);
member3.setStringAttribute(PartitionGroupMetaData.PARTITION_GROUP_ZONE, "eu-central-1");
members.add(member1);
members.add(member2);
members.add(member3);
return members;
}
Aggregations