Skip to content

Commit

Permalink
FactoryTester now has an abstract method: testFactoryName
Browse files Browse the repository at this point in the history
  • Loading branch information
gorobaum committed Apr 20, 2012
1 parent c58fc4b commit b326f0c
Show file tree
Hide file tree
Showing 27 changed files with 209 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

/**
* Belongs to package br.org.archimedes.tests.commands.
Expand Down Expand Up @@ -206,4 +207,10 @@ public void arcFactoryNameIsArc () throws Exception {

assertEquals("The arc factory name should be 'arc'.", "arc", factory.getName());
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package br.org.archimedes.circle;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.factories.CommandFactory;
import br.org.archimedes.helper.FactoryTester;
import br.org.archimedes.model.Drawing;
Expand Down Expand Up @@ -88,4 +89,10 @@ public void testCancel () {
assertSafeNext(factory, point1, false);
assertCancel(factory, false);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package br.org.archimedes.copypaste;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.Utils;
import br.org.archimedes.controller.Controller;
import br.org.archimedes.factories.CommandFactory;
Expand Down Expand Up @@ -208,4 +209,10 @@ public void canCancelWithPreset () {
assertSafeNext(factory, vector, false, true);
assertCancel(factory, false);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package br.org.archimedes.copytoclipboard;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.gui.model.Workspace;
import br.org.archimedes.helper.FactoryTester;
import br.org.archimedes.model.Drawing;
Expand Down Expand Up @@ -138,4 +139,10 @@ public void canCopyWithNewSelectionAndContentStaysOnClipboard () throws Exceptio
.contains(element1));
Assert.assertTrue("The element should be in the clipboard.", clipboard.contains(element2));
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package br.org.archimedes.helper;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.Constant;
import br.org.archimedes.Tester;
import br.org.archimedes.exceptions.InvalidParameterException;
Expand All @@ -22,6 +23,7 @@
import br.org.archimedes.interfaces.Parser;

import org.junit.Assert;
import org.junit.Test;

import java.util.List;

Expand All @@ -32,8 +34,8 @@
* @author marivb
*/
public abstract class FactoryTester extends Tester {

/**
/**
* Constructor.
*/
public FactoryTester () {
Expand Down Expand Up @@ -247,4 +249,7 @@ protected void assertInvalidNext (CommandFactory factory, Object parameter) {
assertFinished(factory, done);
assertMakeCommands(factory, false);
}

@Test
public abstract void testFactoryName ();
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

package br.org.archimedes.dimension.test;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.dimension.DimensionFactory;
import br.org.archimedes.helper.FactoryTester;
import br.org.archimedes.model.Point;
Expand Down Expand Up @@ -139,4 +140,10 @@ public void canCancelAtAnyPoint () {
assertSafeNext(factory, null, true);
assertCancel(factory, false);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*/
package br.org.archimedes.distance;

import static org.junit.Assert.assertNotNull;

import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
Expand Down Expand Up @@ -114,4 +116,10 @@ public void testAnswer () {
Assert.assertNotNull("Returned message should not be null", message);
Assert.assertEquals("Message should be the distance", "" + 5.0, message);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

package br.org.archimedes.erase;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.exceptions.InvalidArgumentException;
import br.org.archimedes.factories.CommandFactory;
import br.org.archimedes.helper.FactoryTester;
Expand Down Expand Up @@ -115,4 +116,10 @@ public void canCancelAtAnytimeWithoutPreset () throws InvalidArgumentException {
selection.add(element);
assertSafeNext(factory, selection, true);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.util.Collections;
import java.util.HashSet;

import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;


Expand Down Expand Up @@ -129,4 +130,10 @@ public void canCancelAPartialFillet () throws Exception {
assertCancel(factory, false);
assertInvalidNext(factory, secondSelection);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
*/
package br.org.archimedes.leader;

import static org.junit.Assert.fail;

import org.junit.Test;

import br.org.archimedes.helper.FactoryTester;


Expand All @@ -21,5 +25,13 @@
* @author "Hugo Corbucci"
*/
public class LeaderFactoryTest extends FactoryTester {

@Override
@Test
public void testFactoryName() {
// TODO Auto-generated method stub
fail("Not yet implemented.");

}
// TODO Add tests to the Leader factory
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
package br.org.archimedes.line;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.factories.CommandFactory;
import br.org.archimedes.helper.FactoryTester;
import br.org.archimedes.model.Point;
Expand Down Expand Up @@ -108,6 +109,13 @@ public void testCancelLineCreation () {
assertSafeNext(factory, vector2, false, true);
assertSafeNext(factory, null, true, false);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());

}

// TODO Test undoing on the factory
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package br.org.archimedes.mirror;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.controller.Controller;
import br.org.archimedes.factories.CommandFactory;
import br.org.archimedes.helper.FactoryTester;
Expand Down Expand Up @@ -198,4 +199,10 @@ public void testCancel () {
assertSafeNext(factory, vector, false);
assertSafeNext(factory, "", true);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package br.org.archimedes.move;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.controller.Controller;
import br.org.archimedes.factories.CommandFactory;
import br.org.archimedes.helper.FactoryTester;
Expand Down Expand Up @@ -169,4 +170,10 @@ public void testCancel () {
assertSafeNext(factory, point, false);
assertSafeNext(factory, vector, true);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package br.org.archimedes.offset;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.controller.Controller;
import br.org.archimedes.exceptions.InvalidParameterException;
import br.org.archimedes.exceptions.NullArgumentException;
Expand Down Expand Up @@ -216,4 +217,10 @@ public void testCancelWithSelection () {
assertSafeNext(factory, true, false, true);
assertCancel(factory, false);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
*/
package br.org.archimedes.orto;

import static org.junit.Assert.*;
import static org.junit.Assert.assertNotNull;

import org.junit.Test;

import br.org.archimedes.helper.FactoryTester;


Expand All @@ -23,4 +28,9 @@
public class OrtoFactoryTest extends FactoryTester {

// TODO Test the Orto factory
@Override
@Test
public void testFactoryName() {
fail("Not yet implemented.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
*/
package br.org.archimedes.pan.tests;

import static org.junit.Assert.*;
import static org.junit.Assert.assertNotNull;

import org.junit.Test;

import br.org.archimedes.helper.FactoryTester;


Expand All @@ -23,5 +28,9 @@
*/
public class PanFactoryTest extends FactoryTester {

// TODO Pan Factory tests
@Override
@Test
public void testFactoryName() {
fail("Not yet implemented.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package br.org.archimedes.paste;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.Constant;
import br.org.archimedes.controller.Controller;
import br.org.archimedes.factories.CommandFactory;
Expand Down Expand Up @@ -74,4 +75,10 @@ public void testPaste () {

assertBegin(factory, true);
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

package br.org.archimedes.polyline.area;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.exceptions.InvalidParameterException;
import br.org.archimedes.factories.CommandFactory;
import br.org.archimedes.helper.FactoryTester;
Expand Down Expand Up @@ -212,4 +213,10 @@ public void testAnswer () {
+ (10 + 5 * Math.sqrt(2)), message);

}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
package br.org.archimedes.polyline.explode;

import static org.junit.Assert.assertNotNull;
import br.org.archimedes.exceptions.InvalidArgumentException;
import br.org.archimedes.exceptions.NullArgumentException;
import br.org.archimedes.factories.CommandFactory;
Expand Down Expand Up @@ -227,4 +228,10 @@ private Element createSafePolyLine (List<Point> points) {
}
return result;
}

@Override
@Test
public void testFactoryName() {
assertNotNull(factory.getName());
}
}
Loading

0 comments on commit b326f0c

Please sign in to comment.