fieldDescriptor.setClassDescriptor(this); fieldDescriptors.put(fieldDescriptor.getName(), fieldDescriptor); } catch (IllegalStateException e) {
fieldDescriptor.setClassDescriptor(this); fieldDescriptors.put(fieldDescriptor.getName(), fieldDescriptor); } catch (IllegalStateException e) {
public void testSetClassDescriptorTwice() throws Exception { FieldDescriptor fd = new TestFieldDescriptor("name"); ClassDescriptor cld = makeClass("Class1"); fd.setClassDescriptor(cld); try { fd.setClassDescriptor(cld); fail("Expected IllegalStateException"); } catch (IllegalStateException e) { } }
public void testSetClassDescriptorNull() throws Exception { FieldDescriptor fd = new TestFieldDescriptor("name"); try { fd.setClassDescriptor(null); fail("Expected NullPointerException"); } catch (NullPointerException e) { } }
public void testSetClassDescriptorValid() throws Exception { FieldDescriptor fd = new TestFieldDescriptor("name"); ClassDescriptor cld = makeClass("Class1"); try { fd.setClassDescriptor(cld); } catch (IllegalStateException e) { fail("Unable to set ClassDescriptor"); } }