package com.github.aureliano.achmed.os;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import com.github.aureliano.achmed.exception.ServiceResourceException;
import com.github.aureliano.achmed.os.pkg.IPackageManager;
import com.github.aureliano.achmed.types.OS;
import com.github.aureliano.achmed.types.OperatingSystemFamily;

public class LinuxTest {

	private Linux linux;
	
	public LinuxTest() {
		this.linux = this.createDefaultOs();
	}
	
	@Test
	public void testGetOperatingSystem() {
		assertEquals(OS.LINUX, this.linux.getOperatingSystem());
	}
	
	@Test
	public void testGetPsCommand() {
		final String cmd = "ps -ef";
		assertEquals(cmd, this.linux.getPsCommand());
	}
	
	@Test(expected = ServiceResourceException.class)
	public void testGetPidWithNullPattern() {
		this.linux.getPid(null);
	}
	
	private Linux createDefaultOs() {
		return new Linux() {
			
			public OperatingSystemFamily getOperatingSystemFamily() {
				return null;
			}
			
			public IPackageManager getDefaultPackageManager() {
				return null;
			}
		};
	}
}
@@ -821,16 +821,140 @@
 );%0A%09%7D%0A%09%0A
+%09@Test(expected = ServiceResourceException.class)%0A%09public void testGetPidWithEmptyPattern() %7B%0A%09%09this.linux.getPid(%22%22);%0A%09%7D%0A%09%0A
 %09private

Add unit test to get pid passing empty pattern.