package com.github.aureliano.achmed.helper;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

import java.io.File;
import java.util.List;

import org.junit.Test;

import com.github.aureliano.achmed.resources.ExecResource;
import com.github.aureliano.achmed.resources.FileResource;
import com.github.aureliano.achmed.resources.IResource;
import com.github.aureliano.achmed.resources.PackageResource;
import com.github.aureliano.achmed.resources.ServiceResource;

public class ApplicationHelperTest {

	private static final String RESOURCES_DIR = "src/test/resources";
	
	@Test
	public void testBuildAllResources() {
		String path = this.buildPath(RESOURCES_DIR, "yaml", "main.yaml");
		List<IResource> resources = ApplicationHelper.buildAllResources(path);
		
		int expectedResources = 4;
		assertEquals(expectedResources, resources.size());
		
		assertTrue(resources.get(0) instanceof ExecResource);
		assertTrue(resources.get(1) instanceof FileResource);
		assertTrue(resources.get(2) instanceof PackageResource);
		assertTrue(resources.get(3) instanceof ServiceResource);
	}
	
	private String buildPath(String...tokens) {
		return StringHelper.join(tokens, File.separator);
	}
}
@@ -1112,16 +1112,930 @@
 );%0A%09%7D%0A%09%0A
+%09@Test%0A%09public void testHelp() %7B%0A%09%09String help = ApplicationHelper.help();%0A%09%09%0A%09%09assertTrue(help.contains(%22Usage: %5Bjava -jar%5D achmed-x.x.x.jar burst %5BFILE%5D%22));%0A%09%09assertTrue(help.contains(%22-h        Print this message.%22));%0A%09%09assertTrue(help.contains(%22-v        Print the version.%22));%0A%09%09assertTrue(help.contains(%22--help    Print this message.%22));%0A%09%09assertTrue(help.contains(%22--version Print the version.%22));%0A%09%09assertTrue(help.contains(%22Required JVM 1.7 or higher.%22));%0A%09%09assertTrue(help.contains(%22Example:%22));%0A%09%09assertTrue(help.contains(%22java -jar achmed-x.x.x.jar burst /path/to/schema.yaml%22));%0A%09%09assertTrue(help.contains(%22Get involved%22));%0A%09%09assertTrue(help.contains(%22- Source: https://github.com/aureliano/achmed%22));%0A%09%09assertTrue(help.contains(%22- Issues: https://github.com/aureliano/achmed/issues%22));%0A%09%09assertTrue(help.contains(%22- Wiki: https://github.com/aureliano/achmed/wiki for more detailed insights.%22));%0A%09%7D%0A%09%0A
 %09private

Add unit test to help method.