本文整理汇总了Java中net.sf.memoranda.EventsManager.createSticker方法的典型用法代码示例。如果您正苦于以下问题:Java EventsManager.createSticker方法的具体用法?Java EventsManager.createSticker怎么用?Java EventsManager.createSticker使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.sf.memoranda.EventsManager
的用法示例。
在下文中一共展示了EventsManager.createSticker方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testStickerExpiration
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
//This will require
public void testStickerExpiration() {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date expirationDate = new Date();
//The 12 is for font size.
String orig = "This sticker should not exist; it is a monument to man's arrogance.";
int sP = 0;
String txt = ("<div style=\"background-color:"+
"0"+";font-size:"+
"12"+";color:"+
"FFFFFF"+"; \">" + orig+
"</div>");
EventsManager.createSticker(txt, sP, expirationDate);
//FileStorage.JN_DOCPATH = FileStorage.JN_DOCPATH + "/ExpirationStickerTest";
CurrentStorage.get().storeEventsManager();
Map stickers = EventsManager.getStickers();
String raw_sticker;
String stickerText;
int first;
int last;
Iterator i = stickers.entrySet().iterator();
while (i.hasNext()){
Entry stickerEntry = (Entry) i.next();
raw_sticker = (String) ((Element)stickerEntry.getValue()).getValue();
stickerText = getOriginalStickerText(raw_sticker);
System.out.println(stickerText);
//Should never load a sticker with the same text as the original
assertFalse(stickerText.compareTo(orig) == 0);
}
}
示例2: testStickerPermanance
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
public void testStickerPermanance() {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
//Date expirationDate = new Date();
//The 12 is for font size.
String orig = "This sticker will live forever.";
int sP = 0;
String txt = ("<div style=\"background-color:"+
"0"+";font-size:"+
"12"+";color:"+
"FFFFFF"+"; \">" + orig+
"</div>");
EventsManager.createSticker(txt, sP, null);
//FileStorage.JN_DOCPATH = FileStorage.JN_DOCPATH + "/ExpirationStickerTest";
CurrentStorage.get().storeEventsManager();
Map stickers = EventsManager.getStickers();
String raw_sticker;
String stickerText;
int first;
int last;
Iterator i = stickers.entrySet().iterator();
boolean success = false;
while (i.hasNext()){
Entry stickerEntry = (Entry) i.next();
raw_sticker = (String)((Element)stickerEntry.getValue()).getValue();
stickerText = getOriginalStickerText(raw_sticker);
System.out.println(stickerText);
//Should never load a sticker with the same text as the original
if (stickerText.compareTo(orig) == 0) {
success = true;
break;
}
}
assertTrue(success);
}
示例3: testStickerNotDeadYet
import net.sf.memoranda.EventsManager; //导入方法依赖的package包/类
@Test
public void testStickerNotDeadYet() throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date expirationDate = sdf.parse("31/03/2018");
//The 12 is for font size.
String orig = "Memento Mori";
int sP = 0;
String txt = ("<div style=\"background-color:"+
"0"+";font-size:"+
"12"+";color:"+
"FFFFFF"+"; \">" + orig+
"</div>");
EventsManager.createSticker(txt, sP, expirationDate);
//FileStorage.JN_DOCPATH = FileStorage.JN_DOCPATH + "/ExpirationStickerTest";
CurrentStorage.get().storeEventsManager();
Map stickers = EventsManager.getStickers();
String raw_sticker;
String stickerText;
int first;
int last;
Iterator i = stickers.entrySet().iterator();
boolean success = false;
while (i.hasNext()){
Entry stickerEntry = (Entry) i.next();
raw_sticker = (String) ((Element)stickerEntry.getValue()).getValue();
stickerText = getOriginalStickerText(raw_sticker);
System.out.println(stickerText);
//Should never load a sticker with the same text as the original
if (stickerText.compareTo(orig) == 0) {
success = true;
break;
}
}
assertTrue(success);
}