예제 #1
0
  @Before
  public void setUp() throws Exception {
    creator = new TestInstanceCreator();
    assertTrue(creator.setUp());
    mockServer = creator.getServer();
    mockCommandSender = creator.getCommandSender();
    // Pull a core instance from the server.
    Plugin plugin = mockServer.getPluginManager().getPlugin("SpamHammer");
    myPlugin = (SpamHammerPlugin) plugin;
    // Make sure plugin is not null
    assertNotNull(plugin);
    // Make sure plugin is enabled
    assertTrue(plugin.isEnabled());

    Field field = SpamHammerPlugin.class.getDeclaredField("listener");
    field.setAccessible(true);
    listener = (PluginListener) field.get(myPlugin);
  }
예제 #2
0
 @After
 public void tearDown() throws Exception {
   creator.tearDown();
 }