@Test public void testCreateInvalidEvents() { String invalid = "com.adaptris.core.PingEventx"; String nonEvent = "java.lang.String"; String empty = ""; try { EventFactory.create(invalid); fail("no CoreException from invalid class name"); } catch (CoreException e) { } try { EventFactory.create(nonEvent); fail("no CoreException from non-Event class (String)"); } catch (CoreException e) { } try { EventFactory.create(empty); fail("no CoreException from \"\""); } catch (CoreException e) { } try { EventFactory.create((String) null); fail("no CoreException from null"); } catch (CoreException e) { } }
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);  }