Package net.alteiar.beans.media

Examples of net.alteiar.beans.media.ImageBean


    return createMap(name, new WebImage(backgroundUrl));
  }

  public static MapBean createMap(String name, TransfertImage background)
      throws IOException {
    return createMap(name, new ImageBean(background));
  }
View Full Code Here


  @Test(timeout = 5000)
  public void testAuthorizableBeansName() {
    String expName = "test-document-name";
    String newExpName = "test-document-name-new";

    ImageBean img = new ImageBean();
    BeanDocument autorizableBean = new BeanDocument(CampaignClient
        .getInstance().getRootDirectory(), expName, "document-type",
        img);

    CampaignClient.getInstance().addBean(autorizableBean);
View Full Code Here

  @Test(timeout = 5000)
  public void testAuthorizableBeansOwner() {
    BeanDocument autorizableBean = new BeanDocument(CampaignClient
        .getInstance().getRootDirectory(), "test-document-name",
        "document-type", new ImageBean());

    Player currentPlayer = CampaignClient.getInstance().getCurrentPlayer();

    autorizableBean = addBean(autorizableBean);
View Full Code Here

  @Test(timeout = 5000)
  public void testAuthorizableBeansModifier() {
    System.out.println(CampaignClient.getInstance().getRootDirectory());
    BeanDocument autorizableBean = new BeanDocument(CampaignClient
        .getInstance().getRootDirectory(), "test-document-name",
        "document-type", new ImageBean());

    Player currentPlayer = CampaignClient.getInstance().getCurrentPlayer();
    autorizableBean = addBean(autorizableBean);

    assertTrue(autorizableBean.isAllowedToApplyChange(currentPlayer));
View Full Code Here

  @Test(timeout = 5000)
  public void testAuthorizableBeansGameMaster() {
    BeanDocument autorizableBean = new BeanDocument(CampaignClient
        .getInstance().getRootDirectory(),
        "test-game-master-change-see-right", "document-type",
        new ImageBean());
    autorizableBean = addBean(autorizableBean);

    Player fakeGameMaster = new Player("GameMaster", true, Color.black);
    fakeGameMaster = addBean(fakeGameMaster);
    assertTrue(fakeGameMaster != null);
View Full Code Here

  @Test(timeout = 5000)
  public void testAuthorizableBeansUsers() {
    BeanDocument autorizableBean = new BeanDocument(CampaignClient
        .getInstance().getRootDirectory(), "test-document-name",
        "document-type", new ImageBean());

    Player currentPlayer = CampaignClient.getInstance().getCurrentPlayer();
    autorizableBean = addBean(autorizableBean);

    assertTrue(autorizableBean.isAllowedToApplyChange(currentPlayer));
View Full Code Here

  @Test(timeout = 5000)
  public void testAuthorizableBeanPublic() {
    BeanDocument autorizableBean = new BeanDocument(CampaignClient
        .getInstance().getRootDirectory(), "test-document-name",
        "document-type", new ImageBean());

    Player currentPlayer = CampaignClient.getInstance().getCurrentPlayer();
    autorizableBean = addBean(autorizableBean);

    assertTrue(autorizableBean.isAllowedToApplyChange(currentPlayer));
View Full Code Here

    COUNT_AUTHORIZATION_CHANGED = 0;
    COUNT_BEAN_CHANGED = 0;

    BeanDocument autorizableBean = new BeanDocument(CampaignClient
        .getInstance().getRootDirectory(), "test-document-name",
        "document-type", new ImageBean(TestMap.createTransfertImage()));

    autorizableBean = addBean(autorizableBean);

    autorizableBean.addPropertyChangeListener(new AuthorizationAdapter() {
      @Override
View Full Code Here

public class TestImageUtils extends NewCampaignTest {

  @Test
  public void testImage() {
    ImageBean image = new ImageBean();
    try {
      image.setImage(new WebImage(
          new URL(
              "http://www.alteiar.net/wiki/lib/exe/fetch.php?cache=&media=applications:chat.jpg")));

      BufferedImage target = ImageIO
          .read(new URL(
              "http://www.alteiar.net/wiki/lib/exe/fetch.php?cache=&media=applications:chat.jpg"));

      compareImage(target, image.getImage().restoreImage());

      assertEquals("get image must return null if no bean are found",
          null, ImageBean.getImage(new UniqueID()));
    } catch (MalformedURLException e) {
      fail("problem with the url");
View Full Code Here

        .talk(MessageFactory.currentPlayer("Hello world"));
    sleep();

    save();

    ImageBean toRemove = null;
    try {
      toRemove = new ImageBean(new WebImage(new URL("http://google.com")));
      CampaignClient.getInstance().addBean(toRemove);
    } catch (MalformedURLException e) {
      fail("no exception should occur");
    }
View Full Code Here

TOP

Related Classes of net.alteiar.beans.media.ImageBean

Copyright © 2018 www.massapicom. 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.