use of org.osate.aadl2.Namespace in project scylla by bptlab.
the class SimulationTest method beforeParsingModels.
protected void beforeParsingModels(Element modelRoot) {
Namespace bpmnNamespace = modelRoot.getNamespace();
List<Element> processElements = modelRoot.getChildren("process", bpmnNamespace);
for (Element process : processElements) {
String id = process.getAttributeValue("id");
processRoots.put(id, process);
beforeParsingModels.getOrDefault(id, Collections.emptyList()).forEach(Runnable::run);
}
}
use of org.osate.aadl2.Namespace in project scylla by bptlab.
the class SimulationConfigurationParserPluggable method runPlugins.
public static void runPlugins(SimulationManager simEnvironment, SimulationConfiguration simulationConfiguration, Document document) throws ScyllaValidationException {
Namespace simNamespace = document.getRootElement().getNamespace();
List<Element> simElements = document.getRootElement().getChildren("simulationConfiguration", simNamespace);
Element sim = simElements.get(0);
String processRef = sim.getAttributeValue("processRef");
ProcessModel processModel = simEnvironment.getProcessModels().get(processRef);
runPluginsPerSC(simEnvironment, simulationConfiguration, processModel, sim);
}
use of org.osate.aadl2.Namespace in project java by kubernetes-client.
the class ProtoExample method main.
public static void main(String[] args) throws IOException, ApiException, InterruptedException {
ApiClient client = Config.defaultClient();
Configuration.setDefaultApiClient(client);
ProtoClient pc = new ProtoClient(client);
ObjectOrStatus<PodList> list = pc.list(PodList.newBuilder(), "/api/v1/namespaces/default/pods");
if (list.object.getItemsCount() > 0) {
Pod p = list.object.getItems(0);
System.out.println(p);
}
Namespace namespace = Namespace.newBuilder().setMetadata(ObjectMeta.newBuilder().setName("test").build()).build();
ObjectOrStatus<Namespace> ns = pc.create(namespace, "/api/v1/namespaces", "v1", "Namespace");
System.out.println(ns);
if (ns.object != null) {
namespace = ns.object.toBuilder().setSpec(NamespaceSpec.newBuilder().addFinalizers("test").build()).build();
// This is how you would update an object, but you can't actually
// update namespaces, so this returns a 405
ns = pc.update(namespace, "/api/v1/namespaces/test", "v1", "Namespace");
System.out.println(ns.status);
}
ns = pc.delete(Namespace.newBuilder(), "/api/v1/namespaces/test");
System.out.println(ns);
}
use of org.osate.aadl2.Namespace in project JMRI by JMRI.
the class LocaleSelectorTest method testFindPartialCodeNoAttribute.
public void testFindPartialCodeNoAttribute() {
LocaleSelector.suffixes = new String[] { "kl_KL", "kl" };
Namespace xml = Namespace.XML_NAMESPACE;
Element el = new Element("foo").addContent(new Element("temp").setAttribute("lang", "aa_BB", xml).addContent("b")).addContent(new Element("temp").setAttribute("lang", "kl", xml).addContent("c")).addContent(new Element("temp").setAttribute("lang", "kl_AA", xml).addContent("d"));
String result = LocaleSelector.getAttribute(el, "temp");
Assert.assertEquals("find default", "c", result);
}
use of org.osate.aadl2.Namespace in project JMRI by JMRI.
the class LocaleSelectorTest method testFindFullCodeNoAttribute.
public void testFindFullCodeNoAttribute() {
LocaleSelector.suffixes = new String[] { "kl_KL", "kl" };
Namespace xml = Namespace.XML_NAMESPACE;
Element el = new Element("foo").addContent(new Element("temp").setAttribute("lang", "aa_BB", xml).addContent("b")).addContent(new Element("temp").setAttribute("lang", "kl", xml).addContent("b")).addContent(new Element("temp").setAttribute("lang", "kl_KL", xml).addContent("c"));
String result = LocaleSelector.getAttribute(el, "temp");
Assert.assertEquals("find default", "c", result);
}
Aggregations