Skip to content

Commit

Permalink
fixed empty method warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nhnb committed Jan 22, 2016
1 parent 26d3c32 commit c7ec5a3
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 158 deletions.
47 changes: 11 additions & 36 deletions tests/games/stendhal/common/CollisionMapTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2016 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand All @@ -12,26 +11,23 @@
***************************************************************************/
package games.stendhal.common;

import games.stendhal.client.entity.Player;
import games.stendhal.client.util.UserInterfaceTestHelper;
import games.stendhal.common.tiled.LayerDefinition;
import games.stendhal.server.core.engine.StendhalRPRuleProcessor;
import games.stendhal.server.maps.MockStendlRPWorld;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import java.awt.geom.Rectangle2D;
import java.util.BitSet;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import games.stendhal.client.entity.Player;
import games.stendhal.client.util.UserInterfaceTestHelper;
import games.stendhal.common.tiled.LayerDefinition;
import games.stendhal.server.core.engine.StendhalRPRuleProcessor;
import games.stendhal.server.maps.MockStendlRPWorld;
import utilities.PlayerTestHelper;
import static org.hamcrest.Matchers.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

public class CollisionMapTest {

Expand All @@ -40,18 +36,6 @@ public static void setUpBeforeClass() throws Exception {
UserInterfaceTestHelper.initUserInterface();
}

@AfterClass
public static void tearDownAfterClass() throws Exception {
}

@Before
public void setUp() throws Exception {
}

@After
public void tearDown() throws Exception {
}

/**
* Tests for collissionMap.
*/
Expand All @@ -63,7 +47,6 @@ public void testCollissionMap() {
final CollisionMap map2x2 = new CollisionMap(2, 2);
assertThat(map2x2.getWidth(), is(2));
assertThat(map2x2.getHeight(), is(2));

}

/**
Expand Down Expand Up @@ -116,7 +99,6 @@ public void testcollides2() {
assertTrue("edge", map.collides(3, 1, 2, 2));
assertTrue("edge", map.collides(3, 2, 2, 2));
assertTrue("edge", map.collides(3, 3, 2, 2));

}

/**
Expand Down Expand Up @@ -144,7 +126,6 @@ public void testcollidesEdges() {
assertTrue("edge", map.collides(3, 1, 2, 2));
assertTrue("edge", map.collides(3, 2, 2, 2));
assertTrue("edge", map.collides(3, 3, 2, 2));

}

/**
Expand Down Expand Up @@ -183,7 +164,6 @@ public void testbitsetlogic() {
assertFalse(subset2.get(4));
assertTrue(subset2.get(5));
assertFalse(subset2.get(6));

}

/**
Expand All @@ -199,7 +179,6 @@ public void testClear() {
assertTrue(map.collides(0, 0, 4, 4));
map.clear();
assertFalse(map.collides(0, 0, 4, 4));

}

/**
Expand Down Expand Up @@ -229,8 +208,8 @@ public void testsetCollideRectangle2D2x1() {
assertFalse(map.get(3, 1));
assertFalse(map.get(3, 2));
assertFalse(map.get(3, 3));

}

/**
* Tests for setCollideRectangle2D2x3.
*/
Expand Down Expand Up @@ -258,7 +237,6 @@ public void testsetCollideRectangle2D2x3() {
assertFalse(map.get(3, 1));
assertFalse(map.get(3, 2));
assertFalse(map.get(3, 3));

}


Expand Down Expand Up @@ -373,9 +351,6 @@ public void testCollidesEntity() {
bob.initialize(serverbob);
assertFalse(map.collides((int) bob.getX(), (int) bob.getY(), (int) bob
.getWidth(), (int) bob.getHeight()));

}



}
17 changes: 1 addition & 16 deletions tests/games/stendhal/common/LevelTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2016 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand All @@ -14,27 +13,16 @@

import static org.junit.Assert.assertEquals;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class LevelTest {

@Before
public void setUp() throws Exception {
}

@After
public void tearDown() throws Exception {
}

/**
* Tests for maxLevel.
*/
@Test
public final void testMaxLevel() {
assertEquals(597, Level.maxLevel());

}

/**
Expand All @@ -50,7 +38,6 @@ public final void testGetLevel() {
*/
@Test
public final void testGetXP() {

assertEquals(0, Level.getXP(0));
assertEquals(50, Level.getXP(1));
assertEquals(9753800, Level.getXP(100));
Expand All @@ -63,7 +50,6 @@ public final void testGetXP() {
*/
@Test
public final void testGetNegativeXP() {

assertEquals(-1, Level.getXP(-1));
assertEquals(-1, Level.getXP(-10));
}
Expand Down Expand Up @@ -91,7 +77,6 @@ public final void testChangeLevel() {
Level.getXP(Level.maxLevel() - 1)));
assertEquals(Level.maxLevel(), Level.changeLevel(0,
Level.getXP(Level.maxLevel())));

}

/**
Expand Down
11 changes: 6 additions & 5 deletions tests/games/stendhal/server/actions/CommandCenterTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2016 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand Down Expand Up @@ -62,14 +61,14 @@ public void testRegisterTwice() {

@Override
public void onAction(final Player player, final RPAction action) {

// do nothing
}
});

CommandCenter.register("this", new ActionListener() {
@Override
public void onAction(final Player player, final RPAction action) {

// do nothing
}
});
}
Expand All @@ -93,17 +92,19 @@ public void testExecuteUnknown() {
CommandCenter.register("this", new ActionListener() {
@Override
public void onAction(final Player player, final RPAction action) {
// do nothing
}
});
CommandCenter.register("that", new ActionListener() {
@Override
public void onAction(final Player player, final RPAction action) {

// do nothing
}
});
CommandCenter.register("thus", new ActionListener() {
@Override
public void onAction(final Player player, final RPAction action) {
// do nothing
}
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2016 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand All @@ -17,23 +16,18 @@

import java.util.Locale;

import marauroa.common.game.Result;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import marauroa.common.game.Result;

public class LowerCaseValidatorTest {

@Before
public void setUp() throws Exception {
Locale.setDefault(Locale.ENGLISH);
}

@After
public void tearDown() throws Exception {
}

/**
* Tests for lowerCaseValidator.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* $Id$ */
/***************************************************************************
* (C) Copyright 2003-2010 - Stendhal *
* (C) Copyright 2003-2016 - Stendhal *
***************************************************************************
***************************************************************************
* *
Expand All @@ -12,31 +11,21 @@
***************************************************************************/
package games.stendhal.server.core.config.factory;

import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;

import java.util.HashMap;
import java.util.Map;

import static org.hamcrest.CoreMatchers.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class ConfigurableFactoryContextTest {

private Map<String, String> attributes;

@BeforeClass
public static void setUpBeforeClass() throws Exception {

}

@AfterClass
public static void tearDownAfterClass() throws Exception {
}

@Before
public void setUp() throws Exception {
attributes = new HashMap<String, String>();
Expand All @@ -46,10 +35,6 @@ public void setUp() throws Exception {
attributes.put("fiveInt", "5");
}

@After
public void tearDown() throws Exception {
}

/**
* Tests for configurableFactoryContext.
*/
Expand Down Expand Up @@ -88,7 +73,6 @@ public void testGetNonExistingRequiredBoolean() {
*/
@Test(expected = IllegalArgumentException.class)
public void testGetNonbooleanRequiredBoolean() {

ConfigurableFactoryContext con = new ConfigurableFactoryContext(
attributes);
assertTrue(con.getRequiredBoolean("string"));
Expand Down Expand Up @@ -125,7 +109,6 @@ public void testGetNonExitantRequiredInt() {
ConfigurableFactoryContext con = new ConfigurableFactoryContext(
attributes);
con.getRequiredInt("nonExistingkey");

}

/**
Expand All @@ -135,7 +118,6 @@ public void testGetRequiredInt() {
ConfigurableFactoryContext con = new ConfigurableFactoryContext(
attributes);
assertThat(con.getRequiredInt("fiveInt"), is(5));

}

/**
Expand All @@ -147,7 +129,6 @@ public void testGetString() {
attributes);
assertThat(con.getString("nonexistantstring", "default"), is("default"));
assertThat(con.getString("string", "default"), is("stringvalue"));

}

/**
Expand All @@ -158,7 +139,6 @@ public void testGetRequiredString() {
ConfigurableFactoryContext con = new ConfigurableFactoryContext(
attributes);
con.getRequiredString("nonexistantstring");

}

}
Loading

0 comments on commit c7ec5a3

Please sign in to comment.