public void testSetValue() {
		Integer scalar = 0;
		List<Integer> list = Arrays.asList(1, 2, 3);
		ListELResolver resolver = new ListELResolver();
		ListELResolver resolverReadOnly = new ListELResolver(true);

		// base == null --> unresolved
		context.setPropertyResolved(false);
		resolver.setValue(context, null, "foo", -1);
		assertFalse(context.isPropertyResolved());

		// base is scalar --> unresolved
		context.setPropertyResolved(false);
		resolver.setValue(context, scalar, "foo", -1);
		assertFalse(context.isPropertyResolved());

		// base is array, property == 1 --> ok
		context.setPropertyResolved(false);
		resolver.setValue(context, list, 1, 999);
		assertEquals(999, list.get(1).intValue());
		assertTrue(context.isPropertyResolved());

		// base is array, bad property --> exception
		try {
			resolver.setValue(context, list, null, 999);
			fail();
		} catch (IllegalArgumentException e) {
			// fine
		}
		try {
			resolver.setValue(context, list, "foo", 999);
			fail();
		} catch (IllegalArgumentException e) {
			// fine
		}
		try {
			resolver.setValue(context, list, -1, 999);
			fail();
		} catch (PropertyNotFoundException e) {
			// fine
		}
		try {
			resolver.setValue(context, list, list.size(), 999);
			fail();
		} catch (PropertyNotFoundException e) {
			// fine
		}

		// base is array, property == 1, value == null --> ok
		context.setPropertyResolved(false);
		resolver.setValue(context, list, 1, null);
		assertNull(list.get(1));
		assertTrue(context.isPropertyResolved());

		// base is array, property == 1, bad value --> exception
		try {
			resolver.setValue(context, list, 1, "foo");
			fail();
		} catch (ClassCastException e) {
			// fine, according to the spec...
		} catch (IllegalArgumentException e) {
			// violates the spec, but we'll accept this...
		}
		
		// read-only resolver
		try {
			resolverReadOnly.setValue(context, list, 1, 999);
			fail();
		} catch (PropertyNotWritableException e) {
			// fine
		}
	}