1 5 package org.exoplatform.test.web.condition; 6 7 import org.exoplatform.test.web.ExoWebClient; 8 import com.meterware.httpunit.*; 9 10 16 public class NoRoleCondition implements Condition { 17 private String role_ ; 18 19 public NoRoleCondition(String role) { 20 role_ = role ; 21 } 22 23 public boolean checkCondition(WebResponse response, WebTable block, ExoWebClient client) throws Exception { 24 return !client.getRoles().containsKey(role_) ; 25 } 26 27 public String getName() { return "NoRoleCondition" ; } 28 public String getDescription() { 29 return "This unit test should run only if the remote user do not have the role '" + role_ + "'" ; 30 } 31 } | Popular Tags |