Line | |
---|
1 | package geniusweb.bidspace;
|
---|
2 |
|
---|
3 | import static org.junit.Assert.assertTrue;
|
---|
4 |
|
---|
5 | import java.io.IOException;
|
---|
6 | import java.nio.file.Files;
|
---|
7 | import java.nio.file.Paths;
|
---|
8 |
|
---|
9 | import org.junit.Test;
|
---|
10 |
|
---|
11 | import com.fasterxml.jackson.databind.ObjectMapper;
|
---|
12 |
|
---|
13 | import geniusweb.profile.Profile;
|
---|
14 | import geniusweb.profile.utilityspace.LinearAdditiveUtilitySpace;
|
---|
15 |
|
---|
16 | public class PartialSpaceFromUtilityTest {
|
---|
17 | private final static ObjectMapper jackson = new ObjectMapper();
|
---|
18 |
|
---|
19 | @Test
|
---|
20 | public void createPartialSpaceJobs() throws IOException {
|
---|
21 | String file1 = new String(Files
|
---|
22 | .readAllBytes(Paths.get("src/test/resources/jobs/jobs1.json")));
|
---|
23 | LinearAdditiveUtilitySpace profile = (LinearAdditiveUtilitySpace) jackson
|
---|
24 | .readValue(file1, Profile.class);
|
---|
25 | PartialSpaceFromUtility partial = new PartialSpaceFromUtility(profile,
|
---|
26 | 20);
|
---|
27 | System.out.println(jackson.writeValueAsString(partial));
|
---|
28 | int size = partial.getBetter().size();
|
---|
29 | assertTrue(size >= 20); // sometimes 20, sometimes 21
|
---|
30 | assertTrue(size <= 21);
|
---|
31 | }
|
---|
32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.