01: /******************************************************************
02: Copyright (c) 2007 Erik Bengtson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15:
16: Contributors:
17: ...
18: *****************************************************************/package org.jpox.metadata.xml;
19:
20: import junit.framework.TestCase;
21:
22: import org.jpox.OMFContext;
23: import org.jpox.PersistenceConfiguration;
24: import org.jpox.exceptions.JPOXException;
25: import org.jpox.jdo.metadata.JDOMetaDataManager;
26:
27: public class MetaDataParserTest extends TestCase {
28:
29: public void testParseMetaDataURLnullURL() {
30: MetaDataParser parser = new MetaDataParser(
31: new JDOMetaDataManager(new OMFContext(
32: new PersistenceConfiguration() {
33: })), true);
34: try {
35: parser.parseMetaDataURL(null, "jdo");
36: fail("expected JPOXException");
37: } catch (JPOXException ex) {
38: //expected
39: }
40: }
41:
42: public void testParseMetaDataURLnullhandler() {
43: MetaDataParser parser = new MetaDataParser(
44: new JDOMetaDataManager(new OMFContext(
45: new PersistenceConfiguration() {
46: })), true);
47: try {
48: parser.parseMetaDataURL(getClass().getResource(
49: "/org/jpox/metadata/xml/package2.jdo"), null);
50: fail("expected JPOXException");
51: } catch (JPOXException ex) {
52: //expected
53: }
54: }
55: }
|