directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r602616 - in /directory/apacheds/branches/bigbang: core-integ/src/test/java/org/apache/directory/server/core/ core-integ/src/test/java/org/apache/directory/server/core/normalization/ core-unit/src/test/java/org/apache/directory/server/core/...
Date Sun, 09 Dec 2007 03:01:00 GMT
Author: akarasulu
Date: Sat Dec  8 19:00:59 2007
New Revision: 602616

URL: http://svn.apache.org/viewvc?rev=602616&view=rev
Log:
converted another test to the new core integ framework

Added:
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/
      - copied from r602604, directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/normalization/
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java
  (with props)
Removed:
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceITest.java
    directory/apacheds/branches/bigbang/core-unit/src/test/java/org/apache/directory/server/core/normalization/
Modified:
    directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java

Modified: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java?rev=602616&r1=602615&r2=602616&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
(original)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/StockCoreISuite.java
Sat Dec  8 19:00:59 2007
@@ -29,6 +29,7 @@
 import org.apache.directory.server.core.integ.annotations.Mode;
 import org.apache.directory.server.core.integ.annotations.Scope;
 import org.apache.directory.server.core.jndi.*;
+import org.apache.directory.server.core.normalization.NormalizationServiceIT;
 import org.apache.directory.server.core.operational.OperationalAttributeServiceIT;
 import org.apache.directory.server.core.prefs.PreferencesIT;
 import org.apache.directory.server.core.sp.LdapClassLoaderIT;
@@ -78,6 +79,7 @@
         SubentryServiceObjectClassChangeHandlingIT.class,
         SubentryServiceIT.class,
         LdapClassLoaderIT.class,
+        NormalizationServiceIT.class,
         PartitionConfigurationIT.class  // Leaves the server in a bad state (partition removal
is incomplete)
         } )
 @Scope ( ServiceScope.TESTSUITE )

Added: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java?rev=602616&view=auto
==============================================================================
--- directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java
(added)
+++ directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java
Sat Dec  8 19:00:59 2007
@@ -0,0 +1,85 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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. 
+ *  
+ */
+package org.apache.directory.server.core.normalization;
+
+
+import org.apache.directory.server.core.DirectoryService;
+import org.apache.directory.server.core.integ.CiRunner;
+import static org.apache.directory.server.core.integ.IntegrationUtils.getSystemContext;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import javax.naming.NamingException;
+import javax.naming.directory.Attribute;
+import javax.naming.directory.Attributes;
+import javax.naming.ldap.LdapContext;
+
+
+
+/**
+ * Test cases for the normalization service.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$
+ */
+@RunWith ( CiRunner.class )
+public final class NormalizationServiceIT
+{
+    public static DirectoryService service;
+
+
+    @Test
+    public void testDireve308Example() throws NamingException
+    {
+        /*
+
+        Use @Ldif to load this data but for now we can do it with code.
+
+dn: ou=direct report view,ou=system
+objectClass: organizationalUnit
+ou: direct report view
+
+dn: ou=corporate category\, operations,ou=direct report view,ou=system
+objectClass: organizationalUnit
+ou: corporate category\, operations
+
+         */
+
+        LdapContext sysRoot = getSystemContext( service );
+
+        Attributes attrs = new AttributesImpl( "objectClass", "organizationalUnit", true
);
+        attrs.put( "ou", "direct report view" );
+        sysRoot.createSubcontext( "ou=direct report view", attrs );
+
+        attrs = new AttributesImpl( "objectClass", "organizationalUnit", true );
+        attrs.put( "ou", "corporate category\\, operations" );
+        sysRoot.createSubcontext( "ou=corporate category\\, operations,ou=direct report view",
attrs );
+
+        attrs = sysRoot.getAttributes( "ou=corporate category\\, operations,ou=direct report
view" );
+        assertNotNull( attrs );
+        Attribute ou = attrs.get( "ou" );
+        assertEquals( "corporate category, operations", ou.get() );
+        Attribute oc = attrs.get( "objectClass" );
+        assertTrue( oc.contains( "top" ) );
+        assertTrue( oc.contains( "organizationalUnit" ) );
+    }
+}

Propchange: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/apacheds/branches/bigbang/core-integ/src/test/java/org/apache/directory/server/core/normalization/NormalizationServiceIT.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Sat Dec  8 19:00:59 2007
@@ -0,0 +1,4 @@
+Rev
+Revision
+Date
+Id



Mime
View raw message