@Test public void testXmlRoundTrip() throws Exception { AdaptrisMarshaller m = DefaultMarshaller.getDefaultMarshaller(); for (int i = 0; i < ALL_EVENT_CLASSES.length; i++) { Event input = EventFactory.create(ALL_EVENT_CLASSES[i]); setSetters(input); String xml = m.marshal(input); log.trace(xml); Event output = (Event) m.unmarshal(xml); BaseCase.assertRoundtripEquality(input, output); } }
public static Event create(String name) throws CoreException { try { Event result = (Event) Class.forName(name).newInstance(); result.setUniqueId(uidGenerator.create(result)); result.setCreationTime(System.currentTimeMillis()); return result; } catch (Exception e) { throw new CoreException(e); } }
EventFactory { public static Event create(String name) throws CoreException { try { Event result = (Event) Class.forName(name).newInstance(); result.setUniqueId(uidGenerator.create(result)); result.setCreationTime(System.currentTimeMillis()); return result; } catch (Exception e) { throw new CoreException(e); } } }
EventFactory { public static Event create(String name) throws CoreException { try { Event result = (Event) Class.forName(name).newInstance(); result.setUniqueId(uidGenerator.create(result)); result.setCreationTime(System.currentTimeMillis()); return result; } catch (Exception e) { throw new CoreException(e); } }  }
EventFactory { public static Event create(String name) throws CoreException { try { Event result = (Event) Class.forName(name).newInstance(); result.setUniqueId(uidGenerator.create(result)); result.setCreationTime(System.currentTimeMillis()); return result; } catch (Exception e) { throw new CoreException(e); } }  static Event create(String name); static T create(Class<T> name); static Event createEvent(AdaptrisMessage msg, AdaptrisMarshaller marshaller); static Event createEvent(AdaptrisMessage msg); }
EventFactory { public static Event create(String name) throws CoreException { try { Event result = (Event) Class.forName(name).newInstance(); result.setUniqueId(uidGenerator.create(result)); result.setCreationTime(System.currentTimeMillis()); return result; } catch (Exception e) { throw new CoreException(e); } }  static Event create(String name); static T create(Class<T> name); static Event createEvent(AdaptrisMessage msg, AdaptrisMarshaller marshaller); static Event createEvent(AdaptrisMessage msg);  }