Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.List;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.MapperFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
Expand All @@ -45,6 +46,8 @@ public InfraBaseCommand(CamelJBangMain main) {
jsonMapper.registerModule(new JavaTimeModule());
jsonMapper.registerModule(new Jdk8Module());
jsonMapper.enable(SerializationFeature.INDENT_OUTPUT);
jsonMapper.configure(MapperFeature.SORT_PROPERTIES_ALPHABETICALLY, true);
jsonMapper.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
}

protected List<TestInfraService> getMetadata() throws IOException {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Comparator;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand All @@ -28,6 +29,7 @@
import com.github.freva.asciitable.AsciiTable;
import com.github.freva.asciitable.Column;
import com.github.freva.asciitable.HorizontalAlign;
import com.github.freva.asciitable.OverflowBehaviour;
import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain;
import org.apache.camel.util.json.Jsoner;
import picocli.CommandLine;
Expand All @@ -42,7 +44,7 @@ public InfraList(CamelJBangMain main) {

@Override
public Integer doCall() throws Exception {
Map<String, InfraServiceAlias> services = new HashMap<>();
Map<String, InfraServiceAlias> services = new LinkedHashMap<>();

List<TestInfraService> metadata = getMetadata();

Expand All @@ -63,12 +65,17 @@ public Integer doCall() throws Exception {
int width = 0;
for (Map.Entry<String, InfraServiceAlias> entry : services.entrySet()) {
width = Math.max(width, entry.getKey().length());

rows.add(new Row(
entry.getKey(),
String.join(", ", entry.getValue().getAliasImplementation()),
entry.getValue().getAliasImplementation()
.stream()
.sorted()
.collect(Collectors.joining(", ")),
entry.getValue().getDescription()));
}

rows.sort(Comparator.comparing(Row::alias));
if (jsonOutput) {
printer().println(
Jsoner.serialize(
Expand All @@ -81,7 +88,8 @@ public Integer doCall() throws Exception {
printer().println(AsciiTable.getTable(AsciiTable.NO_BORDERS, rows, Arrays.asList(
new Column().header("ALIAS").minWidth(width + 5).dataAlign(HorizontalAlign.LEFT)
.with(r -> r.alias()),
new Column().header("IMPLEMENTATION").dataAlign(HorizontalAlign.LEFT).with(r -> r.aliasImplementation()),
new Column().header("IMPLEMENTATION").maxWidth(40, OverflowBehaviour.NEWLINE)
.dataAlign(HorizontalAlign.LEFT).with(r -> r.aliasImplementation()),
new Column().header("DESCRIPTION").dataAlign(HorizontalAlign.LEFT).with(r -> r.description()))));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ private void run(String testService, String testServiceImplementation) throws Ex
HashMap properties = new HashMap();
for (Method method : serviceMethods) {
if (method.getParameterCount() == 0 && !method.getName().contains("registerProperties")) {
Object value = method.invoke(actualService);
properties.put(method.getName(), method.invoke(actualService));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void testPluginMessage(StdErr err) {
Assertions.assertEquals(5, lines.length, "5 lines for the error is expected but received " + lines.length);
Assertions.assertEquals("Unmatched argument at index 0: 'firstInvalid'", lines[0],
"First line mentioning unmatched argument");
Assertions.assertEquals("Did you mean: camel bind or camel plugin or camel version?", lines[1],
Assertions.assertEquals("Did you mean: camel bind or camel infra or camel plugin?", lines[1],
"Second line with suggestion in case it is a typo");
Assertions.assertEquals(
"Maybe a specific Camel JBang plugin must be installed? (Try camel plugin --help' for more information)",
Expand Down
11 changes: 0 additions & 11 deletions test-infra/camel-test-infra-all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,6 @@
<artifactId>camel-test-infra-openldap</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-infra-ignite</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-infra-hashicorp-vault</artifactId>
Expand Down Expand Up @@ -448,12 +443,6 @@
<artifactId>camel-test-infra-openldap</artifactId>
</dependency>
</fileSet>
<fileSet>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-test-infra-ignite</artifactId>
</dependency>
</fileSet>
<fileSet>
<dependency>
<groupId>org.apache.camel</groupId>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

@InfraService(service = ChatScriptInfraService.class,
description = "ChatBot Engine",
serviceAlias = { "chatscript", "chat-script" })
serviceAlias = "chat-script")
public class ChatScriptLocalContainerInfraService implements ChatScriptInfraService, ContainerService<GenericContainer> {
private static final Logger LOG = LoggerFactory.getLogger(ChatScriptLocalContainerInfraService.class);
private static final int SERVICE_PORT = 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

@InfraService(service = HiveMQInfraService.class,
description = "MQTT Platform HiveMQ",
serviceAlias = { "hivemq", "hive-mq" })
serviceAlias = "hive-mq")
public class LocalHiveMQInfraService extends AbstractLocalHiveMQService<LocalHiveMQInfraService> {

LocalHiveMQInfraService() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

@InfraService(service = HiveMQInfraService.class,
description = "MQTT Platform HiveMQ",
serviceAlias = { "hivemq", "hive-mq" },
serviceAlias = "hive-mq",
serviceImplementationAlias = "sparkplug")
public class LocalHiveMQSparkplugTCKInfraService extends AbstractLocalHiveMQService<LocalHiveMQSparkplugTCKInfraService> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.Collections;
import java.util.UUID;

import org.apache.camel.spi.annotations.InfraService;
import org.apache.ignite.Ignite;
import org.apache.ignite.IgniteCheckedException;
import org.apache.ignite.configuration.IgniteConfiguration;
Expand All @@ -32,9 +31,6 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@InfraService(service = IgniteInfraService.class,
description = "Distribuited Database Apache Ignite",
serviceAlias = { "ignite" })
public class IgniteEmbeddedInfraService implements IgniteInfraService {
private static final Logger LOG = LoggerFactory.getLogger(IgniteEmbeddedInfraService.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import javax.inject.Inject;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import org.apache.camel.maven.packaging.generics.PackagePluginUtils;
import org.apache.camel.spi.annotations.InfraService;
import org.apache.camel.tooling.util.FileUtil;
Expand Down Expand Up @@ -89,7 +90,9 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}

try {
String modelsAsJson = new ObjectMapper().writeValueAsString(models);
ObjectMapper mapper = new ObjectMapper();
mapper.enable(SerializationFeature.INDENT_OUTPUT);
String modelsAsJson = mapper.writeValueAsString(models);

if (generatedResourcesOutputDir == null) {
generatedResourcesOutputDir = new File(project.getBasedir(), "src/generated/java");
Expand Down