1   /*
2    * $Id: XSDUseTest.java 1212 2008-11-03 13:15:59Z andreas.hoheisel@first.fraunhofer.de $
3    *
4    * Copyright (c) 2005, The K-Wf Grid Consortium
5    * Fraunhofer Institute for Computer Architecture and Software Technology
6    * See http://www.kwfgrid.eu and http://www.first.fraunhofer.de for more details.
7    */
8   
9   
10  package net.kwfgrid.gworkflowdl;
11  
12  import junit.framework.Assert;
13  import junit.framework.Test;
14  import junit.framework.TestSuite;
15  import net.kwfgrid.gworkflowdl.structure.CapacityException;
16  import net.kwfgrid.gworkflowdl.structure.JdomString;
17  import net.kwfgrid.gworkflowdl.structure.WorkflowFormatException;
18  
19  
20  public final class XSDUseTest extends AbstractTestCase {
21       /***
22       * Create the test case.
23       *
24       * @param testName name of the test case
25       */
26      public XSDUseTest(String testName) {
27          super(testName);
28      }
29  
30      /***
31       * @return the suite of tests being tested
32       */
33      public static Test suite() {
34          return new TestSuite(XSDUseTest.class);
35      }
36  
37  
38      public void testXSDUse() {
39  
40          String s = "";
41          s += "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
42          s += "<workflow>\n";
43          s += "  <place ID=\"end\" capacity=\"4711\" anton=\"berta\" />\n";
44          s += "</workflow>\n";
45  
46          //System.out.println(s);
47  
48          boolean test = false;
49          try {
50              JdomString.string2workflow(s);
51          } catch (CapacityException e) {
52              System.out.println(e.toString());
53              test = true;
54          } catch (WorkflowFormatException e) {
55               System.out.println(e.toString());
56              test = true;
57          }
58          Assert.assertTrue(test);
59      }
60  }