This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
targetNamespace="http://com.yamanyar.ish" | |
xmlns="http://com.yamanyar.ish"> | |
<xs:element name="TransactionalInfo"> | |
<xs:complexType> | |
... |
This file contains hidden or 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
static XmlOptions opts; | |
static { | |
opts = new XmlOptions(); | |
opts.setUseDefaultNamespace(); | |
} |
This file contains hidden or 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
//... | |
TransactionalInformationsDocument transactionalInformationsDocument = TransactionalInformationsDocument.Factory.newInstance(); | |
final TransactionalInformationsDocument.TransactionalInformations transactionalInformations = transactionalInformationsDocument.addNewTransactionalInformations(); | |
//use requierd locale and shop id | |
transactionalInformations.setLocale(requiredLocale.getName()); | |
transactionalInformations.setShopId(requiredShopId); | |
final TypeDocument.Type type = transactionalInformations.addNewType(); | |
type.setType(sourceType.toString()); |
This file contains hidden or 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 org.apache.xmlbeans.XmlException; | |
import org.junit.Ignore; | |
import com.yamanyar.ish.TransactionalInfoDocument; | |
import java.io.File; | |
import java.io.IOException; | |
import static junit.framework.Assert.assertEquals; | |
/** |
This file contains hidden or 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
<build> | |
<plugins> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>xmlbeans-maven-plugin</artifactId> | |
<version>2.2.0</version> | |
<executions> | |
<execution> | |
<goals> | |
<goal>xmlbeans</goal> |
This file contains hidden or 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
<dependencies> | |
<dependency> | |
<groupId>junit</groupId> | |
<artifactId>junit</artifactId> | |
<version>4.7</version> | |
<scope>test</scope> | |
</dependency> | |
<dependency> | |
<groupId>org.apache.xmlbeans</groupId> | |
<artifactId>xmlbeans</artifactId> |
This file contains hidden or 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
//... lines of codes... templateService is mocked... | |
//here is regular expectation; we know the parameter that will be passed and we are verifying it | |
expect(nodeService.getProperties(fakeChildNodeRef2)).andReturn(new HashMap()); | |
//create a capturer; which will capture a map item | |
Capture<Map> capturer = new Capture<Map>(); | |
//write your expectaion again; this time we want to have a reference to whatever passed to | |
//our method processTemplate in mocked item templateService | |
expect(templateService.processTemplate(isA(String.class), and(isA(Map.class), capture(capturer)))).andReturn("fake"); | |
//replay; let the action begin | |
replay(nodeService, templateService); |
This file contains hidden or 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
<configuration> | |
<if condition='"prd".equals(property("environment")) | |
|| "stg".equals(property("environment"))'> | |
<then> | |
<property name="APPLINK_LOG_LEVEL" value="warn"/> | |
</then> | |
<else> | |
<property name="APPLINK_LOG_LEVEL" value="debug"/> | |
</else> |
This file contains hidden or 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
protected String encrypt(String token) throws Exception { | |
// Instantiate the cipher | |
final SecretKeySpec key = new SecretKeySpec("oldhouse".getBytes("ISO-8859-1"), "DES"); | |
AlgorithmParameterSpec paramSpec = new IvParameterSpec("houseold".getBytes()); | |
Cipher cipher = Cipher.getInstance("DES/CFB8/NoPadding"); | |
cipher.init(Cipher.ENCRYPT_MODE, key, paramSpec); | |
byte[] binaryData = cipher.doFinal(token.getBytes("ISO-8859-1")); | |
return new String(org.apache.commons.codec.binary.Base64.encodeBase64(binaryData), "ISO-8859-1"); |
This file contains hidden or 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
#!/usr/bin/python | |
# Rewrite URL Script for Secure Web Issue | |
# author: Kaan Yamanyar | |
from Crypto.Cipher import DES | |
from datetime import datetime, timedelta | |
import sys | |
import re | |
import base64 | |
def parseToken(str): |