You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hivemind.apache.org by hl...@apache.org on 2004/09/27 16:37:14 UTC

cvs commit: jakarta-hivemind/framework/src/test/hivemind/test/services TestMethodSignature.java

hlship      2004/09/27 07:37:14

  Modified:    framework/src/test/hivemind/test/parse
                        TestDescriptorParser.java
               framework/src/test/hivemind/test/config
                        TestConfigurationPoint.java
               framework/src/test/hivemind/test/services
                        TestMethodSignature.java
  Added:       framework/src/test/hivemind/test/parse PrivateSchema.xml
  Removed:     framework/src/test/hivemind/test/config UnresolvedSchema.xml
                        DeferredSchema.xml DupeSymbol.xml
  Log:
  HIVEMIND-58: Add visibility attribute to the <schema> element.
  
  Revision  Changes    Path
  1.23      +24 -0     jakarta-hivemind/framework/src/test/hivemind/test/parse/TestDescriptorParser.java
  
  Index: TestDescriptorParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/parse/TestDescriptorParser.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- TestDescriptorParser.java	25 Sep 2004 17:08:34 -0000	1.22
  +++ TestDescriptorParser.java	27 Sep 2004 14:37:14 -0000	1.23
  @@ -26,11 +26,15 @@
   import org.apache.hivemind.Attribute;
   import org.apache.hivemind.Element;
   import org.apache.hivemind.Occurances;
  +import org.apache.hivemind.Resource;
  +import org.apache.hivemind.impl.DefaultErrorHandler;
  +import org.apache.hivemind.impl.RegistryAssemblyImpl;
   import org.apache.hivemind.internal.Visibility;
   import org.apache.hivemind.parse.ConfigurationPointDescriptor;
   import org.apache.hivemind.parse.ContributionDescriptor;
   import org.apache.hivemind.parse.CreateInstanceDescriptor;
   import org.apache.hivemind.parse.DependencyDescriptor;
  +import org.apache.hivemind.parse.DescriptorParser;
   import org.apache.hivemind.parse.ImplementationDescriptor;
   import org.apache.hivemind.parse.InterceptorDescriptor;
   import org.apache.hivemind.parse.ModuleDescriptor;
  @@ -38,6 +42,7 @@
   import org.apache.hivemind.schema.AttributeModel;
   import org.apache.hivemind.schema.ElementModel;
   import org.apache.hivemind.schema.Schema;
  +import org.apache.hivemind.schema.impl.SchemaImpl;
   import org.apache.hivemind.schema.rules.CreateObjectRule;
   import org.apache.hivemind.schema.rules.InvokeParentRule;
   import org.apache.hivemind.schema.rules.PushAttributeRule;
  @@ -492,6 +497,7 @@
           assertEquals("foo", rule.getAttributeName());
       }
   
  +    /** @since 1.1 */
       public void testPrivateServicePoint() throws Exception
       {
           ModuleDescriptor md = parse("PrivateServicePoint.xml");
  @@ -502,6 +508,7 @@
           assertEquals(Visibility.PRIVATE, spd.getVisibility());
       }
   
  +    /** @since 1.1 */
       public void testPrivateConfigurationPoint() throws Exception
       {
           ModuleDescriptor md = parse("PrivateConfigurationPoint.xml");
  @@ -510,5 +517,22 @@
           ConfigurationPointDescriptor cpd = (ConfigurationPointDescriptor) points.get(0);
   
           assertEquals(Visibility.PRIVATE, cpd.getVisibility());
  +    }
  +
  +    public void testPrivateSchema() throws Exception
  +    {
  +        Resource location = getResource("PrivateSchema.xml");
  +        DefaultErrorHandler eh = new DefaultErrorHandler();
  +
  +        RegistryAssemblyImpl assembly = new RegistryAssemblyImpl(eh);
  +
  +        DescriptorParser p = new DescriptorParser(eh, assembly);
  +
  +        p.parse(location, _resolver);
  +
  +        SchemaImpl s = (SchemaImpl) assembly.getSchema("hivemind.test.parse.PrivateSchema");
  +
  +        assertEquals("hivemind.test.parse", s.getModuleId());
  +        assertEquals(Visibility.PRIVATE, s.getVisibility());
       }
   }
  
  
  
  1.1                  jakarta-hivemind/framework/src/test/hivemind/test/parse/PrivateSchema.xml
  
  Index: PrivateSchema.xml
  ===================================================================
  <?xml version="1.0"?>
  <!-- 
     Copyright 2004 The Apache Software Foundation
  
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
  
         http://www.apache.org/licenses/LICENSE-2.0
  
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
  -->
  
  <module id="hivemind.test.parse" version="1.0.0">
    <schema id="PrivateSchema" visibility="private">
      <element name="foo"/>
    </schema>
  </module>
  
  
  
  1.21      +0 -51     jakarta-hivemind/framework/src/test/hivemind/test/config/TestConfigurationPoint.java
  
  Index: TestConfigurationPoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/config/TestConfigurationPoint.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- TestConfigurationPoint.java	25 Sep 2004 17:08:35 -0000	1.20
  +++ TestConfigurationPoint.java	27 Sep 2004 14:37:14 -0000	1.21
  @@ -418,17 +418,6 @@
           }
       }
   
  -    public void testDupeSymbol() throws Exception
  -    {
  -        Registry r = buildFrameworkRegistry("DupeSymbol.xml");
  -
  -        interceptLogging("hivemind.ApplicationDefaultsSymbolSource");
  -
  -        assertEquals("Fred's friend is barney.", r.expandSymbols("Fred's friend is ${fred}.", null));
  -
  -        assertLoggedMessagePattern("Error at .*?: Default for symbol 'fred' duplicates prior value \\(at .*\\) and has been ignored\\.");
  -    }
  -
       public void testResourceTranslator() throws Exception
       {
           RegistryBuilder builder = new RegistryBuilder();
  @@ -487,46 +476,6 @@
               assertExceptionSubstring(ex, "The HiveMind Registry has been shutdown.");
           }
   
  -    }
  -
  -    /**
  -     * Checks that you can put references to schemas out of order (within a module, though it
  -     * applies to cross-module references as well) and that it still works.
  -     */
  -    public void testDeferredSchema() throws Exception
  -    {
  -        Registry r = buildFrameworkRegistry("DeferredSchema.xml");
  -
  -        List l = r.getConfiguration("hivemind.test.config.DeferredSchema");
  -
  -        assertEquals(1, l.size());
  -
  -        Datum d = (Datum) l.get(0);
  -
  -        assertEquals("buffy", d.getKey());
  -        assertEquals("angel", d.getValue());
  -    }
  -
  -    /**
  -     * And what happens when a &lt;schema&gt;'s ref-id points to a non-existent schema?
  -     */
  -    public void testUnresolvedSchema() throws Exception
  -    {
  -        interceptLogging();
  -
  -        Registry r = buildFrameworkRegistry("UnresolvedSchema.xml");
  -
  -        assertLoggedMessagePattern("Error at .*?UnresolvedSchema.xml.*?: Unable to resolve reference to schema "
  -                + "'hivemind\\.test\\.config\\.Datum'\\.");
  -
  -        List l = r.getConfiguration("hivemind.test.config.UnresolvedSchema");
  -
  -        assertEquals(1, l.size());
  -
  -        Element e = (Element) l.get(0);
  -
  -        assertEquals("buffy", e.getAttributeValue("key"));
  -        assertEquals("angel", e.getAttributeValue("value"));
       }
   
       /**
  
  
  
  1.4       +2 -2      jakarta-hivemind/framework/src/test/hivemind/test/services/TestMethodSignature.java
  
  Index: TestMethodSignature.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/services/TestMethodSignature.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestMethodSignature.java	1 Aug 2004 17:40:37 -0000	1.3
  +++ TestMethodSignature.java	27 Sep 2004 14:37:14 -0000	1.4
  @@ -46,8 +46,8 @@
   
       public void testEqualsAndHashCode()
       {
  -        MethodSignature m1 = find(Object.class, "toString");
  -        MethodSignature m2 = find(Boolean.class, "toString");
  +        MethodSignature m1 = find(Object.class, "hashCode");
  +        MethodSignature m2 = find(Boolean.class, "hashCode");
   
           assertEquals(m1.hashCode(), m2.hashCode());
           assertTrue(m1.equals(m2));
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org