[jboss-cvs] JBossAS SVN: r76143 - in projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection: test and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jul 23 14:02:03 EDT 2008
Author: adrian at jboss.org
Date: 2008-07-23 14:02:02 -0400 (Wed, 23 Jul 2008)
New Revision: 76143
Added:
projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/support/NotPublic.java
projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/support/SuperClassOfNotPublic.java
projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/test/AnnotatedElementLoaderNotPublicUnitTestCase.java
Modified:
projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/test/ReflectionMetaDataLoaderTestSuite.java
Log:
[JBMDR-29] - Tests for work accidently committed early in previous pom fix for log4j at revision 76142
Added: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/support/NotPublic.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/support/NotPublic.java (rev 0)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/support/NotPublic.java 2008-07-23 18:02:02 UTC (rev 76143)
@@ -0,0 +1,46 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2007, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.test.metadata.loader.reflection.support;
+
+import org.jboss.test.metadata.shared.support.TestAnnotation;
+
+/**
+ * NotPublic.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class NotPublic extends SuperClassOfNotPublic
+{
+ @TestAnnotation
+ protected int notPublic;
+
+ @TestAnnotation
+ protected NotPublic()
+ {
+ }
+
+ @TestAnnotation
+ protected void notPublic()
+ {
+ }
+}
Added: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/support/SuperClassOfNotPublic.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/support/SuperClassOfNotPublic.java (rev 0)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/support/SuperClassOfNotPublic.java 2008-07-23 18:02:02 UTC (rev 76143)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2007, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.test.metadata.loader.reflection.support;
+
+import org.jboss.test.metadata.shared.support.TestAnnotation;
+
+/**
+ * SuperClassOfNotPublic.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class SuperClassOfNotPublic
+{
+ @TestAnnotation
+ protected int notPublicSuperClass;
+
+ @TestAnnotation
+ protected void notPublicSuperClass()
+ {
+ }
+}
Added: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/test/AnnotatedElementLoaderNotPublicUnitTestCase.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/test/AnnotatedElementLoaderNotPublicUnitTestCase.java (rev 0)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/test/AnnotatedElementLoaderNotPublicUnitTestCase.java 2008-07-23 18:02:02 UTC (rev 76143)
@@ -0,0 +1,97 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2007, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt 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.test.metadata.loader.reflection.test;
+
+import org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader;
+import org.jboss.metadata.spi.MetaData;
+import org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge;
+import org.jboss.metadata.spi.signature.ConstructorSignature;
+import org.jboss.metadata.spi.signature.FieldSignature;
+import org.jboss.metadata.spi.signature.MethodSignature;
+import org.jboss.test.metadata.AbstractMetaDataTest;
+import org.jboss.test.metadata.loader.reflection.support.NotPublic;
+import org.jboss.test.metadata.shared.support.ExpectedAnnotations;
+import org.jboss.test.metadata.shared.support.NotPresentAnnotation;
+import org.jboss.test.metadata.shared.support.TestAnnotation;
+
+/**
+ * AnnotatedElementLoaderNotPublicUnitTestCase.
+ *
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision: 1.1 $
+ */
+public class AnnotatedElementLoaderNotPublicUnitTestCase extends AbstractMetaDataTest
+{
+ public AnnotatedElementLoaderNotPublicUnitTestCase(String name)
+ {
+ super(name);
+ }
+
+ public void testNotPublicConstructor() throws Exception
+ {
+ MetaData metaData = createMetaData();
+ testTestAnnotation(metaData.getComponentMetaData(new ConstructorSignature()));
+ }
+
+ public void testNotPublicMethod() throws Exception
+ {
+ MetaData metaData = createMetaData();
+ testTestAnnotation(metaData.getComponentMetaData(new MethodSignature("notPublic")));
+ }
+
+ public void testNotPublicField() throws Exception
+ {
+ MetaData metaData = createMetaData();
+ testTestAnnotation(metaData.getComponentMetaData(new FieldSignature("notPublic")));
+ }
+
+ public void testNotPublicMethodSuperClass() throws Exception
+ {
+ MetaData metaData = createMetaData();
+ testTestAnnotation(metaData.getComponentMetaData(new MethodSignature("notPublicSuperClass")));
+ }
+
+ public void testNotPublicFieldSuperClass() throws Exception
+ {
+ MetaData metaData = createMetaData();
+ testTestAnnotation(metaData.getComponentMetaData(new FieldSignature("notPublicSuperClass")));
+ }
+
+ protected void testTestAnnotation(MetaData metaData) throws Exception
+ {
+ assertNotNull(metaData);
+
+ ExpectedAnnotations expectedAnnotations = emptyExpectedAnnotations();
+
+ assertAnnotation(metaData, TestAnnotation.class);
+ assertNoAnnotation(metaData, NotPresentAnnotation.class);
+
+ expectedAnnotations.add(TestAnnotation.class);
+ assertAllAnnotations(metaData, expectedAnnotations, false);
+ }
+
+ protected MetaData createMetaData()
+ {
+ AnnotatedElementMetaDataLoader loader = new AnnotatedElementMetaDataLoader(NotPublic.class);
+ return new MetaDataRetrievalToMetaDataBridge(loader);
+ }
+}
Modified: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/test/ReflectionMetaDataLoaderTestSuite.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/test/ReflectionMetaDataLoaderTestSuite.java 2008-07-23 17:46:18 UTC (rev 76142)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/loader/reflection/test/ReflectionMetaDataLoaderTestSuite.java 2008-07-23 18:02:02 UTC (rev 76143)
@@ -45,7 +45,7 @@
suite.addTest(new TestSuite(AnnotatedElementLoaderBasicAnnotationsUnitTestCase.class));
suite.addTest(new TestSuite(AnnotatedElementLoaderComponentBasicAnnotationsUnitTestCase.class));
suite.addTest(new TestSuite(AnnotatedElementLoaderScopeUnitTestCase.class));
-// suite.addTest(new TestSuite(AnnotatedElementLoaderNotPublicUnitTestCase.class));
+ suite.addTest(new TestSuite(AnnotatedElementLoaderNotPublicUnitTestCase.class));
return suite;
}
}
More information about the jboss-cvs-commits
mailing list