@Test
public void testBenchmarkMediumImages() {
try {
Timer t = new Timer();
t.start();
ImageBean bean = new ImageBean(new WebImage(new URL(
"http://www.alteiar.net/images/cartes/Carte_du_monde.jpg")));
UniqueID id = bean.getId();
CampaignClient.getInstance().addNotPermaBean(bean);
t.end("server sended");
bean = CampaignClient.getInstance().getBean(id, time10second);
if (bean != null) {
BufferedImage img = bean.getImage().restoreImage();
t.end("server received 3.81 Mo (" + img.getWidth() + "x"
+ img.getHeight() + ") ");
} else {
System.out.println("server take more than 10 second");
}
/*
* t.start(); CampaignClient.getInstance().addBean( new
* DocumentImageBuilder("./test/ressources/medium.jpg"));
* t.end("local sended"); doc =
* CampaignClient.getInstance().getDocument(id, time10second); if
* (doc != null) { t.end("local received"); } else {
* System.out.println("local take more than 1 second"); }
*/
t.start();
CampaignClient.getInstance().addNotPermaBean(
new ImageBean(new SerializableImage(new File(
"./test/ressources/medium.jpg"))));
t.end("transfert sended");
bean = CampaignClient.getInstance().getBean(id, time10second);
if (bean != null) {
BufferedImage img = bean.getImage().restoreImage();
t.end("transfert received 3.81 Mo (" + img.getWidth() + "x"
+ img.getHeight() + ") ");
} else {
System.out.println("transfert take more than 10 second");
}