Examples of asString()


Examples of org.gatein.common.text.CharBuffer.asString()

   {
      try
      {
         CharBuffer buffer = new CharBuffer();
         internalWrite(locale, buffer);
         return buffer.asString();
      }
      catch (IOException e)
      {
         throw new UndeclaredIOException(e);
      }
View Full Code Here

Examples of org.glassfish.tyrus.sample.chat.chatdata.ChatTranscriptUpdateMessage.asString()

        for (Session nextSession : connections.values()) {
            RemoteEndpoint.Basic remote = nextSession.getBasicRemote();
            if (remote != null) {
                ChatTranscriptUpdateMessage cm = new ChatTranscriptUpdateMessage(transcriptEntry);
                try {
                    remote.sendText(cm.asString());
                } catch (IOException ioe) {
                    logger.warning("Error updating a client " + remote + " : " + ioe.getMessage());
                }
            }
        }
View Full Code Here

Examples of org.glassfish.tyrus.sample.chat.chatdata.LoginResponseMessage.asString()

    public void handleLoginRequest(LoginRequestMessage message, Session session) {
        String newUsername = this.registerNewUsername(message.getUsername(), session);
        logger.info("Signing " + newUsername + " into chat.");
        LoginResponseMessage lres = new LoginResponseMessage(newUsername);
        try {
            session.getBasicRemote().sendText(lres.asString());
        } catch (IOException ioe) {
            logger.warning("Error signing " + message.getUsername() + " into chat : " + ioe.getMessage());
        }

        this.addToTranscriptAndNotify(newUsername, " has just joined.");
View Full Code Here

Examples of org.glassfish.tyrus.sample.chat.chatdata.UserListUpdateMessage.asString()

        logger.info("Broadcasting updated user list");
        UserListUpdateMessage ulum = new UserListUpdateMessage(new ArrayList(connections.keySet()));
        for (Session nextSession : connections.values()) {
            RemoteEndpoint.Basic remote = nextSession.getBasicRemote();
            try {
                remote.sendText(ulum.asString());
            } catch (IOException ioe) {
                logger.warning("Error updating a client " + remote + " : " + ioe.getMessage());
            }
        }
    }
View Full Code Here

Examples of org.htmlparser.util.NodeList.asString()

    if (node instanceof TextNode) {
      text = ((TextNode)node).getText();
    } else {
      NodeList list = node.getChildren();
      if (list != null) {
        text = list.asString();
      } else {
        return null;
      }
    }
    return convertTextData(text);
View Full Code Here

Examples of org.jamon.Renderer.asString()

                tpl.setResultSet( rs );
                renderer = tpl.makeRenderer();
            }

            if ( renderer != null )
                return renderer.asString();

        }
       
        catch ( final Exception e ) {
            log.debug( e );
View Full Code Here

Examples of org.jbehave.core.model.Description.asString()

                "I want to get a loan" + NL +
                "Scenario:  A first scenario";
        Story story = parser.parseStory(
                wholeStory, storyPath);
        Description description = story.getDescription();
        assertThat(description.asString(), equalTo("Story: This is free-text description"));
        Narrative narrative = story.getNarrative();
        assertThat(narrative.isEmpty(), not(true));
        assertThat(narrative.inOrderTo().toString(), equalTo("renovate my house"));
        assertThat(narrative.asA().toString(), equalTo("customer"));
        assertThat(narrative.iWantTo().toString(), equalTo("get a loan"));
View Full Code Here

Examples of org.jbehave.core.model.ExamplesTable.asString()

                "Given a step with a <one>",
                "When I run the scenario of name <two>",
                "Then I should see <three> in the output"
        )));
        ExamplesTable table = scenario.getExamplesTable();
        assertThat(table.asString(), equalTo(
                "|one|two|three|" + NL +
                        "|11|12|13|" + NL +
                        "|21|22|23|" + NL));
        assertThat(table.getRowCount(), equalTo(2));
        assertThat(table.getRow(0), not(nullValue()));
View Full Code Here

Examples of org.jbehave.core.model.GivenStories.asString()

            "|21|22|";
        Story story = parser.parseStory(wholeStory, storyPath);

        Scenario scenario = story.getScenarios().get(0);
        GivenStories givenStories = scenario.getGivenStories();
        assertThat(givenStories.asString(), equalTo("path/to/one#{0}, path/to/two#{1}, path/to/three#{2}, path/to/four#{a}, path/to/five"));
        assertThat(givenStories.toString(), containsString(givenStories.asString()));
        assertThat(givenStories.getPaths(), equalTo(asList(
                "path/to/one#{0}", // matches first parameters row
                "path/to/two#{1}", // matches second parameters row
                "path/to/three#{2}", // does not match any parameters row
View Full Code Here

Examples of org.jboss.dmr.ModelNode.asString()

            }
            else if (result.hasDefined("host-failure-descriptions")) {
                throw new RuntimeException(result.get("host-failure-descriptions").toString());
            }
            else {
                throw new RuntimeException("Operation outcome is " + result.asString());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.