@Test public void validate() { String errorMessage = null; File file = new File(mSourceFileName); try { FileResourceNameValidator.validate(file, mResourceType); } catch (MergingException e) { errorMessage = e.getMessage(); } assertErrorMessageCorrect(mExpectedErrorMessage, errorMessage, file); }
public static void validate(@NonNull File file, @NonNull ResourceType resourceType) throws MergingException { String error = getErrorTextForFileResource(file.getName(), resourceType); if (error != null) { throw MergingException.withMessage(error).withFile(file).build(); } }
FileResourceNameValidator { public static void validate(@NonNull File file, @NonNull ResourceType resourceType) throws MergingException { String error = getErrorTextForFileResource(file.getName(), resourceType); if (error != null) { throw MergingException.withMessage(error).withFile(file).build(); } } }
FileResourceNameValidator { public static void validate(@NonNull File file, @NonNull ResourceType resourceType) throws MergingException { String error = getErrorTextForFileResource(file.getName(), resourceType); if (error != null) { throw MergingException.withMessage(error).withFile(file).build(); } } private  FileResourceNameValidator(); }
FileResourceNameValidator { public static void validate(@NonNull File file, @NonNull ResourceType resourceType) throws MergingException { String error = getErrorTextForFileResource(file.getName(), resourceType); if (error != null) { throw MergingException.withMessage(error).withFile(file).build(); } } private  FileResourceNameValidator(); static void validate(@NonNull File file, @NonNull ResourceType resourceType); @Nullable static String getErrorTextForFileResource(@NonNull final String fileNameWithExt,
            @NonNull final ResourceType resourceType); @Nullable static String getErrorTextForPartialName(
            @NonNull final String partialFileNameWithExt,
            @NonNull final ResourceType resourceType); @Nullable static String getErrorTextForNameWithoutExtension(
            @NonNull final String fileNameWithoutExt); }
FileResourceNameValidator { public static void validate(@NonNull File file, @NonNull ResourceType resourceType) throws MergingException { String error = getErrorTextForFileResource(file.getName(), resourceType); if (error != null) { throw MergingException.withMessage(error).withFile(file).build(); } } private  FileResourceNameValidator(); static void validate(@NonNull File file, @NonNull ResourceType resourceType); @Nullable static String getErrorTextForFileResource(@NonNull final String fileNameWithExt,
            @NonNull final ResourceType resourceType); @Nullable static String getErrorTextForPartialName(
            @NonNull final String partialFileNameWithExt,
            @NonNull final ResourceType resourceType); @Nullable static String getErrorTextForNameWithoutExtension(
            @NonNull final String fileNameWithoutExt);  }