Skip to content
Permalink
Browse files

renamed project testanza->quackery

  • Loading branch information...
maciejmikosik committed Mar 14, 2015
1 parent 2352c45 commit 10bc85134aa3366c6eaf2c85a9a4904d3c344642
Showing with 222 additions and 187 deletions.
  1. +1 −1 .project
  2. +5 −5 main/build/build.sh
  3. +1 −1 main/java/org/{testanza → quackery}/Build.java
  4. +2 −2 main/java/org/{testanza → quackery}/Case.java
  5. +4 −4 main/java/org/{testanza → quackery}/Junit.java
  6. +13 −0 main/java/org/quackery/QuackeryAssertionException.java
  7. +28 −0 main/java/org/quackery/QuackeryAssumptionException.java
  8. +23 −0 main/java/org/quackery/QuackeryException.java
  9. +11 −11 main/java/org/{testanza → quackery}/Quacks.java
  10. +2 −2 main/java/org/{testanza → quackery}/Suite.java
  11. +1 −1 main/java/org/{testanza → quackery}/Test.java
  12. +1 −1 main/java/org/{testanza → quackery}/Tester.java
  13. +10 −10 main/java/org/{testanza → quackery}/Testers.java
  14. +1 −1 main/java/org/{testanza → quackery}/common/Classes.java
  15. +0 −13 main/java/org/testanza/TestanzaAssertionException.java
  16. +0 −28 main/java/org/testanza/TestanzaAssumptionException.java
  17. +0 −23 main/java/org/testanza/TestanzaException.java
  18. +9 −5 test/java/org/{testanza → quackery}/describe_Case.java
  19. +12 −8 test/java/org/{testanza → quackery}/describe_Junit_junit.java
  20. +12 −6 test/java/org/{testanza → quackery}/describe_Quacks_quacksLike_collection.java
  21. +23 −17 test/java/org/{testanza → quackery}/describe_Suite.java
  22. +17 −11 test/java/org/{testanza → quackery}/describe_Testers_hasConstructor.java
  23. +13 −10 test/java/org/{testanza → quackery}/describe_Testers_hasModifier.java
  24. +13 −10 test/java/org/{testanza → quackery}/describe_Testers_hasNoModifier.java
  25. +11 −8 test/java/org/{testanza → quackery}/describe_Testers_isAssignableTo_Class.java
  26. +2 −2 test/java/org/{testanza/describe_testanza.java → quackery/describe_quackery.java}
  27. +1 −1 test/java/org/{testanza → quackery}/testing/Assertions.java
  28. +1 −1 test/java/org/{testanza → quackery}/testing/Mocks.java
  29. +4 −4 test/java/org/{testanza → quackery}/testing/Tests.java
  30. +1 −1 test/java/org/{testanza → quackery}/testing/bug/collect/MutableList.java
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>testanza</name>
<name>quackery</name>
<comment></comment>
<projects>
</projects>
@@ -20,7 +20,7 @@ javac \
-source 1.7 \
-target 1.7 \
-d "./sink/building" \
./java/org/testanza/Build.java
./java/org/quackery/Build.java

#copy sources
cp \
@@ -33,18 +33,18 @@ cd ./sink/building
zip \
--quiet \
--recurse-paths \
./testanza.jar \
./quackery.jar \
./*
cd $MAIN

#copy testanza.jar
#copy quackery.jar
cp \
./sink/building/testanza.jar \
./sink/building/quackery.jar \
./sink

echo ""
echo "BUILD SUCCESSFUL"
echo "created $MAIN/sink/testanza.jar"
echo "created $MAIN/sink/quackery.jar"

#cleanup
rm \
@@ -1,4 +1,4 @@
package org.testanza;
package org.quackery;

import static java.util.Arrays.asList;

@@ -1,6 +1,6 @@
package org.testanza;
package org.quackery;

import static org.testanza.TestanzaException.check;
import static org.quackery.QuackeryException.check;

public abstract class Case implements Test {
public final String name;
@@ -1,4 +1,4 @@
package org.testanza;
package org.quackery;

import java.lang.ref.WeakReference;
import java.util.Map;
@@ -29,9 +29,9 @@ private static TestCase junit(final Case cas) {
protected void runTest() throws Throwable {
try {
cas.run();
} catch (TestanzaAssertionException e) {
} catch (QuackeryAssertionException e) {
throw new AssertionError(e.getMessage(), e);
} catch (TestanzaAssumptionException e) {
} catch (QuackeryAssumptionException e) {
throw newAssumptionException(e);
}
}
@@ -44,7 +44,7 @@ protected void runTest() throws Throwable {
*/
@SuppressWarnings("deprecation")
private static AssumptionViolatedException newAssumptionException(
TestanzaAssumptionException exception) {
QuackeryAssumptionException exception) {
AssumptionViolatedException wrap = new AssumptionViolatedException(exception.getMessage());
wrap.initCause(exception);
return wrap;
@@ -0,0 +1,13 @@
package org.quackery;

public class QuackeryAssertionException extends RuntimeException {
public QuackeryAssertionException() {}

public QuackeryAssertionException(String message) {
super(message);
}

public QuackeryAssertionException(String message, Throwable cause) {
super(message, cause);
}
}
@@ -0,0 +1,28 @@
package org.quackery;

public class QuackeryAssumptionException extends RuntimeException {
public QuackeryAssumptionException() {}

public QuackeryAssumptionException(String message, Throwable cause, boolean enableSuppression,
boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}

public QuackeryAssumptionException(String message, Throwable cause) {
super(message, cause);
}

public QuackeryAssumptionException(String message) {
super(message);
}

public QuackeryAssumptionException(Throwable cause) {
super(cause);
}

public static void check(boolean condition) {
if (!condition) {
throw new QuackeryAssumptionException();
}
}
}
@@ -0,0 +1,23 @@
package org.quackery;

public class QuackeryException extends RuntimeException {
public QuackeryException() {}

public QuackeryException(String message) {
super(message);
}

public QuackeryException(Throwable cause) {
super(cause);
}

public QuackeryException(String message, Throwable cause) {
super(message, cause);
}

public static void check(boolean condition) {
if (!condition) {
throw new QuackeryException();
}
}
}
@@ -1,7 +1,7 @@
package org.testanza;
package org.quackery;

import static java.util.Arrays.asList;
import static org.testanza.Suite.newSuite;
import static org.quackery.Suite.newSuite;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
@@ -38,7 +38,7 @@ public void run() {
return;
}
}
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " expected that\n" //
+ " " + type.getName() + "\n" //
@@ -55,7 +55,7 @@ public void run() throws Throwable {
Object[] toArray = collection.toArray();
boolean expected = Arrays.equals(toArray, new Object[0]);
if (!expected) {
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " Expected that\n" //
+ " " + type + "\n" //
@@ -76,7 +76,7 @@ public void run() {
return;
}
}
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " expected that\n" //
+ " " + type.getName() + "\n" //
@@ -96,7 +96,7 @@ public void run() throws Throwable {
Object[] toArray = collection.toArray();
boolean expected = Arrays.equals(toArray, original.toArray());
if (!expected) {
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " Expected that\n" //
+ " " + type.getName() + "\n" //
@@ -119,7 +119,7 @@ public void run() throws Throwable {
Collection<?> collection = null;
try {
collection = (Collection<?>) constructor.newInstance((Object) null);
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " Expected that\n" //
+ " " + type + "\n" //
@@ -129,7 +129,7 @@ public void run() throws Throwable {
);
} catch (InvocationTargetException e) {
if (!(e.getCause() instanceof NullPointerException)) {
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " Expected that\n" //
+ " " + type + "\n" //
@@ -154,7 +154,7 @@ public void run() throws Throwable {
Object[] afterToArray = collection.toArray();
boolean expected = Arrays.equals(beforeToArray, afterToArray);
if (!expected) {
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " Expected that\n" //
+ " " + type + "\n" //
@@ -186,7 +186,7 @@ public void run() throws Throwable {
Object[] argumentToArray = argument.toArray();
boolean expected = Arrays.equals(argumentToArray, original.toArray());
if (!expected) {
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " Expected that\n" //
+ " " + type + "\n" //
@@ -207,7 +207,7 @@ public void run() throws Throwable {
try {
return type.getConstructor(parameters);
} catch (NoSuchMethodException e) {
throw new TestanzaAssumptionException(e);
throw new QuackeryAssumptionException(e);
}
}

@@ -1,8 +1,8 @@
package org.testanza;
package org.quackery;

import static java.util.Arrays.asList;
import static java.util.Collections.unmodifiableList;
import static org.testanza.TestanzaException.check;
import static org.quackery.QuackeryException.check;

import java.util.ArrayList;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package org.testanza;
package org.quackery;

public interface Test {

@@ -1,4 +1,4 @@
package org.testanza;
package org.quackery;

public interface Tester<T> {
Test test(T item);
@@ -1,12 +1,12 @@
package org.testanza;
package org.quackery;

import static java.util.Arrays.asList;
import static java.util.Objects.deepEquals;
import static org.testanza.TestanzaException.check;
import static org.testanza.common.Classes.fullName;
import static org.testanza.common.Classes.kind;
import static org.testanza.common.Classes.modifiers;
import static org.testanza.common.Classes.simpleName;
import static org.quackery.QuackeryException.check;
import static org.quackery.common.Classes.fullName;
import static org.quackery.common.Classes.kind;
import static org.quackery.common.Classes.modifiers;
import static org.quackery.common.Classes.simpleName;

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Constructor;
@@ -21,7 +21,7 @@ public Test test(final AnnotatedElement element) {
+ Modifier.toString(modifier)) {
public void run() {
if (!hasModifier(modifier, element)) {
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " expected that\n" //
+ " " + fullName(element) + "\n" //
@@ -42,7 +42,7 @@ public Test test(final AnnotatedElement element) {
+ Modifier.toString(modifier)) {
public void run() {
if (hasModifier(modifier, element)) {
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " expected that\n" //
+ " " + fullName(element) + "\n" //
@@ -71,7 +71,7 @@ public void run() {
return;
}
}
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " expected that\n" //
+ " " + type + "\n" //
@@ -92,7 +92,7 @@ public Test test(final Class<?> item) {
return new Case(simpleName(item) + " is assignable to " + simpleName(type)) {
public void run() {
if (!type.isAssignableFrom(item)) {
throw new TestanzaAssertionException("" //
throw new QuackeryAssertionException("" //
+ "\n" //
+ " expected that\n" //
+ " " + item + "\n" //
@@ -1,4 +1,4 @@
package org.testanza.common;
package org.quackery.common;

import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Constructor;

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.

This file was deleted.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 10bc851

Please sign in to comment.
You can’t perform that action at this time.