New Test Run using REST API - ALM 14 - java

I am trying to update the test results using REST API for ALM Saas
http://targetserver:targetport/qcbin/rest/domains/ALMDomain/projects/ALMProject/runs - EndPoint
Below are the body(payload):
<Entity Type='run'>
<Fields>
<Field Name='name'><Value>testnamegoeshere</Value></Field>
<Field Name='test-instance'><Value>1</Value></Field>
<Field Name='cycle-id'><Value>cycleidgoeshere</Value></Field>
<Field Name='test-id'><Value>testidgoeshere</Value></Field>
<Field Name='subtype-id'><Value>hp.qc.run.MANUAL</Value></Field>
<Field Name='status'><Value>Failed</Value></Field>
<Field Name='owner'><Value>testownergoeshere</Value></Field>
</Fields>
</Entity>
Getting response is like this.
false
here is my question: I need to know if am passing correct parameter or not and please let me know, is API got changed or anything else??

URL you mentioned is for creating a new run. You have mentioned that you are going to update the test run. For that you need to append /{id} (id of run). Make sure you are making put call and not post for this operation.
Also probably you wont require to give cycle-id, test-id, test-instance details with update because those are now constants. If you are creating new run then it is mandatory.
Hope this helps you to solve.

Related

JPOS remove zero padding IFB_NUMERIC

the problem is in the fourth field (and maybe 11):
<field id="4" value="000000010000"/>
it should be:
<field id="4" value="10000"/>
I used IFB_NUMERIC isoFieldPackager for this field. Does correct isofieldpackager exist for my case? Or I need to some other decision...
thanks in advance!
jPOS doesn't perform content manipulation like unpadding. The packager just put what it reads and is the responsibility of the higher-level logic to make the unpadding.
You can use ISOUtil.zeroUnpad(m.getString(4)) method for that.

How give submit on selecting drop down in moqui Framework?

I've implemented an application using Moqui Framework.I have form-single like this
<transition name="languagesUptade">
<service-call name="org.moqui.impl.UserServices.update#searchLanguage"
in-map="[locale:locale]"/>
<default-response url="."/></transition>
<form-single name="languageslist" map="languages" transition="languagesUptade">
<field name="locale" columnSize="col-sm-12"><default-field>
<drop-down allow-empty="false"><list-options list="localeStringList" key="${locale}" text="${locale} - ${name}"/></drop-down>
</default-field></field>
<field name="submitButton" columnSize="col-sm-12"><default-field title="Update"><submit/></default-field></field>
</form-single>
I am trying to remove field submit-button and i need get submitted on selecting drop down and it need to call the transition. How can i achieve that ?
Write some JavaScript to do it, and put it in a render-mode.text element. There is an example of this in the QuickSearch screen in HiveMind:
https://github.com/moqui/HiveMind/blob/master/screen/HiveMindRoot/dashboard/QuickSearch.xml

Lucene/Solr - Indexing publications/texts

I want to be able to search publications with facets. These documents will be annotated so I will upload the annotation to the solr instance. The annotation will have fields which are the terms in the document. Here is an example:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<add>
<doc>
<field name="Title">High Glucose Increases the Expression of Inflammatory Cytokine Genes in
Macrophages Through H3K9 Methyltransferase Mechanism.</field>
<field name="Cytokine">INTERFERON </field>
<field name="Cytokine">CYTOKINE </field>
<field name="Cytokine">CYTOKINE</field>
<field name="Cytokine">MEC</field>
<field name="Cytokine">EPA</field>
<field name="Cytokine">DIA</field>
<field name="Cytokine">FIC</field>
<field name="Cytokine">CYTOKINES</field>
<field name="Cytokine">INTERLEUKIN-6 </field>
<field name="Cytokine">INTERLEUKIN</field>
<field name="Cytokine">IL-12P40</field>
<field name="Cytokine">IL-12</field>
<field name="Cytokine">IL-1</field>
<field name="Cytokine">P40</field>
<field name="Cytokine">MACROPHAGE INFLAMMATORY PROTEIN-1</field>
<field name="Cytokine">MACROPHAGE INFLAMMATORY PROTEIN</field>
</doc>
</add>
These terms are all from a Cytokine ontology.
I want be able to set the facet as Cytokine, then select the term and find all of the documents that contain the selected term.
Here is the catch:
I want to be able to store the location of said term found in the
document (it can show up in multiple locations. So I can highlight
later). All of these locations are stored in the annotation.
I want to be able to select one of the terms from the facet and also
bring up documents that contains that terms synonyms but not upload it as a term in the facet (or it being distinguished as a synonym some how (like subcategory)). e.g. automobile
and car
I want to be able to do a cross search e.g. find documents that
contain MEC and EPA.
I have a list of terms I do want to index and want to search the
documents by. These terms have synonyms which I have entered into the
synonyms.txt file.
Also When a term shows up multiple times in the document the annotation has multiple instances of this term with different locations, how should I handle this? Will solr automatically deal with duplication and not give me the documents twice?
One more thing: What about uploading the entire publication to solr, and indexing it on the predefined list of terms?
I understand that, you have synonyms and a search term should be verified directly and also with synonyms and return the results. Let me know if I got it.
If you have all the synonyms while indexing, then you can index them as multi valued field and search on that field.
Faceting is for searching, where the results are grouped.

How to give weight to the specific field?

I am using Apache Solr for indexing and searching. I have to give weight to the specific field so that If I make search then search has to perform on that field which is most weighted and then on others.
I am using SolrJ, Java, and GWT for development.
To boost at index time you need to supply a boost statement in your update doc.
<add overwrite="true">
<doc boost="2.0">
<field name="id">1234</field>
<field name="type">type1</type>
</doc>
<doc>
<field name="id">2345</field>
<field name="type" boost="0.5">type2</type>
</doc>
</add>
The above example demonstrates how to boost a complete document (elevation) as well as how to boost a specific field.
For more documentation look here and here
Using the dismax (or edismax) query handler, you can set the qf (Query Fields) parameter to assign boosts to different fields. It uses this format:
field1^boost_val field2^boost_val....etc.
There are other good parameters to help you control your result ranking as well.
http://wiki.apache.org/solr/ExtendedDisMax

JAXB multiple mappings for attribute

I'm just changing design errors made in the past, but want to keep backwards compatibility of my software. For this I would need some way to map two flavors of an xml file into one java bean. Can this be done using two JAXB annotations on one attribute/element? I understand the marshalling would be ambiguous, but the unmarshalling could work. Is there some nice way of doing this?
p.s.: I don't care about marshalling.
You can map twice:
the first time using annotations
the second time using XML resources.
Or just two XML mappings instead of annotations.
For XML resource mappings, there's a number of options:
Annox: http://confluence.highsource.org/display/ANX/JAXB+User+Guide (I wrote it so it comes first :))
EclipseLink Moxy: http://eclipse.org/eclipselink/moxy.php
JAXB Intoductions: http://community.jboss.org/wiki/JAXBIntroductions
With Annox you can easily map twice using XML mapping resources with different extensions like MyClass.ann1.xml or MyClass.ann2.xml. (It's MyClass.ann.xml per default, but the adjustment is trivial.)
Here's a sample of what mappings look like:
<class xmlns="http://annox.dev.java.net" xmlns:annox="http://annox.dev.java.net" xmlns:jaxb="http://annox.dev.java.net/javax.xml.bind.annotation">
<jaxb:XmlAccessorType value="FIELD"/>
<jaxb:XmlType name="" propOrder="productName quantity usPrice comment shipDate"/>
<field name="productName">
<jaxb:XmlElement required="true"/>
</field>
<field name="usPrice">
<jaxb:XmlElement name="USPrice" required="true"/>
</field>
<field name="shipDate">
<jaxb:XmlSchemaType name="date"/>
</field>
<field name="partNum">
<jaxb:XmlAttribute required="true"/>
</field>
</class>

Categories

Resources