]> jfr.im git - irc/rizon/moo.git/commitdiff
Add test dependencies to dependencymanagement
authorAdam <redacted>
Mon, 7 Mar 2016 20:12:50 +0000 (15:12 -0500)
committerAdam <redacted>
Mon, 7 Mar 2016 20:12:50 +0000 (15:12 -0500)
core/pom.xml
core/src/main/java/net/rizon/moo/plugin/core/CommandRand.java
core/src/test/java/net/rizon/moo/plugin/core/CommandRandTest.java
dnsblstats/pom.xml
dnsblstats/src/test/java/net/rizon/moo/plugin/dnsblstats/CommandDnsblStatsTest.java
pom.xml

index 3baaa314b21914ee1c466e27e68719a417c4da23..2ea27861804f5e06f1a012d8ec8f9d64a2f3975c 100644 (file)
                        <artifactId>moo-moo</artifactId>
                        <version>${project.version}</version>
                </dependency>
-        <dependency>
-         <groupId>junit</groupId>
-         <artifactId>junit</artifactId>
-         <version>4.10</version>
-         <scope>test</scope>
-        </dependency>
-        <dependency>
-         <groupId>org.mockito</groupId>
-         <artifactId>mockito-all</artifactId>
-         <version>1.10.19</version>
-         <scope>test</scope>
-        </dependency>
+               <dependency>
+                       <groupId>junit</groupId>
+                       <artifactId>junit</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>org.mockito</groupId>
+                       <artifactId>mockito-all</artifactId>
+               </dependency>
+               <dependency>
+                       <groupId>com.google.inject.extensions</groupId>
+                       <artifactId>guice-testlib</artifactId>
+               </dependency>
        </dependencies>
        
        <build>
index a4f2d1fc169b8aebf5168cbcf0e410dc2b6ef6bf..d2c53ba4836f2864ee25e4017c2f0520ab77f1d4 100644 (file)
@@ -5,7 +5,6 @@ import java.util.Random;
 
 import net.rizon.moo.Command;
 import net.rizon.moo.CommandSource;
-import net.rizon.moo.Plugin;
 
 class CommandRand extends Command
 {
index 6294c5fed2560c609dff8b35fcf5eeed18439416..0c00975f92cf84c14f764bd975c00b0f801510e2 100644 (file)
@@ -1,16 +1,13 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
 package net.rizon.moo.plugin.core;
 
+import com.google.inject.Guice;
+import com.google.inject.Inject;
+import com.google.inject.testing.fieldbinder.BoundFieldModule;
 import static org.junit.Assert.assertEquals;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 
 import net.rizon.moo.CommandSource;
-import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 import org.junit.Test;
@@ -27,25 +24,19 @@ import org.mockito.runners.MockitoJUnitRunner;
 public class CommandRandTest
 {
        private static final String COMMAND_NAME = "!rand";
+       
+       @Inject
        private CommandRand testCommand;
+       
        @Mock
        private CommandSource source;
-       ArgumentCaptor<String> commandSourceCaptor = ArgumentCaptor.forClass(String.class);
-
-       public CommandRandTest()
-       {
-       }
+       
+       private final ArgumentCaptor<String> commandSourceCaptor = ArgumentCaptor.forClass(String.class);
 
        @Before
        public void setUp()
        {
-               testCommand = new CommandRand();
-       }
-
-       @After
-       public void tearDown()
-       {
-               testCommand = null;
+               Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
        }
 
        /**
index 94e0b125c439106c35f164bae7791407f41dde36..82e901a91b548667fb9a5316776228b64559c829 100644 (file)
                <dependency>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
-                       <version>4.10</version>
-                       <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>org.mockito</groupId>
                        <artifactId>mockito-all</artifactId>
-                       <version>1.10.19</version>
-                       <scope>test</scope>
                </dependency>
                <dependency>
                        <groupId>com.google.inject.extensions</groupId>
                        <artifactId>guice-testlib</artifactId>
-                       <version>4.0</version>
-                       <scope>test</scope>
                </dependency>
        </dependencies>
        
index 4e40dd3399f4329c4d78c4d856ca2112ce4aec24..e7a3350c38af09d1057d5c23407623dbb995a823 100644 (file)
@@ -1,8 +1,3 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
 package net.rizon.moo.plugin.dnsblstats;
 
 import static org.junit.Assert.assertEquals;
@@ -20,7 +15,6 @@ import net.rizon.moo.conf.Config;
 import net.rizon.moo.irc.Protocol;
 import net.rizon.moo.irc.Server;
 import net.rizon.moo.irc.ServerManager;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -33,7 +27,7 @@ import org.mockito.runners.MockitoJUnitRunner;
  * @author Orillion {@literal <orillion@rizon.net>}
  */
 @RunWith(MockitoJUnitRunner.class)
-public class CommandDnsblStatsTest// extends AbstractModule
+public class CommandDnsblStatsTest
 {
        private static final String COMMAND_NAME = "!dnsblstats";
        private static final String COMMAND_ARGUMENT = "server";
@@ -65,32 +59,18 @@ public class CommandDnsblStatsTest// extends AbstractModule
        @Mock
        private Config mockConfig;
 
-       private ArgumentCaptor<String> stringCaptor = ArgumentCaptor.forClass(String.class);
-
-       public CommandDnsblStatsTest()
-       {
-       }
+       private final ArgumentCaptor<String> stringCaptor = ArgumentCaptor.forClass(String.class);
 
        @Before
        public void setUp()
        {
-               //MockitoAnnotations.initMocks(this);
-
                mockConfig.admin_channels = REQUIRED_CHANNELS;
                mockConfig.oper_channels = REQUIRED_CHANNELS;
                mockConfig.staff_channels = REQUIRED_CHANNELS;
 
-               
-
                Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
        }
 
-       @After
-       public void tearDown()
-       {
-               testCommand = null;
-       }
-
        /**
         * Test of execute method, of class CommandDnsblStats.
         */
diff --git a/pom.xml b/pom.xml
index 037913138201be1c2bc73761ff94de21293aa02a..52eb684de8c3d40f81efb49e7ef3198fb36134bc 100644 (file)
--- a/pom.xml
+++ b/pom.xml
                                <artifactId>gson</artifactId>
                                <version>${gson.version}</version>
                        </dependency>
+                       <dependency>
+                               <groupId>junit</groupId>
+                               <artifactId>junit</artifactId>
+                               <version>4.10</version>
+                               <scope>test</scope>
+                       </dependency>
+                       <dependency>
+                               <groupId>org.mockito</groupId>
+                               <artifactId>mockito-all</artifactId>
+                               <version>1.10.19</version>
+                               <scope>test</scope>
+                       </dependency>
+                       <dependency>
+                               <groupId>com.google.inject.extensions</groupId>
+                               <artifactId>guice-testlib</artifactId>
+                               <version>4.0</version>
+                               <scope>test</scope>
+                       </dependency>
                </dependencies>
        </dependencyManagement>