本文整理汇总了Java中com.belladati.sdk.exception.dataset.data.UnknownServerColumnException类的典型用法代码示例。如果您正苦于以下问题:Java UnknownServerColumnException类的具体用法?Java UnknownServerColumnException怎么用?Java UnknownServerColumnException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnknownServerColumnException类属于com.belladati.sdk.exception.dataset.data包,在下文中一共展示了UnknownServerColumnException类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: uploadData
import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
@Override
public void uploadData(String id, DataTable data) {
List<DataRow> rows = data.getRows();
if (rows.size() == 0) {
// if we don't have data, do nothing
return;
}
try {
client.postUpload("api/import/" + id, tokenHolder, data.toJson().toString());
} catch (UnexpectedResponseException e) {
if (e.getResponseCode() == 400) {
Pattern codePattern = Pattern.compile(".*?'(.*?)'.*");
Matcher codeMatcher = codePattern.matcher(e.getResponseContent());
if (codeMatcher.matches()) {
throw new UnknownServerColumnException(id, codeMatcher.group(1));
}
}
throw new UnexpectedResponseException(e.getResponseCode(), e.getResponseContent(), e);
}
}
示例2: nonExistingColumn
import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
/** non-existing column server error */
public void nonExistingColumn() {
server.registerError(url, 400, "Indicator/attribute '" + column + "' doesn't exist");
try {
getService().uploadData(id, DataTable.createBasicInstance(column).createRow("content"));
fail("No exception thrown");
} catch (UnknownServerColumnException e) {
assertEquals(e.getId(), id);
assertEquals(e.getColumn(), column);
}
}
示例3: nonExistingColumn
import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
/** non-existing column server error */
public void nonExistingColumn() {
server.registerError(url, 400, "Indicator/attribute '" + column + "' doesn't exist");
try {
service.uploadData(id, DataTable.createBasicInstance(column).createRow("content"));
fail("No exception thrown");
} catch (UnknownServerColumnException e) {
assertEquals(e.getId(), id);
assertEquals(e.getColumn(), column);
}
}
示例4: uploadData
import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
/**
* Uploads the given data into this data set. This method doesn't perform
* any validation of the data; the caller should ensure it matches the data
* set's structure.
* <p>
* To ensure the structure is correct, generate the table calling
* {@link #createDataTable()} on the same data set.
*
* @param data the data to upload
* @return this data set
* @throws UnknownServerColumnException if the data table contains a column
* that doesn't exist in the data set
*/
DataSet uploadData(DataTable data) throws UnknownServerColumnException;
示例5: uploadData
import com.belladati.sdk.exception.dataset.data.UnknownServerColumnException; //导入依赖的package包/类
/**
* Uploads the given data into this data set. This method doesn't perform
* any validation of the data; the caller should ensure it matches the data
* set's structure.
*
* @param id ID of the data set to upload to
* @param data the data to upload
* @throws UnknownServerColumnException if the data table contains a column
* that doesn't exist in the data set
* @see <a href="http://support.belladati.com/techdoc/POST+JSON+data">POST JSON data</a>
*/
void uploadData(String id, DataTable data) throws UnknownServerColumnException;