© opitz consulting gmbh 2010seite 1soa testing konstruktionsraster 20mm 4mm opitz consulting...

18
© OPITZ CONSULTING GmbH 2010 Seite 1 SOA Testing <Bild oder OC- Tätigkeitsfeld- Logo> Tobias Bosch Technical Architect Mitglied SOA Competence Center OPITZ CONSULTING München GmbH SOA Testing

Upload: jobst-grosse

Post on 06-Apr-2016

219 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 1SOA Testing

<Bild oder OC-Tätigkeitsfeld-Logo>Tobias BoschTechnical ArchitectMitglied SOA Competence Center

OPITZ CONSULTING München GmbH

SOA Testing

Page 2: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 2SOA Testing

Was ist SOA? Business-IT Alignment Flexibilität

Page 3: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 3SOA Testing

Warum Testen in einer SOA? Softwaretest: Fehler finden Test-Stufen

Unittests Integrationstests Systemtests

SOA Umgebungen Verteiltes System: Lokalisierung der Fehlerursache Flexibilität: Vermeidung von Nebenwirkungen einer Änderung Hohe Qualitätsanforderungen

Page 4: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 4SOA Testing

Unittests in der Oracle SOA Suite (1) Transformationen: XQuery, XSLT JUnit-Test

1 Reader strm = new FileReader(xq);      2 PreparedXQuery xquery =  new XQueryContext().

prepareXQuery(strm);                  

3 xquery.setNode( new QName("var1"), var1Node);

4 XMLSequence seq = xquery.executeQuery(); 5 seq.next(); 6 XMLNode res = seq.getCurrentItem().getNode();

Page 5: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 5SOA Testing

Unittests in der Oracle SOA Suite (2) Orchestrierung: BPMN, BPEL, OSB Flows Test Suites for Composite Applications

Invoke

Assert & Reply

Assert

Page 6: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 6SOA Testing

Systemtests in der SOA-Suite

Service1 Service2

Service4Service3

Invoke

Assert

End-to-End

Page 7: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 7SOA Testing

Integrationstests in der SOA-Suite Testfallabhängige Mock-Services

Service1 Service2

Service4Service3

InvokeMock

Assert

Assert & Reply

Page 8: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 8SOA Testing

Zwischenstand Unit-Tests:

XQuery, XSLT: Via API und JUnit Composites: Test Suite for Composite Applications OSB:

Integrationstests: Systemtests / End-to-End Tests:

Dritthersteller

Fehlt

Fehlt

Page 9: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 9SOA Testing

Integrationstests mit dem OSB (1) Mock-Services und der OSB

Service1 Service2

Service4Service3

OSB OSB OSB

OSB OSB

Page 10: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 10SOA Testing

Aufruf von Services: Dynamic Routing

Integrationstests mit dem OSB (2)

<ctx:route> <ctx:service isProxy="true">

MyProject/Service1 </ctx:service> <ctx:operation>

Operation1 </ctx:operation></ctx:route>

Page 11: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 11SOA Testing

Business-Services: Binding und Protokoll

Integrationstests mit dem OSB (3)

<xml-fragment> <ser:coreEntry isProxy="false" isEnabled="true"> <ser:binding type="abstract XML"/> </ser:coreEntry> <ser:endpointConfig> <tran:provider-id>file</tran:provider-id> <tran:inbound>false</tran:inbound> <tran:URI> <env:value>file:///c:/osbtest/</env:value> </tran:URI> </ser:endpointConfig></xml-fragment>

Page 12: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 12SOA Testing

Service1 JUnit-Test

Integrationstests mit dem OSB (4)

Reply

Consumer1

Provider1

OSB

Configuration API

Invokerservice

Service1 Provider1 MockHTTP

JMX

HTTP

Any

Any

Invoke

Change BizServices

Assert

Page 13: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 13SOA Testing

Integrationstests mit dem OSB (5)

1 @Test2 public void testService1() {3 mockBusinessService("App/Provider1", new Delegate() {4 public String serviceCallReceived(5 String serviceName, String req) throws Exception {6 recvReq = req;7 return "<testresp>hallo</testresp>";8 }9 });10 String recvResp = invokeProxyService(11 "App/Service1",null,12 "<testreq>hallo</testrq>");13 assertEquals("<testreq>hallo</testreq>",recvReq);14 assertEquals("<testresp>hallo</testresp>",recvResp);15 }

Page 14: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 14SOA Testing

Take aways Softwaretests sind Pflicht in einer SOA Unit-Tests:

XQuery, XSLT: Via API und JUnit Composites: Test Suite for Composite Applications OSB:

Integrationstests: Systemtests / End-to-End Tests:

Dritthersteller

NEU (OC)

NEU (OC)

NEU (OC)

Page 15: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 15SOA Testing

Fragen und Antworten

Page 16: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 16SOA Testing

OSB JMX-API

1 SessionManagementMBean sm = …2 ALSBConfigurationMBean cb = …3 sm.createSession("MySession1");4 Ref projRef = Refs.makeProjectRef("proj");5 Ref inputRef = Refs.makeBusinessSvcRef(projRef,

"MyBizService");6 cb.clone(inputRef, saveRef);7 byte[] data = cb.export(inputRefs, false, null); // Change data…8 cb.uploadJarFile(data);9 ALSBImportPlan plan = cb.getImportJarInfo().getDefaultImportPlan();10 plan.setPreserveExistingEnvValues(false);11 cb.importUploaded(plan);12 sm.activateSession("MySession1", "MyComment");

Page 17: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 17SOA Testing

Oracle OSB vs. Mediator Mediator: früher Oracle ESB

Virtualisierung zwischen Komponenten eines Composites Komponente in einem SCA-Deployment

OSB: früher BEA Aqualogic Service Bus (ALSB) Kommunikation nach außen und zwischen Applikationen/Composites Load-Balancing Message-Throtteling Split/Join Primärer Servicebus

Page 18: © OPITZ CONSULTING GmbH 2010Seite 1SOA Testing Konstruktionsraster 20mm 4mm OPITZ CONSULTING Vorlage Powerpoint 2009; Version 1.0; 02.09.2009; TGA, MVI,

© OPITZ CONSULTING GmbH 2010 Seite 18SOA Testing

Dynamische Konfiguration auch für Composites

Service1 JUnit-Test

Automatische Tests für Composites

Assert&Reply

Consumer1

Provider1

SOA

Configuration API

Service1 Provider1 MockHTTP

JMX

HTTPAny

Any

Invoke

Prepare

Assert