/** * Renders the application's description. * @return a non-null string * @throws IOException if something went wrong */ private Object renderApplicationDescription() throws IOException { // No locale? => Display the application's description. // Otherwise, read app.desc_fr_FR.txt or the required file for another locale. // If it does not exist, return the empty string. String s; if( this.locale == null && ! Utils.isEmptyOrWhitespaces( this.applicationTemplate.getDescription())) s = this.applicationTemplate.getDescription(); else s = readCustomInformation( this.applicationDirectory, DocConstants.APP_DESC_PREFIX, DocConstants.FILE_SUFFIX ); String result = ""; if( ! Utils.isEmptyOrWhitespaces( s )) result = renderParagraph( s ); return result; }
/** * Renders the application's description. * @return a non-null string * @throws IOException if something went wrong */ private Object renderApplicationDescription() throws IOException { // No locale? => Display the application's description. // Otherwise, read app.desc_fr_FR.txt or the required file for another locale. // If it does not exist, return the empty string. String s; if( this.locale == null && ! Utils.isEmptyOrWhitespaces( this.applicationTemplate.getDescription())) s = this.applicationTemplate.getDescription(); else s = readCustomInformation( this.applicationDirectory, DocConstants.APP_DESC_PREFIX, DocConstants.FILE_SUFFIX ); String result = ""; if( ! Utils.isEmptyOrWhitespaces( s )) result = renderParagraph( s ); return result; }
generator.writeStringField( DISPLAY_NAME, app.getDisplayName()); if( app.getDescription() != null ) generator.writeStringField( DESC, app.getDescription());
Assert.assertEquals( "A sample LAMP application", result.applicationTemplate.getDescription()); Assert.assertEquals( "1.0.1-SNAPSHOT", result.applicationTemplate.getVersion()); Assert.assertEquals( "roboconf-1.0", result.applicationTemplate.getDslId());
Assert.assertEquals( "A sample LAMP application", result.applicationTemplate.getDescription()); Assert.assertEquals( "1.0.1-SNAPSHOT", result.applicationTemplate.getVersion());
@Test public void testChain() { ApplicationTemplate app = new ApplicationTemplate().name( "ins" ).description( "desc" ).version( "snapshot" ).graphs( new Graphs()); Assert.assertEquals( "ins", app.getName()); Assert.assertEquals( "desc", app.getDescription()); Assert.assertEquals( "snapshot", app.getVersion()); Assert.assertNotNull( app.getGraphs()); }