[jboss-cvs] JBossAS SVN: r92194 - in projects/annotations/trunk: core/src/test/java/org/jboss/annotations/test and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Aug 10 09:41:41 EDT 2009
Author: jesper.pedersen
Date: 2009-08-10 09:41:41 -0400 (Mon, 10 Aug 2009)
New Revision: 92194
Added:
projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/AnnotationScannerFactoryTests.java
projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javalangreflect/unit/AnnotationScannerFactoryTestCase.java
projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javassistclasspool/unit/AnnotationScannerFactoryTestCase.java
projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javassistinputstream/unit/AnnotationScannerFactoryTestCase.java
Modified:
projects/annotations/trunk/build.xml
Log:
[JBANN-12] Create an AnnotationScannerFactoryTests class
Modified: projects/annotations/trunk/build.xml
===================================================================
--- projects/annotations/trunk/build.xml 2009-08-10 11:23:49 UTC (rev 92193)
+++ projects/annotations/trunk/build.xml 2009-08-10 13:41:41 UTC (rev 92194)
@@ -375,6 +375,13 @@
</fileset>
</delete>
<delete>
+ <fileset dir="${basedir}" defaultexcludes="no">
+ <include name="${name}*.zip"/>
+ <include name="${name}*.tar.gz"/>
+ <include name="${name}*.tar.bz2"/>
+ </fileset>
+ </delete>
+ <delete>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</delete>
<delete dir="${build.dir}"/>
Added: projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/AnnotationScannerFactoryTests.java
===================================================================
--- projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/AnnotationScannerFactoryTests.java (rev 0)
+++ projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/AnnotationScannerFactoryTests.java 2009-08-10 13:41:41 UTC (rev 92194)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.annotations.test;
+
+import org.jboss.annotations.AnnotationScanner;
+import org.jboss.annotations.AnnotationScannerFactory;
+
+import java.util.logging.Logger;
+
+import org.junit.Test;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test for the annotation scanner
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public abstract class AnnotationScannerFactoryTests extends AnnotationTests
+{
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static Logger log = Logger.getLogger(AnnotationScannerFactoryTests.class.getName());
+
+ /** The annotation scanner factory constant */
+ protected static int asf;
+
+ // --------------------------------------------------------------------------------||
+ // Tests --------------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Default
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testDefault() throws Throwable
+ {
+ AnnotationScanner scanner = AnnotationScannerFactory.getDefault();
+
+ assertNotNull(scanner);
+ }
+
+ /**
+ * Constant
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testConstant() throws Throwable
+ {
+ AnnotationScanner scanner = AnnotationScannerFactory.getStrategy(asf);
+
+ assertNotNull(scanner);
+ }
+
+
+ /**
+ * Illegal value
+ * @throws Throwable throwable exception
+ */
+ @Test
+ public void testIllegalValue() throws Throwable
+ {
+ try
+ {
+ AnnotationScanner scanner = AnnotationScannerFactory.getStrategy(-1);
+ fail("Operation success");
+ }
+ catch (Throwable t)
+ {
+ // Ok
+ }
+
+ try
+ {
+ AnnotationScanner scanner = AnnotationScannerFactory.getStrategy(3);
+ fail("Operation success");
+ }
+ catch (Throwable t)
+ {
+ // Ok
+ }
+ }
+}
Added: projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javalangreflect/unit/AnnotationScannerFactoryTestCase.java
===================================================================
--- projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javalangreflect/unit/AnnotationScannerFactoryTestCase.java (rev 0)
+++ projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javalangreflect/unit/AnnotationScannerFactoryTestCase.java 2009-08-10 13:41:41 UTC (rev 92194)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.annotations.test.javalangreflect.unit;
+
+import org.jboss.annotations.AnnotationScannerFactory;
+import org.jboss.annotations.test.AnnotationScannerFactoryTests;
+
+import java.util.logging.Logger;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test for the annotation scanner factory
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class AnnotationScannerFactoryTestCase extends AnnotationScannerFactoryTests
+{
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static Logger log = Logger.getLogger(AnnotationScannerFactoryTestCase.class.getName());
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ asf = AnnotationScannerFactory.JAVA_LANG_REFLECT;
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ }
+}
Added: projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javassistclasspool/unit/AnnotationScannerFactoryTestCase.java
===================================================================
--- projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javassistclasspool/unit/AnnotationScannerFactoryTestCase.java (rev 0)
+++ projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javassistclasspool/unit/AnnotationScannerFactoryTestCase.java 2009-08-10 13:41:41 UTC (rev 92194)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.annotations.test.javassistclasspool.unit;
+
+import org.jboss.annotations.AnnotationScannerFactory;
+import org.jboss.annotations.test.AnnotationScannerFactoryTests;
+
+import java.util.logging.Logger;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test for the annotation scanner factory
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class AnnotationScannerFactoryTestCase extends AnnotationScannerFactoryTests
+{
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static Logger log = Logger.getLogger(AnnotationScannerFactoryTestCase.class.getName());
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ asf = AnnotationScannerFactory.JAVASSIST_CLASS_POOL;
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ }
+}
Added: projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javassistinputstream/unit/AnnotationScannerFactoryTestCase.java
===================================================================
--- projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javassistinputstream/unit/AnnotationScannerFactoryTestCase.java (rev 0)
+++ projects/annotations/trunk/core/src/test/java/org/jboss/annotations/test/javassistinputstream/unit/AnnotationScannerFactoryTestCase.java 2009-08-10 13:41:41 UTC (rev 92194)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008-2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.annotations.test.javassistinputstream.unit;
+
+import org.jboss.annotations.AnnotationScannerFactory;
+import org.jboss.annotations.test.AnnotationScannerFactoryTests;
+
+import java.util.logging.Logger;
+
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+import static org.junit.Assert.*;
+
+/**
+ * Test for the annotation scanner factory
+ *
+ * @author <a href="mailto:jesper.pedersen at jboss.org">Jesper Pedersen</a>
+ * @version $Revision: $
+ */
+public class AnnotationScannerFactoryTestCase extends AnnotationScannerFactoryTests
+{
+ // --------------------------------------------------------------------------------||
+ // Class Members ------------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ private static Logger log = Logger.getLogger(AnnotationScannerFactoryTestCase.class.getName());
+
+ // --------------------------------------------------------------------------------||
+ // Lifecycle Methods --------------------------------------------------------------||
+ // --------------------------------------------------------------------------------||
+
+ /**
+ * Lifecycle start, before the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @BeforeClass
+ public static void beforeClass() throws Throwable
+ {
+ asf = AnnotationScannerFactory.JAVASSIST_INPUT_STREAM;
+ }
+
+ /**
+ * Lifecycle stop, after the suite is executed
+ * @throws Throwable throwable exception
+ */
+ @AfterClass
+ public static void afterClass() throws Throwable
+ {
+ }
+}
More information about the jboss-cvs-commits
mailing list