Examples of Evidence


Examples of org.openbel.framework.common.model.Evidence

    /**
     * Tests {@link Evidence#copy()}.
     */
    @Test
    public void testCopy() {
        Evidence e1 = CommonModelFactory.getInstance().createEvidence(
                valueOf(currentTimeMillis()));
        Evidence e2 = e1.clone();
        assertEquals(e1, e2);
        assertFalse(e1 == e2);

        Set<Object> set = new HashSet<Object>();
        set.add(e1);
View Full Code Here

Examples of org.openbel.framework.common.model.Evidence

    public XBELAnnotationGroup convert(AnnotationGroup source) {
        if (source == null) return null;

        List<Annotation> annotations = source.getAnnotations();
        Citation citation = source.getCitation();
        Evidence evidence = source.getEvidence();

        XBELAnnotationGroup xag = new XBELAnnotationGroup();
        List<Object> list = xag.getAnnotationOrEvidenceOrCitation();

        if (hasItems(annotations)) {
            // Defer to AnnotationConverter
            AnnotationConverter aConverter = new AnnotationConverter();
            for (final Annotation a : annotations) {
                XBELAnnotation xa = aConverter.convert(a);
                list.add(xa);
            }
        }

        if (citation != null) {
            // Defer to CitationConverter
            CitationConverter cConverter = new CitationConverter();
            XBELCitation xc = cConverter.convert(citation);
            list.add(xc);
        }

        if (evidence != null) {
            list.add(evidence.getValue());
        }

        return xag;
    }
View Full Code Here

Examples of org.opensaml.saml1.core.Evidence

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {

        Evidence evidence = (Evidence) parentSAMLObject;

        if (childSAMLObject instanceof AssertionIDReference) {
            evidence.getAssertionIDReferences().add((AssertionIDReference) childSAMLObject);
        } else if (childSAMLObject instanceof Assertion) {
            evidence.getAssertions().add((Assertion) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.saml1.core.Evidence

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
            throws UnmarshallingException {

        Evidence evidence = (Evidence) parentSAMLObject;

        if (childSAMLObject instanceof AssertionIDReference) {
            evidence.getAssertionIDReferences().add((AssertionIDReference) childSAMLObject);
        } else if (childSAMLObject instanceof Assertion) {
            evidence.getAssertions().add((Assertion) childSAMLObject);
        } else {
            super.processChildElement(parentSAMLObject, childSAMLObject);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.Evidence

*/
public class EvidenceUnmarshaller extends AbstractSAMLObjectUnmarshaller {

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
        Evidence evidence = (Evidence) parentObject;

        if (childObject instanceof AssertionIDRef) {
            evidence.getAssertionIDReferences().add((AssertionIDRef) childObject);
        } else if (childObject instanceof AssertionURIRef) {
            evidence.getAssertionURIReferences().add((AssertionURIRef) childObject);
        } else if (childObject instanceof Assertion) {
            evidence.getAssertions().add((Assertion) childObject);
        } else if (childObject instanceof EncryptedAssertion) {
            evidence.getEncryptedAssertions().add((EncryptedAssertion) childObject);
        } else {
            super.processChildElement(parentObject, childObject);
        }
    }
View Full Code Here

Examples of org.opensaml.saml2.core.Evidence

        super(namespaceURI, elementLocalName);
    }

    /** {@inheritDoc} */
    protected void processChildElement(XMLObject parentObject, XMLObject childObject) throws UnmarshallingException {
        Evidence evidence = (Evidence) parentObject;

        if (childObject instanceof AssertionIDRef) {
            evidence.getAssertionIDReferences().add((AssertionIDRef) childObject);
        } else if (childObject instanceof AssertionURIRef) {
            evidence.getAssertionURIReferences().add((AssertionURIRef) childObject);
        } else if (childObject instanceof Assertion) {
            evidence.getAssertions().add((Assertion) childObject);
        } else if (childObject instanceof EncryptedAssertion) {
            evidence.getEncryptedAssertions().add((EncryptedAssertion) childObject);
        } else {
            super.processChildElement(parentObject, childObject);
        }
    }
View Full Code Here

Examples of org.owasp.dependencycheck.dependency.Evidence

    @Test
    public void testLog4Net() throws Exception {
        File f = new File(AssemblyAnalyzerTest.class.getClassLoader().getResource("log4net.dll").getPath());
        Dependency d = new Dependency(f);
        analyzer.analyze(d, null);
        assertTrue(d.getVersionEvidence().getEvidence().contains(new Evidence("grokassembly", "version", "1.2.13.0", Confidence.HIGHEST)));
        assertTrue(d.getVendorEvidence().getEvidence().contains(new Evidence("grokassembly", "vendor", "The Apache Software Foundation", Confidence.HIGH)));
        assertTrue(d.getProductEvidence().getEvidence().contains(new Evidence("grokassembly", "product", "log4net", Confidence.HIGH)));
    }
View Full Code Here

Examples of org.owasp.dependencycheck.dependency.Evidence

                gdep = d;
            } else if (d.getActualFile().equals(spring)) {
                sdep = d;
            }
        }
        final Evidence springTest1 = new Evidence("hint analyzer", "product", "springsource_spring_framework", Confidence.HIGH);
        final Evidence springTest2 = new Evidence("hint analyzer", "vendor", "SpringSource", Confidence.HIGH);
        final Evidence springTest3 = new Evidence("hint analyzer", "vendor", "vmware", Confidence.HIGH);
        final Evidence springTest4 = new Evidence("hint analyzer", "product", "springsource_spring_framework", Confidence.HIGH);
        final Evidence springTest5 = new Evidence("hint analyzer", "vendor", "vmware", Confidence.HIGH);

        Set<Evidence> evidence = gdep.getEvidence().getEvidence();
        assertFalse(evidence.contains(springTest1));
        assertFalse(evidence.contains(springTest2));
        assertFalse(evidence.contains(springTest3));
View Full Code Here

Examples of org.owasp.dependencycheck.dependency.Evidence

                throw new AnalysisException(error);
            }

            final String version = xpath.evaluate("/assembly/version", doc);
            if (version != null) {
                dependency.getVersionEvidence().addEvidence(new Evidence("grokassembly", "version",
                        version, Confidence.HIGHEST));
            }

            final String vendor = xpath.evaluate("/assembly/company", doc);
            if (vendor != null) {
                dependency.getVendorEvidence().addEvidence(new Evidence("grokassembly", "vendor",
                        vendor, Confidence.HIGH));
            }

            final String product = xpath.evaluate("/assembly/product", doc);
            if (product != null) {
                dependency.getProductEvidence().addEvidence(new Evidence("grokassembly", "product",
                        product, Confidence.HIGH));
            }

        } catch (IOException ioe) {
            throw new AnalysisException(ioe);
View Full Code Here

Examples of org.owasp.dependencycheck.dependency.Evidence

     * @param engine The scanning engine
     * @throws AnalysisException is thrown if there is an exception analyzing the dependency.
     */
    @Override
    public void analyze(Dependency dependency, Engine engine) throws AnalysisException {
        final Evidence springTest1 = new Evidence("Manifest",
                "Implementation-Title",
                "Spring Framework",
                Confidence.HIGH);

        final Evidence springTest2 = new Evidence("Manifest",
                "Implementation-Title",
                "org.springframework.core",
                Confidence.HIGH);

        final Evidence springTest3 = new Evidence("Manifest",
                "Bundle-Vendor",
                "SpringSource",
                Confidence.HIGH);

        Set<Evidence> evidence = dependency.getProductEvidence().getEvidence();
        if (evidence.contains(springTest1) || evidence.contains(springTest2)) {
            dependency.getProductEvidence().addEvidence("hint analyzer", "product", "springsource_spring_framework", Confidence.HIGH);
            dependency.getVendorEvidence().addEvidence("hint analyzer", "vendor", "SpringSource", Confidence.HIGH);
            dependency.getVendorEvidence().addEvidence("hint analyzer", "vendor", "vmware", Confidence.HIGH);
        }

        evidence = dependency.getVendorEvidence().getEvidence();
        if (evidence.contains(springTest3)) {
            dependency.getProductEvidence().addEvidence("hint analyzer", "product", "springsource_spring_framework", Confidence.HIGH);
            dependency.getVendorEvidence().addEvidence("hint analyzer", "vendor", "vmware", Confidence.HIGH);
        }
        final Iterator<Evidence> itr = dependency.getVendorEvidence().iterator();
        final ArrayList<Evidence> newEntries = new ArrayList<Evidence>();
        while (itr.hasNext()) {
            final Evidence e = itr.next();
            if ("sun".equalsIgnoreCase(e.getValue(false))) {
                final Evidence newEvidence = new Evidence(e.getSource() + " (hint)", e.getName(), "oracle", e.getConfidence());
                newEntries.add(newEvidence);
            } else if ("oracle".equalsIgnoreCase(e.getValue(false))) {
                final Evidence newEvidence = new Evidence(e.getSource() + " (hint)", e.getName(), "sun", e.getConfidence());
                newEntries.add(newEvidence);
            }
        }
        for (Evidence e : newEntries) {
            dependency.getVendorEvidence().addEvidence(e);
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.