package org.hightides.annotations.util;

import java.io.File;

import junit.framework.Assert;

import org.junit.Before;
import org.junit.Test;

public class PackageUtilTest {

	@Before
	public void onSetUpInTransaction() throws Exception {
		PackageUtil.setBaseOutputPath("test/");
	}

	@Test
	public void testGetPackage() {
		PackageUtil packageUtil = new PackageUtil("resources/templates", "test");
		Assert.assertEquals("com.ideyatech", packageUtil.getPackage(new File("test/com/ideyatech/Test.xml")));
		try {
			Assert.assertEquals("com.ideyatech", packageUtil.getPackage(new File("src/com/ideyatech/Test.xml")));
			Assert.fail("Unexpected behavior on invalid path for PackageUtil.getPackage() method.");
		} catch (Exception e) {
			// do nothing
		}
	}

}

@@ -88,16 +88,67 @@
 ssert;%0A%0A
+import org.hightides.annotations.util.PackageUtil;%0A
 import o
@@ -554,17 +554,8 @@
 ));%0A
-%09%09try %7B%0A%09
 %09%09As
@@ -569,32 +569,13 @@
 sert
-Equals(%22com.ideyatech%22, 
+Null(
 pack
@@ -638,147 +638,10 @@
 )));
-%0A
 %09%09
-%09Assert.fail(%22Unexpected behavior on invalid path for PackageUtil.getPackage() method.%22);%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09// do nothing%0A%09%09%7D
 %0A%09%7D%0A

fix package unit test