Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 66003 invoked from network); 31 May 2006 05:06:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 May 2006 05:06:03 -0000 Received: (qmail 99260 invoked by uid 500); 31 May 2006 05:06:01 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 98996 invoked by uid 500); 31 May 2006 05:05:59 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 98972 invoked by uid 500); 31 May 2006 05:05:59 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 98830 invoked by uid 99); 31 May 2006 05:05:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 22:05:56 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 May 2006 22:05:54 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id A90201A983A; Tue, 30 May 2006 22:05:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r410431 - in /webservices/axis2/trunk/c/xml_schema: test-resources/ test-resources/circular/ test/ Date: Wed, 31 May 2006 05:05:31 -0000 To: axis2-cvs@ws.apache.org From: nandika@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060531050534.A90201A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: nandika Date: Tue May 30 22:05:30 2006 New Revision: 410431 URL: http://svn.apache.org/viewvc?rev=410431&view=rev Log: tests added to xml_schema Added: webservices/axis2/trunk/c/xml_schema/test/ webservices/axis2/trunk/c/xml_schema/test-resources/ webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd webservices/axis2/trunk/c/xml_schema/test-resources/circular/ webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd webservices/axis2/trunk/c/xml_schema/test/main.c webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h Added: webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/SimpleContentRestriction.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + Added: webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/allSimpleTypes.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/anyAttTest.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + Added: webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/block.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/circular/a.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/circular/b.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/credit-card-faults.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/elementForm.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + Added: webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/elementreferences.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/forwardRef.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/importAux.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,14 @@ + + + + + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/importBase.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,10 @@ + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/mixedContent.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/resSvc.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Added: webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/twoSchemas.wsdl Tue May 30 22:05:30 2006 @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd (added) +++ webservices/axis2/trunk/c/xml_schema/test-resources/unqualifiedTypes.xsd Tue May 30 22:05:30 2006 @@ -0,0 +1,16 @@ + + + + + + + + + + \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test/main.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test/main.c?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test/main.c (added) +++ webservices/axis2/trunk/c/xml_schema/test/main.c Tue May 30 22:05:30 2006 @@ -0,0 +1,32 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "xml_schema_test.h" + +void RunAllTests(void) { + CuString *output = CuStringNew(); + CuSuite* suite = xml_schema_GetSuite(); + CuSuiteRun(suite); + CuSuiteSummary(suite, output); + CuSuiteDetails(suite, output); + printf("%s", output->buffer); +} + +int main(void) { + RunAllTests(); + getchar(); + return 0; +} Added: webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c (added) +++ webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.c Tue May 30 22:05:30 2006 @@ -0,0 +1,138 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include +#include +#include +#include +#include +#include "xml_schema_test.h" + + +static axis2_om_document_t* +get_root_element_from_filename(axis2_env_t **env, + axis2_char_t *filename); + +void test_simple_type_schema_generation(CuTest *tc); +void test_any_attribute(CuTest *tc); +void test_block_content(CuTest *tc); +void test_circular_schema(CuTest *tc); +void test_schema_import1(CuTest *tc); +void test_schema_import2(CuTest *tc); +void test_mixed_content(CuTest *tc); +void test_local_elements(CuTest *tc); +void test_element_refs(CuTest *tc); +void test_forward_refs(CuTest *tc); +void test_local_unnamed_simple_type(CuTest *tc); +void test_simple_restriction(CuTest *tc); +void test_unqualified_schemas(CuTest *tc); +void test_two_schmes(CuTest *tc); + + +CuSuite* xml_schema_GetSuite() +{ + CuSuite* suite = CuSuiteNew(); + SUITE_ADD_TEST(suite, test_simple_type_schema_generation); + SUITE_ADD_TEST(suite, test_any_attribute); + SUITE_ADD_TEST(suite, test_block_content); + SUITE_ADD_TEST(suite, test_circular_schema); + SUITE_ADD_TEST(suite, test_schema_import1); + SUITE_ADD_TEST(suite, test_schema_import2); + SUITE_ADD_TEST(suite, test_mixed_content); + SUITE_ADD_TEST(suite, test_local_elements); + SUITE_ADD_TEST(suite, test_element_refs); + SUITE_ADD_TEST(suite, test_forward_refs); + SUITE_ADD_TEST(suite, test_local_unnamed_simple_type); + SUITE_ADD_TEST(suite, test_simple_restriction); + SUITE_ADD_TEST(suite, test_unqualified_schemas); + SUITE_ADD_TEST(suite, test_two_schmes); + return suite; +} + +void test_simple_type_schema_generation(CuTest *tc) +{ + axis2_env_t *env = NULL; + axis2_om_document_t *om_doc = NULL; + axis2_xml_schema_collection_t *sch_collection = NULL; + axis2_xml_schema_t *schema = NULL; + axis2_xml_schema_obj_table_t *obj_table = NULL; + axis2_array_list_t *list = NULL; + int i = 0; + + void *ele = NULL; + void *sch_type = NULL; + axis2_char_t *filename = "./..//test-resources/allSimpleTypes.xsd"; + + + + env = axis2_env_create_all("test.log", 1); + om_doc = get_root_element_from_filename(&env, filename); + sch_collection = axis2_xml_schema_collection_create(&env); + schema = AXIS2_XML_SCHEMA_COLLECTION_READ_DOCUMENT( + sch_collection, &env, om_doc); + + CuAssertPtrNotNull(tc, schema); + + obj_table = AXIS2_XML_SCHEMA_GET_ELEMENTS(schema, &env); + + CuAssertPtrNotNull(tc, obj_table); + + list = AXIS2_XML_SCHEMA_OBJ_TABLE_GET_VALUES(obj_table, &env); + + CuAssertPtrNotNull(tc, list); + + for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(list, &env); i++) + { + ele = AXIS2_ARRAY_LIST_GET(list, &env, i); + + CuAssertPtrNotNull(tc, ele); + + sch_type = AXIS2_XML_SCHEMA_ELEMENT_GET_SCHEMA_TYPE(ele, &env); + + CuAssertPtrNotNull(tc, sch_type); + + ele = NULL; + sch_type = NULL; + } +} + +void test_any_attribute(CuTest *tc){} +void test_block_content(CuTest *tc){} +void test_circular_schema(CuTest *tc){} +void test_schema_import1(CuTest *tc){} +void test_schema_import2(CuTest *tc){} +void test_mixed_content(CuTest *tc){} +void test_local_elements(CuTest *tc){} +void test_element_refs(CuTest *tc){} +void test_forward_refs(CuTest *tc){} +void test_local_unnamed_simple_type(CuTest *tc){} +void test_simple_restriction(CuTest *tc){} +void test_unqualified_schemas(CuTest *tc){} +void test_two_schmes(CuTest *tc){} + +static axis2_om_document_t* +get_root_element_from_filename(axis2_env_t **env, + axis2_char_t *filename) +{ + axis2_xml_reader_t *reader = NULL; + axis2_om_stax_builder_t *om_builder = NULL; + axis2_om_document_t *doc = NULL; + reader = axis2_xml_reader_create_for_file(env, filename, NULL); + om_builder = axis2_om_stax_builder_create(env, reader); + doc = axis2_om_document_create(env, NULL, om_builder); + AXIS2_OM_DOCUMENT_BUILD_ALL(doc, env); + return doc; +} \ No newline at end of file Added: webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h?rev=410431&view=auto ============================================================================== --- webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h (added) +++ webservices/axis2/trunk/c/xml_schema/test/xml_schema_test.h Tue May 30 22:05:30 2006 @@ -0,0 +1,40 @@ +/* + * Copyright 2004,2005 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef XML_SCHEMA_TEST_H +#define XML_SCHEMA_TEST_H + +#include +#include + +CuSuite* xml_schema_GetSuite(); + +void test_simple_type_schema_generation(CuTest *tc); +void test_any_attribute(CuTest *tc); +void test_block_content(CuTest *tc); +void test_circular_schema(CuTest *tc); +void test_schema_import1(CuTest *tc); +void test_schema_import2(CuTest *tc); +void test_mixed_content(CuTest *tc); +void test_local_elements(CuTest *tc); +void test_element_refs(CuTest *tc); +void test_forward_refs(CuTest *tc); +void test_local_unnamed_simple_type(CuTest *tc); +void test_simple_restriction(CuTest *tc); +void test_unqualified_schemas(CuTest *tc); +void test_two_schmes(CuTest *tc); + +#endif /* XML_SCHEMA_TEST_H */ --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org