public static void main(String[] args) {
File f = new File(Constantes.PROFIL);
f.delete();
try {
Client.newProfil(new Profil("tarek.tarek13", "azerty", "JAOUANI", "Tarek", Sexe.H));
Client.newProfil(new Profil("kevkev69", "azerty", "FRANCES", "Kévin", Sexe.H));
Client.newProfil(new Profil("dalleria", "azerty", "DALLE-RIVE", "Antoine", Sexe.H));
Client.newProfil(new Profil("calleay", "azerty", "CALLEA", "Yohann", Sexe.H));
Client.newProfil(new Profil("bab", "azerty", "CISSE", "Babacar", Sexe.H));
Client.newProfil(new Profil("aitmachin", "azerty", "AIT-MAMA", "Meryeme", Sexe.F));
} catch (IOException e) {
System.err.println("Une erreur est survenue durant la création d'un profil.");
System.exit(1);
} catch (ProfilException e) {
System.err.println("ProfilException : " + e.getMessage());
System.exit(1);
}
try {
HashMap<String,Profil> profils = Serialiser.deserialiser(Constantes.PROFIL);
for (Profil p : profils.values())
System.out.println(p.getPseudo());
} catch (IOException e) {
System.err.println("Lecture impossible du fichier sérialisé");
e.printStackTrace();
System.exit(1);
}
Profil p = null;
try {
p = Client.getProfil("tarek.tarek13");
} catch (RemoteException e) {
System.err.println("Remote Exception");
System.exit(1);
}
try {
p.setNom("JAOUAOUAOUANI");
} catch (NullPointerException e) {
System.err.println("Profil inexistant");
System.exit(1);
}