private com.relteq.sirius.jaxb.Controller restoreController(Controllers db_cntr) throws TorqueException { com.relteq.sirius.jaxb.Controller cntr = factory.createController(); cntr.setId(id2str(db_cntr.getId())); cntr.setName(db_cntr.getName()); cntr.setType(db_cntr.getType()); cntr.setDt(db_cntr.getDt()); cntr.setEnabled(Boolean.TRUE); cntr.setJavaClass(db_cntr.getJavaClass()); cntr.setDisplayPosition(restorePosition(db_cntr.getDisplayGeometry())); cntr.setTargetElements(restoreTargetElements(db_cntr)); cntr.setFeedbackElements(restoreFeedbackElements(db_cntr)); if (null != db_cntr.getQueueControllerId()) cntr.setQueueController(restoreQueueController(db_cntr.getQueueControllers())); cntr.setParameters(restoreParameters(db_cntr)); List<com.relteq.sirius.jaxb.Table> table_l = restoreTables(db_cntr); if (null != table_l && !table_l.isEmpty()) { cntr.setTable(table_l.get(0)); if (1 < table_l.size()) logger.warn("Controller " + db_cntr.getId() + " has " + table_l.size() + " tables"); } cntr.setActivationIntervals(restoreActivationIntervals(db_cntr)); // TODO cntr.setPlanSequence(); // TODO cntr.setPlanList(); return cntr; }
@Test public void HandlerMethodインスタンスにSessionAttributeComplete注釈がついていないことを判定() throws Exception { HandlerMethod handler = new HandlerMethod( new ControllersTestController(), ControllersTestController.class.getMethod("test")); assertThat(Controllers.isSessionAttributeComplete(handler.getMethod()), is(false)); }
@Test public void HandlerMethodインスタンスであることを判定() throws Exception { HandlerMethod handler = new HandlerMethod( new ControllersTestController(), ControllersTestController.class.getMethod("test")); assertThat(Controllers.isHandlerMethod(handler), is(true)); }
@Test public void HandlerMethodインスタンスに付与されていないSessionAttributes注釈のインスタンスを取得した場合nullが返却される() throws Exception { assertThat( Controllers.findSessionAttributeNames(NonSessionAttributesTestController.class), is(nullValue())); }
@Test public void HandlerMethodインスタンスに付与されていないメソッドを対象SessionAttributeComplete注釈のvalue属性を取得した場合nullが返却される() throws Exception { HandlerMethod handler = new HandlerMethod( new ControllersTestController(), ControllersTestController.class.getMethod("test")); assertThat(Controllers.findClearSessionAttributeNames(handler.getMethod()), is(nullValue())); }
@Test public void HandlerMethodインスタンスに付与されているSessionAttributeComplete注釈のインスタンスを取得() throws Exception { HandlerMethod handler = new HandlerMethod( new ControllersTestController(), ControllersTestController.class.getMethod("sessionAttributeComplete")); assertThat( Controllers.findSessionAttributeCompleteAnnotation(handler.getMethod()), is(notNullValue())); }
@Test public void HandlerMethodインスタンスに付与されているSessionAttributeComplete注釈のvalue属性を取得() throws Exception { HandlerMethod handler = new HandlerMethod( new ControllersTestController(), ControllersTestController.class.getMethod("sessionAttributeComplete")); assertThat( Arrays.asList(Controllers.findClearSessionAttributeNames(handler.getMethod())), hasItem("modelAttribute")); }
private com.relteq.sirius.jaxb.ActivationIntervals restoreActivationIntervals(Controllers db_cntr) throws TorqueException { @SuppressWarnings("unchecked") List<ControllerActivationIntervals> db_cai_l = db_cntr.getControllerActivationIntervalss(); if (db_cai_l.isEmpty()) return null; com.relteq.sirius.jaxb.ActivationIntervals ais = factory.createActivationIntervals(); for (ControllerActivationIntervals db_cai : db_cai_l) ais.getInterval().add(restoreInterval(db_cai)); return ais; }
@Test public void null値がHandlerMethodインスタンスでないことを判定() { assertThat(Controllers.isHandlerMethod(null), is(false)); }
@Test public void exceptionのタイプがマッチしない() throws Exception { assertThat( Controllers.exceptionMatch(Exception.class, IllegalArgumentException.class), is(false)); }
@Test public void exceptionのタイプがマッチする() throws Exception { assertThat(Controllers.exceptionMatch(Exception.class, Exception.class), is(true)); }
@Test public void HandlerMethodインスタンスに付与されているSessionAttributes注釈のインスタンスを取得() throws Exception { assertThat( Arrays.asList(Controllers.findSessionAttributeNames(ControllersTestController.class)), hasItem("mdoelAttribute")); }
public void startGame() throws LWJGLException { if (mcCanvas != null) { Graphics g = mcCanvas.getGraphics(); if (g != null) { g.setColor(Color.BLACK); g.fillRect(0, 0, displayWidth, displayHeight); g.dispose(); } Display.setParent(mcCanvas); } else if (fullscreen) { Display.setFullscreen(true); displayWidth = Display.getDisplayMode().getWidth(); displayHeight = Display.getDisplayMode().getHeight(); if (displayWidth <= 0) { displayWidth = 1; } if (displayHeight <= 0) { displayHeight = 1; } } else { Display.setDisplayMode(new DisplayMode(displayWidth, displayHeight)); } Display.setTitle("Minecraft Minecraft Beta 1.7.3"); try { Display.create(); } catch (LWJGLException lwjglexception) { lwjglexception.printStackTrace(); try { Thread.sleep(1000L); } catch (InterruptedException interruptedexception) { } Display.create(); } mcDataDir = getMinecraftDir(); saveLoader = new SaveConverterMcRegion(new File(mcDataDir, "saves")); gameSettings = new GameSettings(this, mcDataDir); texturePackList = new TexturePackList(this, mcDataDir); renderEngine = new RenderEngine(texturePackList, gameSettings); fontRenderer = new FontRenderer(gameSettings, "/font/default.png", renderEngine); ColorizerWater.func_28182_a(renderEngine.func_28149_a("/misc/watercolor.png")); ColorizerGrass.func_28181_a(renderEngine.func_28149_a("/misc/grasscolor.png")); ColorizerFoliage.func_28152_a(renderEngine.func_28149_a("/misc/foliagecolor.png")); entityRenderer = new EntityRenderer(this); RenderManager.instance.itemRenderer = new ItemRenderer(this); statFileWriter = new StatFileWriter(session, mcDataDir); AchievementList.openInventory.setStatStringFormatter(new StatStringFormatKeyInv(this)); loadScreen(); Keyboard.create(); Mouse.create(); mouseHelper = new MouseHelper(mcCanvas); try { Controllers.create(); } catch (Exception exception) { exception.printStackTrace(); } checkGLError("Pre startup"); GL11.glEnable(3553 /*GL_TEXTURE_2D*/); GL11.glShadeModel(7425 /*GL_SMOOTH*/); GL11.glClearDepth(1.0D); GL11.glEnable(2929 /*GL_DEPTH_TEST*/); GL11.glDepthFunc(515); GL11.glEnable(3008 /*GL_ALPHA_TEST*/); GL11.glAlphaFunc(516, 0.1F); GL11.glCullFace(1029 /*GL_BACK*/); GL11.glMatrixMode(5889 /*GL_PROJECTION*/); GL11.glLoadIdentity(); GL11.glMatrixMode(5888 /*GL_MODELVIEW0_ARB*/); checkGLError("Startup"); glCapabilities = new OpenGlCapsChecker(); sndManager.loadSoundSettings(gameSettings); renderEngine.registerTextureFX(textureLavaFX); renderEngine.registerTextureFX(textureWaterFX); renderEngine.registerTextureFX(new TexturePortalFX()); renderEngine.registerTextureFX(new TextureCompassFX(this)); renderEngine.registerTextureFX(new TextureWatchFX(this)); renderEngine.registerTextureFX(new TextureWaterFlowFX()); renderEngine.registerTextureFX(new TextureLavaFlowFX()); renderEngine.registerTextureFX(new TextureFlamesFX(0)); renderEngine.registerTextureFX(new TextureFlamesFX(1)); renderGlobal = new RenderGlobal(this, renderEngine); GL11.glViewport(0, 0, displayWidth, displayHeight); effectRenderer = new EffectRenderer(theWorld, renderEngine); try { downloadResourcesThread = new ThreadDownloadResources(mcDataDir, this); downloadResourcesThread.start(); } catch (Exception exception1) { } checkGLError("Post startup"); ingameGUI = new GuiIngame(this); if (serverName != null) { displayGuiScreen(new GuiConnecting(this, serverName, serverPort)); } else { displayGuiScreen(new GuiMainMenu()); } }