use of io.fabric8.arquillian.kubernetes.log.Logger in project docker-maven-plugin by fabric8io.
the class LogMatchCallbackTest method matchingMultipleLinesSucceeds.
@Test(expected = LogCallback.DoneException.class)
public void matchingMultipleLinesSucceeds() throws Exception {
final String patterString = "(?s)ready to accept connections.*\\n.*ready to accept connections";
final LogMatchCallback logMatchCallback = new LogMatchCallback(logger, callback, patterString);
new Expectations() {
{
callback.matched();
times = 1;
}
};
logMatchCallback.log(1, new Timestamp(), "LOG: database system is ready to accept connections");
logMatchCallback.log(1, new Timestamp(), "LOG: autovacuum launcher started");
logMatchCallback.log(1, new Timestamp(), "LOG: database system is shut down");
logMatchCallback.log(1, new Timestamp(), "LOG: database system is ready to accept connections");
}
use of io.fabric8.arquillian.kubernetes.log.Logger in project docker-maven-plugin by fabric8io.
the class DockerAssemblyManager method getAssemblyFiles.
/**
* Extract all files with a tracking archiver. These can be used to track changes in the filesystem and triggering
* a rebuild of the image if needed ('docker:watch')
*/
public AssemblyFiles getAssemblyFiles(String name, BuildImageConfiguration buildConfig, MojoParameters mojoParams, Logger log) throws InvalidAssemblerConfigurationException, ArchiveCreationException, AssemblyFormattingException, MojoExecutionException {
BuildDirs buildDirs = createBuildDirs(name, mojoParams);
AssemblyConfiguration assemblyConfig = buildConfig.getAssemblyConfiguration();
String assemblyName = assemblyConfig.getName();
DockerAssemblyConfigurationSource source = new DockerAssemblyConfigurationSource(mojoParams, buildDirs, assemblyConfig);
Assembly assembly = getAssemblyConfig(assemblyConfig, source);
synchronized (trackArchiver) {
MappingTrackArchiver ta = (MappingTrackArchiver) trackArchiver;
ta.init(log, assemblyName);
assembly.setId("tracker");
assemblyArchiver.createArchive(assembly, assemblyName, "track", source, false);
return ta.getAssemblyFiles(mojoParams.getSession());
}
}
use of io.fabric8.arquillian.kubernetes.log.Logger in project docker-maven-plugin by fabric8io.
the class EcrExtendedAuthTest method testClientClosedAndCredentialsDecoded.
@Test
public void testClientClosedAndCredentialsDecoded(@Mocked final CloseableHttpClient closeableHttpClient, @Mocked final CloseableHttpResponse closeableHttpResponse, @Mocked final StatusLine statusLine) throws IOException, MojoExecutionException {
final HttpEntity entity = new StringEntity("{\"authorizationData\": [{" + "\"authorizationToken\": \"QVdTOnBhc3N3b3Jk\"," + "\"expiresAt\": 1448878779.809," + "\"proxyEndpoint\": \"https://012345678910.dkr.ecr.eu-west-1.amazonaws.com\"}]}");
new Expectations() {
{
statusLine.getStatusCode();
result = 200;
closeableHttpResponse.getEntity();
result = entity;
}
};
EcrExtendedAuth eea = new EcrExtendedAuth(logger, "123456789012.dkr.ecr.eu-west-1.amazonaws.com") {
CloseableHttpClient createClient() {
return closeableHttpClient;
}
};
AuthConfig localCredentials = new AuthConfig("username", "password", null, null);
AuthConfig awsCredentials = eea.extendedAuth(localCredentials);
assertEquals("AWS", awsCredentials.getUsername());
assertEquals("password", awsCredentials.getPassword());
new Verifications() {
{
closeableHttpClient.close();
}
};
}
use of io.fabric8.arquillian.kubernetes.log.Logger in project docker-maven-plugin by fabric8io.
the class DockerAssemblyManagerTest method testCopyValidVerifyGivenDockerfile.
@Test
public void testCopyValidVerifyGivenDockerfile(@Injectable final Logger logger) throws IOException {
BuildImageConfiguration buildConfig = createBuildConfig();
assemblyManager.verifyGivenDockerfile(new File(getClass().getResource("/docker/Dockerfile_assembly_verify_copy_valid.test").getPath()), buildConfig, createInterpolator(buildConfig), logger);
new Verifications() {
{
logger.warn(anyString, (Object[]) any);
times = 0;
}
};
}
use of io.fabric8.arquillian.kubernetes.log.Logger in project docker-maven-plugin by fabric8io.
the class DockerAssemblyManagerTest method testCopyInvalidVerifyGivenDockerfile.
@Test
public void testCopyInvalidVerifyGivenDockerfile(@Injectable final Logger logger) throws IOException {
BuildImageConfiguration buildConfig = createBuildConfig();
assemblyManager.verifyGivenDockerfile(new File(getClass().getResource("/docker/Dockerfile_assembly_verify_copy_invalid.test").getPath()), buildConfig, createInterpolator(buildConfig), logger);
new Verifications() {
{
logger.warn(anyString, (Object[]) any);
times = 1;
}
};
}
Aggregations