@Test public void testLoadNull() { initializeExpectedProject(1); expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(null); replay(resourceManager); assertNull(resourceManager.get(PROJECT_INFO.projectId())); }
public Tray() { mSprite = new Sprite(ResourceManager.get("tray")); mWheelCoverSprite = new Sprite(ResourceManager.get("wheelcover")); for (int i = 0; i < MAX_COGS_REALLY_BIG; i++) { mCogs_ReallyBig.add(Cog.getCog(5)); } for (int i = 0; i < MAX_COGS_BIG; i++) { mCogs_Big.add(Cog.getCog(4)); } for (int i = 0; i < MAX_COGS_MEDIUM; i++) { mCogs_Medium.add(Cog.getCog(3)); } for (int i = 0; i < MAX_COGS_SMALL; i++) { mCogs_Small.add(Cog.getCog(2)); } for (int i = 0; i < MAX_COGS_TINY; i++) { mCogs_Tiny.add(Cog.getCog(1)); } }
@Test public void testGet() { initializeExpectedProject(1); expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(expectedProject); replay(resourceManager); Project loadedProject = resourceManager.get(PROJECT_INFO.projectId()); assertEquals(expectedProject, loadedProject); }
@Test public void testReloadNull() { initializeExpectedProject(1); expect(resourceManager.options()).andReturn(mockOptions); expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(null); replay(resourceManager); Project reloadedProject = new Project(resourceManager, new ProjectInfo.BuilderImpl(PROJECT_INFO)).reload(); assertNull(reloadedProject); }
@Test public void testReload() { initializeExpectedProject(2); ProjectInfo newInfo = PROJECT_INFO.toBuilder().addLabel("k3", "v3").build(); Project expectedProject = new Project(serviceMockReturnsOptions, new ProjectInfo.BuilderImpl(newInfo)); expect(resourceManager.options()).andReturn(mockOptions); expect(resourceManager.get(PROJECT_INFO.projectId())).andReturn(expectedProject); replay(resourceManager); initializeProject(); Project newProject = project.reload(); assertEquals(expectedProject, newProject); }
public void testGetUrl() throws Exception { assertNotNull(ResourceManager.get().getUrl("images/menu/about.png")); assertNotNull(ResourceManager.get().getUrl("images/filetypes/folder.png")); }