This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------ solr index issue ------- | |
<target name="setupSolr" description="Creates the SOLR standalone setup by copying the SOLR setup from Pangaea2 source code."> | |
<copy todir="${local.solr.setup.dir.path}"> | |
<fileset dir="${source.pangaea2.solr.base.dir.path}"/> | |
</copy> | |
</target> | |
https://wiki.hybris.com/pages/viewpage.action?pageId=308361467 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.URLEncoder; | |
import javax.crypto.Mac; | |
import javax.crypto.spec.SecretKeySpec; | |
import org.apache.commons.codec.binary.Base64; | |
/** | |
* Sign an unsigned URL. | |
* @param path The URL-encoded path including the leading slash. E.g. "/1.0/account/1/2". | |
* @param key The access key id of the secret access key to use for creating the | |
* signature. | |
* @param expires The time in seconds from the Epoch when the signature expires. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company; | |
/* | |
Simple TLS1.2 HTTP client for use in java 1.7 | |
Uses Apache libraries: | |
httpclient-4.5.2.jar | |
httpcore-4.4.5.jar | |
commons-codec-1.10.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* For a chosen REST Service POST request: | |
* | |
* -> Manually specify a new request body | |
* -> Update the request of ALL (POST) REST TestRequest TestSteps contained in ALL TestCases of a chosen TestSuite | |
*/ | |
//Set TestSuite to update here: | |
def testSuiteNameToUpdate = "TestSuite 2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static com.jayway.jsonpath.JsonPath.parse | |
def json = '''{"quote": { | |
"id": 12345, | |
"am ount": 100, | |
"links": [ | |
{ | |
"rel": "self", | |
"href": "http://localhost:8080/quote/777" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Project, TestSuite & TestCase properties are actually of type String, but you can still increment them in a variety of ways e.g. by parsing the property value into a int type in a Groovy TestStep: | |
def ratingsDown = Integer.parseInt(context.expand('${#TestCase#ratings_down}')) | |
log.info ratingsDown+1 | |
(if ratings_down was 2, this would log 3 - note without the Integer.parseInt(...), this would output 21) | |
(assumes the propety ratings_down is against a TestCase object, hence the #TestCase# before the property) | |
To add on insert into a request: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo -u root -s | |
(switch to root user, don't prompt for password) | |
[Good way to handle linux java packaging and assignment] | |
Check versions | |
update-java-alternatives -l | |
this updates & sets the sym links for all java commands: | |
sudo update-java-alternatives -s java-7-oracle |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Select only products which have at least 1 variant with stock >0 | |
SELECT {p.PK} FROM {Product AS p} WHERE {p.varianttype} IS NOT NULL and | |
exists ({{SELECT {v.PK} FROM {VariantProduct AS v JOIN stocklevel AS s ON {v.code}={s.productCode}} WHERE {v.baseProduct} = {p.PK} AND {s.available} > 0}}) | |
#Select available stock for a product or variant | |
select {sl.available} from {stocklevel as sl} where {sl.productCode}="000001" | |
SELECT count({pk}) FROM {Customer} where {uid} not LIKE '%anonymous%' and {type}='8796099280987' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exporting: | |
insert_update ServicePlan; code[unique=true]; subscriptionTerm(id);supercategories[code] | |
"#% impex.exportItems( ""ServicePlan"" , true );" | |
insert_update ServicePlan; code[unique=true]; subscriptionTerm(id);supercategories[code] | |
"#% impex.exportItemsFlexibleSearch(""select {pk} from {ServicePlan} where {catalog}=8796093088344"");" | |
Remove all items of a type: |