Search in sources :

Example 66 with Namespace

use of com.google.cloud.servicedirectory.v1.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 67 with Namespace

use of com.google.cloud.servicedirectory.v1.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 68 with Namespace

use of com.google.cloud.servicedirectory.v1.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)

Example 69 with Namespace

use of com.google.cloud.servicedirectory.v1.Namespace in project JMRI by JMRI.

the class LocaleSelectorTest method testFindDefault.

public void testFindDefault() {
    LocaleSelector.suffixes = new String[] { "kl_KL", "kl" };
    Namespace xml = Namespace.XML_NAMESPACE;
    Element el = new Element("foo").setAttribute("temp", "a").addContent(new Element("temp").setAttribute("lang", "hh", xml).addContent("b"));
    String result = LocaleSelector.getAttribute(el, "temp");
    Assert.assertEquals("find default", "a", result);
}
Also used : Element(org.jdom2.Element) Namespace(org.jdom2.Namespace)

Example 70 with Namespace

use of com.google.cloud.servicedirectory.v1.Namespace in project qpp-conversion-tool by CMSgov.

the class AciNumeratorDenominatorDecoderTest method testInternalDecode.

@Test
void testInternalDecode() {
    // set-up
    Namespace rootns = Namespace.getNamespace("urn:hl7-org:v3");
    Namespace ns = Namespace.getNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
    Element element = new Element("organizer", rootns);
    Element templateIdElement = new Element("templateId", rootns).setAttribute("root", "2.16.840.1.113883.10.20.27.3.28");
    Element referenceElement = new Element("reference", rootns);
    Element externalDocumentElement = new Element("externalDocument", rootns);
    Element idElement = new Element("id", rootns).setAttribute("extension", MEASURE_ID);
    externalDocumentElement.addContent(idElement);
    referenceElement.addContent(externalDocumentElement);
    element.addContent(templateIdElement);
    element.addContent(referenceElement);
    element.addNamespaceDeclaration(ns);
    Node thisNode = new Node();
    AciNumeratorDenominatorDecoder objectUnderTest = new AciNumeratorDenominatorDecoder(new Context());
    objectUnderTest.setNamespace(element.getNamespace());
    // execute
    objectUnderTest.decode(element, thisNode);
    // assert
    assertThat(thisNode.getValue("measureId")).isEqualTo(MEASURE_ID);
}
Also used : Context(gov.cms.qpp.conversion.Context) Element(org.jdom2.Element) Node(gov.cms.qpp.conversion.model.Node) Namespace(org.jdom2.Namespace) Test(org.junit.jupiter.api.Test)

Aggregations

Namespace (org.jdom2.Namespace)105 Element (org.jdom2.Element)87 IOException (java.io.IOException)24 XConfiguration (org.apache.oozie.util.XConfiguration)19 ArrayList (java.util.ArrayList)16 Configuration (org.apache.hadoop.conf.Configuration)15 HashMap (java.util.HashMap)14 ActionExecutorException (org.apache.oozie.action.ActionExecutorException)14 StringReader (java.io.StringReader)13 List (java.util.List)13 Path (org.apache.hadoop.fs.Path)12 JDOMException (org.jdom2.JDOMException)10 ScyllaValidationException (de.hpi.bpt.scylla.exception.ScyllaValidationException)9 ProcessModel (de.hpi.bpt.scylla.model.process.ProcessModel)9 Attribute (org.jdom2.Attribute)9 Writer (java.io.Writer)8 RegistrationServiceClient (com.google.cloud.servicedirectory.v1.RegistrationServiceClient)7 Map (java.util.Map)7 Document (org.jdom2.Document)7 CoordinatorJobBean (org.apache.oozie.CoordinatorJobBean)6