@SuppressWarnings("deprecation") @Before public void setUp() throws Exception { System.setProperty("java.security.policy", "polis.policy"); if (System.getSecurityManager() == null) { System.setSecurityManager(new SecurityManager()); } try { Registry registry = LocateRegistry.getRegistry("localhost"); articoloFacade = (IArticoloMenuFacade) registry.lookup("ArticoloFacade"); // CONTROLLARE userFacade = (IUserFacade) registry.lookup("UserFacade"); } catch (Exception e) { System.err.println("Exception to obtain the reference to the remote object: " + e); fail("Exception"); } user = userFacade.login(Ruolo.TEST, "test"); ingrediente = new Ingrediente(); ingrediente.setDescrizione("Ingrediente di test"); ingrediente.setId((long) 1000000L); ingrediente.setNome("Ingrediente di Test"); ingrediente.setTipoIngrediente("IngredienteLungaConservazione"); ingrediente.setScadenza(new Date(109, 1, 21)); ingrediente.setUnitaMisura("g"); ingrediente.setVariante(true); ingrediente = articoloFacade.inserisciIngrediente(user, ingrediente); }