32 lines
927 B
Java
32 lines
927 B
Java
|
package org.gcube.application.geoportal.common.model;
|
||
|
|
||
|
import java.io.FileInputStream;
|
||
|
import java.io.FileNotFoundException;
|
||
|
|
||
|
import javax.json.Json;
|
||
|
import javax.json.JsonObject;
|
||
|
|
||
|
import org.gcube.application.geoportal.common.faults.JsonParseException;
|
||
|
import org.gcube.application.geoportal.common.model.profile.Profile;
|
||
|
import org.gcube.application.geoportal.common.utils.Files;
|
||
|
import org.junit.Assert;
|
||
|
import org.junit.Test;
|
||
|
|
||
|
public class SerializationTest {
|
||
|
|
||
|
|
||
|
@Test
|
||
|
public void readProfile() throws FileNotFoundException, JsonParseException {
|
||
|
JsonObject object=Json.createReader(new FileInputStream(Files.getFileFromResources("ProfileConcessioni.json"))).readObject();
|
||
|
|
||
|
System.out.println("object is "+object);
|
||
|
Assert.assertNotNull(object);
|
||
|
Profile concessione=new Profile(object);
|
||
|
System.out.println("Profile is "+concessione.toJson());
|
||
|
|
||
|
Assert.assertTrue(concessione.getFields().size()>0);
|
||
|
|
||
|
}
|
||
|
|
||
|
}
|