1   /*
2    * $Id: AbstractBaseVisualizerXmlTestCase.java 11728 2008-05-13 07:31:11Z dirk.olmes $
3    * --------------------------------------------------------------------------------------
4    * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
5    *
6    * The software in this package is published under the terms of the CPAL v1.0
7    * license, a copy of which has been included with this distribution in the
8    * LICENSE.txt file.
9    */
10  
11  package org.mule.tools.visualizer.maven;
12  
13  import org.mule.util.FileUtils;
14  
15  import java.util.Arrays;
16  
17  import junit.framework.TestCase;
18  
19  public abstract class AbstractBaseVisualizerXmlTestCase extends TestCase 
20  {
21  
22      public abstract String getXmlConfig();
23  
24      public void testConfig() throws Exception
25      {
26          MuleVisualizerPlugin plugin = new MuleVisualizerPlugin();
27          String config = getXmlConfig();
28          String path = FileUtils.getResourcePath(config, getClass());
29          assertNotNull("missing config path: " + config , path);
30          plugin.setFiles(Arrays.asList(new String[]{path}));
31          plugin.setOutputdir(FileUtils.getResourcePath("target", getClass()));
32          plugin.execute();
33      }
34  
35  }