use of edu.harvard.iq.dataverse.dataset.DatasetThumbnail in project dataverse by IQSS.
the class UpdateDatasetThumbnailCommandTest method testIntentNull.
@Test
public void testIntentNull() {
String expected = "No changes to save.";
String actual = null;
DatasetThumbnail datasetThumbnail = null;
try {
datasetThumbnail = testEngine.submit(new UpdateDatasetThumbnailCommand(null, dataset, null, Long.MIN_VALUE, null));
} catch (CommandException ex) {
actual = ex.getMessage();
}
assertEquals(expected, actual);
assertNull(datasetThumbnail);
}
use of edu.harvard.iq.dataverse.dataset.DatasetThumbnail in project dataverse by IQSS.
the class UpdateDatasetThumbnailCommandTest method testSetDatasetFileAsThumbnailFileNotFound.
@Test
public void testSetDatasetFileAsThumbnailFileNotFound() {
String expected = "Could not find file based on id supplied: 1.";
String actual = null;
DatasetThumbnail datasetThumbnail = null;
try {
datasetThumbnail = testEngine.submit(new UpdateDatasetThumbnailCommand(null, dataset, UpdateDatasetThumbnailCommand.UserIntent.setDatasetFileAsThumbnail, unfindableFile, null));
} catch (CommandException ex) {
actual = ex.getMessage();
}
assertEquals(expected, actual);
assertNull(datasetThumbnail);
}
use of edu.harvard.iq.dataverse.dataset.DatasetThumbnail in project dataverse by IQSS.
the class UpdateDatasetThumbnailCommandTest method testDatasetNull.
@Test
public void testDatasetNull() {
dataset = null;
String expected = "Can't update dataset thumbnail. Dataset is null.";
String actual = null;
DatasetThumbnail datasetThumbnail = null;
try {
datasetThumbnail = testEngine.submit(new UpdateDatasetThumbnailCommand(null, dataset, UpdateDatasetThumbnailCommand.UserIntent.setDatasetFileAsThumbnail, Long.MIN_VALUE, null));
} catch (CommandException ex) {
actual = ex.getMessage();
}
assertEquals(expected, actual);
assertNull(datasetThumbnail);
}
use of edu.harvard.iq.dataverse.dataset.DatasetThumbnail in project dataverse by IQSS.
the class UpdateDatasetThumbnailCommandTest method testSetDatasetFileAsThumbnailFileThumbnailUnexpectedlyAbsent.
@Test
public void testSetDatasetFileAsThumbnailFileThumbnailUnexpectedlyAbsent() {
String expected = "Dataset thumbnail is unexpectedly absent.";
String actual = null;
DatasetThumbnail datasetThumbnail = null;
try {
datasetThumbnail = testEngine.submit(new UpdateDatasetThumbnailCommand(null, dataset, UpdateDatasetThumbnailCommand.UserIntent.setDatasetFileAsThumbnail, thumbnailUnexpectedlyAbsent, null));
} catch (CommandException ex) {
actual = ex.getMessage();
}
assertEquals(expected, actual);
assertNull(datasetThumbnail);
}
Aggregations