1   package de.fu_berlin.ties.util;
2   
3   import junit.framework.TestCase;
4   // JUnitDoclet begin import
5   import java.io.File;
6   import java.util.Properties;
7   // JUnitDoclet end import
8   
9   /***
10  * Generated by JUnitDoclet, a tool provided by
11  * ObjectFab GmbH under LGPL.
12  * Please see www.junitdoclet.org, www.gnu.org
13  * and www.objectfab.de for informations about
14  * the tool, the licence and the authors.
15  */
16  
17  
18  public class VelocityServiceTest
19  // JUnitDoclet begin extends_implements
20  extends TestCase
21  // JUnitDoclet end extends_implements
22  {
23    // JUnitDoclet begin class
24    de.fu_berlin.ties.util.VelocityService velocityservice = null;
25    // JUnitDoclet end class
26    
27    public VelocityServiceTest(String name) {
28      // JUnitDoclet begin method VelocityServiceTest
29      super(name);
30      // JUnitDoclet end method VelocityServiceTest
31    }
32    
33    public de.fu_berlin.ties.util.VelocityService createInstance() throws Exception {
34      // JUnitDoclet begin method testcase.createInstance
35      return null; // singleton
36      // JUnitDoclet end method testcase.createInstance
37    }
38    
39    protected void setUp() throws Exception {
40      // JUnitDoclet begin method testcase.setUp
41      super.setUp();
42      // JUnitDoclet end method testcase.setUp
43    }
44    
45    protected void tearDown() throws Exception {
46      // JUnitDoclet begin method testcase.tearDown
47      super.tearDown();
48      // JUnitDoclet end method testcase.tearDown
49    }
50    
51    public void testCompleteTemplateName() throws Exception {
52      // JUnitDoclet begin method completeTemplateName
53      final String[] someNames = new String[] {
54          "mytemplate", "subdir/templ", "templ.with.dots", "", 
55      };
56      for (int i = 0; i < someNames.length; i++) {
57          assertEquals(VelocityService.completeTemplateName(someNames[i]),
58              "velocity" + File.separator + someNames[i] + ".vm");        
59      }
60      // JUnitDoclet end method completeTemplateName
61    }
62    
63    public void testGetDefaultProperties() throws Exception {
64      // JUnitDoclet begin method getDefaultProperties
65      final Properties defProps = VelocityService.getDefaultProperties();
66  
67      // all calls should return the same object
68      assertSame(defProps, VelocityService.getDefaultProperties());
69      
70      assertTrue(defProps.size() >= 5);
71      assertEquals(defProps.getProperty("resource.loader"), "file,classpath");
72      // JUnitDoclet end method getDefaultProperties
73    }
74    
75    public void testMain() throws Exception {
76      // JUnitDoclet begin method main
77      // JUnitDoclet end method main
78    }
79    
80    public void testPrintConfigProperties() throws Exception {
81      // JUnitDoclet begin method printConfigProperties
82      // JUnitDoclet end method printConfigProperties
83    }
84    
85    public void testPrintGoals() throws Exception {
86      // JUnitDoclet begin method printGoals
87      // JUnitDoclet end method printGoals
88    }
89    
90    public void testRenderTemplate() throws Exception {
91      // JUnitDoclet begin method renderTemplate
92      // tested by generating goals + configuration descriptions on the website
93      // JUnitDoclet end method renderTemplate
94    }
95    
96    
97    
98    /***
99    * JUnitDoclet moves marker to this method, if there is not match
100   * for them in the regenerated code and if the marker is not empty.
101   * This way, no test gets lost when regenerating after renaming.
102   * Method testVault is supposed to be empty.
103   */
104   public void testVault() throws Exception {
105     // JUnitDoclet begin method testcase.testVault
106     // JUnitDoclet end method testcase.testVault
107   }
108   
109   public static void main(String[] args) {
110     // JUnitDoclet begin method testcase.main
111     junit.textui.TestRunner.run(VelocityServiceTest.class);
112     // JUnitDoclet end method testcase.main
113   }
114 }