Skip to content

Instantly share code, notes, and snippets.

View malintha's full-sized avatar
🐢

Malintha Fernando malintha

🐢
View GitHub Profile
package org.wso2.iot.integration.SimpleIOTTest;
import junit.framework.Assert;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.net.util.Base64;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Factory;
import org.testng.annotations.Test;
import org.wso2.carbon.automation.engine.context.TestUserMode;
import org.wso2.carbon.automation.engine.context.beans.User;
<test name="Sample-Test" preserve-order="true" parallel="false">
<classes>
<class name="org.wso2.iot.integration.SimpleIOTTest.SimpleIOTTest"/>
</classes>
</test>
#include <iostream>
#include <stdio.h>
using namespace std;
struct node {
int key;
node *parent;
node *left;
node *right;
var name;
var hps = require('/extensions/app/greg-publisher-defaults/themes/default/helpers/view-asset.js');
var that = this;
/*
In order to inherit all variables in the default helper
*/
for (name in hps) {
if (hps.hasOwnProperty(name)) {
that[name] = hps[name];
<field type="text-area" required="false">
<name>Department</name>
</field></div>
<div>
{{#if this.attributes.overview_<wbr />department}}
<div class="col-lg-12 divrow">
<div class="col-lg-2">{{t "Department"}}</div>
<div class="col-lg-10">{{this.<wbr />attributes.overview_<wbr />department}}</div>
</div>
{{/if}}
<?xml version="1.0"?>
<artifactType type="application/vnd.wso2-inventory+xml" shortName="inventory" singularLabel="Inventory" pluralLabel="Inventories"
hasNamespace="false" iconSet="10">
<storagePath>/inventory/@{overview_supplier}/@{overview_item}/@{overview_date}</storagePath>
<nameAttribute>overview_supplier</nameAttribute>
<ui>
<list>
<column name="Supplier">
<data type="path" value="overview_supplier" href="@{storagePath}"/>
</column>
/**
* Created by malintha on 9/25/14.
*/
public class MyHandler extends AbstractHandler {
private static Log audit = LogFactory.getLog(MyHandler.class);
@Override
public InvocationResponse invoke(MessageContext messageContext) throws AxisFault {
SOAPEnvelope mes = messageContext.getEnvelope();
SOAPHeader mesh = mes.getHeader();
/**
* Created by malintha on 9/25/14.
*/
public class LoggingModule implements Module {
public void init(ConfigurationContext configurationContext, AxisModule axisModule) throws AxisFault {}
public void engageNotify(AxisDescription axisDescription) throws AxisFault {}
public void shutdown(ConfigurationContext configurationContext) throws AxisFault {}
public class LoggingHandler extends AbstractHandler implements Handler {
private static final Log log = LogFactory.getLog(LogHandler.class);
private String name;
public String getName() {
return name;
}
public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
log.info(msgContext.getEnvelope().toString());