Skip to content

Instantly share code, notes, and snippets.

<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:switchyard-config:switchyard:1.0"
xmlns:swyd="urn:switchyard-config:switchyard:1.0"
xmlns:sca="http://docs.oasis-open.org/ns/opencsa/sca/200912"
elementFormDefault="qualified">
<import namespace="http://docs.oasis-open.org/ns/opencsa/sca/200912"
schemaLocation="sca-1.1-cd06.xsd"/>
<element name="switchyard" type="swyd:SwitchYardType"/>
public class CDIBeanManagerJNDIDeployer extends AbstractRealDeployer {
private static Logger _logger = Logger.getLogger(CDIBeanManagerJNDIDeployer.class);
private static final String SWITCHYARD_SUB_CONTEXT = "switchyard";
private NameSpaces _nameSpaces;
private Context _beanManagerContext;
/**
* Public default constructor.
*/
<env:unEdifact xmlns:env="urn:org.milyn.edi.unedifact.v41">
<env:UNB xmlns:env="urn:org.milyn.edi.unedifact.v41">
<env:syntaxIdentifier>
<env:id>UNOA</env:id>
<env:versionNum>4</env:versionNum>
</env:syntaxIdentifier>
<env:sender>
<env:id>LOCK</env:id>
<env:codeQualifier>02</env:codeQualifier>
</env:sender>
<xxx>replace this Bard</xxx>
public static void testModel(String ediMappingModelFile, String ediMessageFile, String factoryClassName, boolean dump) throws EDIConfigurationException, IOException, SAXException, IllegalNameException {
StackTraceElement[] thisStack = Thread.currentThread().getStackTrace();
Class callerClass = null;
for(int i = 0; i < thisStack.length; i++) {
if(thisStack[i].getClassName().equals(EJCTestUtil.class.getName())) {
try {
callerClass = Class.forName(thisStack[i + 1].getClassName());
} catch (ClassNotFoundException e) {
e.printStackTrace();
@tfennelly
tfennelly / VFSPackageScanClassResolver
Created May 31, 2011 06:01
VFSPackageScanClassResolver
/*
* JBoss, Home of Professional Open Source
* Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @authors tag. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
* *
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
public class QuickstartInvoker {
private Map<String, Object> _headers = new HashMap<String, Object>();
private String _endpointURL;
private String _responseURL;
private long _timeout = 10000;
/**
* Create a Synchronous invoker.
* @param endpointURL The target endpoint (URL).
@tfennelly
tfennelly / service.json
Created July 12, 2011 16:14
service.json
{
"namespace" : "http://acme/",
"operations":
{
"createOrder":
{
"in": "{http://acme/}order",
"out": "{http://acme/}orderAck",
"fault": "{http://acme/}orderFault",
@tfennelly
tfennelly / 01_OldWay.java
Created July 21, 2011 12:44
SwitchYard Testing
@SwitchYardTestCaseConfig(mixins = CDIMixIn.class)
public class BasicInOutTest extends SwitchYardTestCase {
@Test
public void test_New_Way() {
Message responseMsg = newInvoker("BasicOrderManagementService.createOrder").
sendInOut(new OrderRequest("D123", "ABCD"));
OrderResponse response = (OrderResponse) responseMsg.getContent();
@tfennelly
tfennelly / 01_old_way.java
Created July 21, 2011 13:08
Camel testing
public class SwitchyardComponentTest extends SwitchYardTestCase {
private String _serviceName = "testServiceName";
private CamelContext _camelContext;
private ProducerTemplate _template;
@Before
public void setup() throws Exception {
_camelContext = new DefaultCamelContext();
_camelContext.addRoutes(createRouteBuilder());
_template = _camelContext.createProducerTemplate();