Hi Erik, The jar option seems indeed to be buggy however concerning your directory test I could say that it seems to work. The error you are getting are coming from the comparison between the ouput of SchemaWriter and the original schema but they are meaningless:
In the original schema you are using relative paths and Castor when writing back the schema resolves those paths to use absolute paths. The XMLDiff tool then catches the difference between the attribute values. Arnaud > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 20, 2003 4:52 PM > To: [EMAIL PROTECTED] > Subject: Re: [castor-dev] compiler errors during test case > > Arnaud, > > I tried the <SchemaTest>, but ran into a bunch of issues. > The war story is semi-documented below. > Sorry that I have problems and not solutions -- > I gotta get back to my day job. > > --Erik > > > > -----Original Message----- > > From: Arnaud Blandin [mailto:[EMAIL PROTECTED]] > > Sent: Monday, January 20, 2003 9:04 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [castor-dev] compiler errors during test case > > > > > > Hi Erik, > > > > According to the stack trace I am receiving; the CTF is > > not trying to > > marshall/unmarshall but it is trying to register the > > root class defined > > in the TestDescriptor.xml in the CLASSPATH. Since that > > class doesn't > > exist, it is complaining. > Oops. I knew it was something like that :- ) > > > > > <Skip>true</Skip> allows skipping the pattern > > 'unmarshall/marshal' but > > it doesn't prevent from entering a valid class name. > > However it seems that you want to test a Schema feature > Thanks. I just now tried that. Got some pretty weird behavior. > I've attached my test case jar. > For starters, it wants my schema files to be in META-INF. > With <SourceGeneratorTest>, on the other hand, the CTF wanted the schema files > in the parent of META-INF. > When I execute CTFRun with a <SchemaTest> jar file, I get this: > Unable to locate the root directory for the test cases > > I also got this variant sometimes: > > There was 1 failure: > 1) one.xsd(org.exolab.castor.tests.framework.SchemaTestCase) > "java.io.FileNotFoundException: c:\jsource\castor > Play\importTest\broken_.jar\one.xsd (The system cannot find the path > specified)" > > This looks like the CTF thinks my .jar file is a directory. > > So, I reverted to using a directory testcase. > When I run CTFRun with a <SchemaTest> in a directory, I get this mess: > .\build\classes;.\build\tests;c:\j2sdk1.4.1\lib\tools.jar;lib\adaptx_0.9 .4.6.j > ar;lib\ant_1.4.jar;lib\jakarta-oro-2.0.5.jar;lib\jakarta-regexp- > 1.1.jar;lib\jdbc-se2.0.jar;lib\jndi_1.2.1.jar;lib\jta1.0.1.jar;lib\jtf- > 0.1.jar;lib\junit_3.5.jar;lib\ldapjdk_4.1.jar;lib\postgresql.jar;lib\ser vlet.j > ar;lib\xerces-J_1.4.0.jar > Running in text mode. > Using '1043077456781' as seed for the initialization of the pseudo-random > number generator > - <import namespace="http://alltel.com/two" schemaLocation="a/b/two.xsd"> > + <import namespace="http://alltel.com/two" > schemaLocation="file:/C:/jsource/castorPlay/importTest/schema2_/META- > INF/a/b/two.xsd"> > The attribute 'schemaLocation' contains a difference value in the second node. > - <import namespace="http://alltel.com/three" schemaLocation="three.xsd"> > + <import namespace="http://alltel.com/two" > schemaLocation="file:/C:/jsource/castorPlay/importTest/schema2_/META- > INF/a/b/two.xsd"> > The attribute 'namespace' contains a difference value in the second node. > additional child elements are contained within element 'schema' of the first > node. > F > Time: 1.452 > There was 1 failure: > 1) one.xsd(org.exolab.castor.tests.framework.SchemaTestCase) > junit.framework.AssertionFailedError > at junit.framework.Assert.fail(Assert.java:32) > at junit.framework.Assert.assert(Assert.java:19) > at junit.framework.Assert.assert(Assert.java:26) > at > org.exolab.castor.tests.framework.SchemaTestCase.runTest(SchemaTestCase. java:1 > 52) > at junit.framework.TestCase.runBare(TestCase.java:130) > at junit.framework.TestResult$1.protect(TestResult.java:106) > at junit.framework.TestResult.runProtected(TestResult.java:124) > at junit.framework.TestResult.run(TestResult.java:109) > at junit.framework.TestCase.run(TestCase.java:121) > at junit.framework.TestSuite.runTest(TestSuite.java:157) > at junit.framework.TestSuite.run(TestSuite.java:152) > at junit.framework.TestSuite.runTest(TestSuite.java:157) > at junit.framework.TestSuite.run(TestSuite.java:152) > at junit.framework.TestSuite.runTest(TestSuite.java:157) > at junit.framework.TestSuite.run(TestSuite.java:152) > at junit.textui.TestRunner.doRun(TestRunner.java:74) > at junit.textui.TestRunner.start(TestRunner.java:235) > at junit.textui.TestRunner.main(TestRunner.java:108) > at > org.exolab.castor.tests.framework.CastorTestSuiteRunner.main(CastorTestS uiteRu > nner.java:197) > > FAILURES!!! > Tests run: 1, Failures: 1, Errors: 0 > > > and not a > > SourceGenerator feature so I'd advise you to use the > > <Schema> test case. > > I realize that you simply cannot guess it since the > > documentation is not > > up to date and is missing some elements. > > Taking a look at one of the Schema test in the > > MasterTestSuite or > > RegressionTestSuite should help you writing the test. > > > > Hope that helps, > > > > Arnaud > > > > > -----Original Message----- > > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, January 20, 2003 3:39 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [castor-dev] compiler errors during test case > > > > > > Thanks, Arnaud. > > > > > > I got by it; I'll try that next time. > > > > > > While I've got your ear. I put togother a test case > > > for an exception that was thrown during code generation. > > > > > > The CTF, however, wanted more of an example than I > > > needed to give. I tried using the <Skip>true</Skip> element > > > to no avail. I ended up just putting dummy > > > data items in my XML. The CTF wanted desperately > > > to marshal/unmarshal SOMETHING, so I put in the dummy data. > > > > > > Any suggestions? My test case is attached to this bug: > > > http://bugzilla.exolab.org/show_bug.cgi?id=1180 > > > > > > Thanks, > > > > > > --Erik > > > > > > > -----Original Message----- > > > > From: Arnaud Blandin [mailto:[EMAIL PROTECTED]] > > > > Sent: Monday, January 20, 2003 8:27 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: [castor-dev] compiler errors > > during test case > > > > > > > > > > > > Hi Erik, > > > > > > > > Have you tried to use the '-printStack' > > option on the CTF? > > > > It should work with the latest CVS. > > > > > > > > Arnaud > > > > > > > > > -----Original Message----- > > > > > From: [EMAIL PROTECTED] > > > > [mailto:[EMAIL PROTECTED]] > > > > > Sent: Friday, January 17, 2003 9:42 PM > > > > > To: [EMAIL PROTECTED] > > > > > Subject: [castor-dev] compiler errors > > during test case > > > > > > > > > > All, > > > > > > > > > > I'm writing a testcase for the CTF. > > > > > When I run the CTF, it tries to compile > > some code, but gets > > an > > > > > error. What's the best way to find the compiler > > > > error messages? > > > > > > > > > > The errors "should have been provided" but weren't. > > > > > > > > > > Time: 2.944 > > > > > There was 1 error: > > > > > 1) > > > > > > > > > > > testWithReferenceDocument(org.exolab.castor.tests.framew > > > > ork.SourceGenera > > > > torTes > > > > > tCase) > > > > > Compile failed, messages should have been provided. > > > > > at > > > > > > org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:532) > > > > > at > > > > > > > > > > > org.exolab.castor.tests.framework.SourceGeneratorTestCas > > > > e.setUp(SourceGe > > > > nerato > > > > > rTestCase.java:233) > > > > > at > > junit.framework.TestCase.runBare(TestCase.java:128) > > > > > at > > > > > > junit.framework.TestResult$1.protect(TestResult.java:106) > > > > > at > > > > > > junit.framework.TestResult.runProtected(TestResult.java:124) > > > > > at > > junit.framework.TestResult.run(TestResult.java:109) > > > > > at > > junit.framework.TestCase.run(TestCase.java:121) > > > > > at > > > > junit.framework.TestSuite.runTest(TestSuite.java:157) > > > > > at > > junit.framework.TestSuite.run(TestSuite.java:152) > > > > > at > > > > junit.framework.TestSuite.runTest(TestSuite.java:157) > > > > > at > > junit.framework.TestSuite.run(TestSuite.java:152) > > > > > at > > junit.textui.TestRunner.doRun(TestRunner.java:74) > > > > > at > > junit.textui.TestRunner.start(TestRunner.java:235) > > > > > at > > junit.textui.TestRunner.main(TestRunner.java:108) > > > > > at > > > > > > > > > > > org.exolab.castor.tests.framework.CastorTestSuiteRunner. > > > > main(CastorTestS > > > > uiteRu > > > > > nner.java:197) > > > > > There was 1 failure: > > > > > 1) > > > > > > > > > > > testWithRandomObject(org.exolab.castor.tests.framework.S > > > > ourceGeneratorTe > > > > stCase > > > > > ) "Unable to process the test > > > > > case:java.lang.ClassCastException" > > > > > > > > > > Thanks, > > > > > > > > > > --Erik > > > > > > > > > > > > ----------------------------------------------------------- > > > > > If you wish to unsubscribe from this > > mailing, send mail to > > > > > [EMAIL PROTECTED] with a subject of: > > > > > unsubscribe castor-dev > > > > > > > > > > ----------------------------------------------------------- > > > > If you wish to unsubscribe from this mailing, > > send mail to > > > > [EMAIL PROTECTED] with a subject of: > > > > unsubscribe castor-dev > > > > > > > > > > > > > > ----------------------------------------------------------- > > > If you wish to unsubscribe from this mailing, send mail to > > > [EMAIL PROTECTED] with a subject of: > > > unsubscribe castor-dev > > > > ----------------------------------------------------------- > > If you wish to unsubscribe from this mailing, send mail to > > [EMAIL PROTECTED] with a subject of: > > unsubscribe castor-dev > > > > ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev
