View Javadoc
1   /*
2    * The Kuali Financial System, a comprehensive financial management system for higher education.
3    * 
4    * Copyright 2005-2014 The Kuali Foundation
5    * 
6    * This program is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Affero General Public License as
8    * published by the Free Software Foundation, either version 3 of the
9    * License, or (at your option) any later version.
10   * 
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU Affero General Public License for more details.
15   * 
16   * You should have received a copy of the GNU Affero General Public License
17   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package org.kuali.kfs.module.cg.service;
20  
21  import java.io.IOException;
22  
23  import org.kuali.kfs.module.cg.businessobject.CfdaUpdateResults;
24  import org.kuali.kfs.module.cg.service.impl.CfdaServiceImpl;
25  import org.kuali.kfs.sys.ConfigureContext;
26  import org.kuali.kfs.sys.context.KualiTestBase;
27  import org.kuali.kfs.sys.context.SpringContext;
28  
29  @ConfigureContext
30  public class CfdaServiceTest extends KualiTestBase {
31  
32  //    public void testPatternExtraction() {
33  //
34  //        String[] table = { "<TD ALIGN=\"Center\" NOWRAP valign=\"TOP\"  WIDTH=\"0\"><A HREF=\"CATALOG.PROGRAM_TEXT_RPT.SHOW?p_arg_names=prog_nbr&p_arg_values=10.001\"><FONT STYLE = \"font-family:Arial; color:#00008B; font-size:10pt; \"><B><U>10.001</U></B></FONT></A></TD>\n", "<TD ALIGN=\"Left\" NOWRAP valign=\"TOP\"  WIDTH=\"0\"><FONT STYLE = \"font-family:Arial; font-size:10pt; \">USDA</FONT></TD>\n", "<TD ALIGN=\"Left\" NOWRAP valign=\"TOP\"  WIDTH=\"666\"><FONT STYLE = \"font-family:Arial; font-size:10pt; \">Agricultural Research_Basic and Applied Research</FONT></TD>" };
35  //
36  //        String n = ((CfdaServiceImpl)SpringContext.getBean(CfdaService.class)).extractCfdaNumberFrom(table[0]);
37  //        String a = ((CfdaServiceImpl)SpringContext.getBean(CfdaService.class)).extractCfdaAgencyFrom(table[1]);
38  //        String t = ((CfdaServiceImpl)SpringContext.getBean(CfdaService.class)).extractCfdaTitleFrom(table[2]);
39  //
40  //        assertEquals("Number extraction failed", "10.001", n);
41  //        assertEquals("Agency extraction failed", "USDA", a);
42  //        assertEquals("Title extraction failed", "Agricultural Research_Basic and Applied Research", t);
43  //    }
44  
45      public void testUpdate() throws IOException {
46          // Commented out since causing unit tests to pause for 15 minutes (and doesn't really test anything anyway)
47          //CfdaUpdateResults results = SpringContext.getBean(CfdaService.class).update();
48      }
49  
50  }