BizTalk Server General - Testing Schemas

This is Interesting: Free IT Magazines  
Home > Archive > BizTalk Server General > May 2004 > Testing Schemas





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Testing Schemas
Wor Tony

2004-05-30, 10:46 am

Hi all
I've got a BTS 2004 schema project which has a number of schema files within
it. I compose
message schemas (request/response) by importing other (supporting) schemas
from within
this project, these supporting schemas may also import other schemas from
the project.

This appears to work ok, but I'd like to be able to auto test these schema
files to ensure that
validation works as expected and that subsequent editing does not break
them.

Has anyone done this yet? If so how are you doing it?

Ideally I'd like to be able to use NUnit as this would fit with the rest of
the automated unit
testing that we are doing. I've attempted to do this by using NUnit and
creating a unit test
project which is a c# project that references the schema project and
Microsoft.XLANG.BaseTypes. In my code I create an instance of the type
exposed by
the schema using e.g.

req req = new req();
XmlSchema schemaToTest = req.CreateResolvedSchema();
XmlTextReader xtr = new XmlTextReader("<SomeXml/>, XmlNodeType.Document,
null);
XmlValidatingReader xvr = new XmlValidatingReader(xtr);
xvr.Schemas.Add(schemaToTest);
xvr.ValidationType = ValidationType.Schema;
xvr.ValidationEventHandler += new
ValidationEventHandler(ValidationCallbac
k);
while (xvr.Read()) {};

This kind of works but I've since read that the Microsoft.XLANG.BaseTypes
namespace
should not be used when coding. Is it ok to use these classes or should I
stay clear?

Cheers

AP
Nottingham - UK


Narasimhan Padmanabhan

2004-05-30, 10:46 am

How are you using the classes in the Microsoft.XLANG.BaseTypes
assembly?
This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team
--------------------
| >>Reply-To: "Wor Tony" <anthony@anthonypounder.SHOES.com>
| >>From: "Wor Tony" <anthony@anthonypounder.SHOES.com>
| >>Subject: Testing Schemas
| >>Date: Wed, 26 May 2004 21:59:20 +0100
| >>Lines: 46
| >>X-Priority: 3
| >>X-MSMail-Priority: Normal
| >>X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
| >>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| >>Message-ID: <eE$4SR2QEHA.1644@TK2MSFTNGP09.phx.gbl>
| >>Newsgroups: microsoft.public.biztalk.general
| >>NNTP-Posting-Host: cpc1-mfld2-4-0-cust46.nott.cable.ntl.com
213.104.68.46
| >>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftngxa0
6.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| >>Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:15685
| >>X-Tomcat-NG: microsoft.public.biztalk.general
| >>
| >>Hi all
| >>I've got a BTS 2004 schema project which has a number of schema files
within
| >>it. I compose
| >>message schemas (request/response) by importing other (supporting)
schemas
| >>from within
| >>this project, these supporting schemas may also import other schemas
from
| >>the project.
| >>
| >>This appears to work ok, but I'd like to be able to auto test these
schema
| >>files to ensure that
| >>validation works as expected and that subsequent editing does not break
| >>them.
| >>
| >>Has anyone done this yet? If so how are you doing it?
| >>
| >> Ideally I'd like to be able to use NUnit as this would fit with the
rest of
| >>the automated unit
| >>testing that we are doing. I've attempted to do this by using NUnit and
| >>creating a unit test
| >>project which is a c# project that references the schema project and
| >>Microsoft.XLANG.BaseTypes. In my code I create an instance of the type
| >>exposed by
| >>the schema using e.g.
| >>
| >> req req = new req();
| >> XmlSchema schemaToTest = req.CreateResolvedSchema();
| >> XmlTextReader xtr = new XmlTextReader("<SomeXml/>,
XmlNodeType.Document,
| >>null);
| >> XmlValidatingReader xvr = new XmlValidatingReader(xtr);
| >> xvr.Schemas.Add(schemaToTest);
| >> xvr.ValidationType = ValidationType.Schema;
| >> xvr.ValidationEventHandler += new
| >> ValidationEventHandler(ValidationCallbac
k);
| >> while (xvr.Read()) {};
| >>
| >>This kind of works but I've since read that the
Microsoft.XLANG.BaseTypes
| >>namespace
| >>should not be used when coding. Is it ok to use these classes or
should I
| >>stay clear?
| >>
| >>Cheers
| >>
| >>AP
| >>Nottingham - UK
| >>
| >>
| >>

Wor Tony

2004-05-30, 10:46 am

Narasimhan,
I'm using the classes indirectly, the types (that are defined by my schemas)
require Microsoft.XLANGs.BaseTypes.SchemaBase, see the error message if I
don't have
the assembly referenced in my unit test project:
c:\develop\schema\Schema.Canonical.UnitTests\bin\Debug\Schema.Canonical.dll
Referenced class 'msgs.ws.verify.v100.req' has base class or interface
'Microsoft.XLANGs.BaseTypes.SchemaBase' defined in an assembly that is not
referenced. You must add a reference to assembly
'Microsoft.XLANGs.BaseTypes'.

Cheers

AP

"Narasimhan Padmanabhan (MSFT)" <narpad@online.microsoft.com> wrote in
message news:sR2cVGEREHA.3804@cpmsftngxa10.phx.gbl...
> How are you using the classes in the Microsoft.XLANG.BaseTypes
> assembly?
> This posting is provided "AS IS" with no warranties, and confers no

rights.
>
> EBusiness Server Team
> --------------------
> | >>Reply-To: "Wor Tony" <anthony@anthonypounder.SHOES.com>
> | >>From: "Wor Tony" <anthony@anthonypounder.SHOES.com>
> | >>Subject: Testing Schemas
> | >>Date: Wed, 26 May 2004 21:59:20 +0100
> | >>Lines: 46
> | >>X-Priority: 3
> | >>X-MSMail-Priority: Normal
> | >>X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
> | >>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
> | >>Message-ID: <eE$4SR2QEHA.1644@TK2MSFTNGP09.phx.gbl>
> | >>Newsgroups: microsoft.public.biztalk.general
> | >>NNTP-Posting-Host: cpc1-mfld2-4-0-cust46.nott.cable.ntl.com
> 213.104.68.46
> | >>Path:
>

cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!TK2MSFTNGXA01.phx.gbl!cpmsftngxa0
> 6.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
> | >>Xref: cpmsftngxa10.phx.gbl microsoft.public.biztalk.general:15685
> | >>X-Tomcat-NG: microsoft.public.biztalk.general
> | >>
> | >>Hi all
> | >>I've got a BTS 2004 schema project which has a number of schema files
> within
> | >>it. I compose
> | >>message schemas (request/response) by importing other (supporting)
> schemas
> | >>from within
> | >>this project, these supporting schemas may also import other schemas
> from
> | >>the project.
> | >>
> | >>This appears to work ok, but I'd like to be able to auto test these
> schema
> | >>files to ensure that
> | >>validation works as expected and that subsequent editing does not

break
> | >>them.
> | >>
> | >>Has anyone done this yet? If so how are you doing it?
> | >>
> | >> Ideally I'd like to be able to use NUnit as this would fit with the
> rest of
> | >>the automated unit
> | >>testing that we are doing. I've attempted to do this by using NUnit

and
> | >>creating a unit test
> | >>project which is a c# project that references the schema project and
> | >>Microsoft.XLANG.BaseTypes. In my code I create an instance of the

type
> | >>exposed by
> | >>the schema using e.g.
> | >>
> | >> req req = new req();
> | >> XmlSchema schemaToTest = req.CreateResolvedSchema();
> | >> XmlTextReader xtr = new XmlTextReader("<SomeXml/>,
> XmlNodeType.Document,
> | >>null);
> | >> XmlValidatingReader xvr = new XmlValidatingReader(xtr);
> | >> xvr.Schemas.Add(schemaToTest);
> | >> xvr.ValidationType = ValidationType.Schema;
> | >> xvr.ValidationEventHandler += new
> | >> ValidationEventHandler(ValidationCallbac
k);
> | >> while (xvr.Read()) {};
> | >>
> | >>This kind of works but I've since read that the
> Microsoft.XLANG.BaseTypes
> | >>namespace
> | >>should not be used when coding. Is it ok to use these classes or
> should I
> | >>stay clear?
> | >>
> | >>Cheers
> | >>
> | >>AP
> | >>Nottingham - UK
> | >>
> | >>
> | >>
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com