package com.st.maven.apt;

import static org.junit.Assert.assertEquals;

import java.io.File;

import org.apache.maven.plugin.logging.SystemStreamLog;
import org.junit.Test;

public class AptDeployMojoTest {
	
	@Test
	public void testControlFile() throws Exception {
		ControlFile file = AptDeployMojo.readControl(new SystemStreamLog(), new File("./src/test/resources/rtl-sdr_0.6git_armhf.deb"));
		assertEquals("rtl-sdr", file.getPackageName());
	}

	@Test
	public void testControlFileNewFormat() throws Exception {
		ControlFile file = AptDeployMojo.readControl(new SystemStreamLog(), new File("./src/test/resources/rtl-sdr_0.6_armhf.deb"));
		assertEquals("rtl-sdr", file.getPackageName());
	}
}

@@ -87,16 +87,94 @@
 o.File;%0A
+import java.util.UUID;%0A%0Aimport org.apache.maven.plugin.MojoExecutionException;
 %0Aimport 
@@ -281,16 +281,211 @@
 est %7B%0A%09%0A
+%09@Test(expected = MojoExecutionException.class)%0A%09public void testUnknownFile() throws Exception %7B%0A%09%09AptDeployMojo.readControl(new SystemStreamLog(), new File(UUID.randomUUID().toString()));%0A%09%7D%0A%09%0A
 %09@Test%0A%09

add some tests