@Test public void createDocOrgRelationMatcher() { JavaSparkContext sparkContext = Mockito.mock(JavaSparkContext.class); String inputAvroDocProjPath = "/path/docproj/"; String inputAvroInferredDocProjPath = "/path/docproj/inferred/"; String inputAvroProjOrgPath = "/path/projorg/"; Float inputDocProjConfidenceThreshold = 0.4f; AffOrgMatcher matcher = DocOrgRelationMatcherFactory.createDocOrgRelationMatcher(sparkContext, inputAvroDocProjPath, inputAvroInferredDocProjPath, inputAvroProjOrgPath, inputDocProjConfidenceThreshold); AffOrgJoiner joiner = getInternalState(matcher, AffOrgJoiner.class); assertTrue(joiner instanceof DocOrgRelationAffOrgJoiner); DocumentOrganizationFetcher docOrgFetcher = getInternalState(joiner, DocumentOrganizationFetcher.class); assertTrue(getInternalState(docOrgFetcher, ProjectOrganizationReader.class) instanceof IisProjectOrganizationReader); assertNotNull(getInternalState(docOrgFetcher, DocumentOrganizationCombiner.class)); float actualDocProjConfidenceLevelThreshold = getInternalState(docOrgFetcher, "docProjConfidenceLevelThreshold"); assertEquals(inputDocProjConfidenceThreshold, actualDocProjConfidenceLevelThreshold, PRECISION); assertEquals(sparkContext, getInternalState(docOrgFetcher, JavaSparkContext.class)); assertEquals(inputAvroProjOrgPath, getInternalState(docOrgFetcher, "projOrgPath")); DocumentProjectFetcher docProjFetcher = getInternalState(docOrgFetcher, DocumentProjectFetcher.class); assertTrue(getInternalState(docProjFetcher, "firstDocumentProjectReader") instanceof IisDocumentProjectReader); assertTrue(getInternalState(docProjFetcher, "secondDocumentProjectReader") instanceof IisInferredDocumentProjectReader); assertEquals(inputAvroDocProjPath, getInternalState(docProjFetcher, "firstDocProjPath")); assertEquals(inputAvroInferredDocProjPath, getInternalState(docProjFetcher, "secondDocProjPath")); assertNotNull(getInternalState(docProjFetcher, DocumentProjectMerger.class)); AffOrgMatchComputer computer = getInternalState(matcher, AffOrgMatchComputer.class); List<AffOrgMatchVoter> voters = getInternalState(computer, "affOrgMatchVoters"); assertDocOrgRelationMatcherVoters(voters); }
public static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold) { DocumentOrganizationFetcher documentOrganizationFetcher = new DocumentOrganizationFetcher(); DocumentProjectFetcher documentProjectFetcher = new DocumentProjectFetcher(); documentProjectFetcher.setFirstDocumentProjectReader(new IisDocumentProjectReader()); documentProjectFetcher.setSecondDocumentProjectReader(new IisInferredDocumentProjectReader()); documentProjectFetcher.setDocumentProjectMerger(new DocumentProjectMerger()); documentProjectFetcher.setSparkContext(sparkContext); documentProjectFetcher.setFirstDocProjPath(inputAvroDocProjPath); documentProjectFetcher.setSecondDocProjPath(inputAvroInferredDocProjPath); documentOrganizationFetcher.setDocumentProjectFetcher(documentProjectFetcher); documentOrganizationFetcher.setProjectOrganizationReader(new IisProjectOrganizationReader()); documentOrganizationFetcher.setDocumentOrganizationCombiner(new DocumentOrganizationCombiner()); documentOrganizationFetcher.setDocProjConfidenceLevelThreshold(inputDocProjConfidenceThreshold); documentOrganizationFetcher.setSparkContext(sparkContext); documentOrganizationFetcher.setProjOrgPath(inputAvroProjOrgPath); DocOrgRelationAffOrgJoiner docOrgRelationJoiner = new DocOrgRelationAffOrgJoiner(); docOrgRelationJoiner.setDocumentOrganizationFetcher(documentOrganizationFetcher); AffOrgMatchComputer docOrgRelationMatchComputer = new AffOrgMatchComputer(); docOrgRelationMatchComputer.setAffOrgMatchVoters(createDocOrgRelationMatcherVoters()); return new AffOrgMatcher(docOrgRelationJoiner, docOrgRelationMatchComputer); }
DocOrgRelationMatcherFactory { public static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold) { DocumentOrganizationFetcher documentOrganizationFetcher = new DocumentOrganizationFetcher(); DocumentProjectFetcher documentProjectFetcher = new DocumentProjectFetcher(); documentProjectFetcher.setFirstDocumentProjectReader(new IisDocumentProjectReader()); documentProjectFetcher.setSecondDocumentProjectReader(new IisInferredDocumentProjectReader()); documentProjectFetcher.setDocumentProjectMerger(new DocumentProjectMerger()); documentProjectFetcher.setSparkContext(sparkContext); documentProjectFetcher.setFirstDocProjPath(inputAvroDocProjPath); documentProjectFetcher.setSecondDocProjPath(inputAvroInferredDocProjPath); documentOrganizationFetcher.setDocumentProjectFetcher(documentProjectFetcher); documentOrganizationFetcher.setProjectOrganizationReader(new IisProjectOrganizationReader()); documentOrganizationFetcher.setDocumentOrganizationCombiner(new DocumentOrganizationCombiner()); documentOrganizationFetcher.setDocProjConfidenceLevelThreshold(inputDocProjConfidenceThreshold); documentOrganizationFetcher.setSparkContext(sparkContext); documentOrganizationFetcher.setProjOrgPath(inputAvroProjOrgPath); DocOrgRelationAffOrgJoiner docOrgRelationJoiner = new DocOrgRelationAffOrgJoiner(); docOrgRelationJoiner.setDocumentOrganizationFetcher(documentOrganizationFetcher); AffOrgMatchComputer docOrgRelationMatchComputer = new AffOrgMatchComputer(); docOrgRelationMatchComputer.setAffOrgMatchVoters(createDocOrgRelationMatcherVoters()); return new AffOrgMatcher(docOrgRelationJoiner, docOrgRelationMatchComputer); } }
DocOrgRelationMatcherFactory { public static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold) { DocumentOrganizationFetcher documentOrganizationFetcher = new DocumentOrganizationFetcher(); DocumentProjectFetcher documentProjectFetcher = new DocumentProjectFetcher(); documentProjectFetcher.setFirstDocumentProjectReader(new IisDocumentProjectReader()); documentProjectFetcher.setSecondDocumentProjectReader(new IisInferredDocumentProjectReader()); documentProjectFetcher.setDocumentProjectMerger(new DocumentProjectMerger()); documentProjectFetcher.setSparkContext(sparkContext); documentProjectFetcher.setFirstDocProjPath(inputAvroDocProjPath); documentProjectFetcher.setSecondDocProjPath(inputAvroInferredDocProjPath); documentOrganizationFetcher.setDocumentProjectFetcher(documentProjectFetcher); documentOrganizationFetcher.setProjectOrganizationReader(new IisProjectOrganizationReader()); documentOrganizationFetcher.setDocumentOrganizationCombiner(new DocumentOrganizationCombiner()); documentOrganizationFetcher.setDocProjConfidenceLevelThreshold(inputDocProjConfidenceThreshold); documentOrganizationFetcher.setSparkContext(sparkContext); documentOrganizationFetcher.setProjOrgPath(inputAvroProjOrgPath); DocOrgRelationAffOrgJoiner docOrgRelationJoiner = new DocOrgRelationAffOrgJoiner(); docOrgRelationJoiner.setDocumentOrganizationFetcher(documentOrganizationFetcher); AffOrgMatchComputer docOrgRelationMatchComputer = new AffOrgMatchComputer(); docOrgRelationMatchComputer.setAffOrgMatchVoters(createDocOrgRelationMatcherVoters()); return new AffOrgMatcher(docOrgRelationJoiner, docOrgRelationMatchComputer); } private  DocOrgRelationMatcherFactory(); }
DocOrgRelationMatcherFactory { public static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold) { DocumentOrganizationFetcher documentOrganizationFetcher = new DocumentOrganizationFetcher(); DocumentProjectFetcher documentProjectFetcher = new DocumentProjectFetcher(); documentProjectFetcher.setFirstDocumentProjectReader(new IisDocumentProjectReader()); documentProjectFetcher.setSecondDocumentProjectReader(new IisInferredDocumentProjectReader()); documentProjectFetcher.setDocumentProjectMerger(new DocumentProjectMerger()); documentProjectFetcher.setSparkContext(sparkContext); documentProjectFetcher.setFirstDocProjPath(inputAvroDocProjPath); documentProjectFetcher.setSecondDocProjPath(inputAvroInferredDocProjPath); documentOrganizationFetcher.setDocumentProjectFetcher(documentProjectFetcher); documentOrganizationFetcher.setProjectOrganizationReader(new IisProjectOrganizationReader()); documentOrganizationFetcher.setDocumentOrganizationCombiner(new DocumentOrganizationCombiner()); documentOrganizationFetcher.setDocProjConfidenceLevelThreshold(inputDocProjConfidenceThreshold); documentOrganizationFetcher.setSparkContext(sparkContext); documentOrganizationFetcher.setProjOrgPath(inputAvroProjOrgPath); DocOrgRelationAffOrgJoiner docOrgRelationJoiner = new DocOrgRelationAffOrgJoiner(); docOrgRelationJoiner.setDocumentOrganizationFetcher(documentOrganizationFetcher); AffOrgMatchComputer docOrgRelationMatchComputer = new AffOrgMatchComputer(); docOrgRelationMatchComputer.setAffOrgMatchVoters(createDocOrgRelationMatcherVoters()); return new AffOrgMatcher(docOrgRelationJoiner, docOrgRelationMatchComputer); } private  DocOrgRelationMatcherFactory(); static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, 
            String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold); static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters(); }
DocOrgRelationMatcherFactory { public static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold) { DocumentOrganizationFetcher documentOrganizationFetcher = new DocumentOrganizationFetcher(); DocumentProjectFetcher documentProjectFetcher = new DocumentProjectFetcher(); documentProjectFetcher.setFirstDocumentProjectReader(new IisDocumentProjectReader()); documentProjectFetcher.setSecondDocumentProjectReader(new IisInferredDocumentProjectReader()); documentProjectFetcher.setDocumentProjectMerger(new DocumentProjectMerger()); documentProjectFetcher.setSparkContext(sparkContext); documentProjectFetcher.setFirstDocProjPath(inputAvroDocProjPath); documentProjectFetcher.setSecondDocProjPath(inputAvroInferredDocProjPath); documentOrganizationFetcher.setDocumentProjectFetcher(documentProjectFetcher); documentOrganizationFetcher.setProjectOrganizationReader(new IisProjectOrganizationReader()); documentOrganizationFetcher.setDocumentOrganizationCombiner(new DocumentOrganizationCombiner()); documentOrganizationFetcher.setDocProjConfidenceLevelThreshold(inputDocProjConfidenceThreshold); documentOrganizationFetcher.setSparkContext(sparkContext); documentOrganizationFetcher.setProjOrgPath(inputAvroProjOrgPath); DocOrgRelationAffOrgJoiner docOrgRelationJoiner = new DocOrgRelationAffOrgJoiner(); docOrgRelationJoiner.setDocumentOrganizationFetcher(documentOrganizationFetcher); AffOrgMatchComputer docOrgRelationMatchComputer = new AffOrgMatchComputer(); docOrgRelationMatchComputer.setAffOrgMatchVoters(createDocOrgRelationMatcherVoters()); return new AffOrgMatcher(docOrgRelationJoiner, docOrgRelationMatchComputer); } private  DocOrgRelationMatcherFactory(); static AffOrgMatcher createDocOrgRelationMatcher(JavaSparkContext sparkContext, String inputAvroDocProjPath, String inputAvroInferredDocProjPath, 
            String inputAvroProjOrgPath, Float inputDocProjConfidenceThreshold); static ImmutableList<AffOrgMatchVoter> createDocOrgRelationMatcherVoters();  }