static { GregorianCalendar c = new GregorianCalendar(); c.set(1856, 7, 9); tesla = new Inventor("Nikola Tesla", c.getTime(), "Serbian"); tesla.setPlaceOfBirth(new PlaceOfBirth("SmilJan")); tesla.setInventions( new String[] { "Telephone repeater", "Rotating magnetic field principle", "Polyphase alternating-current system", "Induction motor", "Alternating-current power transmission", "Tesla coil transformer", "Wireless communication", "Radio", "Fluorescent lights" }); pupin = new Inventor("Pupin", c.getTime(), "Idvor"); pupin.setPlaceOfBirth(new PlaceOfBirth("Idvor")); }
/** * Create the root context object, an Inventor instance. Non-qualified property and method * references will be resolved against this context object. * * @param testContext the evaluation context in which to set the root object */ private static void setupRootContextObject(StandardEvaluationContext testContext) { GregorianCalendar c = new GregorianCalendar(); c.set(1856, 7, 9); Inventor tesla = new Inventor("Nikola Tesla", c.getTime(), "Serbian"); tesla.setPlaceOfBirth(new PlaceOfBirth("SmilJan")); tesla.setInventions( new String[] { "Telephone repeater", "Rotating magnetic field principle", "Polyphase alternating-current system", "Induction motor", "Alternating-current power transmission", "Tesla coil transformer", "Wireless communication", "Radio", "Fluorescent lights" }); testContext.setRootObject(tesla); }