Package fr

Source Code of fr.CreationChasseTest

package fr;

import java.util.ArrayList;
import java.util.List;

import org.restlet.resource.ClientResource;

import fr.emn.nuitinfo.model.Chasse;
import fr.emn.nuitinfo.model.CoordonneesGPS;
import fr.emn.nuitinfo.model.Duree;
import fr.emn.nuitinfo.model.Etape;
import fr.emn.nuitinfo.model.Lieu;
import fr.emn.nuitinfo.model.interfaces.IEtape;

public class CreationChasseTest {

  public static void main(String[] args) {

    ClientResource cr = new ClientResource(
        "http://localhost:8080/resources/utilisateurs");
    String test = createJSONChasse();
    System.out.println(test);
    cr.post(test);

  }

  public static String createJSONChasse() {

    Chasse chasseTest;
    List<IEtape> etapes = new ArrayList<IEtape>();

    String[] reponse = new String[1];
    reponse[0] = "reponse";
    String[] indice = new String[1];
    indice[0] = "indice";
    Etape ietape1 = new Etape("enigme", reponse, "commentaires", indice, new Lieu(new CoordonneesGPS(45.0,45.0), "unLieu"));

    etapes.add(ietape1);
    Duree myDuree = new Duree(5, 5, 5);
    List<String> tags = new ArrayList<String>();
    tags.add("tag1");
    tags.add("tag2");
    tags.add("tag3");
    chasseTest = new Chasse("uneRegion", tags, etapes, myDuree, "unNom", "Unedescription");

    return (chasseTest.toString());

  }

}
TOP

Related Classes of fr.CreationChasseTest

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.