Return-Path: X-Original-To: apmail-directory-commits-archive@www.apache.org Delivered-To: apmail-directory-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 538D618DE6 for ; Mon, 15 Feb 2016 23:12:29 +0000 (UTC) Received: (qmail 47189 invoked by uid 500); 15 Feb 2016 23:12:29 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 47142 invoked by uid 500); 15 Feb 2016 23:12:29 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 47132 invoked by uid 99); 15 Feb 2016 23:12:29 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Feb 2016 23:12:29 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CE3651A0064 for ; Mon, 15 Feb 2016 23:12:28 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.471 X-Spam-Level: * X-Spam-Status: No, score=1.471 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-0.329] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 7XNmOAMbAmvP for ; Mon, 15 Feb 2016 23:12:27 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 729E75F1B9 for ; Mon, 15 Feb 2016 23:12:26 +0000 (UTC) Received: from svn01-us-west.apache.org (svn.apache.org [10.41.0.6]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 4B20DE0097 for ; Mon, 15 Feb 2016 23:12:25 +0000 (UTC) Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 2CADA3A10A5 for ; Mon, 15 Feb 2016 23:12:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1730621 - in /directory/studio/trunk: plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/ tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/ Date: Mon, 15 Feb 2016 23:12:25 -0000 To: commits@directory.apache.org From: seelmann@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20160215231225.2CADA3A10A5@svn01-us-west.apache.org> Author: seelmann Date: Mon Feb 15 23:12:24 2016 New Revision: 1730621 URL: http://svn.apache.org/viewvc?rev=1730621&view=rev Log: DIRSTUDIO-1085: Fix default schema loading Added: directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/SchemaTest.java (with props) Modified: directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java Modified: directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java?rev=1730621&r1=1730620&r2=1730621&view=diff ============================================================================== --- directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java (original) +++ directory/studio/trunk/plugins/ldapbrowser.core/src/main/java/org/apache/directory/studio/ldapbrowser/core/model/schema/Schema.java Mon Feb 15 23:12:24 2016 @@ -169,7 +169,7 @@ public class Schema { LdifParser parser = new LdifParser(); LdifEnumeration enumeration = parser.parse( reader ); - if ( enumeration.hasNext() ) + while ( enumeration.hasNext() ) { LdifContainer container = enumeration.next(); if ( container instanceof LdifContentRecord ) Added: directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/SchemaTest.java URL: http://svn.apache.org/viewvc/directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/SchemaTest.java?rev=1730621&view=auto ============================================================================== --- directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/SchemaTest.java (added) +++ directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/SchemaTest.java Mon Feb 15 23:12:24 2016 @@ -0,0 +1,77 @@ +/* + * 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.studio.test.integration.core; + + +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; + +import java.util.Collection; + +import org.apache.directory.api.ldap.model.schema.AttributeType; +import org.apache.directory.api.ldap.model.schema.ObjectClass; +import org.apache.directory.server.annotations.CreateLdapServer; +import org.apache.directory.server.annotations.CreateTransport; +import org.apache.directory.server.core.integ.AbstractLdapTestUnit; +import org.apache.directory.server.core.integ.FrameworkRunner; +import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema; +import org.junit.Test; +import org.junit.runner.RunWith; + + +/** + * Tests the {@link Schema}. + * + * @author Apache Directory Project + */ +@RunWith(FrameworkRunner.class) +@CreateLdapServer(transports = + { @CreateTransport(protocol = "LDAP"), @CreateTransport(protocol = "LDAPS") }) +public class SchemaTest extends AbstractLdapTestUnit +{ + + /** + * Test that the default schema is properly loaded. + */ + @Test + public void testDefaultSchema() + { + Schema defaultSchema = Schema.DEFAULT_SCHEMA; + assertNotNull( defaultSchema ); + + Collection ocds = defaultSchema.getObjectClassDescriptions(); + assertNotNull( ocds ); + assertFalse( ocds.isEmpty() ); + + assertNotNull( defaultSchema.getObjectClassDescription( "top" ) ); + assertNotNull( defaultSchema.getObjectClassDescription( "inetOrgPerson" ) ); + assertNotNull( defaultSchema.getObjectClassDescription( "groupOfNames" ) ); + + Collection atds = defaultSchema.getAttributeTypeDescriptions(); + assertNotNull( atds ); + assertFalse( atds.isEmpty() ); + + assertNotNull( defaultSchema.getAttributeTypeDescription( "objectClass" ) ); + assertNotNull( defaultSchema.getAttributeTypeDescription( "cn" ) ); + assertNotNull( defaultSchema.getAttributeTypeDescription( "member" ) ); + } + +} Propchange: directory/studio/trunk/tests/test.integration.core/src/main/java/org/apache/directory/studio/test/integration/core/SchemaTest.java ------------------------------------------------------------------------------ svn:eol-style = native