[hibernate-commits] Hibernate SVN: r19525 - in validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap: testutil and 1 other directories.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Sat May 15 12:05:09 EDT 2010


Author: gunnar.morling
Date: 2010-05-15 12:05:09 -0400 (Sat, 15 May 2010)
New Revision: 19525

Added:
   validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpectation.java
Removed:
   validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpection.java
Modified:
   validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/ConstraintValidationProcessorTest.java
   validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/testutil/CompilerTestHelper.java
Log:
HV-322: Renamed DiagnosticExpection to DiagnosticExpectation

Modified: validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/ConstraintValidationProcessorTest.java
===================================================================
--- validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/ConstraintValidationProcessorTest.java	2010-05-15 15:50:33 UTC (rev 19524)
+++ validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/ConstraintValidationProcessorTest.java	2010-05-15 16:05:09 UTC (rev 19525)
@@ -66,7 +66,7 @@
 import org.hibernate.validator.ap.testmodel.nouniquevalidatorresolution.SizeValidatorForSerializable;
 import org.hibernate.validator.ap.testmodel.nouniquevalidatorresolution.SizeValidatorForSet;
 import org.hibernate.validator.ap.testutil.CompilerTestHelper;
-import org.hibernate.validator.ap.util.DiagnosticExpection;
+import org.hibernate.validator.ap.util.DiagnosticExpectation;
 
 import static org.hibernate.validator.ap.testutil.CompilerTestHelper.assertThatDiagnosticsMatch;
 import static org.testng.Assert.assertFalse;
@@ -121,7 +121,7 @@
 
 		assertFalse( compilationResult );
 		assertThatDiagnosticsMatch(
-				diagnostics, new DiagnosticExpection( Kind.ERROR, 54 ), new DiagnosticExpection( Kind.ERROR, 60 )
+				diagnostics, new DiagnosticExpectation( Kind.ERROR, 54 ), new DiagnosticExpectation( Kind.ERROR, 60 )
 		);
 	}
 
@@ -141,9 +141,9 @@
 
 		assertThatDiagnosticsMatch(
 				diagnostics,
-				new DiagnosticExpection( Kind.NOTE, Diagnostic.NOPOS ), //says that verbose messaging is enabled
-				new DiagnosticExpection( Kind.WARNING, 54 ),
-				new DiagnosticExpection( Kind.WARNING, 60 )
+				new DiagnosticExpectation( Kind.NOTE, Diagnostic.NOPOS ), //says that verbose messaging is enabled
+				new DiagnosticExpectation( Kind.WARNING, 54 ),
+				new DiagnosticExpectation( Kind.WARNING, 60 )
 		);
 	}
 
@@ -166,7 +166,7 @@
 				);
 
 		assertFalse( compilationResult );
-		assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpection( Kind.ERROR, 30 ) );
+		assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpectation( Kind.ERROR, 30 ) );
 	}
 
 	@Test
@@ -188,7 +188,7 @@
 				);
 
 		assertFalse( compilationResult );
-		assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpection( Kind.ERROR, 30 ) );
+		assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpectation( Kind.ERROR, 30 ) );
 	}
 
 	@Test
@@ -202,10 +202,10 @@
 		assertFalse( compilationResult );
 		assertThatDiagnosticsMatch(
 				diagnostics,
-				new DiagnosticExpection( Kind.ERROR, 32 ),
-				new DiagnosticExpection( Kind.ERROR, 39 ),
-				new DiagnosticExpection( Kind.ERROR, 47 ),
-				new DiagnosticExpection( Kind.ERROR, 54 )
+				new DiagnosticExpectation( Kind.ERROR, 32 ),
+				new DiagnosticExpectation( Kind.ERROR, 39 ),
+				new DiagnosticExpectation( Kind.ERROR, 47 ),
+				new DiagnosticExpectation( Kind.ERROR, 54 )
 		);
 	}
 
@@ -222,7 +222,7 @@
 				);
 
 		assertFalse( compilationResult );
-		assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpection( Kind.ERROR, 28 ) );
+		assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpectation( Kind.ERROR, 28 ) );
 	}
 
 	@Test
@@ -235,7 +235,7 @@
 				compilerHelper.compile( new ConstraintValidationProcessor(), diagnostics, sourceFile1, sourceFile2 );
 
 		assertFalse( compilationResult );
-		assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpection( Kind.ERROR, 29 ) );
+		assertThatDiagnosticsMatch( diagnostics, new DiagnosticExpectation( Kind.ERROR, 29 ) );
 	}
 
 	@Test
@@ -271,10 +271,10 @@
 		assertFalse( compilationResult );
 		assertThatDiagnosticsMatch(
 				diagnostics,
-				new DiagnosticExpection( Kind.ERROR, 29 ),
-				new DiagnosticExpection( Kind.ERROR, 41 ),
-				new DiagnosticExpection( Kind.ERROR, 50 ),
-				new DiagnosticExpection( Kind.ERROR, 56 )
+				new DiagnosticExpectation( Kind.ERROR, 29 ),
+				new DiagnosticExpectation( Kind.ERROR, 41 ),
+				new DiagnosticExpectation( Kind.ERROR, 50 ),
+				new DiagnosticExpectation( Kind.ERROR, 56 )
 		);
 	}
 
@@ -293,11 +293,11 @@
 		assertFalse( compilationResult );
 		assertThatDiagnosticsMatch(
 				diagnostics,
-				new DiagnosticExpection( Kind.ERROR, 31 ),
-				new DiagnosticExpection( Kind.ERROR, 37 ),
-				new DiagnosticExpection( Kind.ERROR, 43 ),
-				new DiagnosticExpection( Kind.ERROR, 59 ),
-				new DiagnosticExpection( Kind.ERROR, 67 )
+				new DiagnosticExpectation( Kind.ERROR, 31 ),
+				new DiagnosticExpectation( Kind.ERROR, 37 ),
+				new DiagnosticExpectation( Kind.ERROR, 43 ),
+				new DiagnosticExpectation( Kind.ERROR, 59 ),
+				new DiagnosticExpectation( Kind.ERROR, 67 )
 		);
 	}
 
@@ -311,7 +311,7 @@
 
 		assertFalse( compilationResult );
 		assertThatDiagnosticsMatch(
-				diagnostics, new DiagnosticExpection( Kind.ERROR, 28 ), new DiagnosticExpection( Kind.ERROR, 29 )
+				diagnostics, new DiagnosticExpectation( Kind.ERROR, 28 ), new DiagnosticExpectation( Kind.ERROR, 29 )
 		);
 	}
 
@@ -339,7 +339,7 @@
 
 		assertFalse( compilationResult );
 		assertThatDiagnosticsMatch(
-				diagnostics, new DiagnosticExpection(
+				diagnostics, new DiagnosticExpectation(
 						Kind.ERROR, 33
 				)
 		);
@@ -357,8 +357,8 @@
 		assertFalse( compilationResult );
 		assertThatDiagnosticsMatch(
 				diagnostics,
-				new DiagnosticExpection( Kind.ERROR, 33 ),
-				new DiagnosticExpection( Kind.ERROR, 33 )
+				new DiagnosticExpectation( Kind.ERROR, 33 ),
+				new DiagnosticExpectation( Kind.ERROR, 33 )
 		);
 	}
 
@@ -374,13 +374,13 @@
 		assertFalse( compilationResult );
 		assertThatDiagnosticsMatch(
 				diagnostics,
-				new DiagnosticExpection( Kind.ERROR, 34 ),
-				new DiagnosticExpection( Kind.ERROR, 40 ),
-				new DiagnosticExpection( Kind.ERROR, 56 ),
-				new DiagnosticExpection( Kind.ERROR, 64 ),
-				new DiagnosticExpection( Kind.ERROR, 72 ),
-				new DiagnosticExpection( Kind.ERROR, 80 ),
-				new DiagnosticExpection( Kind.ERROR, 88 )
+				new DiagnosticExpectation( Kind.ERROR, 34 ),
+				new DiagnosticExpectation( Kind.ERROR, 40 ),
+				new DiagnosticExpectation( Kind.ERROR, 56 ),
+				new DiagnosticExpectation( Kind.ERROR, 64 ),
+				new DiagnosticExpectation( Kind.ERROR, 72 ),
+				new DiagnosticExpectation( Kind.ERROR, 80 ),
+				new DiagnosticExpectation( Kind.ERROR, 88 )
 		);
 	}
 }

Modified: validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/testutil/CompilerTestHelper.java
===================================================================
--- validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/testutil/CompilerTestHelper.java	2010-05-15 15:50:33 UTC (rev 19524)
+++ validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/testutil/CompilerTestHelper.java	2010-05-15 16:05:09 UTC (rev 19525)
@@ -30,7 +30,7 @@
 import javax.tools.JavaFileObject;
 import javax.tools.StandardJavaFileManager;
 
-import org.hibernate.validator.ap.util.DiagnosticExpection;
+import org.hibernate.validator.ap.util.DiagnosticExpectation;
 
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
@@ -148,28 +148,28 @@
 	 *
 	 * @param diagnostics The actual diagnostics as populated by the executed
 	 * {@link CompilationTask}.
-	 * @param expections The expectations to compare against.
+	 * @param expectations The expectations to compare against.
 	 */
-	public static void assertThatDiagnosticsMatch(DiagnosticCollector<JavaFileObject> diagnostics, DiagnosticExpection... expections) {
+	public static void assertThatDiagnosticsMatch(DiagnosticCollector<JavaFileObject> diagnostics, DiagnosticExpectation... expectations) {
 
 		List<Diagnostic<? extends JavaFileObject>> diagnosticsList = diagnostics.getDiagnostics();
 
-		if ( expections == null ) {
+		if ( expectations == null ) {
 			assertTrue( diagnosticsList.isEmpty() );
 		}
 		else {
 
-			if ( diagnosticsList.size() != expections.length ) {
+			if ( diagnosticsList.size() != expectations.length ) {
 				System.out.println( diagnosticsList );
 			}
 
-			assertEquals( diagnosticsList.size(), expections.length, "Wrong number of diagnostics." );
+			assertEquals( diagnosticsList.size(), expectations.length, "Wrong number of diagnostics." );
 
 			int i = 0;
-			for ( DiagnosticExpection oneExpection : expections ) {
+			for ( DiagnosticExpectation oneExpectation : expectations ) {
 
-				assertEquals( diagnosticsList.get( i ).getKind(), oneExpection.getKind() );
-				assertEquals( diagnosticsList.get( i ).getLineNumber(), oneExpection.getLineNumber() );
+				assertEquals( diagnosticsList.get( i ).getKind(), oneExpectation.getKind() );
+				assertEquals( diagnosticsList.get( i ).getLineNumber(), oneExpectation.getLineNumber() );
 
 				i++;
 			}

Copied: validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpectation.java (from rev 19518, validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpection.java)
===================================================================
--- validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpectation.java	                        (rev 0)
+++ validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpectation.java	2010-05-15 16:05:09 UTC (rev 19525)
@@ -0,0 +1,51 @@
+// $Id$
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, Red Hat Middleware LLC, and individual contributors
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* 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.
+*/
+package org.hibernate.validator.ap.util;
+
+import javax.tools.Diagnostic;
+import javax.tools.Diagnostic.Kind;
+
+/**
+ * Expectation value to be matched against a given {@link Diagnostic}.
+ *
+ * @author Gunnar Morling
+ */
+public class DiagnosticExpectation {
+
+	private final Kind kind;
+
+	private final long lineNumber;
+
+	public DiagnosticExpectation(Kind kind, long lineNumber) {
+		this.kind = kind;
+		this.lineNumber = lineNumber;
+	}
+
+	public Kind getKind() {
+		return kind;
+	}
+
+	public long getLineNumber() {
+		return lineNumber;
+	}
+
+	@Override
+	public String toString() {
+		return "DiagnosticExpectation [kind=" + kind + ", lineNumber=" + lineNumber + "]";
+	}
+}
\ No newline at end of file


Property changes on: validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpectation.java
___________________________________________________________________
Name: svn:keywords
   + Id

Deleted: validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpection.java
===================================================================
--- validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpection.java	2010-05-15 15:50:33 UTC (rev 19524)
+++ validator/trunk/hibernate-validator-annotation-processor/src/test/java/org/hibernate/validator/ap/util/DiagnosticExpection.java	2010-05-15 16:05:09 UTC (rev 19525)
@@ -1,50 +0,0 @@
-// $Id$
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2009, Red Hat Middleware LLC, and individual contributors
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* 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.
-*/
-package org.hibernate.validator.ap.util;
-
-import javax.tools.Diagnostic;
-import javax.tools.Diagnostic.Kind;
-
-/**
- * Expectation value to be matched against a given {@link Diagnostic}.
- *
- * @author Gunnar Morling
- */
-public class DiagnosticExpection {
-	private final Kind kind;
-
-	private final long lineNumber;
-
-	public DiagnosticExpection(Kind kind, long lineNumber) {
-		this.kind = kind;
-		this.lineNumber = lineNumber;
-	}
-
-	public Kind getKind() {
-		return kind;
-	}
-
-	public long getLineNumber() {
-		return lineNumber;
-	}
-
-	@Override
-	public String toString() {
-		return "DiagnosticExpection [kind=" + kind + ", lineNumber=" + lineNumber + "]";
-	}
-}
\ No newline at end of file



More information about the hibernate-commits mailing list