creadur-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject svn commit: r1549148 - /creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/HeaderCheckWorkerTest.java
Date Sun, 08 Dec 2013 19:45:39 GMT
Author: rdonkin
Date: Sun Dec  8 19:45:39 2013
New Revision: 1549148

URL: http://svn.apache.org/r1549148
Log:
Rename Test, Only one assert for each test.

Modified:
    creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/HeaderCheckWorkerTest.java

Modified: creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/HeaderCheckWorkerTest.java
URL: http://svn.apache.org/viewvc/creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/HeaderCheckWorkerTest.java?rev=1549148&r1=1549147&r2=1549148&view=diff
==============================================================================
--- creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/HeaderCheckWorkerTest.java
(original)
+++ creadur/rat/branches/gsoc/apache-rat-core/src/test/java/org/apache/rat/analysis/HeaderCheckWorkerTest.java
Sun Dec  8 19:45:39 2013
@@ -24,6 +24,7 @@ import static org.junit.Assert.assertNot
 import static org.junit.Assert.assertTrue;
 
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
@@ -40,19 +41,31 @@ import org.junit.Test;
  */
 public class HeaderCheckWorkerTest {
 
+
 	/**
-	 * Checks if is finished.
+	 * Not finished.
 	 * 
-	 * @throws Exception
-	 *             the exception
 	 */
     @Test
-    public void isFinished() throws Exception {
+	public void notFinished() {
+		final Document subject = new MockLocation("subject");
+		HeaderCheckWorker worker = new HeaderCheckWorker(new StringReader(""),
+				new ApacheSoftwareLicense20(), subject);
+		assertFalse("Work status can´t be finished", worker.isFinished());
+	}
+
+	/**
+	 * Checks if is finished.
+	 * 
+	 * @throws IOException
+	 *             Signals that an I/O exception has occurred.
+	 */
+	@Test
+	public void isFinished() throws IOException {
         final Document subject = new MockLocation("subject");
         HeaderCheckWorker worker = new HeaderCheckWorker(new StringReader(""), new ApacheSoftwareLicense20(),
subject);
-        assertFalse(worker.isFinished());
         worker.read();
-        assertTrue(worker.isFinished());
+		assertTrue("Work status must be finished", worker.isFinished());
     }
     
 	/**
@@ -64,13 +77,14 @@ public class HeaderCheckWorkerTest {
     @Test
 	public void testHeaderCheckWorkerConstructor()
 			throws UnsupportedEncodingException {
-		InputStream in = new ByteArrayInputStream("Test".getBytes("UTF-8"));
-		Reader reader = new InputStreamReader(in, "UTF-8");
+		InputStream inputStream = new ByteArrayInputStream(
+				"Test".getBytes("UTF-8"));
+		Reader reader = new InputStreamReader(inputStream, "UTF-8");
 		IHeaderMatcher matcher = null;
 		int numberOfRetainedHeaderLine = 0;
 		Document name = null;
 		HeaderCheckWorker headerCheckWorker = new HeaderCheckWorker(reader,
 				numberOfRetainedHeaderLine, matcher, name);
-        assertNotNull(headerCheckWorker);
+		assertNotNull("Not null", headerCheckWorker);
     }
 }



Mime
View raw message