@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"); 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"); bevanda = new Bevanda(); bevanda.setCapacita(1000F); bevanda.setNome("BEVANDA TEST"); bevanda.setTipoArticolo("Bevanda"); bevanda.setTipoPietanza(TipoPietanza.BEVANDA.ordinal()); bevanda = articoloFacade.inserisciBevandaMenu(user, bevanda); articoloFacade.inserisciBevandaMagazzino(user, bevanda.getId(), 1L, 10000); }