* configurable ignored packages
[scannotation] / src / test / java / org / scannotation / test / TestSmoke.java
index 8f914aa..cb8b842 100644 (file)
@@ -4,9 +4,10 @@ import com.titan.domain.Address;
 import org.junit.Assert;
 import org.junit.Test;
 import org.scannotation.AnnotationDB;
-import org.scannotation.classpath.ClasspathUrlFinder;
+import org.scannotation.ClasspathUrlFinder;
 
 import java.io.IOException;
+import java.io.PrintWriter;
 import java.net.URL;
 import java.util.Map;
 import java.util.Set;
@@ -41,6 +42,7 @@ public class TestSmoke
       if (System.getProperty("java.class.path").indexOf("titan-cruise-1.0.jar") == -1)
       {
          System.err.println("WARNING!!!!!!!! CANNOT TEST testFindClasspaths():  This is a Maven2 and Surefire problem in that it doesn't set java.class.path correctly.  I run this test within the IDE");
+         return;
       }
 
       URL[] urls = ClasspathUrlFinder.findClassPaths("titan-cruise-1.0.jar");
@@ -56,6 +58,7 @@ public class TestSmoke
       if (System.getProperty("java.class.path").indexOf("titan-cruise-1.0.jar") == -1)
       {
          System.err.println("WARNING!!!!!!! CANNOT TEST testFindClasspaths2():  This is a Maven2 and Surefire problem in that it doesn't set java.class.path correctly.  I run this test within the IDE");
+         return;
       }
 
       URL[] urls = ClasspathUrlFinder.findClassPaths();
@@ -106,6 +109,18 @@ public class TestSmoke
    }
 
 
+   @Test
+   public void testCrossRefMetaAnnotations() throws Exception
+   {
+      URL url = ClasspathUrlFinder.findClassBase(TestSmoke.class);
+      AnnotationDB db = new AnnotationDB();
+      db.scanArchives(url);
+      db.crossReferenceMetaAnnotations();
+
+      Assert.assertTrue(db.getAnnotationIndex().get(MetaAnnotation.class.getName()).contains(CrossRefMetaAnnotaiton.class.getName()));
+   }
+
+
    @Test
    public void testByClass() throws Exception
    {