1   /*
2    * Copyright (C) The MetaClass Group. All rights reserved.
3    *
4    * This software is published under the terms of the Spice
5    * Software License version 1.1, a copy of which has been included
6    * with this distribution in the LICENSE.txt file.
7    */
8   package org.codehaus.metaclass.tools.tasks;
9   
10  import java.io.File;
11  import junit.framework.TestCase;
12  import org.apache.tools.ant.types.FileSet;
13  
14  /***
15   * @author Peter Donald
16   * @version $Revision: 1.3 $ $Date: 2003/11/28 11:14:55 $
17   */
18  public class PluginElementTestCase
19      extends TestCase
20  {
21      public void testGetName()
22          throws Exception
23      {
24          final PluginElement element = new PluginElement();
25          element.setName( "bob" );
26          assertEquals( "bob", element.getName() );
27      }
28  
29      public void testGetNullPath()
30          throws Exception
31      {
32          final PluginElement element = new PluginElement();
33          assertEquals( null, element.getPath() );
34      }
35  
36      public void testGetPathWithFileSet()
37          throws Exception
38      {
39          final PluginElement element = new PluginElement();
40          final FileSet set1 = new FileSet();
41          final FileSet set2 = new FileSet();
42          set1.setDir( new File( "set1" ) );
43          set2.setDir( new File( "set2" ) );
44          element.createClasspath().addFileset( set1 );
45          element.createClasspath().addFileset( set2 );
46          assertNotNull( element.getPath() );
47      }
48  }