1 22 package org.objectweb.petals.kernel.registry.msg.request; 23 24 import junit.framework.TestCase; 25 26 import org.objectweb.petals.kernel.registry.msg.request.RegistryRequest.RequestType; 27 28 33 public class RegistryRequestTest extends TestCase { 34 35 public void testToString() { 36 RegistryRequest registryRequest = new RegistryRequest(RequestType.ping, 37 0, 0); 38 registryRequest.requestDate = 1; 39 assertEquals(registryRequest.toString(), "RegistryRequest ping date 1"); 40 } 41 42 public void testSetters() { 43 RegistryRequest registryRequest = new RegistryRequest(RequestType.ping, 44 0, 0); 45 assertEquals(registryRequest.sender, 0); 46 registryRequest.setSender(1); 47 assertEquals(registryRequest.sender, 1); 48 assertEquals(registryRequest.recipient, 0); 49 registryRequest.setRecipient(1); 50 assertEquals(registryRequest.recipient, 1); 51 assertEquals(registryRequest.type, RequestType.ping); 52 registryRequest.setType(RequestType.bind); 53 assertEquals(registryRequest.type, RequestType.bind); 54 } 55 56 } 57 | Popular Tags |