Skip to content

Commit 6b8e446

Browse files
authored
Merge pull request #46 from openml/fix_jdkversion
Fix jdkversion
2 parents 7ccb2ee + 2e6f8d2 commit 6b8e446

10 files changed

Lines changed: 81 additions & 26 deletions

File tree

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: java
22
sudo: false
33
jdk:
4-
- oraclejdk8
4+
- oraclejdk17
55
before_script: cd apiconnector
66
script: mvn clean verify
77
deploy:

apiconnector/pom.xml

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>org.openml</groupId>
77
<artifactId>apiconnector</artifactId>
8-
<version>1.0.24-SNAPSHOT</version>
8+
<version>1.0.25-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010

1111
<name>APIConnector</name>
@@ -95,7 +95,7 @@
9595
<dependency>
9696
<groupId>junit</groupId>
9797
<artifactId>junit</artifactId>
98-
<version>4.11</version>
98+
<version>4.13</version>
9999
<scope>test</scope>
100100
</dependency>
101101

@@ -108,31 +108,31 @@
108108
<dependency>
109109
<groupId>org.apache.commons</groupId>
110110
<artifactId>commons-lang3</artifactId>
111-
<version>3.1</version>
111+
<version>3.12.0</version>
112112
</dependency>
113113

114114
<dependency>
115115
<groupId>org.apache.httpcomponents</groupId>
116116
<artifactId>httpclient</artifactId>
117-
<version>4.5.1</version>
117+
<version>4.5.13</version>
118118
</dependency>
119119

120120
<dependency>
121121
<groupId>org.apache.commons</groupId>
122122
<artifactId>commons-csv</artifactId>
123-
<version>1.4</version>
123+
<version>1.8</version>
124124
</dependency>
125125

126126
<dependency>
127127
<groupId>org.apache.httpcomponents</groupId>
128128
<artifactId>httpmime</artifactId>
129-
<version>4.2.5</version>
129+
<version>4.5.13</version>
130130
</dependency>
131131

132132
<dependency>
133133
<groupId>com.thoughtworks.xstream</groupId>
134134
<artifactId>xstream</artifactId>
135-
<version>1.4.7</version>
135+
<version>1.4.16</version>
136136
</dependency>
137137

138138
<dependency>
@@ -144,7 +144,7 @@
144144
<dependency>
145145
<groupId>org.json</groupId>
146146
<artifactId>json</artifactId>
147-
<version>20140107</version>
147+
<version>20210307</version>
148148
</dependency>
149149
</dependencies>
150150

@@ -159,17 +159,17 @@
159159
<plugin>
160160
<groupId>org.apache.maven.plugins</groupId>
161161
<artifactId>maven-compiler-plugin</artifactId>
162-
<version>2.0.2</version>
162+
<version>3.8.1</version>
163163
<configuration>
164-
<source>1.6</source>
165-
<target>1.6</target>
164+
<source>1.8</source>
165+
<target>1.8</target>
166166
</configuration>
167167
</plugin>
168168

169169
<plugin>
170170
<groupId>org.apache.maven.plugins</groupId>
171171
<artifactId>maven-surefire-plugin</artifactId>
172-
<version>2.7.2</version>
172+
<version>3.0.0-M5</version>
173173
<configuration>
174174
<includes>
175175
<include>**/Test*.java</include>
@@ -182,7 +182,7 @@
182182
<plugin>
183183
<groupId>org.apache.maven.plugins</groupId>
184184
<artifactId>maven-release-plugin</artifactId>
185-
<version>2.5.3</version>
185+
<version>3.0.0-M1</version>
186186
<configuration>
187187
<useReleaseProfile>false</useReleaseProfile>
188188
<localCheckout>true</localCheckout>
@@ -197,7 +197,7 @@
197197
<plugin>
198198
<groupId>org.apache.maven.plugins</groupId>
199199
<artifactId>maven-clean-plugin</artifactId>
200-
<version>2.4.1</version>
200+
<version>3.1.0</version>
201201
<configuration>
202202
<filesets>
203203
<fileset>
@@ -216,7 +216,7 @@
216216
<plugin>
217217
<groupId>org.apache.maven.plugins</groupId>
218218
<artifactId>maven-jar-plugin</artifactId>
219-
<version>2.3.2</version>
219+
<version>3.2.0</version>
220220
<executions>
221221
<execution>
222222
<goals>
@@ -229,7 +229,7 @@
229229
<plugin>
230230
<groupId>org.apache.maven.plugins</groupId>
231231
<artifactId>maven-source-plugin</artifactId>
232-
<version>2.1.2</version>
232+
<version>3.2.1</version>
233233
<executions>
234234
<execution>
235235
<id>attach-sources</id>
@@ -252,6 +252,7 @@
252252
<plugin>
253253
<groupId>org.apache.maven.plugins</groupId>
254254
<artifactId>maven-javadoc-plugin</artifactId>
255+
<version>3.2.0</version>
255256
<executions>
256257
<execution>
257258
<id>attach-javadocs</id>
@@ -268,9 +269,9 @@
268269
</configuration>
269270
</plugin>
270271
<plugin>
271-
<groupId>org.eluder.coveralls</groupId>
272-
<artifactId>coveralls-maven-plugin</artifactId>
273-
<version>4.3.0</version>
272+
<groupId>org.eluder.coveralls</groupId>
273+
<artifactId>coveralls-maven-plugin</artifactId>
274+
<version>4.3.0</version>
274275
</plugin>
275276
</plugins>
276277
</build>

apiconnector/src/main/java/org/openml/apiconnector/algorithms/TaskInformation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static Data_set getSourceData( Task t ) throws Exception {
9595
return t.getInputs()[i].getData_set();
9696
}
9797
}
98-
throw new Exception("Task does not define an estimation procedure (task_id="+t.getTask_id()+")");
98+
throw new Exception("Task does not define a source data field (task_id="+t.getTask_id()+")");
9999
}
100100

101101
/**

apiconnector/src/main/java/org/openml/apiconnector/io/OpenmlBasicConnector.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ public int getVerboselevel() {
101101
return verboseLevel;
102102
}
103103

104+
/**
105+
* Returns the Base URL.
106+
*
107+
* @return api url (server)
108+
*/
109+
public String getBaseUrl(){
110+
return OPENML_URL;
111+
}
112+
104113
/**
105114
* Returns the total API URL.
106115
*

apiconnector/src/main/java/org/openml/apiconnector/xml/Data.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,22 @@ public class Data extends OpenmlApiResponse {
5151
public DataSet[] getData() {
5252
return data;
5353
}
54+
55+
public Integer[] getIds() {
56+
Integer[] ids = new Integer[data.length];
57+
for (int i = 0; i < data.length; ++i) {
58+
ids[i] = data[i].did;
59+
}
60+
return ids;
61+
}
62+
63+
public String[] getNames() {
64+
String[] names = new String[data.length];
65+
for (int i = 0; i < data.length; ++i) {
66+
names[i] = data[i].name;
67+
}
68+
return names;
69+
}
5470

5571
@XStreamAlias("oml:dataset")
5672
public static class DataSet {

apiconnector/src/test/java/apiconnector/TestDataFunctionality.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import org.apache.commons.csv.CSVFormat;
4747
import org.apache.commons.csv.CSVParser;
4848
import org.apache.commons.csv.CSVRecord;
49+
import org.junit.Ignore;
4950
import org.junit.Test;
5051
import org.openml.apiconnector.algorithms.Conversion;
5152
import org.openml.apiconnector.io.ApiException;
@@ -77,6 +78,7 @@ public class TestDataFunctionality extends BaseTestFramework {
7778
private static final int probe = 61;
7879
private static final String tag = "junittest";
7980

81+
@Ignore // while working on MinIo, the dataset layout might change slightly. hard to check
8082
@Test
8183
public void testApiDataDownload() throws Exception {
8284
DataSetDescription dsd = client_read_test.dataGet(probe);

apiconnector/src/test/java/apiconnector/TestFlowFunctionality.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,19 @@ public void testApiFlowUploadDuplicate() throws Exception {
119119
"test should be deleted", "english", "UnitTest"));
120120
created.addParameter(new Parameter("test_p", "option", "bla", "more bla"));
121121
created.setCustom_name("Jans flow");
122-
123-
int flowId = client_write_test.flowUpload(created);
124-
122+
int flowId = -1;
123+
try {
124+
flowId = client_write_test.flowUpload(created);
125+
} catch (ApiException e) {
126+
if (e.getCode() == 171) {
127+
String idStr = e.getMessage().substring(e.getMessage().lastIndexOf(":") + 1);
128+
flowId = Integer.parseInt(idStr);
129+
client_admin_test.flowDelete(flowId);
130+
fail("Flow was still on server, will be deleted now.");
131+
} else {
132+
fail("Flow was still on server, failed to delete it.");
133+
}
134+
}
125135
try {
126136
client_write_test.flowUpload(created);
127137
fail("Test failed, flow upload should have been blocked.");

apiconnector/src/test/java/apiconnector/TestRunFunctionality.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public void testApiEvaluationRequest() throws Exception {
189189
Map<String, String> filters = new TreeMap<String, String>();
190190
Integer[] ttids = {3,4};
191191
String ttidString = Arrays.toString(ttids).replaceAll(" ", "").replaceAll("\\[", "").replaceAll("\\]", "");
192-
int numRequests = 100;
192+
int numRequests = 25;
193193
filters.put("ttid", ttidString);
194194
EvaluationRequest er = client_admin_test.evaluationRequest(42, "random", numRequests, filters);
195195
assertTrue(er.getRuns().length == numRequests);

apiconnector/src/test/java/apiconnector/TestTaskFunctions.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,23 @@ public void testAvoidInactiveDataset() throws Exception {
176176
} catch(Exception e) { }
177177
}
178178

179+
@Test
180+
public void testAvoidInactiveDatasetClustering() throws Exception {
181+
// clustering task is more complex test case, since the dataset does not need to be processed.
182+
File toUpload = new File(TestDataFunctionality.data_file);
183+
DataSetDescription dsd = new DataSetDescription("test", "Unit test should be deleted", "arff", "class");
184+
int dataId = client_write_test.dataUpload(dsd, toUpload);
185+
186+
Input[] inputs = new Input[2];
187+
inputs[0] = new Input("estimation_procedure", "17");
188+
inputs[1] = new Input("source_data", "" + dataId);
189+
190+
try {
191+
client_write_test.taskUpload(new TaskInputs(null, 5, inputs, null));
192+
fail("Should not be able to upload task.");
193+
} catch(Exception e) { }
194+
}
195+
179196
@Test
180197
public void testCreateChallengeTask() throws Exception {
181198
Input[] inputs = new Input[4];

apiconnector/src/test/java/testbase/BaseTestFramework.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public class BaseTestFramework {
1414
protected static final String url_live = "https://www.openml.org/";
1515
protected static final OpenmlConnector client_admin_test = new OpenmlConnector(url_test,"d488d8afd93b32331cf6ea9d7003d4c3");
1616
protected static final OpenmlConnector client_write_test = new OpenmlConnector(url_test, "8baa83ecddfe44b561fd3d92442e3319");
17-
protected static final OpenmlConnector client_read_test = new OpenmlConnector(url_test, "c1994bdb7ecb3c6f3c8f3b35f4b47f1f");
17+
protected static final OpenmlConnector client_read_test = new OpenmlConnector(url_test, "6a4e0925273c6c9e2709b8b5179755c2"); // user id 3345, vanrijn@freiburg
1818
protected static final OpenmlConnector client_read_live = new OpenmlConnector(url_live, "c1994bdb7ecb3c6f3c8f3b35f4b47f1f");
1919

2020
protected static final XStream xstream = XstreamXmlMapping.getInstance();

0 commit comments

Comments
 (0)