@@ -0,0 +1,3273 @@
+/*%0A *  Licensed to the Apache Software Foundation (ASF) under one or more%0A *  contributor license agreements.  See the NOTICE file distributed with%0A *  this work for additional information regarding copyright ownership.%0A *  The ASF licenses this file to You under the Apache License, Version 2.0%0A *  (the %22License%22); you may not use this file except in compliance with%0A *  the License.  You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing, software%0A *  distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  See the License for the specific language governing permissions and%0A *  limitations under the License.%0A *%0A */%0Apackage org.apache.easyant.tasks;%0A%0Aimport java.io.File;%0Aimport java.net.MalformedURLException;%0Aimport java.net.URISyntaxException;%0A%0Aimport org.apache.easyant.core.EasyAntMagicNames;%0Aimport org.apache.easyant.core.ant.ProjectUtils;%0Aimport org.apache.easyant.core.ivy.IvyInstanceHelper;%0Aimport org.apache.ivy.ant.IvyConfigure;%0Aimport org.apache.tools.ant.BuildException;%0Aimport org.apache.tools.ant.Project;%0Aimport org.apache.tools.ant.taskdefs.Delete;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class CheckResolverTest %7B%0A%0A    private File cache;%0A    private CheckResolver checkResolver = new CheckResolver();%0A%0A    @Before%0A    public void setUp() throws MalformedURLException, URISyntaxException %7B%0A        createCache();%0A        Project project = new Project();%0A        ProjectUtils.configureProjectHelper(project);%0A        project.setProperty(%22ivy.cache.dir%22, cache.getAbsolutePath());%0A%0A        IvyConfigure configure = new IvyConfigure();%0A        configure.setProject(project);%0A%0A        File f = new File(this.getClass().getResource(%22/repositories/easyant-ivysettings-test.xml%22).toURI());%0A        configure.setFile(f);%0A%0A        configure.setSettingsId(EasyAntMagicNames.EASYANT_IVY_INSTANCE);%0A        configure.execute();%0A%0A        checkResolver = new CheckResolver();%0A        checkResolver.setSettingsRef(IvyInstanceHelper.buildEasyAntIvyReference(project));%0A        checkResolver.setProject(project);%0A    %7D%0A%0A    private void createCache() %7B%0A        cache = new File(%22build/cache%22);%0A        cache.mkdirs();%0A    %7D%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        cleanCache();%0A    %7D%0A%0A    private void cleanCache() %7B%0A        Delete del = new Delete();%0A        del.setProject(new Project());%0A        del.setDir(cache);%0A        del.execute();%0A    %7D%0A%0A    @Test(expected = BuildException.class)%0A    public void shouldFailIfNoMandatoryAttributesAreSet() %7B%0A        checkResolver.execute();%0A    %7D%0A%0A    @Test(expected = BuildException.class)%0A    public void shouldFailIfResolverDoesntExists() %7B%0A        checkResolver.getProject().setProperty(%22resolver.to.check%22, %22unknown%22);%0A        checkResolver.setResolver(%22resolver.to.check%22);%0A        checkResolver.execute();%0A    %7D%0A%0A    @Test%0A    public void shouldNotFailIfResolverExists() %7B%0A        checkResolver.getProject().setProperty(%22resolver.to.check%22, %22test-plugin%22);%0A        checkResolver.setResolver(%22resolver.to.check%22);%0A        checkResolver.execute();%0A    %7D%0A%7D%0A

Add CheckResovler test