use of mockit.Verifications in project docker-maven-plugin by fabric8io.
the class DockerAssemblyManagerTest method testCopyChownValidVerifyGivenDockerfile.
@Test
public void testCopyChownValidVerifyGivenDockerfile(@Injectable final Logger logger) throws IOException {
BuildImageConfiguration buildConfig = createBuildConfig();
assemblyManager.verifyGivenDockerfile(new File(getClass().getResource("/docker/Dockerfile_assembly_verify_copy_chown_valid.test").getPath()), buildConfig, createInterpolator(buildConfig), logger);
new Verifications() {
{
logger.warn(anyString, (Object[]) any);
times = 0;
}
};
}
use of mockit.Verifications in project imagej-omero by imagej.
the class UploadTableTest method testFloatTable.
@Test
public void testFloatTable() throws ServerError, PermissionDeniedException, CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException {
final FloatTable table = new DefaultFloatTable(4, 2);
table.get(0).fill(new float[] { -380129.125f, 0.25f });
table.get(1).fill(new float[] { 9871234.0f, -12.5f });
table.get(2).fill(new float[] { 0.0625f, 13208.03125f });
table.get(3).fill(new float[] { -0.0625f, 1908471790.5f });
final String[] headers = new String[] { "H1", "H2", "H3", "H4" };
for (int i = 0; i < table.getColumnCount(); i++) {
table.get(i).setHeader(headers[i]);
}
// Create expectations
setUpMethodCalls();
final long id = service.uploadTable(credentials, "table", table, 0);
assertEquals(id, -1);
// NB: Can only capture in a Verifications block
new Verifications() {
{
TableData td;
tablesFacility.addTable((SecurityContext) any, (ImageData) any, anyString, td = withCapture());
tableEquals(table, td, Double.class);
}
};
}
use of mockit.Verifications in project imagej-omero by imagej.
the class UploadTableTest method testByteArrayTable.
@Test
public void testByteArrayTable() throws ServerError, PermissionDeniedException, CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException {
final GenericTable table = new DefaultGenericTable();
final DefaultColumn<ByteArray> ij0 = new DefaultColumn<>(ByteArray.class);
final DefaultColumn<ByteArray> ij1 = new DefaultColumn<>(ByteArray.class);
ij0.add(new ByteArray(new byte[] { -128, 127 }));
ij0.add(new ByteArray(new byte[] { 0, 10 }));
ij1.add(new ByteArray(new byte[] { 112, 42 }));
ij1.add(new ByteArray(new byte[] { -13, -84 }));
table.add(ij0);
table.add(ij1);
// Create expectations
setUpMethodCalls();
final long id = service.uploadTable(credentials, "table", table, 0);
assertEquals(id, -1);
// NB: Can only capture in a Verifications block
new Verifications() {
{
TableData td;
tablesFacility.addTable((SecurityContext) any, (ImageData) any, anyString, td = withCapture());
tableEquals(table, td, Long[].class);
}
};
}
use of mockit.Verifications in project imagej-omero by imagej.
the class UploadTableTest method testCharTable.
@Test
public void testCharTable() throws ServerError, PermissionDeniedException, CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException {
final CharTable table = new DefaultCharTable(5, 2);
table.get(0).fill(new char[] { 'q', 'V' });
table.get(1).fill(new char[] { '2', '$' });
table.get(2).fill(new char[] { 'b', 'a' });
table.get(3).fill(new char[] { '\t', '\n' });
table.get(4).fill(new char[] { '.', ' ' });
// Create expectations
setUpMethodCalls();
final long id = service.uploadTable(credentials, "table", table, 0);
assertEquals(id, -1);
// NB: Can only capture in a Verifications block
new Verifications() {
{
TableData td;
tablesFacility.addTable((SecurityContext) any, (ImageData) any, anyString, td = withCapture());
tableEquals(table, td, String.class);
}
};
}
use of mockit.Verifications in project imagej-omero by imagej.
the class UploadTableTest method testReferenceTable.
@Test
public void testReferenceTable() throws ServerError, PermissionDeniedException, CannotCreateSessionException, ExecutionException, DSOutOfServiceException, DSAccessException {
final GenericTable table = new DefaultGenericTable();
final OMERORefColumn rc0 = new OMERORefColumn(OMERORef.WELL);
final OMERORefColumn rc1 = new OMERORefColumn(OMERORef.WELL);
final OMERORefColumn rc2 = new OMERORefColumn(OMERORef.WELL);
rc0.fill(new long[] { 2314, 3141324, 1235 });
rc1.fill(new long[] { 1234, 18367, 82156 });
rc2.fill(new long[] { 3198, 968431, 5489 });
table.add(rc0);
table.add(rc1);
table.add(rc2);
final Object[][] wells = new Object[3][3];
for (int c = 0; c < table.getColumnCount(); c++) {
for (int r = 0; r < table.getRowCount(); r++) {
wells[c][r] = new WellSampleData(new WellSampleI((long) table.get(c, r), false));
}
((OMERORefColumn) table.get(c)).setOriginalData(wells[c]);
}
// Create expectations
setUpMethodCalls();
final long id = service.uploadTable(credentials, "table", table, 0);
assertEquals(id, -1);
// NB: Can only capture in a Verifications block
new Verifications() {
{
TableData td;
tablesFacility.addTable((SecurityContext) any, (ImageData) any, anyString, td = withCapture());
tableEquals(table, td, WellSampleData.class);
}
};
}
Aggregations