View Javadoc

1   /*
2    * $Id: ResourceMatcherClientTest.java 1529 2011-06-22 16:37:19Z hoheisel $
3    *
4    * Copyright (c) 2005-2006, 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   package net.kwfgrid.gwes;
10  
11  import de.fraunhofer.first.resmatch.client.ResourceMatcherClient;
12  import junit.framework.Assert;
13  import junit.framework.Test;
14  import junit.framework.TestSuite;
15  import net.kwfgrid.gwes.exception.LoggingException;
16  import org.apache.log4j.Logger;
17  
18  /**
19   * maven -Dtestcase=net.kwfgrid.gwes.ResourceMatcherClientTest test:single
20   *
21   * @author Andreas Hoheisel
22   *         (<a href="http://www.andreas-hoheisel.de">www.andreas-hoheisel.de</a>)
23   * @version $Id: ResourceMatcherClientTest.java 1529 2011-06-22 16:37:19Z hoheisel $
24   */
25  public final class ResourceMatcherClientTest extends LocalGWESAbstractTestCase {
26  
27      /**
28       * log4j logger
29       */
30      static Logger logger = Logger.getLogger(ResourceMatcherClientTest.class);
31  
32      /**
33       * Create the test case.
34       *
35       * @param testName name of the test case
36       */
37      public ResourceMatcherClientTest(String testName) throws LoggingException {
38          super(testName);
39      }
40  
41      /**
42       * @return the suite of tests being tested
43       */
44      public static Test suite() {
45          return new TestSuite(ResourceMatcherClientTest.class);
46      }
47  
48      /**
49       * Test
50       */
51      public void testResourceMatcherClient() {
52  
53          try {
54  
55              String fn = "examples/programexecution/concatenateIt_10.xml";
56  
57              // in order to read the properties...
58              GWES gwes = new GWESEngine();
59  
60              // Test the WS
61              String result = ResourceMatcherClient.getInstance().match(readfile(fn));
62              logger.info(result);
63          } catch (Exception e) {
64              logger.fatal("exception: " + e, e);
65              Assert.fail();
66          }
67      }
68  
69  }