HashSet oper = new HashSet(), affil = new HashSet(); oper.add("oper1"); oper.add("oper2"); affil.add("org1"); affil.add("org2");   AuthorizationClient client = new AuthorizationClient("name", "display", "url", "lang", "home", affil, oper, attrs);
HashSet oper = new HashSet(), affil = new HashSet(); oper.add("oper1"); oper.add("oper2"); affil.add("org1"); affil.add("org2");
	public void testNewAuthorizationClient() {		/*		 * Illegal values		 */		/* Name */		try {			new AuthorizationClient(null, "foo", "foo", "foo", "foo", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (name = null)");		} catch (IllegalArgumentException success) {		}		try {			new AuthorizationClient("", "foo", "foo", "foo", "foo", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (name = '')");		} catch (IllegalArgumentException success) {		}		/* Display name */		try {			new AuthorizationClient("foo", null, "foo", "foo", "foo", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (displayName = null)");		} catch (IllegalArgumentException success) {		}		try {			new AuthorizationClient("foo", "", "foo", "foo", "foo", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (displayName = '')");		} catch (IllegalArgumentException success) {		}		/* URL */		// TODO: Test for illegal URL for instance ftp://foobar		try {			new AuthorizationClient("foo", "foo", "", "foo", "foo", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (url = null)");		} catch (IllegalArgumentException success) {		}		try {			new AuthorizationClient("foo", "foo", "", "foo", "foo", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (url = '')");		} catch (IllegalArgumentException success) {		}		/* Language */		try {			new AuthorizationClient("foo", "foo", "foo", null, "foo", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (language = null)");		} catch (IllegalArgumentException success) {		}		try {			new AuthorizationClient("foo", "foo", "foo", null, "foo", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (language = '')");		} catch (IllegalArgumentException success) {		}		/* Home */		try {			new AuthorizationClient("foo", "foo", "foo", "foo", null, emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (home = null)");		} catch (IllegalArgumentException success) {		}		try {			new AuthorizationClient("foo", "foo", "foo", "foo", "", emptySet, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (home = '')");		} catch (IllegalArgumentException success) {		}		/* Affiliation */		try {			new AuthorizationClient("foo", "foo", "foo", "foo", "foo", null, emptySet, emptyMap);			fail("Should raise IllegalArgumentException (affiliation = null)");		} catch (IllegalArgumentException success) {		}		/* Operations */		try {			new AuthorizationClient("foo", "foo", "foo", "foo", "foo", emptySet, null, emptyMap);			fail("Should raise IllegalArgumentException (operations = null)");		} catch (IllegalArgumentException success) {		}		/* Affiliation */		try {			new AuthorizationClient("foo", "foo", "foo", "foo", "foo", emptySet, emptySet, null);			fail("Should raise IllegalArgumentException (attributes = null)");		} catch (IllegalArgumentException success) {		}		HashMap attrs = new HashMap();		attrs.put("attr1", new AuthorizationAttribute("attr1", false, 2));		HashSet oper = new HashSet(), affil = new HashSet();		oper.add("oper1");		oper.add("oper2");		affil.add("org1");		affil.add("org2");				/* Verify a valid object */		AuthorizationClient client =			new AuthorizationClient("name", "display", "url", "lang", "home", affil, oper, attrs);		Assert.assertEquals("Name differs", "name", client.getName());		Assert.assertEquals("Display name differs", "display", client.getDisplayName());		Assert.assertEquals("URL differs", "url", client.getURL());		Assert.assertEquals("Language differs", "lang", client.getLanguage());		Assert.assertEquals("Home differs", "home", client.getHome());		Assert.assertEquals("Affiliation differs", affil, client.getAffiliation());		Assert.assertEquals("Operations differs", oper, client.getOperations());		Assert.assertEquals("Attributes differs", attrs, client.getAttributes());			}