@Test(expected = IllegalArgumentException.class) public void testExceptionForNullResourceDirectory() throws Exception { try { AbstractDefineResourcesMojo.findOrCreateResource(resources, null); fail("Resources directory cannot be null. Must throw an exception."); } catch (IllegalArgumentException exception) { } }
static Resource findOrCreateResource(final List<Resource> resources, final String resourceDirectory) { if (resourceDirectory == null) { throw new IllegalArgumentException("The resource directory argument cannot be null"); } for (Resource resource : resources) { if (resourceDirectory.equals(resource.getDirectory())) { return resource; } } Resource resource = new Resource(); resource.setDirectory(resourceDirectory); return resource; }
AbstractDefineResourcesMojo extends AbstractWOMojo { static Resource findOrCreateResource(final List<Resource> resources, final String resourceDirectory) { if (resourceDirectory == null) { throw new IllegalArgumentException("The resource directory argument cannot be null"); } for (Resource resource : resources) { if (resourceDirectory.equals(resource.getDirectory())) { return resource; } } Resource resource = new Resource(); resource.setDirectory(resourceDirectory); return resource; } }
AbstractDefineResourcesMojo extends AbstractWOMojo { static Resource findOrCreateResource(final List<Resource> resources, final String resourceDirectory) { if (resourceDirectory == null) { throw new IllegalArgumentException("The resource directory argument cannot be null"); } for (Resource resource : resources) { if (resourceDirectory.equals(resource.getDirectory())) { return resource; } } Resource resource = new Resource(); resource.setDirectory(resourceDirectory); return resource; } AbstractDefineResourcesMojo(); }
AbstractDefineResourcesMojo extends AbstractWOMojo { static Resource findOrCreateResource(final List<Resource> resources, final String resourceDirectory) { if (resourceDirectory == null) { throw new IllegalArgumentException("The resource directory argument cannot be null"); } for (Resource resource : resources) { if (resourceDirectory.equals(resource.getDirectory())) { return resource; } } Resource resource = new Resource(); resource.setDirectory(resourceDirectory); return resource; } AbstractDefineResourcesMojo(); void execute(); Boolean flattenResources(); abstract boolean hasContentsFolder(); abstract boolean includesVersionInArtifactName(); void setFlattingResources(final Boolean flattenResources); }
AbstractDefineResourcesMojo extends AbstractWOMojo { static Resource findOrCreateResource(final List<Resource> resources, final String resourceDirectory) { if (resourceDirectory == null) { throw new IllegalArgumentException("The resource directory argument cannot be null"); } for (Resource resource : resources) { if (resourceDirectory.equals(resource.getDirectory())) { return resource; } } Resource resource = new Resource(); resource.setDirectory(resourceDirectory); return resource; } AbstractDefineResourcesMojo(); void execute(); Boolean flattenResources(); abstract boolean hasContentsFolder(); abstract boolean includesVersionInArtifactName(); void setFlattingResources(final Boolean flattenResources);  }