![JAR search and dependency download from the Maven repository](/logo.png)
io.toast.tk.runtime.ActionItemDescriptionCollector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of toast-tk-runtime Show documentation
Show all versions of toast-tk-runtime Show documentation
Toast Toolkit Runtime Module contains covers:
- Test Source Adapters
- Test Parsing
- Test Execution
- Test Report generation
The newest version!
package io.toast.tk.runtime;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.io.IOUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import io.toast.tk.runtime.bean.ActionItem;
public class ActionItemDescriptionCollector {
private static final Logger LOG = LogManager.getLogger(ActionItemDescriptionCollector.class);
@SuppressWarnings("unchecked")
public static List initActionItems() {
final List actionItems = new ArrayList<>();
try(final InputStream actionItemsSource = ActionItemDescriptionCollector.class.getClassLoader().getResourceAsStream("type_descriptor.json");) {
final String json = IOUtils.toString(actionItemsSource, "UTF-8");
final Gson g = new Gson();
final Type typeOfT = new TypeToken>() {/*NOOP*/}.getType();
actionItems.addAll((List) g.fromJson(json, typeOfT));
}
catch(final IOException e) {
LOG.error(e.getMessage(), e);
}
return actionItems;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy