Package uk.gov.nationalarchives.droid.planet.xml.dao

Examples of uk.gov.nationalarchives.droid.planet.xml.dao.PlanetsXMLData


    @Ignore
    @Test
    public void testPlanetsXMLEndToEnd() {
        String[] topLevelItems = new String[] {"foo", "bar"};

        PlanetsXMLData data = new PlanetsXMLData();

        data.setTopLevelItems(Arrays.asList(topLevelItems));

        List<GroupByYearSizeAndCountRow> dataList = new ArrayList<GroupByYearSizeAndCountRow>();
        GroupByYearSizeAndCountRow groupByYearSizeAndCountRow = new GroupByYearSizeAndCountRow();
        groupByYearSizeAndCountRow.setYear(1990);
        groupByYearSizeAndCountRow.setCount(new BigInteger("20"));
        groupByYearSizeAndCountRow.setSize(new BigDecimal("5000"));
        dataList.add(groupByYearSizeAndCountRow);

        data.setGroupByYear(dataList);

        List<GroupByPuidSizeAndCountRow> dataList1 = new ArrayList<GroupByPuidSizeAndCountRow>();
        GroupByPuidSizeAndCountRow groupByPuidSizeAndCountRow = new GroupByPuidSizeAndCountRow();
        groupByPuidSizeAndCountRow.setPuid("Xfmt/doc");
        groupByPuidSizeAndCountRow.setCount(new BigInteger("20"));
        groupByPuidSizeAndCountRow.setSize(new BigDecimal("50000"));
        dataList1.add(groupByPuidSizeAndCountRow);
        data.setGroupByPuid(dataList1);
       
       
        ProfileStat profileStat = new ProfileStat();
       
        profileStat.setProfileEndDate(new Date());
        profileStat.setProfileSaveDate(new Date());
        profileStat.setProfileStartDate(new Date());
       
        profileStat.setProfileLargestSize(new BigInteger("20"));
        profileStat.setProfileMeanSize(new BigDecimal("50000"));
        profileStat.setProfileSmallestSize(new BigInteger("20"));
        profileStat.setProfileTotalSize(new BigInteger("20"));
        profileStat.setProfileTotalReadableFiles(new BigInteger("20"));
        profileStat.setProfileTotalUnReadableFiles(new BigInteger("20"));
        profileStat.setProfileTotalUnReadableFolders(new BigInteger("20"));
       
       
        data.setProfileStat(profileStat);

        planetsGenerator = new PlanetsXMLGenerator(filename, data);
        planetsGenerator.generate();

        assertTrue(destination.exists());
View Full Code Here


    @Ignore
    @Test
    public void testPlanetsWithNoElement() {
        String[] topLevelItems = new String[] {};

        PlanetsXMLData data = new PlanetsXMLData();

        data.setTopLevelItems(Arrays.asList(topLevelItems));

        List<GroupByYearSizeAndCountRow> dataList = new ArrayList<GroupByYearSizeAndCountRow>();
        //GroupByYearSizeAndCountRow groupByYearSizeAndCountRow = new GroupByYearSizeAndCountRow();
        //groupByYearSizeAndCountRow.setYear(0);
        //groupByYearSizeAndCountRow.setCount(null);
        //groupByYearSizeAndCountRow.setSize(null);
        //dataList.add(groupByYearSizeAndCountRow);

        data.setGroupByYear(dataList);

        List<GroupByPuidSizeAndCountRow> dataList1 = new ArrayList<GroupByPuidSizeAndCountRow>();
        GroupByPuidSizeAndCountRow groupByPuidSizeAndCountRow = new GroupByPuidSizeAndCountRow();
        groupByPuidSizeAndCountRow.setPuid("Xfmt/doc");
        groupByPuidSizeAndCountRow.setCount(new BigInteger("20"));
        groupByPuidSizeAndCountRow.setSize(new BigDecimal("50000"));
        dataList1.add(groupByPuidSizeAndCountRow);
        data.setGroupByPuid(dataList1);
       
       
        ProfileStat profileStat = new ProfileStat();
       
        profileStat.setProfileEndDate(new Date());
        profileStat.setProfileSaveDate(new Date());
        profileStat.setProfileStartDate(new Date());
       
        profileStat.setProfileLargestSize(new BigInteger("20"));
        profileStat.setProfileMeanSize(new BigDecimal("50000"));
        profileStat.setProfileSmallestSize(new BigInteger("20"));
        profileStat.setProfileTotalSize(new BigInteger("20"));
        profileStat.setProfileTotalReadableFiles(new BigInteger("20"));
        profileStat.setProfileTotalUnReadableFiles(new BigInteger("20"));
        profileStat.setProfileTotalUnReadableFolders(new BigInteger("20"));
       
       
        data.setProfileStat(profileStat);

        planetsGenerator = new PlanetsXMLGenerator(filename, data);
        planetsGenerator.generate();

        assertTrue(destination.exists());
View Full Code Here

            throw new RuntimeException("Profile not available");
        }
        ProfileInstance profile = profileContextLocator.getProfileInstance(profileId);
        ProfileInstanceManager profileInstancemanager = profileContextLocator.openProfileInstanceManager(profile);

        PlanetsXMLData planetsData = profileInstancemanager.getPlanetsData();

        planetsData.getProfileStat().setProfileStartDate(profile.getProfileStartDate());
        planetsData.getProfileStat().setProfileEndDate(profile.getProfileEndDate());
        planetsData.getProfileStat().setProfileSaveDate(profile.getDateCreated());

        planetsData.setTopLevelItems(ReportUtils.toResourcePaths(profile.getProfileSpec().getResources()));

        PlanetsXMLGenerator planetXMLGenerator = new PlanetsXMLGenerator(observer, nameAndPathOfTheFile, planetsData);
        planetXMLGenerator.generate();

        long stopTime = System.currentTimeMillis();
View Full Code Here

TOP

Related Classes of uk.gov.nationalarchives.droid.planet.xml.dao.PlanetsXMLData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.