Revision 62301
Added by Alessia Bardi almost 2 years ago
Gtr2Test.java | ||
---|---|---|
15 | 15 |
@Ignore |
16 | 16 |
public class Gtr2Test { |
17 | 17 |
|
18 |
private String baseURL = "http://gtr.rcuk.ac.uk/gtr/api";
|
|
18 |
private String baseURL = "https://gtr.ukri.org/gtr/api";
|
|
19 | 19 |
private Gtr2Helper helper; |
20 | 20 |
private Gtr2ProjectsIterable it; |
21 | 21 |
private HttpConnector connector; |
... | ... | |
31 | 31 |
System.out.println("one project"); |
32 | 32 |
VTDGen vg_tmp = new VTDGen(); |
33 | 33 |
connector = new HttpConnector(); |
34 |
byte[] bytes = connector.getInputSource("http://gtr.rcuk.ac.uk/gtr/api/projects/E178742B-571B-498F-8402-122F17C47546").getBytes("UTF-8"); |
|
34 |
String tmp = connector.getInputSource("https://gtr.ukri.org/gtr/api/projects/E178742B-571B-498F-8402-122F17C47546"); |
|
35 |
byte[] bytes = tmp.getBytes("UTF-8"); |
|
35 | 36 |
//vg_tmp.parseHttpUrl("https://gtr.rcuk.ac.uk/gtr/api/projects/E178742B-571B-498F-8402-122F17C47546", false); |
36 | 37 |
vg_tmp.setDoc(bytes); |
37 | 38 |
vg_tmp.parse(false); |
... | ... | |
84 | 85 |
Iterator<String> iterator = it.iterator(); |
85 | 86 |
while (iterator.hasNext()) { |
86 | 87 |
String res = iterator.next(); |
87 |
assertNotNull(res); |
|
88 |
// System.out.println(res);
|
|
89 |
// Scanner keyboard = new Scanner(System.in);
|
|
90 |
// System.out.println("press enter for next record");
|
|
91 |
// keyboard.nextLine();
|
|
88 |
assertNotNull(res);
|
|
89 |
// System.out.println(res);
|
|
90 |
// Scanner keyboard = new Scanner(System.in);
|
|
91 |
// System.out.println("press enter for next record");
|
|
92 |
// keyboard.nextLine();
|
|
92 | 93 |
|
93 | 94 |
} |
94 | 95 |
} |
... | ... | |
102 | 103 |
System.out.println("Got "+i+" projects"); |
103 | 104 |
return i; |
104 | 105 |
} |
105 |
} |
|
106 |
} |
Also available in: Unified diff
UKRI workaround for wrong URLs from Miriam