use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project yakc by manusa.
the class CustomResourceV1IT method deleteNamespacedMountain.
@Test
@DisplayName("deleteNamespacedMountain, should delete existing Mountain")
void deleteNamespacedMountain() throws IOException {
// When
final Status result = KC.create(MountainsV1Api.class).deleteNamespacedMountain(mountainName, NAMESPACE).get();
// Then
assertThat(result).isNotNull().hasFieldOrPropertyWithValue("status", "Success");
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project yakc by manusa.
the class EventsV1ApiIT method deleteNamespacedEvent.
@Test
@DisplayName("deleteNamespacedEvent, should delete existing Event")
void deleteNamespacedEvent() throws IOException {
// When
final Status result = deleteEventForTest();
// Then
assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project yakc by manusa.
the class SecretIT method deleteNamespacedSecret.
@Test
@DisplayName("deleteNamespacedSecret, should delete existing Secret")
void deleteNamespacedSecret() throws IOException {
// When
final Status result = KC.create(CoreV1Api.class).deleteNamespacedSecret(secretName, NAMESPACE, DeleteOptions.builder().gracePeriodSeconds(1).build()).get();
// Then
assertThat(result).isNotNull().extracting(Status::getStatus).isEqualTo("Success");
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project koronavilkku-backend by THLfi.
the class DiagnosisKeyControllerDemoIT method assertStatus.
private void assertStatus(BatchId previous, List<BatchId> expected, boolean v2) throws Exception {
String statusUrl = v2 ? STATUS_URL_V2 : STATUS_URL;
Status status = new Status(expected, Optional.of(configService.getLatestAppConfig()), Optional.of(configService.getLatestExposureConfig()), Optional.of(configService.getLatestV2ExposureConfig()));
mockMvc.perform(get(statusUrl + previous)).andExpect(status().isOk()).andExpect(header().exists("Cache-Control")).andExpect(content().contentType(MediaType.APPLICATION_JSON)).andExpect(content().json(mapper.writeValueAsString(status)));
}
use of com.marcnuri.yakc.model.io.k8s.apimachinery.pkg.apis.meta.v1.Status in project atlas by lorenzleutgeb.
the class Run method run.
@Override
public void run() {
final var start = Instant.now();
Loader loader = Loader.atDefaultHome();
/*
try {
loader.autoload();
} catch (IOException e) {
throw new RuntimeException(e);
}*/
Program program;
try {
program = loader.load(fqns);
// program = loader.loadMatching(pattern);
} catch (IOException e) {
throw new RuntimeException(e);
}
if (name != null && !name.isBlank()) {
program.setName(name);
}
if (program.isEmpty()) {
System.out.println("Program to analyze is empty, nothing to do!");
System.exit(3);
}
program.normalize();
if (!program.infer()) {
return;
}
program.unshare(true);
program.analyzeSizes();
// log.info("Loaded definitions:");
// program.printAllSimpleSignaturesInOrder(System.out);
System.out.println("Output Directory: " + program.getBasePath().toAbsolutePath());
System.out.println();
Map<String, Path> tacticsMap = new HashMap<>();
// log.info(infer ? "Given for comparison:" : "Will check following types:");
log.info("Manual tactics disabled. All tactics will be automatically generated.");
System.out.println("Function Definitions:");
for (int i = 0; i < program.getOrder().size(); i++) {
final var stratum = program.getOrder().get(i);
for (var fqn : stratum) {
FunctionDefinition fd = program.getFunctionDefinitions().get(fqn);
if (tactics != null) {
var path = tactics.resolve(fd.getModuleName().replace(".", "/") + "/" + fd.getName() + ".txt");
if (Files.exists(path) && Files.isReadable(path)) {
tacticsMap.put(fd.getFullyQualifiedName(), path);
}
}
System.out.println(fd.getAnnotatedSignatureString());
// log.info("\tDependencies: " + fd.getOcurringFunctionsNonRecursive());
System.out.println("\tSource: " + fd.getBody().getSource().getRoot());
System.out.println("\tBound: " + fd.getAnnotatedSignature().getAnnotation().map(a -> a.getBounds(fd.treeLikeArguments().stream().map(IdentifierExpression::getName).toList())).orElse("?"));
if (tactics != null) {
final var p = tacticsMap.get(fd.getFullyQualifiedName());
if (p == null) {
System.out.println("\tTactic: n/a (will be automatically generated)");
} else {
System.out.println("\tTactic: " + p.toAbsolutePath());
}
}
}
}
System.out.println();
System.setProperty(Util.getPropertyName(Prover.class, "tickAst"), useTickAst.toString());
final var result = program.solve(new HashMap<>(), tacticsMap, infer, consistentModules, equalRanks, simpleAnnotations, !infer, Collections.emptySet());
final var stop = Instant.now();
System.out.println("Elapsed Walltime: " + Duration.between(start, stop));
System.out.println();
if (Status.UNSATISFIABLE.equals(result.getStatus())) {
System.out.println("UNSAT");
System.exit(1);
} else if (Status.UNKNOWN.equals(result.getStatus())) {
System.out.println("UNKNOWN");
System.exit(2);
} else if (Status.SATISFIABLE.equals(result.getStatus())) {
if (!infer) {
System.out.println("SAT");
System.out.println();
} else {
System.out.println("Results:");
program.printAllInferredAnnotationsAndBoundsInOrder(System.out);
System.out.println();
}
} else {
throw new RuntimeException("encountered unknown status");
}
/*
if (json != null) {
JsonObjectBuilder builder = Json.createObjectBuilder();
builder.add("result", program.inferredSignaturesToJson());
builder.add("duration", Json.createValue(Duration.between(start, stop).toString()));
JsonObjectBuilder z3ObjectBuilder = Json.createObjectBuilder();
z3ObjectBuilder.add("status", Json.createValue(result.getStatus().toString()));
JsonObjectBuilder z3StatisticsBuilder = Json.createObjectBuilder();
result.getStatistics().forEach(z3StatisticsBuilder::add);
z3ObjectBuilder.add("statistics", z3StatisticsBuilder.build());
if (result.getSmtFile().isPresent()) {
z3ObjectBuilder.add("file", Json.createValue(result.getSmtFile().get().toString()));
}
builder.add("z3", z3ObjectBuilder.build());
log.info("Writing JSON output to {}", json);
try (final var out = output(json)) {
Json.createWriter(out).writeObject(builder.build());
} catch (IOException ioException) {
log.error("Failed to write JSON output.", ioException);
}
}
*/
// System.exit(result.toExitCode());
System.exit(0);
}
Aggregations