import org.junit.Test;
public class ServerPolicyCalculatorTest extends Assert {
@Test
public void testCompatibleServerPolicies() {
ServerPolicyCalculator spc = new ServerPolicyCalculator();
HTTPServerPolicy p1 = new HTTPServerPolicy();
assertTrue("Policy is not compatible with itself.", spc.compatible(p1, p1));
HTTPServerPolicy p2 = new HTTPServerPolicy();
assertTrue("Policies are not compatible.", spc.compatible(p1, p2));
p1.setServerType("server");
assertTrue("Policies are not compatible.", spc.compatible(p1, p2));
p1.setServerType(null);
p1.setReceiveTimeout(10000);
assertTrue("Policies are not compatible.", spc.compatible(p1, p2));
p1.setSuppressClientSendErrors(false);
assertTrue("Policies are compatible.", spc.compatible(p1, p2));
p1.setSuppressClientSendErrors(true);
assertTrue("Policies are compatible.", !spc.compatible(p1, p2));
p2.setSuppressClientSendErrors(true);
assertTrue("Policies are compatible.", spc.compatible(p1, p2));
}