target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void validate_shouldRejectAnEmptyUsernameIfUserIsNotNull() throws Exception { account.setGivenName("give name"); account.setFamilyName("family name"); account.setGender("M"); account.setPrivilegeLevel(fullPrivileges); Errors errors = new BindException(account, "account"); validator.validate(account, errors... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void validate_shouldRejectPasswordAndConfirmPasswordIfTheyDontMatch() throws Exception { account.setGivenName("give name"); account.setFamilyName("family name"); account.setGender("M"); account.setUsername("username"); account.setPassword("password"); account.setConfirmPassword("confirm password"); Errors ... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldCreateErrorWhenConfirmPasswordIsNotProvided() throws Exception { account.setGivenName("give name"); account.setFamilyName("family name"); account.setGender("M"); account.setUsername("username"); account.setPassword("password"); Errors errors = new BindException(account, "account"); validator.val... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldCreateErrorWhenPasswordIsNotProvided() throws Exception { account.setGivenName("give name"); account.setFamilyName("family name"); account.setGender("M"); account.setUsername("username"); account.setConfirmPassword("password"); Errors errors = new BindException(account, "account"); validator.val... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void validate_shouldFailIfNoProviderRoleSpecified() throws Exception { account.setUsername("username"); account.setGivenName("give name"); account.setFamilyName("family name"); account.setGender("M"); account.setPassword("Password123"); account.setConfirmPassword("Password123"); account.setPrivilegeLevel(f... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldReturnNullIfOrderFrequencyNotPresent() throws Exception { when(orderService.getOrderFrequencies(false)).thenReturn(new ArrayList<OrderFrequency>()); OrderFrequency orderFrequency = orderMetadataService.getOrderFrequencyByName(ONCE_A_DAY_CONCEPT_NAME, false); assertNull(orderFrequency); } | public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return orderFrequency; } } retu... | OrderMetadataService { public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return o... | OrderMetadataService { public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return o... | OrderMetadataService { public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return o... | OrderMetadataService { public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return o... |
@Test public void validate_shouldPassForAValidAccount() throws Exception { account.setUsername("username"); account.setGivenName("give name"); account.setFamilyName("family name"); account.setGender("M"); account.setPassword("Password123"); account.setConfirmPassword("Password123"); account.setPrivilegeLevel(fullPrivil... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void validate_shouldRequirePasswordsForNewAUserAccount() throws Exception { account.setUsername("username"); account.setGivenName("give name"); account.setFamilyName("family name"); account.setGender("M"); account.setUsername("username"); account.setPrivilegeLevel(fullPrivileges); Errors errors = new BindE... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void validate_shouldNotRequirePasswordsForExistingUserAccount() throws Exception { account.setUsername("username"); account.setGivenName("give name"); account.setFamilyName("family name"); account.setGender("M"); account.setUsername("username"); account.setPrivilegeLevel(fullPrivileges); account.getUser().... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldCreateAnErrorMessageWhenUsernameHasOnlyOneCharacter() { mockStatic(OpenmrsUtil.class); createAccountWithUsernameAs("a"); Errors errors = new BindException(account, "account"); validator.validate(account, errors); assertTrue(errors.hasErrors()); List<FieldError> errorList = errors.getFieldErrors(... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldCreateAnErrorMessageWhenUsernameHasMoreThanFiftyCharacters() { mockStatic(OpenmrsUtil.class); createAccountWithUsernameAs("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"); Errors errors = new BindException(account, "account"); validator.validate(account, errors); assertTrue(errors.hasE... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldCreateAnErrorMessageWhenUserNameCharactersAreNotValid() { mockStatic(OpenmrsUtil.class); createAccountWithUsernameAs("usern@me"); Errors errors = new BindException(account, "account"); validator.validate(account, errors); assertTrue(errors.hasErrors()); List<FieldError> errorList = errors.getFie... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldValidateIfUserNameCharactersAreValid() { mockStatic(OpenmrsUtil.class); createAccountWithUsernameAs("usern.-_1"); Errors errors = new BindException(account, "account"); validator.validate(account, errors); assertFalse(errors.hasErrors()); } | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldCreateAnErrorMessageWhenUserIsNullAndNoProviderRole() { mockStatic(OpenmrsUtil.class); account.setFamilyName("family name"); account.setGivenName("given Name"); Errors errors = new BindException(account, "account"); validator.validate(account, errors); assertTrue(errors.hasErrors()); } | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldCreateErrorMessageIfUserWithNoCapabilities() { mockStatic(OpenmrsUtil.class); createAccountWithUsernameAs("username"); account.setCapabilities(new HashSet<Role>()); Errors errors = new BindException(account, "account"); validator.validate(account, errors); assertTrue(errors.hasErrors()); List<Fi... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldCreateErrorMessageIfDuplicateUsername() { mockStatic(OpenmrsUtil.class); createAccountWithUsernameAs("username"); when(userService.hasDuplicateUsername(account.getUser())).thenReturn(true); Errors errors = new BindException(account, "account"); validator.validate(account, errors); assertTrue(err... | @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (AccountDomainWrapper) obj; User user = accou... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... | AccountValidator implements Validator { @Override public void validate(Object obj, Errors errors) { if (obj == null || !(obj instanceof AccountDomainWrapper)) throw new IllegalArgumentException("The parameter obj should not be null and must be of type" + AccountDomainWrapper.class); AccountDomainWrapper account = (Acco... |
@Test public void shouldReturnNullOrderFrequencyForNullInput() { assertNull(orderMetadataService.getOrderFrequencyByName(null, false)); } | public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return orderFrequency; } } retu... | OrderMetadataService { public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return o... | OrderMetadataService { public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return o... | OrderMetadataService { public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return o... | OrderMetadataService { public OrderFrequency getOrderFrequencyByName(String conceptName, boolean includeRetired) { List<OrderFrequency> orderFrequencies = orderService.getOrderFrequencies(includeRetired); for (OrderFrequency orderFrequency : orderFrequencies) { if(orderFrequency.getName().equals(conceptName)){ return o... |
@Test public void shouldReturnTrueWhenPassedInDispositionObsGroup() { Obs dispositionSet = createDispositionObsGroup(); assertTrue(dispositionDescriptor.isDisposition(dispositionSet)); } | public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } | DispositionDescriptor extends ConceptSetDescriptor { public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } } | DispositionDescriptor extends ConceptSetDescriptor { public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); } | DispositionDescriptor extends ConceptSetDescriptor { public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispositionSetCo... | DispositionDescriptor extends ConceptSetDescriptor { public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispositionSetCo... |
@Test public void shouldReturnFalseWhenPassedInNonDispositionObsGroup() { Obs notDispositionSet = new Obs(); Concept notDispositionConcept = new Concept(); notDispositionSet.setConcept(notDispositionConcept); assertFalse(dispositionDescriptor.isDisposition(notDispositionSet)); } | public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } | DispositionDescriptor extends ConceptSetDescriptor { public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } } | DispositionDescriptor extends ConceptSetDescriptor { public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); } | DispositionDescriptor extends ConceptSetDescriptor { public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispositionSetCo... | DispositionDescriptor extends ConceptSetDescriptor { public boolean isDisposition(Obs obs) { return obs.getConcept().equals(dispositionSetConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispositionSetCo... |
@Test public void shouldBuildDispositionObsGroup() { Disposition admissionDisposition = new Disposition(); admissionDisposition.setConceptCode("ADMISSION"); Obs dispositionObsGroup = dispositionDescriptor.buildObsGroup(admissionDisposition, emrConceptService); assertThat(dispositionObsGroup.getConcept(), is(disposition... | public Obs buildObsGroup(Disposition disposition, EmrConceptService emrConceptService) { Obs dispoObs = new Obs(); dispoObs.setConcept(dispositionConcept); dispoObs.setValueCoded(emrConceptService.getConcept(disposition.getConceptCode())); Obs group = new Obs(); group.setConcept(dispositionSetConcept); group.addGroupMe... | DispositionDescriptor extends ConceptSetDescriptor { public Obs buildObsGroup(Disposition disposition, EmrConceptService emrConceptService) { Obs dispoObs = new Obs(); dispoObs.setConcept(dispositionConcept); dispoObs.setValueCoded(emrConceptService.getConcept(disposition.getConceptCode())); Obs group = new Obs(); grou... | DispositionDescriptor extends ConceptSetDescriptor { public Obs buildObsGroup(Disposition disposition, EmrConceptService emrConceptService) { Obs dispoObs = new Obs(); dispoObs.setConcept(dispositionConcept); dispoObs.setValueCoded(emrConceptService.getConcept(disposition.getConceptCode())); Obs group = new Obs(); grou... | DispositionDescriptor extends ConceptSetDescriptor { public Obs buildObsGroup(Disposition disposition, EmrConceptService emrConceptService) { Obs dispoObs = new Obs(); dispoObs.setConcept(dispositionConcept); dispoObs.setValueCoded(emrConceptService.getConcept(disposition.getConceptCode())); Obs group = new Obs(); grou... | DispositionDescriptor extends ConceptSetDescriptor { public Obs buildObsGroup(Disposition disposition, EmrConceptService emrConceptService) { Obs dispoObs = new Obs(); dispoObs.setConcept(dispositionConcept); dispoObs.setValueCoded(emrConceptService.getConcept(disposition.getConceptCode())); Obs group = new Obs(); grou... |
@Test public void shouldFetchAdmissionLocationObsOffObsGroup() { Obs dispositionObsGroup = createDispositionObsGroup(); Obs admissionLocation = new Obs(); admissionLocation.setConcept(admissionLocationConcept); dispositionObsGroup.addGroupMember(admissionLocation); assertThat(dispositionDescriptor.getAdmissionLocationO... | public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispo... | DispositionDescriptor extends ConceptSetDescriptor { public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispo... |
@Test public void shouldNotFailIfNoMatchingObsWhenFetchingAdmissionLocationObs() { Obs dispositionObsGroup = createDispositionObsGroup(); assertNull(dispositionDescriptor.getAdmissionLocationObs(dispositionObsGroup)); } | public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispo... | DispositionDescriptor extends ConceptSetDescriptor { public Obs getAdmissionLocationObs(Obs obsGroup) { return findMember(obsGroup, admissionLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispo... |
@Test public void shouldFetchTransferLocationObsOffObsGroup() { Obs dispositionObsGroup = createDispositionObsGroup(); Obs transferLocation = new Obs(); transferLocation.setConcept(transferLocationConcept); dispositionObsGroup.addGroupMember(transferLocation); assertThat(dispositionDescriptor.getInternalTransferLocatio... | public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept... | DispositionDescriptor extends ConceptSetDescriptor { public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept... |
@Test public void shouldNotFailIfNoMatchingObsWhenFetchingTransferLocationOffObsGroup() { Obs dispositionObsGroup = createDispositionObsGroup(); assertNull(dispositionDescriptor.getInternalTransferLocationObs(dispositionObsGroup)); } | public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept... | DispositionDescriptor extends ConceptSetDescriptor { public Obs getInternalTransferLocationObs(Obs obsGroup) { return findMember(obsGroup, internalTransferLocationConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept... |
@Test public void shouldFetchDateOfDeathObsOffObsGroup() { Obs dispositionObsGroup = createDispositionObsGroup(); Obs dateOfDeath = new Obs(); dateOfDeath.setConcept(dateOfDeathConcept); dispositionObsGroup.addGroupMember(dateOfDeath); assertThat(dispositionDescriptor.getDateOfDeathObs(dispositionObsGroup), is(dateOfDe... | public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispositionSetCon... | DispositionDescriptor extends ConceptSetDescriptor { public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispositionSetCon... |
@Test public void shouldNotFailIfNoMatchingObsWhenDateOfDeath() { Obs dispositionObsGroup = createDispositionObsGroup(); assertNull(dispositionDescriptor.getDateOfDeathObs(dispositionObsGroup)); } | public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); } | DispositionDescriptor extends ConceptSetDescriptor { public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispositionSetCon... | DispositionDescriptor extends ConceptSetDescriptor { public Obs getDateOfDeathObs(Obs obsGroup) { return findMember(obsGroup, dateOfDeathConcept); } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); Concept getDispositionSetConcept(); void setDispositionSetConcept(Concept dispositionSetCon... |
@Test public void shouldFetchAdmissionLocationOffObsGroup() { Obs dispositionObsGroup = createDispositionObsGroup(); Obs admissionLocationObs = new Obs(); admissionLocationObs.setConcept(admissionLocationConcept); admissionLocationObs.setValueText(admissionLocation.getId().toString()); dispositionObsGroup.addGroupMembe... | public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueText())); } else { return null; } } | DispositionDescriptor extends ConceptSetDescriptor { public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueTex... | DispositionDescriptor extends ConceptSetDescriptor { public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueTex... | DispositionDescriptor extends ConceptSetDescriptor { public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueTex... | DispositionDescriptor extends ConceptSetDescriptor { public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueTex... |
@Test public void shouldSaveNewDrugOrdersInTheSequenceOfOrdering() throws ParseException { EmrOrderServiceImpl_1_12 emrOrderService = new EmrOrderServiceImpl_1_12(openMRSDrugOrderMapper, encounterService, openMRSOrderMapper, orderSetService, openMRSOrderGroupMapper); EncounterTransaction.DrugOrder drugOrder1 = new Drug... | @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGroups, drugOrder.getOrderGroup(), encounter... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderG... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderG... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderG... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderG... |
@Test public void shouldNotFailIfNoMatchingObsWhenFetchingAdmissionLocation() { Obs dispositionObsGroup = createDispositionObsGroup(); assertNull(dispositionDescriptor.getAdmissionLocation(dispositionObsGroup, locationService)); } | public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueText())); } else { return null; } } | DispositionDescriptor extends ConceptSetDescriptor { public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueTex... | DispositionDescriptor extends ConceptSetDescriptor { public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueTex... | DispositionDescriptor extends ConceptSetDescriptor { public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueTex... | DispositionDescriptor extends ConceptSetDescriptor { public Location getAdmissionLocation(Obs obsGroup, LocationService locationService) { Obs admissionLocationObs = getAdmissionLocationObs(obsGroup); if (admissionLocationObs != null) { return locationService.getLocation(Integer.valueOf(admissionLocationObs.getValueTex... |
@Test public void shouldFetchTransferLocationOffObsGroup() { Obs dispositionObsGroup = createDispositionObsGroup(); Obs transferLocationObs = new Obs(); transferLocationObs.setConcept(transferLocationConcept); transferLocationObs.setValueText(transferLocation.getId().toString()); dispositionObsGroup.addGroupMember(tran... | public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.getValueText())); } else { return null; } } | DispositionDescriptor extends ConceptSetDescriptor { public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.... | DispositionDescriptor extends ConceptSetDescriptor { public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.... | DispositionDescriptor extends ConceptSetDescriptor { public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.... | DispositionDescriptor extends ConceptSetDescriptor { public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.... |
@Test public void shouldNotFailIfNoMatchingObsWhenFetchingTransferLocation() { Obs dispositionObsGroup = createDispositionObsGroup(); assertNull(dispositionDescriptor.getInternalTransferLocation(dispositionObsGroup, locationService)); } | public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.getValueText())); } else { return null; } } | DispositionDescriptor extends ConceptSetDescriptor { public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.... | DispositionDescriptor extends ConceptSetDescriptor { public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.... | DispositionDescriptor extends ConceptSetDescriptor { public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.... | DispositionDescriptor extends ConceptSetDescriptor { public Location getInternalTransferLocation(Obs obsGroup, LocationService locationService) { Obs transferLocationObs = getInternalTransferLocationObs(obsGroup); if (transferLocationObs != null) { return locationService.getLocation(Integer.valueOf(transferLocationObs.... |
@Test public void shouldFetchDateOfDeathOffObsGroup() { Obs dispositionObsGroup = createDispositionObsGroup(); Date dateOfDeath = new Date(); Obs dateOfDeathObs = new Obs(); dateOfDeathObs.setConcept(dateOfDeathConcept); dateOfDeathObs.setValueDate(dateOfDeath); dispositionObsGroup.addGroupMember(dateOfDeathObs); asser... | public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } | DispositionDescriptor extends ConceptSetDescriptor { public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } } | DispositionDescriptor extends ConceptSetDescriptor { public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); ... | DispositionDescriptor extends ConceptSetDescriptor { public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); ... | DispositionDescriptor extends ConceptSetDescriptor { public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); ... |
@Test public void shouldFetchAdditionalObsOffObsGroup() { Obs dispositionObsGroup = createDispositionObsGroup(); Obs admissionLocationObs = new Obs(); admissionLocationObs.setConcept(admissionLocationConcept); admissionLocationObs.setValueText(admissionLocation.getId().toString()); dispositionObsGroup.addGroupMember(ad... | public List<Obs> getAdditionalObs(Obs obsGroup) { List<Obs> notDisposition = new ArrayList<Obs>(); if (obsGroup.hasGroupMembers()) { for (Obs candidate : obsGroup.getGroupMembers()) { if (!candidate.getConcept().equals(dispositionConcept) && !candidate.getConcept().equals(admissionLocationConcept) && !candidate.getConc... | DispositionDescriptor extends ConceptSetDescriptor { public List<Obs> getAdditionalObs(Obs obsGroup) { List<Obs> notDisposition = new ArrayList<Obs>(); if (obsGroup.hasGroupMembers()) { for (Obs candidate : obsGroup.getGroupMembers()) { if (!candidate.getConcept().equals(dispositionConcept) && !candidate.getConcept().e... | DispositionDescriptor extends ConceptSetDescriptor { public List<Obs> getAdditionalObs(Obs obsGroup) { List<Obs> notDisposition = new ArrayList<Obs>(); if (obsGroup.hasGroupMembers()) { for (Obs candidate : obsGroup.getGroupMembers()) { if (!candidate.getConcept().equals(dispositionConcept) && !candidate.getConcept().e... | DispositionDescriptor extends ConceptSetDescriptor { public List<Obs> getAdditionalObs(Obs obsGroup) { List<Obs> notDisposition = new ArrayList<Obs>(); if (obsGroup.hasGroupMembers()) { for (Obs candidate : obsGroup.getGroupMembers()) { if (!candidate.getConcept().equals(dispositionConcept) && !candidate.getConcept().e... | DispositionDescriptor extends ConceptSetDescriptor { public List<Obs> getAdditionalObs(Obs obsGroup) { List<Obs> notDisposition = new ArrayList<Obs>(); if (obsGroup.hasGroupMembers()) { for (Obs candidate : obsGroup.getGroupMembers()) { if (!candidate.getConcept().equals(dispositionConcept) && !candidate.getConcept().e... |
@Test public void shouldNotFailIfNoMatchingObsWhenFetchingDateOfDeath() { Obs dispositionObsGroup = createDispositionObsGroup(); assertNull(dispositionDescriptor.getDateOfDeath(dispositionObsGroup)); } | public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } | DispositionDescriptor extends ConceptSetDescriptor { public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } } | DispositionDescriptor extends ConceptSetDescriptor { public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); ... | DispositionDescriptor extends ConceptSetDescriptor { public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); ... | DispositionDescriptor extends ConceptSetDescriptor { public Date getDateOfDeath(Obs obsGroup) { Obs dateOfDeathObs = getDateOfDeathObs(obsGroup); if (dateOfDeathObs != null) { return dateOfDeathObs.getValueDate(); } else { return null; } } DispositionDescriptor(ConceptService conceptService); DispositionDescriptor(); ... |
@Test public void testActionShouldCreateTransferAction() throws Exception { final Location toLocation = new Location(); final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); Location transferLocation = dispositionService.getDispositionDescriptor(... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... |
@Test public void testActionShouldDoNothingIfAlreadyAdmittedToTransferLocation() throws Exception { final Location toLocation = new Location(); final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); Location transferLocation = dispositionService.getDispositionDescriptor(... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... |
@Test public void testActionShouldCreateTransferEncounterIfPatientNotAdmitted() throws Exception { final Location toLocation = new Location(); final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit)... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); Location transferLocation = dispositionService.getDispositionDescriptor(... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... | TransferToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()... |
@Test public void shouldCloseActiveVisit() throws Exception { final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider(new EncounterRole(), new Provider()); encounter.setEncoun... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); if (visitDomai... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... |
@Test public void shouldSaveNewDrugOrdersInTheSequenceOfOrderingToAnEncounterWithExistingOrders() throws ParseException { EmrOrderServiceImpl_1_12 emrOrderService = new EmrOrderServiceImpl_1_12(openMRSDrugOrderMapper, encounterService, openMRSOrderMapper, orderSetService, openMRSOrderGroupMapper); EncounterTransaction.... | @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGroups, drugOrder.getOrderGroup(), encounter... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderG... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderG... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderG... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void save(List<EncounterTransaction.DrugOrder> drugOrders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.DrugOrder drugOrder : drugOrders) { OrderGroup orderGroup = mapToOpenMRSOrderG... |
@Test public void shouldCloseActiveVisitIfSubsequentEncountersButOnSameDay() throws Exception { final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider(new EncounterRole(), ne... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); if (visitDomai... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... |
@Test public void shouldNotCloseActiveVisitIfSubsequentEncountersOnAnotherDay() throws Exception { final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider(new EncounterRole(),... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); if (visitDomai... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... |
@Test public void shouldNotCloseVisitThatIsNotActive() throws Exception { final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider(new EncounterRole(), new Provider()); encount... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); if (visitDomai... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... | CloseCurrentVisitDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters){ if (encounterDomainWrapper.getVisit() == null) { return; } VisitDomainWrapper visitDomainWrapper = ... |
@Test public void testDischargesIfAdmitted() throws Exception { final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider(new EncounterRole(), new Provider()); encounter.setEnco... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtService.wrap(visit); if (visitDomainWrapper.isAdmitted()) { AdtAction di... | DischargeIfAdmittedDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtServ... | DischargeIfAdmittedDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtServ... | DischargeIfAdmittedDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtServ... | DischargeIfAdmittedDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtServ... |
@Test public void testDoesNotDischargesIfNotAdmitted() throws Exception { final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider(new EncounterRole(), new Provider()); encount... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtService.wrap(visit); if (visitDomainWrapper.isAdmitted()) { AdtAction di... | DischargeIfAdmittedDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtServ... | DischargeIfAdmittedDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtServ... | DischargeIfAdmittedDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtServ... | DischargeIfAdmittedDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Visit visit = encounterDomainWrapper.getVisit(); VisitDomainWrapper visitDomainWrapper = adtServ... |
@Test public void testAction() throws Exception { final Location toLocation = new Location(); final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider(new EncounterRole(), new ... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); if (visitDomainWrapper.isAdmitted(encounterDomainWrapper.getEncounterDat... | AdmitToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); ... | AdmitToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); ... | AdmitToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); ... | AdmitToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); ... |
@Test public void testActionWhenAlreadyAdmitted() throws Exception { final Visit visit = new Visit(); final Encounter encounter = new Encounter(); final Date encounterDate = (new DateTime(2013, 05, 13, 20, 26)).toDate(); encounter.setVisit(visit); encounter.addProvider(new EncounterRole(), new Provider()); encounter.se... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); if (visitDomainWrapper.isAdmitted(encounterDomainWrapper.getEncounterDat... | AdmitToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); ... | AdmitToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); ... | AdmitToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); ... | AdmitToSpecificLocationDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { VisitDomainWrapper visitDomainWrapper = adtService.wrap(encounterDomainWrapper.getVisit()); ... |
@Test public void testActionShouldMarkPatientAsDead() throws Exception { Concept unknown = new Concept(); when(emrApiProperties.getUnknownCauseOfDeathConcept()).thenReturn(unknown); Date expectedDeathDate = (new DateTime(2013, 05, 10, 20, 26)).toDate(); Patient patient = new Patient(); final Visit visit = new Visit(); ... | @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Date deathDate = dispositionService.getDispositionDescriptor().getDateOfDeath(dispositionObsGroupBeingCreated); Concept causeOfDeath = emrApiProperties.getUnknownCa... | MarkPatientDeadDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Date deathDate = dispositionService.getDispositionDescriptor().getDateOfDeath(dispositionObsGroupBei... | MarkPatientDeadDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Date deathDate = dispositionService.getDispositionDescriptor().getDateOfDeath(dispositionObsGroupBei... | MarkPatientDeadDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Date deathDate = dispositionService.getDispositionDescriptor().getDateOfDeath(dispositionObsGroupBei... | MarkPatientDeadDispositionAction implements DispositionAction { @Override public void action(EncounterDomainWrapper encounterDomainWrapper, Obs dispositionObsGroupBeingCreated, Map<String, String[]> requestParameters) { Date deathDate = dispositionService.getDispositionDescriptor().getDateOfDeath(dispositionObsGroupBei... |
@Test public void testFormatFreeText() throws Exception { String actual = new CodedOrFreeTextAnswer("Free text").format(Locale.ENGLISH); assertThat(actual, is("\"Free text\"")); } | public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && specificCodedAnswer.getLo... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... |
@Test public void testFormatCoded() throws Exception { Concept concept = new Concept(); concept.addName(new ConceptName("English", Locale.ENGLISH)); String actual = new CodedOrFreeTextAnswer(concept).format(Locale.ENGLISH); assertThat(actual, is("English")); } | public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && specificCodedAnswer.getLo... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... |
@Test public void shouldSaveOrders() throws ParseException { EmrOrderServiceImpl_1_12 emrOrderService = new EmrOrderServiceImpl_1_12(openMRSDrugOrderMapper, encounterService, openMRSOrderMapper, orderSetService, openMRSOrderGroupMapper); EncounterTransaction.Order order1 = new OrderBuilder().withConceptUuid("concept-uu... | @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGroups, order.getOrderGroup(), encounter); Order omrsOrder... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGrou... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGrou... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGrou... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGrou... |
@Test public void testFormatSpecificCoded() throws Exception { ConceptName preferredEnglishName = new ConceptName("English", Locale.ENGLISH); preferredEnglishName.setLocalePreferred(true); preferredEnglishName.setConceptNameType(ConceptNameType.FULLY_SPECIFIED); ConceptName frenchSynonym = new ConceptName("Français", L... | public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && specificCodedAnswer.getLo... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... |
@Test public void testFormatSpecificCodedWhenItIsLocalePreferred() throws Exception { ConceptName preferred = new ConceptName("Preferred", Locale.ENGLISH); preferred.setLocalePreferred(true); preferred.setConceptNameType(ConceptNameType.FULLY_SPECIFIED); ConceptName synonym = new ConceptName("Synonym", Locale.ENGLISH);... | public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && specificCodedAnswer.getLo... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... |
@Test public void testFormatSpecificCodedWithIdenticalName() throws Exception { ConceptName preferredEnglishName = new ConceptName("English", Locale.ENGLISH); preferredEnglishName.setLocalePreferred(true); preferredEnglishName.setConceptNameType(ConceptNameType.FULLY_SPECIFIED); ConceptName ukEnglishSynonym = new Conce... | public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && specificCodedAnswer.getLo... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... | CodedOrFreeTextAnswer { public String format(Locale locale) { if (nonCodedAnswer != null) { return "\"" + nonCodedAnswer + "\""; } else if (codedAnswer == null) { return "?"; } else if (specificCodedAnswer == null) { return codedAnswer.getName(locale).getName(); } else { if (specificCodedAnswer.isLocalePreferred() && s... |
@Test public void shouldProperlySetupConcepts() { ConceptSetDescriptorImpl conceptSetDescriptorImpl = new ConceptSetDescriptorImpl(); conceptSetDescriptorImpl.setup(conceptService, "someConceptSource", ConceptSetDescriptorField.required("setConcept", "setConceptCode"), ConceptSetDescriptorField.required("firstMemberCon... | protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConceptByMapping(primaryConc... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... |
@Test(expected = IllegalStateException.class) public void shouldRaiseExceptionIfRequiredConceptDoesNotExist() { ConceptSetDescriptorImpl conceptSetDescriptorImpl = new ConceptSetDescriptorImpl(); conceptSetDescriptorImpl.setup(conceptService, "someConceptSource", ConceptSetDescriptorField.required("setConcept", "setCon... | protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConceptByMapping(primaryConc... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... |
@Test public void shouldNotRaiseExceptionIfOptionalConceptDoesNotExist() { ConceptSetDescriptorImpl conceptSetDescriptorImpl = new ConceptSetDescriptorImpl(); conceptSetDescriptorImpl.setup(conceptService, "someConceptSource", ConceptSetDescriptorField.required("setConcept", "setConceptCode"), ConceptSetDescriptorField... | protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConceptByMapping(primaryConc... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... | ConceptSetDescriptor { protected void setup(ConceptService conceptService, String conceptSourceName, ConceptSetDescriptorField primaryConceptField, ConceptSetDescriptorField... memberConceptFields) { try { String primaryConceptCode = primaryConceptField.getConceptCode(); Concept primaryConcept = conceptService.getConce... |
@Ignore("TEMP HACK: disable this while we decide whether or not we want this functionality") @Test(expected = IllegalStateException.class) public void testThrowsExceptionIfNoSuitableVisitExists() throws Exception { Patient patient = new Patient(); Location location = new Location(); Visit notSuitable = new Visit(); not... | @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocation() == null) { return; } List<Patient> patient = Collections.singletonList(encounter.getPatient(... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... |
@Test public void testAssigningASuitableVisitWhenOneExists() throws Exception { Patient patient = new Patient(); Location location = new Location(); Visit notSuitable = new Visit(); notSuitable.setPatient(patient); notSuitable.setStartDatetime(DateUtils.addDays(new Date(), -7)); notSuitable.setStopDatetime(DateUtils.ad... | @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocation() == null) { return; } List<Patient> patient = Collections.singletonList(encounter.getPatient(... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... |
@Test public void testAdjustingEncounterTimeToStartOfVisitWhenAssignedToVisit() throws Exception { Patient patient = new Patient(); Location location = new Location(); Visit suitable = new Visit(); suitable.setPatient(patient); suitable.setStartDatetime(new DateTime().withTimeAtStartOfDay().minusDays(1).plusHours(12).t... | @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocation() == null) { return; } List<Patient> patient = Collections.singletonList(encounter.getPatient(... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... |
@Test public void testAdjustingEncounterTimeToEndOfVisitWhenAssignedToVisit() throws Exception { Patient patient = new Patient(); Location location = new Location(); Visit suitable = new Visit(); suitable.setPatient(patient); suitable.setStartDatetime(new DateTime().withTimeAtStartOfDay().minusDays(1).plusHours(12).toD... | @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocation() == null) { return; } List<Patient> patient = Collections.singletonList(encounter.getPatient(... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... | EmrApiVisitAssignmentHandler extends BaseEncounterVisitHandler implements EncounterVisitHandler { @Override public void beforeCreateEncounter(Encounter encounter) { if (encounter.getVisit() != null) { return; } Date when = encounter.getEncounterDatetime(); if (when == null) { when = new Date(); } if (encounter.getLocat... |
@Test public void shouldSaveOrdersWithOrderGroups() throws ParseException { EmrOrderServiceImpl_1_12 emrOrderService = new EmrOrderServiceImpl_1_12(openMRSDrugOrderMapper, encounterService, openMRSOrderMapper, orderSetService, openMRSOrderGroupMapper); EncounterTransaction.Order order1 = new OrderBuilder().withConceptU... | @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGroups, order.getOrderGroup(), encounter); Order omrsOrder... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGrou... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGrou... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGrou... | EmrOrderServiceImpl_1_12 implements EmrOrderService { @Override public void saveOrders(List<EncounterTransaction.Order> orders, Encounter encounter) { Set<OrderGroup> orderGroups = new LinkedHashSet<OrderGroup>(); for (EncounterTransaction.Order order : orders) { OrderGroup orderGroup = mapToOpenMRSOrderGroup(orderGrou... |
@Test public void TestCalc() { InputStream resourceAsStream = getClass().getResourceAsStream("note_frequencies.csv"); try (BufferedReader reader = new BufferedReader(new InputStreamReader(resourceAsStream))) { while (reader.ready()) { String line = reader.readLine(); String[] components = line.split(","); String noteWi... | public double getFrequency(Note note) { int semitonesPerOctave = 12; int referenceOctave = 4; double distance = semitonesPerOctave * (note.getOctave() - referenceOctave); distance += notes.indexOf(note.getName() + note.getSign()) - notes.indexOf("A"); return referenceFrequency * Math.pow(2, distance / 12); } | NoteFrequencyCalculator { public double getFrequency(Note note) { int semitonesPerOctave = 12; int referenceOctave = 4; double distance = semitonesPerOctave * (note.getOctave() - referenceOctave); distance += notes.indexOf(note.getName() + note.getSign()) - notes.indexOf("A"); return referenceFrequency * Math.pow(2, di... | NoteFrequencyCalculator { public double getFrequency(Note note) { int semitonesPerOctave = 12; int referenceOctave = 4; double distance = semitonesPerOctave * (note.getOctave() - referenceOctave); distance += notes.indexOf(note.getName() + note.getSign()) - notes.indexOf("A"); return referenceFrequency * Math.pow(2, di... | NoteFrequencyCalculator { public double getFrequency(Note note) { int semitonesPerOctave = 12; int referenceOctave = 4; double distance = semitonesPerOctave * (note.getOctave() - referenceOctave); distance += notes.indexOf(note.getName() + note.getSign()) - notes.indexOf("A"); return referenceFrequency * Math.pow(2, di... | NoteFrequencyCalculator { public double getFrequency(Note note) { int semitonesPerOctave = 12; int referenceOctave = 4; double distance = semitonesPerOctave * (note.getOctave() - referenceOctave); distance += notes.indexOf(note.getName() + note.getSign()) - notes.indexOf("A"); return referenceFrequency * Math.pow(2, di... |
@Test public void retrieveNote() { PowerMockito.mockStatic(MainActivity.class); Mockito.when(MainActivity.getCurrentTuning()).thenReturn(new GuitarTuning()); Mockito.when(MainActivity.getReferencePitch()).thenReturn(440); Map<Float, PitchDifference> expectations = new HashMap<>(); expectations.put(20f, new PitchDiffere... | static PitchDifference retrieveNote(float pitch) { Tuning tuning = MainActivity.getCurrentTuning(); int referencePitch = MainActivity.getReferencePitch(); Note[] notes = tuning.getNotes(); NoteFrequencyCalculator noteFrequencyCalculator = new NoteFrequencyCalculator(referencePitch); Arrays.sort(notes, (o1, o2) -> Doubl... | PitchComparator { static PitchDifference retrieveNote(float pitch) { Tuning tuning = MainActivity.getCurrentTuning(); int referencePitch = MainActivity.getReferencePitch(); Note[] notes = tuning.getNotes(); NoteFrequencyCalculator noteFrequencyCalculator = new NoteFrequencyCalculator(referencePitch); Arrays.sort(notes,... | PitchComparator { static PitchDifference retrieveNote(float pitch) { Tuning tuning = MainActivity.getCurrentTuning(); int referencePitch = MainActivity.getReferencePitch(); Note[] notes = tuning.getNotes(); NoteFrequencyCalculator noteFrequencyCalculator = new NoteFrequencyCalculator(referencePitch); Arrays.sort(notes,... | PitchComparator { static PitchDifference retrieveNote(float pitch) { Tuning tuning = MainActivity.getCurrentTuning(); int referencePitch = MainActivity.getReferencePitch(); Note[] notes = tuning.getNotes(); NoteFrequencyCalculator noteFrequencyCalculator = new NoteFrequencyCalculator(referencePitch); Arrays.sort(notes,... | PitchComparator { static PitchDifference retrieveNote(float pitch) { Tuning tuning = MainActivity.getCurrentTuning(); int referencePitch = MainActivity.getReferencePitch(); Note[] notes = tuning.getNotes(); NoteFrequencyCalculator noteFrequencyCalculator = new NoteFrequencyCalculator(referencePitch); Arrays.sort(notes,... |
@Test public void the_average_difference_is_calculated_correctly() { List<PitchDifference> samples = new ArrayList<>(); samples.add(new PitchDifference(E2, 2.46D)); samples.add(new PitchDifference(E2, -10.3D)); samples.add(new PitchDifference(E2, 5.71D)); samples.add(new PitchDifference(E2, 12.532D)); samples.add(new P... | static PitchDifference calculateAverageDifference(List<PitchDifference> samples) { Note mostFrequentNote = extractMostFrequentNote(samples); List<PitchDifference> filteredSamples = filterByNote(samples, mostFrequentNote); double deviationSum = 0; int sameNoteCount = 0; for (PitchDifference pitchDifference : filteredSam... | Sampler { static PitchDifference calculateAverageDifference(List<PitchDifference> samples) { Note mostFrequentNote = extractMostFrequentNote(samples); List<PitchDifference> filteredSamples = filterByNote(samples, mostFrequentNote); double deviationSum = 0; int sameNoteCount = 0; for (PitchDifference pitchDifference : f... | Sampler { static PitchDifference calculateAverageDifference(List<PitchDifference> samples) { Note mostFrequentNote = extractMostFrequentNote(samples); List<PitchDifference> filteredSamples = filterByNote(samples, mostFrequentNote); double deviationSum = 0; int sameNoteCount = 0; for (PitchDifference pitchDifference : f... | Sampler { static PitchDifference calculateAverageDifference(List<PitchDifference> samples) { Note mostFrequentNote = extractMostFrequentNote(samples); List<PitchDifference> filteredSamples = filterByNote(samples, mostFrequentNote); double deviationSum = 0; int sameNoteCount = 0; for (PitchDifference pitchDifference : f... | Sampler { static PitchDifference calculateAverageDifference(List<PitchDifference> samples) { Note mostFrequentNote = extractMostFrequentNote(samples); List<PitchDifference> filteredSamples = filterByNote(samples, mostFrequentNote); double deviationSum = 0; int sameNoteCount = 0; for (PitchDifference pitchDifference : f... |
@Test public void samples_are_filtered_correctly() { List<PitchDifference> samples = new ArrayList<>(); samples.add(new PitchDifference(E2, 2D)); samples.add(new PitchDifference(E2, 2D)); samples.add(new PitchDifference(B3, 3D)); samples.add(new PitchDifference(E2, 2D)); samples.add(new PitchDifference(G3, 4D)); sample... | static List<PitchDifference> filterByNote(List<PitchDifference> samples, Note note) { List<PitchDifference> filteredSamples = new ArrayList<>(); for (PitchDifference sample : samples) { if (sample.closest == note) { filteredSamples.add(sample); } } return filteredSamples; } | Sampler { static List<PitchDifference> filterByNote(List<PitchDifference> samples, Note note) { List<PitchDifference> filteredSamples = new ArrayList<>(); for (PitchDifference sample : samples) { if (sample.closest == note) { filteredSamples.add(sample); } } return filteredSamples; } } | Sampler { static List<PitchDifference> filterByNote(List<PitchDifference> samples, Note note) { List<PitchDifference> filteredSamples = new ArrayList<>(); for (PitchDifference sample : samples) { if (sample.closest == note) { filteredSamples.add(sample); } } return filteredSamples; } } | Sampler { static List<PitchDifference> filterByNote(List<PitchDifference> samples, Note note) { List<PitchDifference> filteredSamples = new ArrayList<>(); for (PitchDifference sample : samples) { if (sample.closest == note) { filteredSamples.add(sample); } } return filteredSamples; } } | Sampler { static List<PitchDifference> filterByNote(List<PitchDifference> samples, Note note) { List<PitchDifference> filteredSamples = new ArrayList<>(); for (PitchDifference sample : samples) { if (sample.closest == note) { filteredSamples.add(sample); } } return filteredSamples; } } |
@Test public void the_most_frequent_note_is_extracted_correctly() { List<PitchDifference> samples = new ArrayList<>(); samples.add(new PitchDifference(E2, 2D)); samples.add(new PitchDifference(E2, 2D)); samples.add(new PitchDifference(B3, 3D)); samples.add(new PitchDifference(E2, 2D)); samples.add(new PitchDifference(G... | static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFrequencies.p... | Sampler { static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFre... | Sampler { static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFre... | Sampler { static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFre... | Sampler { static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFre... |
@Test public void if_there_are_notes_with_the_same_number_of_occurrences_one_of_them_is_returned() { List<PitchDifference> samples = new ArrayList<>(); samples.add(new PitchDifference(G3, 2D)); samples.add(new PitchDifference(E2, 2D)); samples.add(new PitchDifference(B3, 3D)); samples.add(new PitchDifference(E2, 2D)); ... | static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFrequencies.p... | Sampler { static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFre... | Sampler { static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFre... | Sampler { static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFre... | Sampler { static Note extractMostFrequentNote(List<PitchDifference> samples) { Map<Note, Integer> noteFrequencies = new HashMap<>(); for (PitchDifference pitchDifference : samples) { Note closest = pitchDifference.closest; if (noteFrequencies.containsKey(closest)) { Integer count = noteFrequencies.get(closest); noteFre... |
@Test public void testGetInputFormat() { assertEquals(FormatService.getInputFormat("turtle"), SerializationFormatFactory.createTurtle()); assertEquals(FormatService.getInputFormat("ttl"), SerializationFormatFactory.createTurtle()); assertEquals(FormatService.getInputFormat("ntriples"), SerializationFormatFactory.create... | public static SerializationFormat getInputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsInput(name)) { return ft; } } return null; } | FormatService { public static SerializationFormat getInputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsInput(name)) { return ft; } } return null; } } | FormatService { public static SerializationFormat getInputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsInput(name)) { return ft; } } return null; } private FormatService(); } | FormatService { public static SerializationFormat getInputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsInput(name)) { return ft; } } return null; } private FormatService(); static SerializationFormat getInputFormat(String name); static SerializationFormat getO... | FormatService { public static SerializationFormat getInputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsInput(name)) { return ft; } } return null; } private FormatService(); static SerializationFormat getInputFormat(String name); static SerializationFormat getO... |
@Test public void fillSchemaServiceFromLOVTest() throws IOException { int currentSize = SchemaService.getSize(); RDFUnitUtils.fillSchemaServiceFromLOV(); assertThat(SchemaService.getSize()) .isGreaterThan(currentSize); } | public static void fillSchemaServiceFromLOV() throws IOException { log.info("Loading cached schema entries from LOV!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaLOV.csv"); } | RDFUnitUtils { public static void fillSchemaServiceFromLOV() throws IOException { log.info("Loading cached schema entries from LOV!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaLOV.csv"); } } | RDFUnitUtils { public static void fillSchemaServiceFromLOV() throws IOException { log.info("Loading cached schema entries from LOV!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaLOV.csv"); } private RDFUnitUtils(); } | RDFUnitUtils { public static void fillSchemaServiceFromLOV() throws IOException { log.info("Loading cached schema entries from LOV!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaLOV.csv"); } private RDFUnitUtils(); static void fillSchemaServiceFromFile(String additionalCSV); stati... | RDFUnitUtils { public static void fillSchemaServiceFromLOV() throws IOException { log.info("Loading cached schema entries from LOV!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaLOV.csv"); } private RDFUnitUtils(); static void fillSchemaServiceFromFile(String additionalCSV); stati... |
@Test public void fillSchemaServiceFromDeclTest() throws IOException { int currentSize = SchemaService.getSize(); RDFUnitUtils.fillSchemaServiceFromSchemaDecl(); assertThat(SchemaService.getSize()) .isGreaterThan(currentSize); } | public static void fillSchemaServiceFromSchemaDecl() throws IOException { log.info("Adding manual schema entries (or overriding LOV)!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaDecl.csv"); } | RDFUnitUtils { public static void fillSchemaServiceFromSchemaDecl() throws IOException { log.info("Adding manual schema entries (or overriding LOV)!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaDecl.csv"); } } | RDFUnitUtils { public static void fillSchemaServiceFromSchemaDecl() throws IOException { log.info("Adding manual schema entries (or overriding LOV)!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaDecl.csv"); } private RDFUnitUtils(); } | RDFUnitUtils { public static void fillSchemaServiceFromSchemaDecl() throws IOException { log.info("Adding manual schema entries (or overriding LOV)!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaDecl.csv"); } private RDFUnitUtils(); static void fillSchemaServiceFromFile(String add... | RDFUnitUtils { public static void fillSchemaServiceFromSchemaDecl() throws IOException { log.info("Adding manual schema entries (or overriding LOV)!"); RDFUnitUtils.fillSchemaServiceFromResource("org/aksw/rdfunit/configuration/schemaDecl.csv"); } private RDFUnitUtils(); static void fillSchemaServiceFromFile(String add... |
@Test public void testValidateModel() throws Exception { RDFUnitStaticValidator.validate(ModelFactory.createDefaultModel(), testCaseExecutionType); } | public static TestExecution validate(final Model inputModel) throws Exception { return validate(inputModel, TestCaseExecutionType.shaclTestCaseResult); } | RDFUnitStaticValidator { public static TestExecution validate(final Model inputModel) throws Exception { return validate(inputModel, TestCaseExecutionType.shaclTestCaseResult); } } | RDFUnitStaticValidator { public static TestExecution validate(final Model inputModel) throws Exception { return validate(inputModel, TestCaseExecutionType.shaclTestCaseResult); } private RDFUnitStaticValidator(); } | RDFUnitStaticValidator { public static TestExecution validate(final Model inputModel) throws Exception { return validate(inputModel, TestCaseExecutionType.shaclTestCaseResult); } private RDFUnitStaticValidator(); static void initWrapper(@NonNull RDFUnitTestSuiteGenerator testSuiteGenerator); static TestSuite getTestSu... | RDFUnitStaticValidator { public static TestExecution validate(final Model inputModel) throws Exception { return validate(inputModel, TestCaseExecutionType.shaclTestCaseResult); } private RDFUnitStaticValidator(); static void initWrapper(@NonNull RDFUnitTestSuiteGenerator testSuiteGenerator); static TestSuite getTestSu... |
@Test public void testGetPrefix() throws IOException { Model prefixModel = ModelFactory.createDefaultModel(); try (InputStream is = org.aksw.rdfunit.services.PrefixNSService.class.getResourceAsStream(Resources.PREFIXES)) { prefixModel.read(is, null, "TURTLE"); } Map<String, String> prefixes = prefixModel.getNsPrefixMap... | public static String getNSFromPrefix(final String prefix) { return MapInstance.prefixNsBidiMap.get(prefix); } | PrefixNSService { public static String getNSFromPrefix(final String prefix) { return MapInstance.prefixNsBidiMap.get(prefix); } } | PrefixNSService { public static String getNSFromPrefix(final String prefix) { return MapInstance.prefixNsBidiMap.get(prefix); } private PrefixNSService(); } | PrefixNSService { public static String getNSFromPrefix(final String prefix) { return MapInstance.prefixNsBidiMap.get(prefix); } private PrefixNSService(); static String getNSFromPrefix(final String prefix); static String getPrefixFromNS(final String namespace); static void setNSPrefixesInModel(Model model); static Str... | PrefixNSService { public static String getNSFromPrefix(final String prefix) { return MapInstance.prefixNsBidiMap.get(prefix); } private PrefixNSService(); static String getNSFromPrefix(final String prefix); static String getPrefixFromNS(final String namespace); static void setNSPrefixesInModel(Model model); static Str... |
@Test public void testGetConfigurationFromArguments() throws ParseException, ParameterException { Options cliOptions = ValidateUtils.getCliOptions(); String args; RDFUnitConfiguration configuration; CommandLine commandLine; CommandLineParser cliParser = new DefaultParser(); SchemaService.addSchemaDecl("rdfs", "http: Sc... | public static RDFUnitConfiguration getConfigurationFromArguments(CommandLine commandLine) throws ParameterException { checkIfRequiredParametersMissing(commandLine); RDFUnitConfiguration configuration = readDatasetUriAndInitConfiguration(commandLine); setDumpOrSparqlEndpoint(commandLine, configuration); loadSchemaDecl(c... | ValidateUtils { public static RDFUnitConfiguration getConfigurationFromArguments(CommandLine commandLine) throws ParameterException { checkIfRequiredParametersMissing(commandLine); RDFUnitConfiguration configuration = readDatasetUriAndInitConfiguration(commandLine); setDumpOrSparqlEndpoint(commandLine, configuration); ... | ValidateUtils { public static RDFUnitConfiguration getConfigurationFromArguments(CommandLine commandLine) throws ParameterException { checkIfRequiredParametersMissing(commandLine); RDFUnitConfiguration configuration = readDatasetUriAndInitConfiguration(commandLine); setDumpOrSparqlEndpoint(commandLine, configuration); ... | ValidateUtils { public static RDFUnitConfiguration getConfigurationFromArguments(CommandLine commandLine) throws ParameterException { checkIfRequiredParametersMissing(commandLine); RDFUnitConfiguration configuration = readDatasetUriAndInitConfiguration(commandLine); setDumpOrSparqlEndpoint(commandLine, configuration); ... | ValidateUtils { public static RDFUnitConfiguration getConfigurationFromArguments(CommandLine commandLine) throws ParameterException { checkIfRequiredParametersMissing(commandLine); RDFUnitConfiguration configuration = readDatasetUriAndInitConfiguration(commandLine); setDumpOrSparqlEndpoint(commandLine, configuration); ... |
@Test public void testWrite() throws RdfReaderException, RdfWriterException { Model inputModel = RdfReaderFactory.createResourceReader(Resources.PATTERNS).read(); Collection<Pattern> patterns = BatchPatternReader.create().getPatternsFromModel(inputModel); Model outputModel = ModelFactory.createDefaultModel(); for (Patt... | @Override public Resource write(Model model) { Resource resource = ElementWriter.copyElementResourceInModel(pattern, model); resource .addProperty(RDF.type, RDFUNITv.Pattern) .addProperty(DCTerms.identifier, pattern.getId()) .addProperty(DCTerms.description, pattern.getDescription()) .addProperty(RDFUNITv.sparqlWherePa... | PatternWriter implements ElementWriter { @Override public Resource write(Model model) { Resource resource = ElementWriter.copyElementResourceInModel(pattern, model); resource .addProperty(RDF.type, RDFUNITv.Pattern) .addProperty(DCTerms.identifier, pattern.getId()) .addProperty(DCTerms.description, pattern.getDescripti... | PatternWriter implements ElementWriter { @Override public Resource write(Model model) { Resource resource = ElementWriter.copyElementResourceInModel(pattern, model); resource .addProperty(RDF.type, RDFUNITv.Pattern) .addProperty(DCTerms.identifier, pattern.getId()) .addProperty(DCTerms.description, pattern.getDescripti... | PatternWriter implements ElementWriter { @Override public Resource write(Model model) { Resource resource = ElementWriter.copyElementResourceInModel(pattern, model); resource .addProperty(RDF.type, RDFUNITv.Pattern) .addProperty(DCTerms.identifier, pattern.getId()) .addProperty(DCTerms.description, pattern.getDescripti... | PatternWriter implements ElementWriter { @Override public Resource write(Model model) { Resource resource = ElementWriter.copyElementResourceInModel(pattern, model); resource .addProperty(RDF.type, RDFUNITv.Pattern) .addProperty(DCTerms.identifier, pattern.getId()) .addProperty(DCTerms.description, pattern.getDescripti... |
@Test public void testRead() throws RdfReaderException { ShaclModel shaclModel = new ShaclModel(RdfReaderFactory.createResourceReader(shapeResource).read()); Set<GenericTestCase> tests = shaclModel.generateTestCases(); assertThat(tests) .isNotEmpty(); } | public Set<GenericTestCase> generateTestCases() { return allShapeGroup.stream().flatMap(groupShape -> getGenericTestCase(groupShape).values().stream().flatMap(Collection::stream)).collect(Collectors.toSet()); } | ShaclModel { public Set<GenericTestCase> generateTestCases() { return allShapeGroup.stream().flatMap(groupShape -> getGenericTestCase(groupShape).values().stream().flatMap(Collection::stream)).collect(Collectors.toSet()); } } | ShaclModel { public Set<GenericTestCase> generateTestCases() { return allShapeGroup.stream().flatMap(groupShape -> getGenericTestCase(groupShape).values().stream().flatMap(Collection::stream)).collect(Collectors.toSet()); } ShaclModel(Model inputShaclGraph); } | ShaclModel { public Set<GenericTestCase> generateTestCases() { return allShapeGroup.stream().flatMap(groupShape -> getGenericTestCase(groupShape).values().stream().flatMap(Collection::stream)).collect(Collectors.toSet()); } ShaclModel(Model inputShaclGraph); Set<GenericTestCase> generateTestCases(); } | ShaclModel { public Set<GenericTestCase> generateTestCases() { return allShapeGroup.stream().flatMap(groupShape -> getGenericTestCase(groupShape).values().stream().flatMap(Collection::stream)).collect(Collectors.toSet()); } ShaclModel(Model inputShaclGraph); Set<GenericTestCase> generateTestCases(); } |
@Test public void testRead() throws RdfReaderException { Model shapesModel = RdfReaderFactory.createResourceReader(shapeResource).read(); List<Shape> shapes = shapesModel.listResourcesWithProperty(RDF.type, SHACL.Shape).toList() .stream() .map( r -> ShapeReader.create().read(r)) .collect(Collectors.toList()); assertTha... | @Override public Shape read(Resource resource) { checkNotNull(resource); ShapeImpl.ShapeImplBuilder shapeBuilder = ShapeImpl.builder(); shapeBuilder .element(resource) .propertyValuePairSets(PropertyValuePairSet.createFromResource(resource)); Resource path = resource.getPropertyResourceValue(SHACL.path); if (path != nu... | ShapeReader implements ElementReader<Shape> { @Override public Shape read(Resource resource) { checkNotNull(resource); ShapeImpl.ShapeImplBuilder shapeBuilder = ShapeImpl.builder(); shapeBuilder .element(resource) .propertyValuePairSets(PropertyValuePairSet.createFromResource(resource)); Resource path = resource.getPro... | ShapeReader implements ElementReader<Shape> { @Override public Shape read(Resource resource) { checkNotNull(resource); ShapeImpl.ShapeImplBuilder shapeBuilder = ShapeImpl.builder(); shapeBuilder .element(resource) .propertyValuePairSets(PropertyValuePairSet.createFromResource(resource)); Resource path = resource.getPro... | ShapeReader implements ElementReader<Shape> { @Override public Shape read(Resource resource) { checkNotNull(resource); ShapeImpl.ShapeImplBuilder shapeBuilder = ShapeImpl.builder(); shapeBuilder .element(resource) .propertyValuePairSets(PropertyValuePairSet.createFromResource(resource)); Resource path = resource.getPro... | ShapeReader implements ElementReader<Shape> { @Override public Shape read(Resource resource) { checkNotNull(resource); ShapeImpl.ShapeImplBuilder shapeBuilder = ShapeImpl.builder(); shapeBuilder .element(resource) .propertyValuePairSets(PropertyValuePairSet.createFromResource(resource)); Resource path = resource.getPro... |
@Test public void testRead() { Component c = ComponentReader.create().read(resource); int i = 0; } | @Override public Component read(Resource resource) { checkNotNull(resource); ComponentImpl.ComponentImplBuilder componentBuilder = ComponentImpl.builder(); componentBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL.parameter).toList()) { Resource obj = smt.getObject().asResource(); Component... | ComponentReader implements ElementReader<Component> { @Override public Component read(Resource resource) { checkNotNull(resource); ComponentImpl.ComponentImplBuilder componentBuilder = ComponentImpl.builder(); componentBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL.parameter).toList()) { ... | ComponentReader implements ElementReader<Component> { @Override public Component read(Resource resource) { checkNotNull(resource); ComponentImpl.ComponentImplBuilder componentBuilder = ComponentImpl.builder(); componentBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL.parameter).toList()) { ... | ComponentReader implements ElementReader<Component> { @Override public Component read(Resource resource) { checkNotNull(resource); ComponentImpl.ComponentImplBuilder componentBuilder = ComponentImpl.builder(); componentBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL.parameter).toList()) { ... | ComponentReader implements ElementReader<Component> { @Override public Component read(Resource resource) { checkNotNull(resource); ComponentImpl.ComponentImplBuilder componentBuilder = ComponentImpl.builder(); componentBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL.parameter).toList()) { ... |
@Test public void testRead() { SparqlValidatorReader.create().read(resource); } | @Override public Validator read(Resource resource) { checkNotNull(resource); SparqlValidatorImpl.SparqlValidatorImplBuilder validatorBuilder = SparqlValidatorImpl.builder(); validatorBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL.message).toList()) { validatorBuilder.message(smt.getObject... | SparqlValidatorReader implements ElementReader<Validator> { @Override public Validator read(Resource resource) { checkNotNull(resource); SparqlValidatorImpl.SparqlValidatorImplBuilder validatorBuilder = SparqlValidatorImpl.builder(); validatorBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL... | SparqlValidatorReader implements ElementReader<Validator> { @Override public Validator read(Resource resource) { checkNotNull(resource); SparqlValidatorImpl.SparqlValidatorImplBuilder validatorBuilder = SparqlValidatorImpl.builder(); validatorBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL... | SparqlValidatorReader implements ElementReader<Validator> { @Override public Validator read(Resource resource) { checkNotNull(resource); SparqlValidatorImpl.SparqlValidatorImplBuilder validatorBuilder = SparqlValidatorImpl.builder(); validatorBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL... | SparqlValidatorReader implements ElementReader<Validator> { @Override public Validator read(Resource resource) { checkNotNull(resource); SparqlValidatorImpl.SparqlValidatorImplBuilder validatorBuilder = SparqlValidatorImpl.builder(); validatorBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL... |
@Test public void testGetOutputFormat() { assertEquals(FormatService.getOutputFormat("turtle"), SerializationFormatFactory.createTurtle()); assertEquals(FormatService.getOutputFormat("ttl"), SerializationFormatFactory.createTurtle()); assertEquals(FormatService.getOutputFormat("ntriples"), SerializationFormatFactory.cr... | public static SerializationFormat getOutputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsOutput(name)) { return ft; } } return null; } | FormatService { public static SerializationFormat getOutputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsOutput(name)) { return ft; } } return null; } } | FormatService { public static SerializationFormat getOutputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsOutput(name)) { return ft; } } return null; } private FormatService(); } | FormatService { public static SerializationFormat getOutputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsOutput(name)) { return ft; } } return null; } private FormatService(); static SerializationFormat getInputFormat(String name); static SerializationFormat ge... | FormatService { public static SerializationFormat getOutputFormat(String name) { for (SerializationFormat ft : Instance.serializationFormats) { if (ft.isAcceptedAsOutput(name)) { return ft; } } return null; } private FormatService(); static SerializationFormat getInputFormat(String name); static SerializationFormat ge... |
@Test public void testRead() { assertThat(ShapePathReader.create().read(shaclPath).asSparqlPropertyPath()) .isEqualTo(propertyPathString); } | @Override public ShapePath read(Resource resource) { checkNotNull(resource); ShapePathImpl.ShapePathImplBuilder shapePathBuilder = ShapePathImpl.builder(); shapePathBuilder.element(resource); shapePathBuilder.jenaPath(readPath(resource)); return shapePathBuilder.build(); } | ShapePathReader implements ElementReader<ShapePath> { @Override public ShapePath read(Resource resource) { checkNotNull(resource); ShapePathImpl.ShapePathImplBuilder shapePathBuilder = ShapePathImpl.builder(); shapePathBuilder.element(resource); shapePathBuilder.jenaPath(readPath(resource)); return shapePathBuilder.bui... | ShapePathReader implements ElementReader<ShapePath> { @Override public ShapePath read(Resource resource) { checkNotNull(resource); ShapePathImpl.ShapePathImplBuilder shapePathBuilder = ShapePathImpl.builder(); shapePathBuilder.element(resource); shapePathBuilder.jenaPath(readPath(resource)); return shapePathBuilder.bui... | ShapePathReader implements ElementReader<ShapePath> { @Override public ShapePath read(Resource resource) { checkNotNull(resource); ShapePathImpl.ShapePathImplBuilder shapePathBuilder = ShapePathImpl.builder(); shapePathBuilder.element(resource); shapePathBuilder.jenaPath(readPath(resource)); return shapePathBuilder.bui... | ShapePathReader implements ElementReader<ShapePath> { @Override public ShapePath read(Resource resource) { checkNotNull(resource); ShapePathImpl.ShapePathImplBuilder shapePathBuilder = ShapePathImpl.builder(); shapePathBuilder.element(resource); shapePathBuilder.jenaPath(readPath(resource)); return shapePathBuilder.bui... |
@Test public void testRead() { ComponentValidatorReader.create(ComponentValidatorType.ASK_VALIDATOR).read(resource); } | @Override public ComponentValidator read(Resource resource) { checkNotNull(resource); ComponentValidatorImpl.ComponentValidatorImplBuilder validatorBuilder = ComponentValidatorImpl.builder(); validatorBuilder.element(resource); validatorBuilder.type(type); for (Statement smt : resource.listProperties(SHACL.message).toL... | ComponentValidatorReader implements ElementReader<ComponentValidator> { @Override public ComponentValidator read(Resource resource) { checkNotNull(resource); ComponentValidatorImpl.ComponentValidatorImplBuilder validatorBuilder = ComponentValidatorImpl.builder(); validatorBuilder.element(resource); validatorBuilder.typ... | ComponentValidatorReader implements ElementReader<ComponentValidator> { @Override public ComponentValidator read(Resource resource) { checkNotNull(resource); ComponentValidatorImpl.ComponentValidatorImplBuilder validatorBuilder = ComponentValidatorImpl.builder(); validatorBuilder.element(resource); validatorBuilder.typ... | ComponentValidatorReader implements ElementReader<ComponentValidator> { @Override public ComponentValidator read(Resource resource) { checkNotNull(resource); ComponentValidatorImpl.ComponentValidatorImplBuilder validatorBuilder = ComponentValidatorImpl.builder(); validatorBuilder.element(resource); validatorBuilder.typ... | ComponentValidatorReader implements ElementReader<ComponentValidator> { @Override public ComponentValidator read(Resource resource) { checkNotNull(resource); ComponentValidatorImpl.ComponentValidatorImplBuilder validatorBuilder = ComponentValidatorImpl.builder(); validatorBuilder.element(resource); validatorBuilder.typ... |
@Test public void testRead() { ComponentParameterReader.create().read(resource); } | @Override public ComponentParameter read(Resource resource) { checkNotNull(resource); ComponentParameterImpl.ComponentParameterImplBuilder argumentBuilder = ComponentParameterImpl.builder(); argumentBuilder.element(resource); for (Statement smt : resource.listProperties(SHACL.path).toList()) { argumentBuilder = argumen... | ComponentParameterReader implements ElementReader<ComponentParameter> { @Override public ComponentParameter read(Resource resource) { checkNotNull(resource); ComponentParameterImpl.ComponentParameterImplBuilder argumentBuilder = ComponentParameterImpl.builder(); argumentBuilder.element(resource); for (Statement smt : r... | ComponentParameterReader implements ElementReader<ComponentParameter> { @Override public ComponentParameter read(Resource resource) { checkNotNull(resource); ComponentParameterImpl.ComponentParameterImplBuilder argumentBuilder = ComponentParameterImpl.builder(); argumentBuilder.element(resource); for (Statement smt : r... | ComponentParameterReader implements ElementReader<ComponentParameter> { @Override public ComponentParameter read(Resource resource) { checkNotNull(resource); ComponentParameterImpl.ComponentParameterImplBuilder argumentBuilder = ComponentParameterImpl.builder(); argumentBuilder.element(resource); for (Statement smt : r... | ComponentParameterReader implements ElementReader<ComponentParameter> { @Override public ComponentParameter read(Resource resource) { checkNotNull(resource); ComponentParameterImpl.ComponentParameterImplBuilder argumentBuilder = ComponentParameterImpl.builder(); argumentBuilder.element(resource); for (Statement smt : r... |
@Test public void testRead() throws RdfReaderException { Model shapesModel = RdfReaderFactory.createResourceReader(shapeResource).read(); Resource r1 = shapesModel.getResource("http: Set<ShapeTarget> targets1 = BatchShapeTargetReader.create().read(r1); assertThat(targets1) .hasSize(2); } | public Set<ShapeTarget> read(Resource resource) { checkNotNull(resource); ImmutableSet.Builder<ShapeTarget> targetBuilder = ImmutableSet.builder(); targetBuilder.addAll(collectExplicitTargets(resource)); return targetBuilder.build(); } | BatchShapeTargetReader { public Set<ShapeTarget> read(Resource resource) { checkNotNull(resource); ImmutableSet.Builder<ShapeTarget> targetBuilder = ImmutableSet.builder(); targetBuilder.addAll(collectExplicitTargets(resource)); return targetBuilder.build(); } } | BatchShapeTargetReader { public Set<ShapeTarget> read(Resource resource) { checkNotNull(resource); ImmutableSet.Builder<ShapeTarget> targetBuilder = ImmutableSet.builder(); targetBuilder.addAll(collectExplicitTargets(resource)); return targetBuilder.build(); } private BatchShapeTargetReader(); } | BatchShapeTargetReader { public Set<ShapeTarget> read(Resource resource) { checkNotNull(resource); ImmutableSet.Builder<ShapeTarget> targetBuilder = ImmutableSet.builder(); targetBuilder.addAll(collectExplicitTargets(resource)); return targetBuilder.build(); } private BatchShapeTargetReader(); static BatchShapeTargetR... | BatchShapeTargetReader { public Set<ShapeTarget> read(Resource resource) { checkNotNull(resource); ImmutableSet.Builder<ShapeTarget> targetBuilder = ImmutableSet.builder(); targetBuilder.addAll(collectExplicitTargets(resource)); return targetBuilder.build(); } private BatchShapeTargetReader(); static BatchShapeTargetR... |
@Test public void testRead() { PatternReader.create().read(resource); } | @Override public Pattern read(Resource resource) { checkNotNull(resource); PatternImpl.Builder patternBuilder = new PatternImpl.Builder(); patternBuilder.setElement(resource); int count; count = 0; for (Statement smt : resource.listProperties(DCTerms.identifier).toList()) { checkArgument(++count == 1, "Cannot have more... | PatternReader implements ElementReader<Pattern> { @Override public Pattern read(Resource resource) { checkNotNull(resource); PatternImpl.Builder patternBuilder = new PatternImpl.Builder(); patternBuilder.setElement(resource); int count; count = 0; for (Statement smt : resource.listProperties(DCTerms.identifier).toList(... | PatternReader implements ElementReader<Pattern> { @Override public Pattern read(Resource resource) { checkNotNull(resource); PatternImpl.Builder patternBuilder = new PatternImpl.Builder(); patternBuilder.setElement(resource); int count; count = 0; for (Statement smt : resource.listProperties(DCTerms.identifier).toList(... | PatternReader implements ElementReader<Pattern> { @Override public Pattern read(Resource resource) { checkNotNull(resource); PatternImpl.Builder patternBuilder = new PatternImpl.Builder(); patternBuilder.setElement(resource); int count; count = 0; for (Statement smt : resource.listProperties(DCTerms.identifier).toList(... | PatternReader implements ElementReader<Pattern> { @Override public Pattern read(Resource resource) { checkNotNull(resource); PatternImpl.Builder patternBuilder = new PatternImpl.Builder(); patternBuilder.setElement(resource); int count; count = 0; for (Statement smt : resource.listProperties(DCTerms.identifier).toList(... |
@Test public void testRead() { PatternParameterReader.create().read(resource); } | @Override public PatternParameter read(Resource resource) { checkNotNull(resource); PatternParameterImpl.Builder parameterBuilder = new PatternParameterImpl.Builder(); parameterBuilder.setElement(resource); for (Statement smt : resource.listProperties(DCTerms.identifier).toList()) { parameterBuilder.setID(smt.getObject... | PatternParameterReader implements ElementReader<PatternParameter> { @Override public PatternParameter read(Resource resource) { checkNotNull(resource); PatternParameterImpl.Builder parameterBuilder = new PatternParameterImpl.Builder(); parameterBuilder.setElement(resource); for (Statement smt : resource.listProperties(... | PatternParameterReader implements ElementReader<PatternParameter> { @Override public PatternParameter read(Resource resource) { checkNotNull(resource); PatternParameterImpl.Builder parameterBuilder = new PatternParameterImpl.Builder(); parameterBuilder.setElement(resource); for (Statement smt : resource.listProperties(... | PatternParameterReader implements ElementReader<PatternParameter> { @Override public PatternParameter read(Resource resource) { checkNotNull(resource); PatternParameterImpl.Builder parameterBuilder = new PatternParameterImpl.Builder(); parameterBuilder.setElement(resource); for (Statement smt : resource.listProperties(... | PatternParameterReader implements ElementReader<PatternParameter> { @Override public PatternParameter read(Resource resource) { checkNotNull(resource); PatternParameterImpl.Builder parameterBuilder = new PatternParameterImpl.Builder(); parameterBuilder.setElement(resource); for (Statement smt : resource.listProperties(... |
@Test public void testCreate() { String varName = "test"; SelectVar selectVar = SelectVar.create(varName); assertThat(selectVar.getName()) .isEqualTo(varName); assertThat(selectVar.getLabel()) .isEqualTo(varName); assertThat(selectVar.asString()) .isEqualTo(" ?" + varName + " "); } | public static SelectVar create(String name) { return new SelectVar(name, name); } | SelectVar { public static SelectVar create(String name) { return new SelectVar(name, name); } } | SelectVar { public static SelectVar create(String name) { return new SelectVar(name, name); } } | SelectVar { public static SelectVar create(String name) { return new SelectVar(name, name); } static SelectVar create(String name); static SelectVar create(String name, String label); String asString(); } | SelectVar { public static SelectVar create(String name) { return new SelectVar(name, name); } static SelectVar create(String name); static SelectVar create(String name, String label); String asString(); } |
@Test(expected=NullPointerException.class) public void testNull() { SelectVar.create(null); } | public static SelectVar create(String name) { return new SelectVar(name, name); } | SelectVar { public static SelectVar create(String name) { return new SelectVar(name, name); } } | SelectVar { public static SelectVar create(String name) { return new SelectVar(name, name); } } | SelectVar { public static SelectVar create(String name) { return new SelectVar(name, name); } static SelectVar create(String name); static SelectVar create(String name, String label); String asString(); } | SelectVar { public static SelectVar create(String name) { return new SelectVar(name, name); } static SelectVar create(String name); static SelectVar create(String name, String label); String asString(); } |
@Test public void testAddTemplateMin() { AnnotationTemplate at = AnnotationTemplate.create(); assertThat(at.existsInTemplate(sa1)).isFalse(); at.addTemplateMin(RDF.type, 2); assertThat(at.existsInTemplate(sa1)).isTrue(); assertThat(at.isValidAccordingToTemplate(sa1)).isFalse(); assertThat(at.existsInTemplate(sa2)).isFa... | public void addTemplateMin(Property property, int minOccurs) { template.put(property, Range.atLeast(minOccurs)); } | AnnotationTemplate { public void addTemplateMin(Property property, int minOccurs) { template.put(property, Range.atLeast(minOccurs)); } } | AnnotationTemplate { public void addTemplateMin(Property property, int minOccurs) { template.put(property, Range.atLeast(minOccurs)); } private AnnotationTemplate(); } | AnnotationTemplate { public void addTemplateMin(Property property, int minOccurs) { template.put(property, Range.atLeast(minOccurs)); } private AnnotationTemplate(); static AnnotationTemplate create(); void addTemplateMin(Property property, int minOccurs); void addTemplateMax(Property property, int maxOccurs); void ad... | AnnotationTemplate { public void addTemplateMin(Property property, int minOccurs) { template.put(property, Range.atLeast(minOccurs)); } private AnnotationTemplate(); static AnnotationTemplate create(); void addTemplateMin(Property property, int minOccurs); void addTemplateMax(Property property, int maxOccurs); void ad... |
@Test public void testAddTemplateMax() { AnnotationTemplate at = AnnotationTemplate.create(); assertThat(at.existsInTemplate(sa1)).isFalse(); at.addTemplateMax(RDF.type, 1); assertThat(at.existsInTemplate(sa1)).isTrue(); assertThat(at.isValidAccordingToTemplate(sa1)).isTrue(); assertThat(at.existsInTemplate(sa2)).isFal... | public void addTemplateMax(Property property, int maxOccurs) { template.put(property, Range.atMost(maxOccurs)); } | AnnotationTemplate { public void addTemplateMax(Property property, int maxOccurs) { template.put(property, Range.atMost(maxOccurs)); } } | AnnotationTemplate { public void addTemplateMax(Property property, int maxOccurs) { template.put(property, Range.atMost(maxOccurs)); } private AnnotationTemplate(); } | AnnotationTemplate { public void addTemplateMax(Property property, int maxOccurs) { template.put(property, Range.atMost(maxOccurs)); } private AnnotationTemplate(); static AnnotationTemplate create(); void addTemplateMin(Property property, int minOccurs); void addTemplateMax(Property property, int maxOccurs); void add... | AnnotationTemplate { public void addTemplateMax(Property property, int maxOccurs) { template.put(property, Range.atMost(maxOccurs)); } private AnnotationTemplate(); static AnnotationTemplate create(); void addTemplateMin(Property property, int minOccurs); void addTemplateMax(Property property, int maxOccurs); void add... |
@Test public void testGetFormatFromExtension() { Map<String, String> testVals = new HashMap<>(); testVals.put("asdf.ttl", "TURTLE"); testVals.put("asdf.nt", "N-TRIPLE"); testVals.put("asdf.n3", "N3"); testVals.put("asdf.jsonld", "JSON-LD"); testVals.put("asdf.rj", "RDF/JSON"); testVals.put("asdf.rdf", "RDF/XML"); testV... | public static String getFormatFromExtension(String filename) { String format = "TURTLE"; try { String extension; Lang jenaLang = RDFLanguages.filenameToLang(filename); if (jenaLang != null) { extension = jenaLang.getFileExtensions().get(0); } else { int index = filename.lastIndexOf('.'); extension = filename.substring(... | FormatService { public static String getFormatFromExtension(String filename) { String format = "TURTLE"; try { String extension; Lang jenaLang = RDFLanguages.filenameToLang(filename); if (jenaLang != null) { extension = jenaLang.getFileExtensions().get(0); } else { int index = filename.lastIndexOf('.'); extension = fil... | FormatService { public static String getFormatFromExtension(String filename) { String format = "TURTLE"; try { String extension; Lang jenaLang = RDFLanguages.filenameToLang(filename); if (jenaLang != null) { extension = jenaLang.getFileExtensions().get(0); } else { int index = filename.lastIndexOf('.'); extension = fil... | FormatService { public static String getFormatFromExtension(String filename) { String format = "TURTLE"; try { String extension; Lang jenaLang = RDFLanguages.filenameToLang(filename); if (jenaLang != null) { extension = jenaLang.getFileExtensions().get(0); } else { int index = filename.lastIndexOf('.'); extension = fil... | FormatService { public static String getFormatFromExtension(String filename) { String format = "TURTLE"; try { String extension; Lang jenaLang = RDFLanguages.filenameToLang(filename); if (jenaLang != null) { extension = jenaLang.getFileExtensions().get(0); } else { int index = filename.lastIndexOf('.'); extension = fil... |
@Test public void testAddTemplateMinMax() { AnnotationTemplate at = AnnotationTemplate.create(); assertThat(at.existsInTemplate(sa1)).isFalse(); at.addTemplateMinMax(RDF.type, 1, 2); assertThat(at.existsInTemplate(sa1)).isTrue(); assertThat(at.isValidAccordingToTemplate(sa1)).isTrue(); assertThat(at.existsInTemplate(sa... | public void addTemplateMinMax(Property property, int minOccurs, int maxOccurs) { template.put(property, Range.closed(minOccurs, maxOccurs)); } | AnnotationTemplate { public void addTemplateMinMax(Property property, int minOccurs, int maxOccurs) { template.put(property, Range.closed(minOccurs, maxOccurs)); } } | AnnotationTemplate { public void addTemplateMinMax(Property property, int minOccurs, int maxOccurs) { template.put(property, Range.closed(minOccurs, maxOccurs)); } private AnnotationTemplate(); } | AnnotationTemplate { public void addTemplateMinMax(Property property, int minOccurs, int maxOccurs) { template.put(property, Range.closed(minOccurs, maxOccurs)); } private AnnotationTemplate(); static AnnotationTemplate create(); void addTemplateMin(Property property, int minOccurs); void addTemplateMax(Property prope... | AnnotationTemplate { public void addTemplateMinMax(Property property, int minOccurs, int maxOccurs) { template.put(property, Range.closed(minOccurs, maxOccurs)); } private AnnotationTemplate(); static AnnotationTemplate create(); void addTemplateMin(Property property, int minOccurs); void addTemplateMax(Property prope... |
@Test public void testGetPropertiesAsSet() { AnnotationTemplate at = AnnotationTemplate.create(); at.addTemplateMinMax(RDF.type, 1,2); at.addTemplateMinMax(RDF.predicate, 3,5); assertThat(at.getPropertiesAsSet()).isNotEmpty(); assertThat(at.getPropertiesAsSet().size()).isEqualTo(2); } | public Set<Property> getPropertiesAsSet() { return template.keySet(); } | AnnotationTemplate { public Set<Property> getPropertiesAsSet() { return template.keySet(); } } | AnnotationTemplate { public Set<Property> getPropertiesAsSet() { return template.keySet(); } private AnnotationTemplate(); } | AnnotationTemplate { public Set<Property> getPropertiesAsSet() { return template.keySet(); } private AnnotationTemplate(); static AnnotationTemplate create(); void addTemplateMin(Property property, int minOccurs); void addTemplateMax(Property property, int maxOccurs); void addTemplateMinMax(Property property, int minO... | AnnotationTemplate { public Set<Property> getPropertiesAsSet() { return template.keySet(); } private AnnotationTemplate(); static AnnotationTemplate create(); void addTemplateMin(Property property, int minOccurs); void addTemplateMax(Property property, int maxOccurs); void addTemplateMinMax(Property property, int minO... |
@Test(expected=NullPointerException.class) public void testCreateNullType() { ShapeTargetCore.create(null, null); } | public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::nodeTargetPattern); cas... | ShapeTargetCore implements ShapeTarget { public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node,... | ShapeTargetCore implements ShapeTarget { public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node,... | ShapeTargetCore implements ShapeTarget { public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node,... | ShapeTargetCore implements ShapeTarget { public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node,... |
@Test public void testPatternUnique() { List<String> targetPatterns = Arrays.stream(ShapeTargetType.values() ) .filter( sct -> !sct.equals(ShapeTargetType.ValueShapeTarget)) .map( s -> ShapeTargetCore.create(s, ResourceFactory.createResource("http: .map(ShapeTarget::getPattern) .collect(Collectors.toList()); assertThat... | public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::nodeTargetPattern); cas... | ShapeTargetCore implements ShapeTarget { public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node,... | ShapeTargetCore implements ShapeTarget { public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node,... | ShapeTargetCore implements ShapeTarget { public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node,... | ShapeTargetCore implements ShapeTarget { public static ShapeTarget create(@NonNull ShapeTargetType targetType, @NonNull RDFNode node) { switch (targetType) { case ClassTarget: return new ShapeTargetCore(targetType, node, ShapeTargetCore::classTargetPattern); case NodeTarget: return new ShapeTargetCore(targetType, node,... |
@Test public void testGetDefaultValue() { assertThat(argDef.getDefaultValue().isPresent()) .isFalse(); RDFNode node = ResourceFactory.createResource("http: ComponentParameterImpl arg2 = ComponentParameterImpl.builder().element(element).predicate(predicate).defaultValue(node).build(); assertThat(arg2.getDefaultValue().g... | @Override public Optional<RDFNode> getDefaultValue() { return Optional.ofNullable(defaultValue); } | ComponentParameterImpl implements ComponentParameter { @Override public Optional<RDFNode> getDefaultValue() { return Optional.ofNullable(defaultValue); } } | ComponentParameterImpl implements ComponentParameter { @Override public Optional<RDFNode> getDefaultValue() { return Optional.ofNullable(defaultValue); } } | ComponentParameterImpl implements ComponentParameter { @Override public Optional<RDFNode> getDefaultValue() { return Optional.ofNullable(defaultValue); } @Override Optional<RDFNode> getDefaultValue(); } | ComponentParameterImpl implements ComponentParameter { @Override public Optional<RDFNode> getDefaultValue() { return Optional.ofNullable(defaultValue); } @Override Optional<RDFNode> getDefaultValue(); } |
@Test public void returnsVocabulary() throws InitializationError { final RdfUnitJunitRunner rdfUnitJunitRunner = new RdfUnitJunitRunner(ControlledVocabularyTest.class); assertThat(rdfUnitJunitRunner.getAdditionalDataModel()).isSameAs(CONTROLLED_VOCABULARY); } | protected RdfReader getAdditionalDataModel() { return additionalData; } | RdfUnitJunitRunner extends ParentRunner<RdfUnitJunitTestCase> { protected RdfReader getAdditionalDataModel() { return additionalData; } } | RdfUnitJunitRunner extends ParentRunner<RdfUnitJunitTestCase> { protected RdfReader getAdditionalDataModel() { return additionalData; } RdfUnitJunitRunner(Class<?> testClass); } | RdfUnitJunitRunner extends ParentRunner<RdfUnitJunitTestCase> { protected RdfReader getAdditionalDataModel() { return additionalData; } RdfUnitJunitRunner(Class<?> testClass); } | RdfUnitJunitRunner extends ParentRunner<RdfUnitJunitTestCase> { protected RdfReader getAdditionalDataModel() { return additionalData; } RdfUnitJunitRunner(Class<?> testClass); static final Class<?> INPUT_DATA_RETURN_TYPE; } |
@Test public void testCreateDefault() { MetricMapper metricMapper = MetricMapper.createDefault(); int DEFAULT_MAP_SIZE = 16; assertThat(metricMapper.getMetricMap().size()) .isEqualTo(DEFAULT_MAP_SIZE); } | public static MetricMapper createDefault() { Model model; try { model = RdfReaderFactory.createResourceReader("/org/aksw/rdfunit/dqv/metricMappings.ttl").read(); } catch (RdfReaderException e) { throw new IllegalArgumentException("Cannot read default metric mappings", e); } ImmutableMap.Builder<String, String> builder ... | MetricMapper { public static MetricMapper createDefault() { Model model; try { model = RdfReaderFactory.createResourceReader("/org/aksw/rdfunit/dqv/metricMappings.ttl").read(); } catch (RdfReaderException e) { throw new IllegalArgumentException("Cannot read default metric mappings", e); } ImmutableMap.Builder<String, S... | MetricMapper { public static MetricMapper createDefault() { Model model; try { model = RdfReaderFactory.createResourceReader("/org/aksw/rdfunit/dqv/metricMappings.ttl").read(); } catch (RdfReaderException e) { throw new IllegalArgumentException("Cannot read default metric mappings", e); } ImmutableMap.Builder<String, S... | MetricMapper { public static MetricMapper createDefault() { Model model; try { model = RdfReaderFactory.createResourceReader("/org/aksw/rdfunit/dqv/metricMappings.ttl").read(); } catch (RdfReaderException e) { throw new IllegalArgumentException("Cannot read default metric mappings", e); } ImmutableMap.Builder<String, S... | MetricMapper { public static MetricMapper createDefault() { Model model; try { model = RdfReaderFactory.createResourceReader("/org/aksw/rdfunit/dqv/metricMappings.ttl").read(); } catch (RdfReaderException e) { throw new IllegalArgumentException("Cannot read default metric mappings", e); } ImmutableMap.Builder<String, S... |
@Test public void testNotExceptionRead() { ArrayList<RdfReader> rdfReaders = new ArrayList<>(); rdfReaders.add(new RdfStreamReader("")); rdfReaders.add(RdfReaderFactory.createResourceReader("/org/aksw/rdfunit/io/empty.ttl")); RdfFirstSuccessReader reader = new RdfFirstSuccessReader(rdfReaders); try { reader.read(); } c... | @Override public void read(Model model) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.read(model); return; } catch (RdfReaderException e) { message.append('\n'); if (e.getMessage() != null) { message.append(e.getMessage()); } else { message.append(e); } }... | RdfFirstSuccessReader implements RdfReader { @Override public void read(Model model) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.read(model); return; } catch (RdfReaderException e) { message.append('\n'); if (e.getMessage() != null) { message.append(e.g... | RdfFirstSuccessReader implements RdfReader { @Override public void read(Model model) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.read(model); return; } catch (RdfReaderException e) { message.append('\n'); if (e.getMessage() != null) { message.append(e.g... | RdfFirstSuccessReader implements RdfReader { @Override public void read(Model model) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.read(model); return; } catch (RdfReaderException e) { message.append('\n'); if (e.getMessage() != null) { message.append(e.g... | RdfFirstSuccessReader implements RdfReader { @Override public void read(Model model) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.read(model); return; } catch (RdfReaderException e) { message.append('\n'); if (e.getMessage() != null) { message.append(e.g... |
@Test public void testNotExceptionReadDataset() { ArrayList<RdfReader> rdfReaders = new ArrayList<>(); rdfReaders.add(new RdfStreamReader("")); rdfReaders.add(RdfReaderFactory.createResourceReader("/org/aksw/rdfunit/io/empty.ttl")); RdfFirstSuccessReader reader = new RdfFirstSuccessReader(rdfReaders); try { reader.read... | @Override public void readDataset(Dataset dataset) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.readDataset(dataset); return; } catch (RdfReaderException e) { message.append("\n"); if (e.getMessage() != null) { message.append(e.getMessage()); } else { me... | RdfFirstSuccessReader implements RdfReader { @Override public void readDataset(Dataset dataset) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.readDataset(dataset); return; } catch (RdfReaderException e) { message.append("\n"); if (e.getMessage() != null) ... | RdfFirstSuccessReader implements RdfReader { @Override public void readDataset(Dataset dataset) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.readDataset(dataset); return; } catch (RdfReaderException e) { message.append("\n"); if (e.getMessage() != null) ... | RdfFirstSuccessReader implements RdfReader { @Override public void readDataset(Dataset dataset) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.readDataset(dataset); return; } catch (RdfReaderException e) { message.append("\n"); if (e.getMessage() != null) ... | RdfFirstSuccessReader implements RdfReader { @Override public void readDataset(Dataset dataset) throws RdfReaderException { StringBuilder message = new StringBuilder(); for (RdfReader r : readers) { try { r.readDataset(dataset); return; } catch (RdfReaderException e) { message.append("\n"); if (e.getMessage() != null) ... |
@Test public void testReader() throws Exception{ Model readModel = RdfReaderFactory.createResourceReader(resourceName).read(); assertTrue("Models not the same", model.isIsomorphicWith(readModel)); } | @Override public void read(Model model) throws RdfReaderException { try { RDFDataMgr.read(model, inputStream, null, RDFLanguages.nameToLang(format)); } catch (Exception e) { throw new RdfReaderException(e.getMessage(), e); } } | RdfStreamReader implements RdfReader { @Override public void read(Model model) throws RdfReaderException { try { RDFDataMgr.read(model, inputStream, null, RDFLanguages.nameToLang(format)); } catch (Exception e) { throw new RdfReaderException(e.getMessage(), e); } } } | RdfStreamReader implements RdfReader { @Override public void read(Model model) throws RdfReaderException { try { RDFDataMgr.read(model, inputStream, null, RDFLanguages.nameToLang(format)); } catch (Exception e) { throw new RdfReaderException(e.getMessage(), e); } } RdfStreamReader(String filename); RdfStreamReader(Str... | RdfStreamReader implements RdfReader { @Override public void read(Model model) throws RdfReaderException { try { RDFDataMgr.read(model, inputStream, null, RDFLanguages.nameToLang(format)); } catch (Exception e) { throw new RdfReaderException(e.getMessage(), e); } } RdfStreamReader(String filename); RdfStreamReader(Str... | RdfStreamReader implements RdfReader { @Override public void read(Model model) throws RdfReaderException { try { RDFDataMgr.read(model, inputStream, null, RDFLanguages.nameToLang(format)); } catch (Exception e) { throw new RdfReaderException(e.getMessage(), e); } } RdfStreamReader(String filename); RdfStreamReader(Str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.