当前位置: 首页>>代码示例>>Java>>正文


Java EventsManager.createSticker方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:35,代码来源:StickerExpirationTest.java

示例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);
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:39,代码来源:StickerExpirationTest.java

示例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);
}
 
开发者ID:ser316asu,项目名称:SER316-Munich,代码行数:39,代码来源:StickerExpirationTest.java


注:本文中的net.sf.memoranda.EventsManager.createSticker方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。