You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/09/03 11:06:43 UTC
svn commit: r267439 - in
/directory/shared/ldap/branches/new-codec-integration/common/src:
java/org/apache/ldap/common/subtree/ test/org/apache/ldap/common/subtree/
Author: elecharny
Date: Sat Sep 3 02:06:32 2005
New Revision: 267439
URL: http://svn.apache.org/viewcvs?rev=267439&view=rev
Log:
Backporting trunk modifications to the branch
Modified:
directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/BaseSubtreeSpecification.java
directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationLexer.java
directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationParser.java
directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/SubtreeSpecificationParser.java
directory/shared/ldap/branches/new-codec-integration/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java
Modified: directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/BaseSubtreeSpecification.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/BaseSubtreeSpecification.java?rev=267439&r1=267438&r2=267439&view=diff
==============================================================================
--- directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/BaseSubtreeSpecification.java (original)
+++ directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/BaseSubtreeSpecification.java Sat Sep 3 02:06:32 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 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.
Modified: directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationLexer.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationLexer.java?rev=267439&r1=267438&r2=267439&view=diff
==============================================================================
--- directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationLexer.java (original)
+++ directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationLexer.java Sat Sep 3 02:06:32 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 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.
Modified: directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationParser.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationParser.java?rev=267439&r1=267438&r2=267439&view=diff
==============================================================================
--- directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationParser.java (original)
+++ directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/ReusableAntlrSubtreeSpecificationParser.java Sat Sep 3 02:06:32 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 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.
Modified: directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/SubtreeSpecificationParser.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/SubtreeSpecificationParser.java?rev=267439&r1=267438&r2=267439&view=diff
==============================================================================
--- directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/SubtreeSpecificationParser.java (original)
+++ directory/shared/ldap/branches/new-codec-integration/common/src/java/org/apache/ldap/common/subtree/SubtreeSpecificationParser.java Sat Sep 3 02:06:32 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 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.
@@ -124,7 +124,13 @@
msg += "\nAntlr exception trace:\n" + e.getMessage();
throw new ParseException( msg, e.getColumn() );
}
-
+ catch ( Exception e )
+ {
+ String msg = "Parser failure on subtree specification:\n\t" + spec ;
+ msg += "\nAntlr exception trace:\n" + e.getMessage();
+ throw new ParseException( msg, 0 );
+ }
+
return ss;
}
Modified: directory/shared/ldap/branches/new-codec-integration/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java
URL: http://svn.apache.org/viewcvs/directory/shared/ldap/branches/new-codec-integration/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java?rev=267439&r1=267438&r2=267439&view=diff
==============================================================================
--- directory/shared/ldap/branches/new-codec-integration/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java (original)
+++ directory/shared/ldap/branches/new-codec-integration/common/src/test/org/apache/ldap/common/subtree/SubtreeSpecificationParserTest.java Sat Sep 3 02:06:32 2005
@@ -1,5 +1,5 @@
/*
- * Copyright 2004 The Apache Software Foundation
+ * Copyright 2005 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.
@@ -47,10 +47,6 @@
private static final String EMPTY_SPEC =
"{ }";
- /** An invalid empty specification with two white spaces between brackets */
- private static final String INVALID_EMPTY_SPEC_WITH_EXTRA_WS =
- "{ }";
-
/** A valid specification only with base set */
private static final String SPEC_WITH_BASE =
"{ base \"ou=system\" }";
@@ -59,21 +55,17 @@
private static final String INVALID_SPEC_WITH_BASE_AND_MISSING_WS =
"{ base\"ou=system\"}";
- /** An invalid specification with extra whitespace and base set */
- private static final String INVALID_SPEC_WITH_BASE_AND_EXTRA_WS =
- "{ base ou=system\" } ";
-
/** A valid specification with some specific exclusions set */
private static final String SPEC_WITH_SPECIFICEXCLUSIONS =
- "{, specificExclusions { chopAfter:\"ef=gh\", chopBefore:\"ab=cd\" } }";
+ "{ specificExclusions { chopAfter:\"ef=gh\", chopBefore:\"ab=cd\" } }";
/** A valid specification with empty specific exclusions set */
private static final String SPEC_WITH_EMPTY_SPECIFICEXCLUSIONS =
- "{, specificExclusions { } }";
+ "{ specificExclusions { } }";
/** A valid specification with minimum and maximum set */
private static final String SPEC_WITH_MINIMUM_AND_MAXIMUM =
- "{, minimum 1, maximum 2 }";
+ "{ minimum 1, maximum 2 }";
/** A valid specification with base and minimum and maximum set */
private static final String SPEC_WITH_BASE_AND_MINIMUM_AND_MAXIMUM =
@@ -100,9 +92,11 @@
", minimum 7, maximum 77" +
", specificationFilter and:{ and:{ item:1.2.3, or:{ item:4.5.6, item:7.8.9 } }, not:{ item:10.11.12 } } }";
+ /** An invalid specification with wrong component order */
private static final String INVALID_SPEC_WITH_WRONG_COMPONENT_ORDER =
"{ base \"ou=system\", minimum 3, specificExclusions { chopBefore:\"x=y\" } }";
+ /** An invalid specification with completely unrelated content */
private static final String INVALID_SILLY_THING =
"How much wood would a wood chuck chuck if a wood chuck would chuck wood?";
@@ -156,27 +150,6 @@
/**
- * Tests the parser with an invalid empty specification with extra white spaces.
- */
- public void testInvalidEmptySpecWithExtraWS() throws Exception
- {
- try
- {
- SubtreeSpecification ss = parser.parse( INVALID_EMPTY_SPEC_WITH_EXTRA_WS );
- fail( "testInvalidEmptySpecWithExtraWS() should never come here..." );
- }
- catch ( ParseException e )
- {
- assertNotNull( e );
- }
- catch ( IOException e )
- {
- assertNotNull( e );
- }
- }
-
-
- /**
* Tests the parser with a valid specification with base set.
*/
public void testSpecWithBase() throws Exception
@@ -199,31 +172,6 @@
fail( "testInvalidSpecWithBaseAndMissingWS() should never come here..." );
}
catch ( ParseException e )
- {
- assertNotNull( e );
- }
- catch ( IOException e )
- {
- assertNotNull( e );
- }
- }
-
-
- /**
- * Tests the parser with an invalid specification with extra white spaces and base set.
- */
- public void testInvalidSpecWithBaseAndExtraWS() throws Exception
- {
- try
- {
- SubtreeSpecification ss = parser.parse( INVALID_SPEC_WITH_BASE_AND_EXTRA_WS );
- fail( "testInvalidSpecWithBaseAndExtraWS() should never come here..." );
- }
- catch ( ParseException e )
- {
- assertNotNull( e );
- }
- catch ( IOException e )
{
assertNotNull( e );
}