Examples of FileData


Examples of io.fathom.cloud.protobuf.FileModel.FileData

                // writeComma();
                // writeKeyLiteral("content_type");
                // writeValue("application/directory");
            } else {
                FileData file = entry.getFile();

                writeKeyLiteral("name");
                writeValue(file.getKey());

                if (file.hasHash()) {
                    writeComma();
                    writeKeyLiteral("hash");
                    writeValue(Hex.toHex(file.getHash().toByteArray()));
                }

                if (file.hasLength()) {
                    writeComma();
                    writeKeyLiteral("bytes");
                    writeValue(Long.toString(file.getLength()));
                }

                if (file.hasContentType()) {
                    writeComma();
                    writeKeyLiteral("content_type");
                    writeValue(file.getContentType());
                }

                if (file.hasLastModified()) {
                    writeComma();
                    writeKeyLiteral("last_modified");
                    writeValue(formatter.print(file.getLastModified()));
                }
            }
            endObject();
        }
View Full Code Here

Examples of io.fathom.cloud.protobuf.FileModel.FileData

        FsFile found = findFile();
        return buildReadResponse(httpRequest, fs, found);
    }

    private static void setHeaders(FsFile found, ResponseBuilder response) {
        FileData data = found.getData();

        if (data.hasLastModified()) {
            response.lastModified(new Date(data.getLastModified()));
        }

        if (data.hasHash()) {
            response.header(HttpHeaders.ETAG, Hex.toHex(data.getHash().toByteArray()));
        }

        if (data.hasContentType()) {
            response.header(HttpHeaders.CONTENT_TYPE, data.getContentType());
        }

        if (data.hasAttributes()) {
            Attributes attributes = data.getAttributes();
            for (KeyValueData entry : attributes.getUserAttributesList()) {
                response.header(OBJECT_META_PREFIX + entry.getKey(), entry.getValue());
            }
        }
    }
View Full Code Here

Examples of jscover.report.FileData

            classElement.setAttribute("complexity", "0");

            classElement.appendChild(doc.createElement("methods"));
            Element linesElement = doc.createElement("lines");
            classElement.appendChild(linesElement);
            FileData fileData = (FileData) file;
            addLines(doc, linesElement, fileData);
        }
    }
View Full Code Here

Examples of jscover.report.FileData

        functions.add(7);
        functions.add(2);
        functions.add(0);
        functions.add(5);

        FileData coverageData = new FileData("/test.js", lines, functions, branches);

        String result = lCovGenerator.generateRecord(coverageData, "dest");
        String expected = "SF:dest/test.js\n" +
                "FNDA:7,0\n" +
                "FNDA:2,1\n" +
View Full Code Here

Examples of jscover.report.FileData

        assertThat(getXPath(xpath, document, "/coverage/sources/source"), equalTo("c:/sourceDir"));
    }

    @Test
    public void shouldGenerateXmlForOneFile() throws Exception {
        FileData coverable = mock(FileData.class);
        files.add(coverable);

        given(coverable.getUri()).willReturn("/dir/file.js");
        given(coverable.getCodeLineCount()).willReturn(10);
        given(coverable.getCodeLinesCoveredCount()).willReturn(5);
        given(coverable.getLineCoverRate()).willReturn(.5d);
        given(coverable.getBranchCount()).willReturn(5);
        given(coverable.getBranchesCoveredCount()).willReturn(2);
        given(coverable.getBranchRate()).willReturn(.4d);

        data = new CoberturaData(files);
        String xml = generator.generateXml(data, "srcDir", "version");
        //System.out.println("xml = " + xml);
View Full Code Here

Examples of jscover.report.FileData

        assertThat(getXPath(xpath, document, classXPath + "/@filename"), equalTo("dir/file.js"));
    }

    @Test
    public void shouldGenerateXmlForTwoFiles() throws Exception {
        FileData coverable1 = mock(FileData.class);
        files.add(coverable1);
        FileData coverable2 = mock(FileData.class);
        files.add(coverable2);

        given(coverable1.getUri()).willReturn("/dir/file1.js");
        given(coverable1.getCodeLineCount()).willReturn(8);
        given(coverable1.getCodeLinesCoveredCount()).willReturn(4);
        given(coverable1.getLineCoverRate()).willReturn(.5d);
        given(coverable1.getBranchCount()).willReturn(5);
        given(coverable1.getBranchesCoveredCount()).willReturn(2);
        given(coverable1.getBranchRate()).willReturn(.4d);

        given(coverable2.getUri()).willReturn("/dir/file2.js");
        given(coverable2.getCodeLineCount()).willReturn(2);
        given(coverable2.getCodeLinesCoveredCount()).willReturn(2);
        given(coverable2.getLineCoverRate()).willReturn(1d);
        given(coverable2.getBranchCount()).willReturn(5);
        given(coverable2.getBranchesCoveredCount()).willReturn(5);
        given(coverable2.getBranchRate()).willReturn(1d);

        data = new CoberturaData(files);
        String xml = generator.generateXml(data, "srcDir", "version");
        //System.out.println("xml = " + xml);
View Full Code Here

Examples of jscover.report.FileData

    @Test
    public void shouldGenerateXmlLineNoBranch() throws Exception {
        List<Integer> lines = new ArrayList<Integer>(){{add(null);}{add(10);}};
        SortedMap<Integer, List<BranchData>> branchData = new TreeMap<Integer, List<BranchData>>();
        files.add(new FileData("/dir/file.js", lines, null, branchData));

        data = new CoberturaData(files);
        String xml = generator.generateXml(data, "srcDir", "version");
        //System.out.println("xml = " + xml);
View Full Code Here

Examples of jscover.report.FileData

        SortedMap<Integer, List<BranchData>> branchDataMap = new TreeMap<Integer, List<BranchData>>();
        List<BranchData> conditionsList = new ArrayList<BranchData>();
        conditionsList.add(null);
        conditionsList.add(new BranchData(0, 0, null, 1, 0));
        branchDataMap.put(1, conditionsList);
        files.add(new FileData("/dir/file.js", lines, null, branchDataMap));

        data = new CoberturaData(files);
        String xml = generator.generateXml(data, "srcDir", "version");
        //System.out.println("xml = " + xml);
View Full Code Here

Examples of jscover.report.FileData

        SortedMap<Integer, List<BranchData>> branchDataMap = new TreeMap<Integer, List<BranchData>>();
        List<BranchData> conditionsList = new ArrayList<BranchData>();
        conditionsList.add(null);
        conditionsList.add(new BranchData(0, 0, null, 0, 1));
        branchDataMap.put(1, conditionsList);
        files.add(new FileData("/dir/file.js", lines, null, branchDataMap));

        data = new CoberturaData(files);
        String xml = generator.generateXml(data, "srcDir", "version");
        //System.out.println("xml = " + xml);
View Full Code Here

Examples of jscover.report.FileData

        SortedMap<Integer, List<BranchData>> branchDataMap = new TreeMap<Integer, List<BranchData>>();
        List<BranchData> conditionsList = new ArrayList<BranchData>();
        conditionsList.add(null);
        conditionsList.add(new BranchData(0, 0, null, 0, 0));
        branchDataMap.put(1, conditionsList);
        files.add(new FileData("/dir/file.js", lines, null, branchDataMap));

        data = new CoberturaData(files);
        String xml = generator.generateXml(data, "srcDir", "version");
        //System.out.println("xml = " + xml);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.