@@ -0,0 +1,3230 @@
+package au.gov.ga.geodesy.domain.service;%0A%0Aimport static org.testng.Assert.assertEquals;%0Aimport static org.testng.Assert.assertNotNull;%0A%0Aimport java.io.File;%0Aimport java.io.FileReader;%0Aimport java.util.List;%0A%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.test.annotation.Rollback;%0Aimport org.springframework.test.context.ContextConfiguration;%0Aimport org.springframework.test.context.support.AnnotationConfigContextLoader;%0Aimport org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests;%0Aimport org.springframework.transaction.annotation.Transactional;%0Aimport org.testng.annotations.Test;%0A%0Aimport au.gov.ga.geodesy.domain.model.GnssCorsSite;%0Aimport au.gov.ga.geodesy.domain.model.GnssCorsSiteRepository;%0Aimport au.gov.ga.geodesy.domain.model.Node;%0Aimport au.gov.ga.geodesy.domain.model.NodeRepository;%0Aimport au.gov.ga.geodesy.domain.model.Setup;%0Aimport au.gov.ga.geodesy.domain.model.SetupRepository;%0Aimport au.gov.ga.geodesy.igssitelog.domain.model.IgsSiteLog;%0Aimport au.gov.ga.geodesy.igssitelog.domain.model.IgsSiteLogRepository;%0Aimport au.gov.ga.geodesy.igssitelog.domain.model.SiteIdentification;%0Aimport au.gov.ga.geodesy.igssitelog.interfaces.xml.IgsSiteLogXmlMarshaller;%0Aimport au.gov.ga.geodesy.support.spring.GeodesyServiceTestConfig;%0Aimport au.gov.ga.geodesy.support.spring.PersistenceJpaConfig;%0A%0A@ContextConfiguration(%0A        classes = %7BGeodesyServiceTestConfig.class, PersistenceJpaConfig.class%7D,%0A        loader = AnnotationConfigContextLoader.class)%0A%0A@Transactional(%22geodesyTransactionManager%22)%0Apublic class UploadADE1Test extends AbstractTransactionalTestNGSpringContextTests %7B%0A%0A    private static final String siteLogsDir = %22src/test/resources/sitelog/%22;%0A%0A    private static final String fourCharId = %22ADE1%22;%0A%0A    @Autowired%0A    private IgsSiteLogService siteLogService;%0A%0A    @Autowired%0A    private GnssCorsSiteService siteService;%0A%0A    @Autowired%0A    private GnssCorsSiteRepository sites;%0A%0A    @Autowired%0A    private SetupRepository setupRepo;%0A%0A    @Autowired%0A    private NodeRepository nodeRepo;%0A%0A    @Autowired%0A    private NodeService nodeService;%0A%0A    @Autowired%0A    private IgsSiteLogRepository siteLogs;%0A%0A    @Autowired%0A    private IgsSiteLogXmlMarshaller marshaller;%0A%0A    @Test%0A    @Rollback(false)%0A    public void saveSiteLog() throws Exception %7B%0A        File siteLog = new File(siteLogsDir + fourCharId + %22.xml%22);%0A        siteLogService.upload(marshaller.unmarshal(new FileReader(siteLog)));%0A    %7D%0A%0A    @Test(dependsOnMethods = %7B%22saveSiteLog%22%7D)%0A    @Rollback(false)%0A    public void checkSite() throws Exception %7B%0A        IgsSiteLog siteLog = siteLogs.findByFourCharacterId(fourCharId);%0A        GnssCorsSite site = sites.findByFourCharacterId(fourCharId);%0A        assertNotNull(site);%0A%0A        SiteIdentification identification = siteLog.getSiteIdentification();%0A        assertEquals(site.getName(), identification.getSiteName());%0A        assertEquals(site.getDateInstalled(), identification.getDateInstalled());%0A%0A        List%3CSetup%3E setups = setupRepo.findBySiteId(site.getId());%0A        assertEquals(setups.size(), 7);%0A%0A        List%3CNode%3E nodes = nodeRepo.findBySiteId(site.getId());%0A        assertEquals(nodes.size(), 4);%0A    %7D%0A%7D%0A

Test upload site log ADE1.