Permalink
Browse files

update with changes from upstream

  • Loading branch information...
1 parent ef5f13c commit 7dc5aa48078f495fcc68abce4d2e344666c6b396 @gesellix gesellix committed Aug 11, 2012
Showing 584 changed files with 1,239 additions and 3,584 deletions.
View
@@ -2,6 +2,7 @@
/target
#IntelliJ project files
/.idea
+/*.iml
#Eclipse project files
/.settings
/.classpath
View
@@ -0,0 +1,4 @@
+language: java
+branches:
+ only:
+ - master
View
@@ -24,3 +24,7 @@ Thanks to Cloudbees for their FOSS program that allows Fest to have a Jenkins CI
![cloudbees](/alexruiz/fest-assert-2.x/raw/master/src/site/resources/images/built-on-Dev@Cloud-Cloudbees.png)
+### Current build status:
+
+[![Build Status](https://secure.travis-ci.org/gesellix/fest-assert-2.x.png?branch=master)](http://travis-ci.org/gesellix/fest-assert-2.x)
+
View
@@ -4,15 +4,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert-core</artifactId>
- <version>2.0M8-SNAPSHOT</version>
+ <version>2.0M8-MODULARIZATION-SNAPSHOT</version>
<name>FEST Fluent Assertions</name>
<description>'Flexible' or 'fluent' assertions for testing</description>
<inceptionYear>2007</inceptionYear>
<url>http://fest.easytesting.org/assert</url>
<parent>
<groupId>org.easytesting</groupId>
<artifactId>fest</artifactId>
- <version>1.0.14</version>
+ <version>1.0.15-MODULARIZATION-SNAPSHOT</version>
</parent>
<mailingLists>
<mailingList>
@@ -28,32 +28,30 @@
<url>https://github.com/alexruiz/fest-assert-2.x</url>
</scm>
<issueManagement>
- <system>github</system>
- <url>https://github.com/alexruiz/fest-assert-2.x/issues</url>
+ <system>github</system>
+ <url>https://github.com/alexruiz/fest-assert-2.x/issues</url>
</issueManagement>
<dependencies>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-util</artifactId>
- <version>1.2.2</version>
+ <version>1.2.3-MODULARIZATION-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-test</artifactId>
- <version>2.0</version>
+ <version>2.1-MODULARIZATION-SNAPSHOT</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
- <version>1.9.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.10</version>
<scope>test</scope>
</dependency>
</dependencies>
Binary file not shown.
@@ -14,7 +14,6 @@
*/
package org.fest.assertions.api;
-import java.awt.image.BufferedImage;
import java.io.File;
import java.io.InputStream;
import java.math.BigDecimal;
@@ -32,7 +31,6 @@
import org.fest.assertions.data.MapEntry;
import org.fest.assertions.data.Offset;
import org.fest.assertions.groups.Properties;
-import org.fest.assertions.util.ImageReader;
/**
* Entry point for assertion methods for different data types. Each method in this class is a static factory for the type-specific
@@ -97,16 +95,6 @@ public static BooleanArrayAssert assertThat(boolean[] actual) {
}
/**
- * Creates a new instance of <code>{@link ImageAssert}</code>. To read an image from the file system use
- * <code>{@link ImageReader#readImageFrom(String)}</code>.
- * @param actual the actual value.
- * @return the created assertion object.
- */
- public static ImageAssert assertThat(BufferedImage actual) {
- return new ImageAssert(actual);
- }
-
- /**
* Creates a new instance of <code>{@link ByteAssert}</code>.
* @param actual the actual value.
* @return the created assertion object.
@@ -1,111 +0,0 @@
-/*
- * Created on Oct 20, 2010
- *
- * 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.
- *
- * Copyright @2010-2011 the original author or authors.
- */
-package org.fest.assertions.api;
-
-import java.awt.Dimension;
-import java.awt.image.BufferedImage;
-import java.util.Comparator;
-
-import org.fest.assertions.data.Offset;
-import org.fest.assertions.internal.Images;
-import org.fest.util.VisibleForTesting;
-
-/**
- * Assertion methods for images.
- * <p>
- * To create an instance of this class, invoke <code>{@link Assertions#assertThat(BufferedImage)}</code>.
- * </p>
- *
- * @author Yvonne Wang
- * @author Alex Ruiz
- * @author Ansgar Konermann
- * @author Joel Costigliola
- * @author Mikhail Mazursky
- */
-public class ImageAssert extends AbstractAssert<ImageAssert, BufferedImage> {
-
- @VisibleForTesting
- Images images = Images.instance();
-
- protected ImageAssert(BufferedImage actual) {
- super(actual, ImageAssert.class);
- }
-
- /**
- * Verifies that the actual image is equal to the given one. Two images are equal if:
- * <ol>
- * <li>they have equal size</li>
- * <li>the the RGB values of the color at each pixel are equal</li>
- * </ol>
- * @param expected the given image to compare the actual image to.
- * @return {@code this} assertion object.
- * @throws AssertionError if the actual image is not equal to the given one.
- */
- @Override
- public ImageAssert isEqualTo(BufferedImage expected) {
- images.assertEqual(info, actual, expected);
- return this;
- }
-
- /**
- * Verifies that the actual image is equal to the given one. Two images are equal if:
- * <ol>
- * <li>they have the same size</li>
- * <li>the difference between the RGB values of the color at each pixel is less than or equal to the given offset</li>
- * </ol>
- * @param expected the given image to compare the actual image to.
- * @param offset helps decide if the color of two pixels are similar: two pixels that are identical to the human eye may still
- * have slightly different color values. For example, by using an offset of 1 we can indicate that a blue value of 60
- * is similar to a blue value of 61.
- * @return {@code this} assertion object.
- * @throws NullPointerException if the given offset is {@code null}.
- * @throws AssertionError if the actual image is not equal to the given one.
- */
- public ImageAssert isEqualTo(BufferedImage expected, Offset<Integer> offset) {
- images.assertEqual(info, actual, expected, offset);
- return this;
- }
-
- /** {@inheritDoc} */
- @Override
- public ImageAssert isNotEqualTo(BufferedImage other) {
- images.assertNotEqual(info, actual, other);
- return this;
- }
-
- /**
- * Verifies that the actual image has the given size.
- * @param expected the expected size of the actual image.
- * @return {@code this} assertion object.
- * @throws NullPointerException if the given size is {@code null}.
- * @throws AssertionError if the size of the actual image is not equal to the given size.
- */
- public ImageAssert hasSize(Dimension expected) {
- images.assertHasSize(info, actual, expected);
- return this;
- }
-
- @Override
- public ImageAssert usingComparator(Comparator<? super BufferedImage> customComparator) {
- throw new UnsupportedOperationException("custom Comparator is not supported for image comparison");
- }
-
- @Override
- public ImageAssert usingDefaultComparator() {
- super.usingDefaultComparator();
- this.images = Images.instance();
- return myself;
- }
-}
@@ -16,8 +16,6 @@
import static org.fest.util.ToString.toStringOf;
-import java.awt.image.BufferedImage;
-
import org.fest.assertions.description.Description;
import org.fest.util.*;
@@ -73,7 +71,7 @@ public String format(Description d, String format, Object... args) {
}
private String asText(Object o) {
- if (o instanceof BufferedImage) return "image";
+ if (o != null && INSTANCE.getClass().getName().equals("java.awt.image.BufferedImage")) return "image";
if (o instanceof ComparatorBasedComparisonStrategy) return " according to " + o + " comparator";
if (o instanceof StandardComparisonStrategy) return "";
return toStringOf(o);
Oops, something went wrong.

0 comments on commit 7dc5aa4

Please sign in to comment.