package uk.ac.ebi.phenotype.service;

import java.io.IOException;

import javax.xml.bind.JAXBException;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import uk.ac.ebi.phenotype.web.TestConfig;


/**
 * @since 2015/10/08
 * @author ilinca
 *
 */

@RunWith(SpringJUnit4ClassRunner.class)
@TestPropertySource("file:${user.home}/configfiles/${profile}/test.properties")
@SpringApplicationConfiguration(classes = TestConfig.class)
@Transactional
public class UniprotServiceTest {

	
    @Autowired
    UniprotService uniprotService;

    @Test
    public void testCheckTypeParameterString() {
       
        UniprotDTO dto = new UniprotDTO();
		try {
			
			dto = uniprotService.readXml("http://www.uniprot.org/uniprot/Q6ZNJ1.xml" , dto);
		
	        assert(dto.getFunction() != null);
	        assert(dto.getGoCell() != null && dto.getGoCell().size() >= 2);
	        assert(dto.getGoMolecularFunction() != null && dto.getGoMolecularFunction().size() >= 1);
	        assert(dto.getGoProcess() != null && dto.getGoProcess().size() >= 2);
	        
		} catch (JAXBException | IOException e) {
			e.printStackTrace();
		}
    }
}
@@ -35,75 +35,8 @@
 e;%0A%0A
-import java.io.IOException;%0A%0Aimport javax.xml.bind.JAXBException;%0A%0A
 impo
@@ -54,16 +54,16 @@
 t.Test;%0A
+
 import o
@@ -416,17 +416,16 @@
 tional;%0A
-%0A
 import u
@@ -460,16 +460,82 @@
 onfig;%0A%0A
+import javax.xml.bind.JAXBException;%0Aimport java.io.IOException;%0A%0A
 %0A/**%0A * 
@@ -808,18 +808,17 @@
 Test %7B%0A%0A
-%09
 %0A
+
     @Aut
@@ -919,24 +919,17 @@
 ing() %7B%0A
-       
 %0A
+
         
@@ -971,19 +971,16 @@
 %09%09try %7B%0A
-%09%09%09
 %0A%09%09%09dto 
@@ -1040,14 +1040,14 @@
 rot/
-Q6ZNJ1
+P26367
 .xml
@@ -1056,18 +1056,16 @@
 , dto);%0A
-%09%09
 %0A%09      
@@ -1356,18 +1356,9 @@
 2);%0A
-%09        
 %0A
+
 %09%09%7D 
@@ -1431,9 +1431,10 @@
 %7D%0A    %7D%0A
-
 %7D
+%0A

use different gene with GO process terms associated (pax6)