package geniusweb.bidspace; import static org.junit.Assert.assertEquals; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Paths; import org.junit.Test; import com.fasterxml.jackson.databind.ObjectMapper; import geniusweb.profile.Profile; import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace; public class PartialSpaceFromUtilityTest { private final static ObjectMapper jackson = new ObjectMapper(); @Test public void createPartialSpaceJobs() throws IOException { String file1 = new String(Files.readAllBytes(Paths.get("src/test/resources/jobs/jobs1.json"))); LinearAdditiveUtilitySpace profile = (LinearAdditiveUtilitySpace) jackson.readValue(file1, Profile.class); PartialSpaceFromUtility partial = new PartialSpaceFromUtility(profile, 20); System.out.println(jackson.writeValueAsString(partial)); assertEquals(20, partial.getBetter().size()); } }