Checkstyle fixes.
This commit is contained in:
parent
7c724db67e
commit
64ffd95aba
48 changed files with 512 additions and 118 deletions
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,14 +29,25 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import com.rometools.rome.feed.synd.*;
|
||||
import com.rometools.rome.feed.synd.SyndContent;
|
||||
import com.rometools.rome.feed.synd.SyndContentImpl;
|
||||
import com.rometools.rome.feed.synd.SyndEntry;
|
||||
import com.rometools.rome.feed.synd.SyndEntryImpl;
|
||||
import com.rometools.rome.feed.synd.SyndFeed;
|
||||
import com.rometools.rome.feed.synd.SyndFeedImpl;
|
||||
import com.rometools.rome.io.FeedException;
|
||||
import com.rometools.rome.io.SyndFeedInput;
|
||||
import com.rometools.rome.io.SyndFeedOutput;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
|
@ -125,7 +136,8 @@ final class EntriesMgr {
|
|||
|
||||
final String today;
|
||||
|
||||
try (final InputStreamReader reader = new InputStreamReader(new FileInputStream(file), StandardCharsets.UTF_8)) {
|
||||
try (final InputStreamReader reader = new InputStreamReader(
|
||||
new FileInputStream(file), StandardCharsets.UTF_8)) {
|
||||
final SyndFeed feed = input.build(reader);
|
||||
|
||||
today = Utils.isoLocalDate(feed.getPublishedDate());
|
||||
|
@ -263,13 +275,14 @@ final class EntriesMgr {
|
|||
history.remove(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
try (final Writer fw = new OutputStreamWriter(
|
||||
new FileOutputStream(bot.getLogsDir() + NAV_XML), StandardCharsets.UTF_8)) {
|
||||
rss = new SyndFeedImpl();
|
||||
rss.setFeedType("rss_2.0");
|
||||
rss.setTitle(bot.getChannel() + " IRC Links Backlogs");
|
||||
rss.setDescription("Backlogs of Links from " + bot.getIrcServer() + " on " + bot.getChannel());
|
||||
rss.setDescription("Backlogs of Links from " + bot.getIrcServer() + " on "
|
||||
+ bot.getChannel());
|
||||
rss.setLink(bot.getBacklogsUrl());
|
||||
rss.setPublishedDate(Calendar.getInstance().getTime());
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import com.rometools.rome.feed.synd.SyndCategory;
|
||||
|
@ -328,6 +329,15 @@ public class EntryLink implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the tags.
|
||||
*
|
||||
* @param tags The tags.
|
||||
*/
|
||||
private void setTags(final List<SyndCategory> tags) {
|
||||
this.tags.addAll(tags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the comment's title.
|
||||
*
|
||||
|
@ -377,15 +387,6 @@ public class EntryLink implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the tags.
|
||||
*
|
||||
* @param tags The tags.
|
||||
*/
|
||||
private void setTags(final List<SyndCategory> tags) {
|
||||
this.tags.addAll(tags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a string representation of the object.
|
||||
*
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import com.rometools.rome.feed.synd.SyndEntry;
|
||||
|
|
|
@ -29,14 +29,33 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import com.rometools.rome.io.FeedException;
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
import net.thauvin.erik.mobibot.modules.*;
|
||||
import net.thauvin.erik.mobibot.modules.AbstractModule;
|
||||
import net.thauvin.erik.mobibot.modules.Calc;
|
||||
import net.thauvin.erik.mobibot.modules.CurrencyConverter;
|
||||
import net.thauvin.erik.mobibot.modules.Dice;
|
||||
import net.thauvin.erik.mobibot.modules.GoogleSearch;
|
||||
import net.thauvin.erik.mobibot.modules.Joke;
|
||||
import net.thauvin.erik.mobibot.modules.Lookup;
|
||||
import net.thauvin.erik.mobibot.modules.Ping;
|
||||
import net.thauvin.erik.mobibot.modules.StockQuote;
|
||||
import net.thauvin.erik.mobibot.modules.Twitter;
|
||||
import net.thauvin.erik.mobibot.modules.War;
|
||||
import net.thauvin.erik.mobibot.modules.Weather2;
|
||||
import net.thauvin.erik.mobibot.modules.WorldTime;
|
||||
import net.thauvin.erik.mobibot.msg.Message;
|
||||
import net.thauvin.erik.semver.Version;
|
||||
import org.apache.commons.cli.*;
|
||||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.commons.cli.CommandLineParser;
|
||||
import org.apache.commons.cli.DefaultParser;
|
||||
import org.apache.commons.cli.HelpFormatter;
|
||||
import org.apache.commons.cli.Option;
|
||||
import org.apache.commons.cli.Options;
|
||||
import org.apache.commons.cli.ParseException;
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
@ -47,10 +66,20 @@ import org.jibble.pircbot.User;
|
|||
import org.jsoup.Jsoup;
|
||||
import org.jsoup.nodes.Document;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.time.Clock;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
/**
|
||||
* Implements the #mobitopia bot.
|
||||
|
@ -162,7 +191,7 @@ public class Mobibot extends PircBot {
|
|||
// The default tags/categories.
|
||||
private String defaultTags = "";
|
||||
// The feed URL.
|
||||
private String feedURL = "";
|
||||
private String feedUrl = "";
|
||||
// The ident message.
|
||||
private String identMsg = "";
|
||||
// The ident nick.
|
||||
|
@ -237,7 +266,7 @@ public class Mobibot extends PircBot {
|
|||
|
||||
// Set the URLs
|
||||
setWeblogUrl(getVersion());
|
||||
setFeedURL(p.getProperty("feed", ""));
|
||||
setFeedUrl(p.getProperty("feed", ""));
|
||||
setBacklogsUrl(Utils.ensureDir(p.getProperty("backlogs", weblogUrl), true));
|
||||
|
||||
// Set the pinboard authentication
|
||||
|
@ -443,8 +472,8 @@ public class Mobibot extends PircBot {
|
|||
* @param sender The nick of the person who sent the private message.
|
||||
*/
|
||||
private void feedResponse(final String sender) {
|
||||
if (Utils.isValidString(feedURL)) {
|
||||
new Thread(new FeedReader(this, sender, feedURL)).start();
|
||||
if (Utils.isValidString(feedUrl)) {
|
||||
new Thread(new FeedReader(this, sender, feedUrl)).start();
|
||||
} else {
|
||||
send(sender, "There is no weblog setup for this channel.");
|
||||
}
|
||||
|
@ -1009,9 +1038,7 @@ public class Mobibot extends PircBot {
|
|||
send(sender, Utils.bold("Duplicate") + " >> " + Utils.buildLink(dupIndex, entry));
|
||||
}
|
||||
}
|
||||
}
|
||||
// mobibot: <command>
|
||||
else if (message.matches(getNickPattern() + ":.*")) {
|
||||
} else if (message.matches(getNickPattern() + ":.*")) { // mobibot: <command>
|
||||
isCommand = true;
|
||||
|
||||
final String[] cmds = message.substring(message.indexOf(':') + 1).trim().split(" ", 2);
|
||||
|
@ -1023,45 +1050,27 @@ public class Mobibot extends PircBot {
|
|||
args = cmds[1].trim();
|
||||
}
|
||||
|
||||
// mobibot: help
|
||||
if (cmd.startsWith(Commands.HELP_CMD)) {
|
||||
|
||||
if (cmd.startsWith(Commands.HELP_CMD)) { // mobibot: help
|
||||
helpResponse(sender, args);
|
||||
}
|
||||
// mobibot: recap
|
||||
else if (cmd.equals(Commands.RECAP_CMD)) {
|
||||
} else if (cmd.equals(Commands.RECAP_CMD)) { // mobibot: recap
|
||||
recapResponse(sender, false);
|
||||
}
|
||||
// mobibot: users
|
||||
else if (cmd.equals(Commands.USERS_CMD)) {
|
||||
} else if (cmd.equals(Commands.USERS_CMD)) { // mobibot: users
|
||||
usersResponse(sender, false);
|
||||
}
|
||||
// mobibot: info
|
||||
else if (cmd.equals(Commands.INFO_CMD)) {
|
||||
} else if (cmd.equals(Commands.INFO_CMD)) { // mobibot: info
|
||||
infoResponse(sender, false);
|
||||
}
|
||||
// mobbiot: version
|
||||
else if (cmd.equals(Commands.VERSION_CMD)) {
|
||||
} else if (cmd.equals(Commands.VERSION_CMD)) { // mobbiot: version
|
||||
versionResponse(sender, false);
|
||||
}
|
||||
// mobibot: <channel>
|
||||
else if (cmd.equalsIgnoreCase(channel.substring(1))) {
|
||||
} else if (cmd.equalsIgnoreCase(channel.substring(1))) { // mobibot: <channel>
|
||||
feedResponse(sender);
|
||||
}
|
||||
// mobibot: view
|
||||
else if (cmd.startsWith(Commands.VIEW_CMD)) {
|
||||
} else if (cmd.startsWith(Commands.VIEW_CMD)) { // mobibot: view
|
||||
viewResponse(sender, args, false);
|
||||
}
|
||||
// mobibot: tell
|
||||
else if (cmd.startsWith(Tell.TELL_CMD) && tell.isEnabled()) {
|
||||
} else if (cmd.startsWith(Tell.TELL_CMD) && tell.isEnabled()) { // mobibot: tell
|
||||
tell.response(sender, args);
|
||||
}
|
||||
// mobibot: ignore
|
||||
else if (cmd.startsWith(Commands.IGNORE_CMD)) {
|
||||
} else if (cmd.startsWith(Commands.IGNORE_CMD)) { // mobibot: ignore
|
||||
ignoreResponse(sender, args);
|
||||
}
|
||||
// modules
|
||||
else {
|
||||
for (final AbstractModule module : MODULES) {
|
||||
} else {
|
||||
for (final AbstractModule module : MODULES) { // modules
|
||||
for (final String c : module.getCommands()) {
|
||||
if (cmd.startsWith(c)) {
|
||||
module.commandResponse(this, sender, args, false);
|
||||
|
@ -1069,9 +1078,7 @@ public class Mobibot extends PircBot {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// L1:<comment>, L1:-, L1:|<title>, etc.
|
||||
else if (message.matches(Commands.LINK_CMD + "[0-9]+:.*")) {
|
||||
} else if (message.matches(Commands.LINK_CMD + "[0-9]+:.*")) { // L1:<comment>, L1:-, L1:|<title>, etc.
|
||||
isCommand = true;
|
||||
|
||||
final String[] cmds = message.substring(1).split(":", 2);
|
||||
|
@ -1112,9 +1119,7 @@ public class Mobibot extends PircBot {
|
|||
} else {
|
||||
send(sender, "Please ask a channel op to remove this entry for you.");
|
||||
}
|
||||
}
|
||||
// L1:|<title>
|
||||
else if (cmd.charAt(0) == '|') {
|
||||
} else if (cmd.charAt(0) == '|') { // L1:|<title>
|
||||
if (cmd.length() > 1) {
|
||||
final EntryLink entry = entries.get(index);
|
||||
entry.setTitle(cmd.substring(1).trim());
|
||||
|
@ -1126,9 +1131,7 @@ public class Mobibot extends PircBot {
|
|||
send(channel, Utils.buildLink(index, entry));
|
||||
saveEntries(false);
|
||||
}
|
||||
}
|
||||
// L1:=<url>
|
||||
else if (cmd.charAt(0) == '=') {
|
||||
} else if (cmd.charAt(0) == '=') { // L1:=<url>
|
||||
final EntryLink entry = entries.get(index);
|
||||
|
||||
if (entry.getLogin().equals(login) || isOp(sender)) {
|
||||
|
@ -1149,9 +1152,7 @@ public class Mobibot extends PircBot {
|
|||
} else {
|
||||
send(sender, "Please ask a channel op to change this link for you.");
|
||||
}
|
||||
}
|
||||
// L1:?<author>
|
||||
else if (cmd.charAt(0) == '?') {
|
||||
} else if (cmd.charAt(0) == '?') { // L1:?<author>
|
||||
if (isOp(sender)) {
|
||||
if (cmd.length() > 1) {
|
||||
final EntryLink entry = entries.get(index);
|
||||
|
@ -1172,9 +1173,7 @@ public class Mobibot extends PircBot {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// L1T:<+-tag>
|
||||
else if (message.matches(Commands.LINK_CMD + "[0-9]+T:.*")) {
|
||||
} else if (message.matches(Commands.LINK_CMD + "[0-9]+T:.*")) { // L1T:<+-tag>
|
||||
isCommand = true;
|
||||
|
||||
final String[] cmds = message.substring(1).split("T:", 2);
|
||||
|
@ -1206,9 +1205,7 @@ public class Mobibot extends PircBot {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// L1.1:<command>
|
||||
else if (message.matches(Commands.LINK_CMD + "[0-9]+\\.[0-9]+:.*")) {
|
||||
} else if (message.matches(Commands.LINK_CMD + "[0-9]+\\.[0-9]+:.*")) { // L1.1:<command>
|
||||
isCommand = true;
|
||||
|
||||
final String[] cmds = message.substring(1).split("[.:]", 3);
|
||||
|
@ -1225,15 +1222,11 @@ public class Mobibot extends PircBot {
|
|||
if (cmd.length() == 0) {
|
||||
final EntryComment comment = entry.getComment(cindex);
|
||||
send(channel, Utils.buildComment(index, cindex, comment));
|
||||
}
|
||||
// L1.1:-
|
||||
else if ("-".equals(cmd)) {
|
||||
} else if ("-".equals(cmd)) { // L1.1:-
|
||||
entry.deleteComment(cindex);
|
||||
send(channel, "Comment " + Commands.LINK_CMD + (index + 1) + '.' + (cindex + 1) + " removed.");
|
||||
saveEntries(false);
|
||||
}
|
||||
// L1.1:?<author>
|
||||
else if (cmd.charAt(0) == '?') {
|
||||
} else if (cmd.charAt(0) == '?') { // L1.1:?<author>
|
||||
if (isOp(sender)) {
|
||||
if (cmd.length() > 1) {
|
||||
final EntryComment comment = entry.getComment(cindex);
|
||||
|
@ -1490,10 +1483,10 @@ public class Mobibot extends PircBot {
|
|||
/**
|
||||
* Sets the feed URL.
|
||||
*
|
||||
* @param feedURL The feed URL.
|
||||
* @param feedUrl The feed URL.
|
||||
*/
|
||||
private void setFeedURL(final String feedURL) {
|
||||
this.feedURL = feedURL;
|
||||
private void setFeedUrl(final String feedUrl) {
|
||||
this.feedUrl = feedUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1652,9 +1645,9 @@ public class Mobibot extends PircBot {
|
|||
entry = entries.get(i);
|
||||
|
||||
if (lcArgs.length() > 0) {
|
||||
if ((entry.getLink().toLowerCase().contains(lcArgs)) ||
|
||||
(entry.getTitle().toLowerCase().contains(lcArgs)) ||
|
||||
(entry.getNick().toLowerCase().contains(lcArgs))) {
|
||||
if ((entry.getLink().toLowerCase().contains(lcArgs))
|
||||
|| (entry.getTitle().toLowerCase().contains(lcArgs))
|
||||
|| (entry.getNick().toLowerCase().contains(lcArgs))) {
|
||||
if (sent > MAX_ENTRIES) {
|
||||
send(sender,
|
||||
"To view more, try: " + Utils
|
||||
|
|
|
@ -29,11 +29,12 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import net.thauvin.erik.pinboard.PinboardPoster;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.SwingWorker;
|
||||
import java.time.ZoneId;
|
||||
import java.time.ZonedDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -81,6 +82,13 @@ public class Tell {
|
|||
// The serialized object file.
|
||||
private final String serializedObject;
|
||||
|
||||
/**
|
||||
* Creates a new instance.
|
||||
*
|
||||
* @param bot The bot.
|
||||
* @param maxDays Max days.
|
||||
* @param maxSize Max size.
|
||||
*/
|
||||
public Tell(final Mobibot bot, final String maxDays, final String maxSize) {
|
||||
this.bot = bot;
|
||||
this.maxDays = Utils.getIntProperty(maxDays, DEFAULT_TELL_MAX_DAYS);
|
||||
|
@ -264,7 +272,9 @@ public class Tell {
|
|||
}
|
||||
}
|
||||
|
||||
if (clean()) save();
|
||||
if (clean()) {
|
||||
save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
|
@ -29,11 +29,21 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInput;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutput;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.time.Clock;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
|
@ -52,12 +62,12 @@ final class TellMessagesMgr {
|
|||
*
|
||||
* @throws UnsupportedOperationException If the constructor is called.
|
||||
*/
|
||||
private TellMessagesMgr() {
|
||||
private TellMessagesMgr() {
|
||||
throw new UnsupportedOperationException("Illegal constructor call.");
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans the messages queue
|
||||
* Cleans the messages queue.
|
||||
*
|
||||
* @param tellMessages The messages list.
|
||||
* @param tellMaxDays The maximum number of days to keep messages for.
|
||||
|
@ -117,7 +127,8 @@ final class TellMessagesMgr {
|
|||
public static void save(final String file, final List<TellMessage> messages, final Logger logger) {
|
||||
try {
|
||||
|
||||
try (final ObjectOutput output = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(file)))) {
|
||||
try (final ObjectOutput output = new ObjectOutputStream(
|
||||
new BufferedOutputStream(new FileOutputStream(file)))) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Saving the messages.");
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ import java.io.InputStreamReader;
|
|||
* Then execute:
|
||||
* <p>
|
||||
* <code>
|
||||
* java -cp "mobibot.jar:lib/*"net.thauvin.erik.mobibot.TwitterOAuth <consumerKey> <consumerSecret>
|
||||
* java -cp "mobibot.jar:lib/*" net.thauvin.erik.mobibot.TwitterOAuth <consumerKey> <consumerSecret>
|
||||
* </code>
|
||||
* </p>
|
||||
* and follow the prompts/instructions.
|
||||
|
@ -28,6 +28,11 @@ import java.io.InputStreamReader;
|
|||
* @since 1.0
|
||||
*/
|
||||
public final class TwitterOAuth {
|
||||
/**
|
||||
* Twitter OAuth Client Registration.
|
||||
*
|
||||
* @param args The consumerKey and consumerSecret should be passed as arguments.
|
||||
*/
|
||||
@SuppressFBWarnings(value = "DM_DEFAULT_ENCODING")
|
||||
public static void main(final String[] args)
|
||||
throws Exception {
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import org.jibble.pircbot.Colors;
|
||||
|
@ -170,7 +171,7 @@ public final class Utils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Meks the given string cyan
|
||||
* Meks the given string cyan.
|
||||
*
|
||||
* @param s The string.
|
||||
* @return The cyan string.
|
||||
|
@ -323,7 +324,7 @@ public final class Utils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the specified date formatted as <code>yyyy-MM-dd HH:mm</code>
|
||||
* Returns the specified date formatted as <code>yyyy-MM-dd HH:mm</code>.
|
||||
*
|
||||
* @param date The date.
|
||||
* @return The fromatted date.
|
||||
|
@ -333,7 +334,7 @@ public final class Utils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the specified date formatted as <code>yyyy-MM-dd HH:mm</code>
|
||||
* Returns the specified date formatted as <code>yyyy-MM-dd HH:mm</code>.
|
||||
*
|
||||
* @param date The date.
|
||||
* @return The formatted date.
|
||||
|
|
|
@ -29,12 +29,17 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
import net.thauvin.erik.mobibot.Utils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* The <code>Module</code> abstract class.
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.objecthunter.exp4j.Expression;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
|
@ -149,7 +150,9 @@ public final class CurrencyConverter extends ThreadedModule {
|
|||
|
||||
int i = 0;
|
||||
for (final Map.Entry<String, String> rate : EXCHANGE_RATES.entrySet()) {
|
||||
if (i > 0) buff.append(", ");
|
||||
if (i > 0) {
|
||||
buff.append(", ");
|
||||
}
|
||||
buff.append(rate.getKey()).append(": ").append(rate.getValue());
|
||||
i++;
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
@ -112,7 +113,7 @@ public final class Joke extends ThreadedModule {
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a random joke from <a href="http://www.icndb.com/">The Internet Chuck Norris Database</a>
|
||||
* Returns a random joke from <a href="http://www.icndb.com/">The Internet Chuck Norris Database</a>.
|
||||
*/
|
||||
void run(final Mobibot bot, final String sender, String arg) {
|
||||
try {
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
@ -55,7 +56,7 @@ public final class Lookup extends AbstractModule {
|
|||
private static final String LOOKUP_CMD = "lookup";
|
||||
|
||||
/**
|
||||
* The default constructor
|
||||
* The default constructor.
|
||||
*/
|
||||
public Lookup() {
|
||||
commands.add(LOOKUP_CMD);
|
||||
|
@ -154,8 +155,8 @@ public final class Lookup extends AbstractModule {
|
|||
bot.send(Lookup.lookup(args));
|
||||
} catch (UnknownHostException ignore) {
|
||||
if (args.matches(
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\." +
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")) {
|
||||
"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\."
|
||||
+ "(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)")) {
|
||||
try {
|
||||
final String[] lines = Lookup.whois(args);
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import okhttp3.HttpUrl;
|
||||
|
@ -100,11 +101,13 @@ class ModuleException extends Exception {
|
|||
final String causeMessage = getCause().getMessage();
|
||||
final Matcher matcher = urlPattern.matcher(causeMessage);
|
||||
if (matcher.find()) {
|
||||
final HttpUrl url = HttpUrl.parse(matcher.group(1)+matcher.group(2));
|
||||
if (url != null){
|
||||
final HttpUrl url = HttpUrl.parse(matcher.group(1) + matcher.group(2));
|
||||
if (url != null) {
|
||||
final StringBuilder query = new StringBuilder("?");
|
||||
for (int i = 0, size = url.querySize(); i < size; i++) {
|
||||
if (i > 0) query.append('&');
|
||||
if (i > 0) {
|
||||
query.append('&');
|
||||
}
|
||||
query.append(url.queryParameterName(i)).append('=').append('[')
|
||||
.append(url.queryParameterValue(i).length()).append(']');
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.aksingh.owmjapis.api.APIException;
|
||||
|
@ -72,7 +73,8 @@ public class Weather2 extends ThreadedModule {
|
|||
properties.put(OWM_API_KEY_PROP, "");
|
||||
}
|
||||
|
||||
private static String fAndC(final Double d) {
|
||||
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
|
||||
private static String getTemps(final Double d) {
|
||||
final double c = (d - 32) * 5 / 9;
|
||||
return Math.round(d) + " \u00B0F, " + Math.round(c) + " \u00B0C";
|
||||
}
|
||||
|
@ -122,7 +124,7 @@ public class Weather2 extends ThreadedModule {
|
|||
final Main main = cwd.getMainData();
|
||||
if (main != null) {
|
||||
if (main.hasTemp()) {
|
||||
messages.add(new PublicMessage("Temperature: " + fAndC(main.getTemp())));
|
||||
messages.add(new PublicMessage("Temperature: " + getTemps(main.getTemp())));
|
||||
}
|
||||
|
||||
if (main.hasHumidity() && (main.getHumidity() != null)) {
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.Mobibot;
|
||||
|
@ -55,7 +56,7 @@ public final class WorldTime extends AbstractModule {
|
|||
private static final String BEATS_KEYWORD = ".beats";
|
||||
// The supported countries.
|
||||
private static final Map<String, String> COUNTRIES_MAP = new TreeMap<>();
|
||||
|
||||
|
||||
/**
|
||||
* The time command.
|
||||
*/
|
||||
|
@ -138,10 +139,10 @@ public final class WorldTime extends AbstractModule {
|
|||
COUNTRIES_MAP.put("ZULU", "Zulu");
|
||||
COUNTRIES_MAP.put("INTERNET", BEATS_KEYWORD);
|
||||
COUNTRIES_MAP.put("BEATS", BEATS_KEYWORD);
|
||||
|
||||
ZoneId.getAvailableZoneIds().stream().filter(
|
||||
tz -> !tz.contains("/") && tz.length() == 3 && !COUNTRIES_MAP.containsKey(tz)).forEach(
|
||||
tz -> COUNTRIES_MAP.put(tz, tz));
|
||||
|
||||
ZoneId.getAvailableZoneIds().stream().filter(tz ->
|
||||
!tz.contains("/") && tz.length() == 3 && !COUNTRIES_MAP.containsKey(tz)).forEach(tz ->
|
||||
COUNTRIES_MAP.put(tz, tz));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.msg;
|
||||
|
||||
/**
|
||||
|
@ -39,11 +40,23 @@ package net.thauvin.erik.mobibot.msg;
|
|||
* @since 1.0
|
||||
*/
|
||||
public class ErrorMessage extends Message {
|
||||
/**
|
||||
* Creates a new error message.
|
||||
*
|
||||
* @param message The error message.
|
||||
*/
|
||||
public ErrorMessage(final String message) {
|
||||
this.setMessage(message);
|
||||
this.setError(true);
|
||||
this.setNotice(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new error message.
|
||||
*
|
||||
* @param message The message.
|
||||
* @param color The message color.
|
||||
*/
|
||||
public ErrorMessage(final String message, final String color) {
|
||||
this.setMessage(message);
|
||||
this.setError(true);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.msg;
|
||||
|
||||
import org.jibble.pircbot.Colors;
|
||||
|
@ -101,7 +102,7 @@ public class Message {
|
|||
}
|
||||
|
||||
/**
|
||||
* Set the color
|
||||
* Set the color.
|
||||
*
|
||||
* @param color The new color.
|
||||
*/
|
||||
|
@ -175,9 +176,9 @@ public class Message {
|
|||
/**
|
||||
* Sets the message private flag.
|
||||
*
|
||||
* @param aPrivate The private flag.
|
||||
* @param isPrivate The private flag.
|
||||
*/
|
||||
public void setPrivate(boolean aPrivate) {
|
||||
isPrivate = aPrivate;
|
||||
public void setPrivate(boolean isPrivate) {
|
||||
this.isPrivate = isPrivate;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.msg;
|
||||
|
||||
/**
|
||||
|
@ -39,11 +40,22 @@ package net.thauvin.erik.mobibot.msg;
|
|||
* @since 1.0
|
||||
*/
|
||||
public class NoticeMessage extends Message {
|
||||
/**
|
||||
* Creates a new notice.
|
||||
*
|
||||
* @param message The notice's message.
|
||||
*/
|
||||
public NoticeMessage(final String message) {
|
||||
this.setMessage(message);
|
||||
this.setNotice(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new notice.
|
||||
*
|
||||
* @param message The ntoice's message.
|
||||
* @param color The color.
|
||||
*/
|
||||
public NoticeMessage(final String message, final String color) {
|
||||
this.setMessage(message);
|
||||
this.setNotice(true);
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.msg;
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.msg;
|
||||
|
||||
/**
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot;
|
||||
|
||||
import org.jibble.pircbot.Colors;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.msg.Message;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import org.testng.annotations.BeforeSuite;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import org.testng.annotations.DataProvider;
|
||||
|
|
|
@ -29,11 +29,13 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* The <code>PingTest</code> class.
|
||||
*
|
||||
|
@ -49,6 +51,6 @@ public class PingTest {
|
|||
|
||||
@Test
|
||||
public void testPingsArray() {
|
||||
assertThat(Ping.PINGS).as("Pings array is not empty.").isNotEmpty();
|
||||
assertThat(Ping.PINGS).as("Pings array is not empty.").isNotEmpty();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.msg.Message;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import net.thauvin.erik.mobibot.msg.Message;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
package net.thauvin.erik.mobibot.modules;
|
||||
|
||||
import org.testng.annotations.Test;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue