Skip to content

Commit

Permalink
ported test to bukkit
Browse files Browse the repository at this point in the history
  • Loading branch information
wea_ondara committed Feb 9, 2016
1 parent 69b092f commit 6ae327e
Showing 1 changed file with 39 additions and 0 deletions.
@@ -0,0 +1,39 @@
package net.alpenblock.bungeeperms.testsuite.bukkit.tests;

import net.alpenblock.bungeeperms.BungeePerms;
import net.alpenblock.bungeeperms.User;
import net.alpenblock.bungeeperms.testsuite.bukkit.BukkitTest;
import net.alpenblock.bungeeperms.testsuite.bukkit.BukkitTestSuite;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;

public class DisplayableTest extends BukkitTest
{

@Override
public boolean test(CommandSender sender)
{
if (Bukkit.getPlayer(BukkitTestSuite.getTestplayer()) == null)
{
throw new RuntimeException("test player " + BukkitTestSuite.getTestplayer() + " not found");
}

User u = BungeePerms.getInstance().getPermissionsManager().getUser(BukkitTestSuite.getTestplayer());
if (u == null)
{
throw new RuntimeException("test player " + BukkitTestSuite.getTestplayer() + " not found");
}

sender.sendMessage("Prefix: " + u.buildPrefix().replaceAll("§", "&"));
sender.sendMessage("Suffix: " + u.buildSuffix().replaceAll("§", "&"));

return result();
}

@Override
public String getName()
{
return "DisplayableTest";
}

}

0 comments on commit 6ae327e

Please sign in to comment.