Search in sources :

Example 96 with Namespace

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);
    }
}
Also used : Element(org.jdom2.Element) Namespace(org.jdom2.Namespace)

Example 97 with Namespace

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);
}
Also used : ProcessModel(de.hpi.bpt.scylla.model.process.ProcessModel) Element(org.jdom2.Element) Namespace(org.jdom2.Namespace)

Example 98 with Namespace

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);
}
Also used : PodList(io.kubernetes.client.proto.V1.PodList) Pod(io.kubernetes.client.proto.V1.Pod) ApiClient(io.kubernetes.client.openapi.ApiClient) Namespace(io.kubernetes.client.proto.V1.Namespace) ProtoClient(io.kubernetes.client.ProtoClient)

Example 99 with Namespace

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);
}
Also used : Element(org.jdom2.Element) Namespace(org.jdom2.Namespace)

Example 100 with Namespace

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);
}
Also used : Element(org.jdom2.Element) Namespace(org.jdom2.Namespace)

Aggregations

Namespace (org.jdom2.Namespace)166 Element (org.jdom2.Element)137 IOException (java.io.IOException)40 Document (org.jdom2.Document)31 ArrayList (java.util.ArrayList)27 Attribute (org.jdom2.Attribute)25 List (java.util.List)22 HashMap (java.util.HashMap)21 XConfiguration (org.apache.oozie.util.XConfiguration)19 Configuration (org.apache.hadoop.conf.Configuration)15 JDOMException (org.jdom2.JDOMException)15 StringReader (java.io.StringReader)14 ActionExecutorException (org.apache.oozie.action.ActionExecutorException)14 Namespace.getNamespace (org.jdom2.Namespace.getNamespace)14 MigrationReport (com.mulesoft.tools.migration.step.category.MigrationReport)13 File (java.io.File)12 Map (java.util.Map)12 Path (org.apache.hadoop.fs.Path)12 SAXBuilder (org.jdom2.input.SAXBuilder)12 Path (java.nio.file.Path)11