[jboss-cvs] JBossAS SVN: r75918 - in projects/jboss-mdr/trunk/src: tests/org/jboss/test/metadata/retrieval/support and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Jul 16 07:38:40 EDT 2008


Author: kabir.khan at jboss.com
Date: 2008-07-16 07:38:39 -0400 (Wed, 16 Jul 2008)
New Revision: 75918

Removed:
   projects/jboss-mdr/trunk/src/main/org/jboss/metadata/spi/annotation/InstanceAnnotation.java
   projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/SimpleMBean.java
   projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/SimpleMBean2.java
   projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/TestJMX.java
   projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/TestJMXImpl.java
   projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/test/MarkupAnnotationsTestCase.java
Log:
[JBMDR-27] Remove @InstanceAnnotation

Deleted: projects/jboss-mdr/trunk/src/main/org/jboss/metadata/spi/annotation/InstanceAnnotation.java
===================================================================
--- projects/jboss-mdr/trunk/src/main/org/jboss/metadata/spi/annotation/InstanceAnnotation.java	2008-07-16 11:36:55 UTC (rev 75917)
+++ projects/jboss-mdr/trunk/src/main/org/jboss/metadata/spi/annotation/InstanceAnnotation.java	2008-07-16 11:38:39 UTC (rev 75918)
@@ -1,44 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.metadata.spi.annotation;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-/**
- * Add metadata to annotations, whether it should be used for instance metadata check.
- *
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
- at Retention(RetentionPolicy.RUNTIME)
- at Target(ElementType.ANNOTATION_TYPE)
-public @interface InstanceAnnotation
-{
-   /**
-    * Is this an instance metadata annotation
-    *
-    * @return true marked annotation should be used when checking instance metadata
-    */
-   boolean value();
-}

Deleted: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/SimpleMBean.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/SimpleMBean.java	2008-07-16 11:36:55 UTC (rev 75917)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/SimpleMBean.java	2008-07-16 11:38:39 UTC (rev 75918)
@@ -1,30 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.retrieval.support;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
- at TestJMX
-public class SimpleMBean
-{
-}

Deleted: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/SimpleMBean2.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/SimpleMBean2.java	2008-07-16 11:36:55 UTC (rev 75917)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/SimpleMBean2.java	2008-07-16 11:38:39 UTC (rev 75918)
@@ -1,31 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.retrieval.support;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
- at TestJMX
- at TestAnnotation
-public class SimpleMBean2
-{
-}
\ No newline at end of file

Deleted: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/TestJMX.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/TestJMX.java	2008-07-16 11:36:55 UTC (rev 75917)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/TestJMX.java	2008-07-16 11:38:39 UTC (rev 75918)
@@ -1,39 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.retrieval.support;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-import org.jboss.metadata.spi.annotation.InstanceAnnotation;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
- at Retention(RetentionPolicy.RUNTIME)
- at Target({ElementType.TYPE})
- at InstanceAnnotation(false)
-public @interface TestJMX
-{
-}
\ No newline at end of file

Deleted: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/TestJMXImpl.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/TestJMXImpl.java	2008-07-16 11:36:55 UTC (rev 75917)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/support/TestJMXImpl.java	2008-07-16 11:38:39 UTC (rev 75918)
@@ -1,35 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.retrieval.support;
-
-import java.lang.annotation.Annotation;
-
-/**
- * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
- */
-public class TestJMXImpl implements TestJMX
-{
-   public Class<? extends Annotation> annotationType()
-   {
-      return TestJMX.class;
-   }
-}

Deleted: projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/test/MarkupAnnotationsTestCase.java
===================================================================
--- projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/test/MarkupAnnotationsTestCase.java	2008-07-16 11:36:55 UTC (rev 75917)
+++ projects/jboss-mdr/trunk/src/tests/org/jboss/test/metadata/retrieval/test/MarkupAnnotationsTestCase.java	2008-07-16 11:38:39 UTC (rev 75918)
@@ -1,99 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2006, 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.retrieval.test;
-
-import java.lang.annotation.Annotation;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.jboss.metadata.plugins.loader.memory.MemoryMetaDataLoader;
-import org.jboss.metadata.plugins.loader.reflection.AnnotatedElementMetaDataLoader;
-import org.jboss.metadata.spi.MetaData;
-import org.jboss.metadata.spi.annotation.InstanceAnnotation;
-import org.jboss.metadata.spi.retrieval.MetaDataRetrievalToMetaDataBridge;
-import org.jboss.test.metadata.AbstractMetaDataTest;
-import org.jboss.test.metadata.retrieval.support.SimpleMBean;
-import org.jboss.test.metadata.retrieval.support.SimpleMBean2;
-import org.jboss.test.metadata.retrieval.support.TestJMXImpl;
-
-/**
- * MarkupAnnotationsTestCase.
- * <p/>
- * Test annotations that markup additional behavior:
- * - @org.jboss.metadata.spi.annotation.InstanceAnnotation
- *
- * @author <a href="ales.justin at jboss.com">Ales Justin</a>
- */
-public class MarkupAnnotationsTestCase extends AbstractMetaDataTest
-{
-   public MarkupAnnotationsTestCase(String name)
-   {
-      super(name);
-   }
-
-   protected MetaData getClassMetaData(Class<?> clazz)
-   {
-      AnnotatedElementMetaDataLoader loader = new AnnotatedElementMetaDataLoader(clazz);
-      return new MetaDataRetrievalToMetaDataBridge(loader);
-   }
-
-   protected boolean hasMetaDataAtInstanceLevel(MetaData metaData)
-   {
-      if (metaData != null && metaData.isEmpty() == false)
-      {
-         Set<Object> checkSet = new HashSet<Object>();
-         Object[] allMetaData = metaData.getMetaData();
-         Annotation[] annotations = metaData.getAnnotations();
-
-         checkSet.addAll(Arrays.asList(allMetaData));
-         checkSet.removeAll(Arrays.asList(annotations));
-
-         // do we have something else than annotations
-         if (checkSet.isEmpty() == false)
-            return true;
-         else
-         {
-            // do we have an annotation that's not marked with IA
-            for (Annotation annotation : annotations)
-            {
-               InstanceAnnotation ia = annotation.annotationType().getAnnotation(InstanceAnnotation.class);
-               if (ia == null || ia.value())
-                  return true;
-            }
-         }
-      }
-      return false;
-   }
-
-   public void testInstanceAnnotation() throws Throwable
-   {
-      assertFalse(hasMetaDataAtInstanceLevel(getClassMetaData(SimpleMBean.class)));
-      assertTrue(hasMetaDataAtInstanceLevel(getClassMetaData(SimpleMBean2.class)));
-
-      MemoryMetaDataLoader mem1 = new MemoryMetaDataLoader();
-      mem1.addAnnotation(new TestJMXImpl());
-      mem1.addMetaData("foobar", String.class);
-      MetaData md1 = new MetaDataRetrievalToMetaDataBridge(mem1);
-      assertTrue(hasMetaDataAtInstanceLevel(md1));
-   }
-}
\ No newline at end of file




More information about the jboss-cvs-commits mailing list