浏览代码

:fire: Suppr fichier test

Arthur Brandao 6 年之前
父节点
当前提交
ff1d555202

+ 0 - 23
BSWFX/src/test/HandlerAttackAffect.java

@@ -1,23 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentHandler;
-
-/**
- *
- * @author loquicom
- */
-public class HandlerAttackAffect implements BomberStudentHandler {
-
-    @Override
-    public boolean handle(JSONObject json) {
-        System.out.println("Handler Attack Affect : " + json.toString(1));
-        return true;
-    }
-    
-}

+ 0 - 23
BSWFX/src/test/HandlerAttackBomb.java

@@ -1,23 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentHandler;
-
-/**
- *
- * @author loquicom
- */
-public class HandlerAttackBomb implements BomberStudentHandler{
-
-    @Override
-    public boolean handle(JSONObject json) {
-        System.out.println("Handler Attack Bomb : " + json.toString(1));
-        return true;
-    }
-    
-}

+ 0 - 23
BSWFX/src/test/HandlerAttackExplode.java

@@ -1,23 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentHandler;
-
-/**
- *
- * @author loquicom
- */
-public class HandlerAttackExplode implements BomberStudentHandler {
-
-    @Override
-    public boolean handle(JSONObject json) {
-        System.out.println("Handler Attack Explode : " + json.toString(1));
-        return true;
-    }
-    
-}

+ 0 - 23
BSWFX/src/test/HandlerPlayerJoin.java

@@ -1,23 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentHandler;
-
-/**
- *
- * @author loquicom
- */
-public class HandlerPlayerJoin implements BomberStudentHandler{
-
-    @Override
-    public boolean handle(JSONObject json) {
-        System.out.println("Join Handler : " + json.toString(1));
-        return true;
-    }
-    
-}

+ 0 - 23
BSWFX/src/test/HandlerPlayerMajorEnd.java

@@ -1,23 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentHandler;
-
-/**
- *
- * @author loquicom
- */
-public class HandlerPlayerMajorEnd implements BomberStudentHandler{
-
-    @Override
-    public boolean handle(JSONObject json) {
-        System.out.println("Player Major End Handler : " + json.toString(1));
-        return true;
-    }
-    
-}

+ 0 - 23
BSWFX/src/test/HandlerPlayerMove.java

@@ -1,23 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentHandler;
-
-/**
- *
- * @author loquicom
- */
-public class HandlerPlayerMove implements BomberStudentHandler{
-
-    @Override
-    public boolean handle(JSONObject json) {
-        System.out.println("Player Move Handler : " + json.toString(1));
-        return true;
-    }
-    
-}

+ 0 - 23
BSWFX/src/test/HandlerPlayerQuit.java

@@ -1,23 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentHandler;
-
-/**
- *
- * @author loquicom
- */
-public class HandlerPlayerQuit implements BomberStudentHandler{
-
-    @Override
-    public boolean handle(JSONObject json) {
-        System.out.println("Player quit : " + json.toString(1));
-        return true;
-    }
-    
-}

+ 0 - 21
BSWFX/src/test/HandlerServerEnd.java

@@ -1,21 +0,0 @@
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentClient;
-import rsx.BomberStudentHandler;
-
-/**
- *
- * @author Arthur Brandao
- */
-public class HandlerServerEnd implements BomberStudentHandler{
-
-    @Override
-    public boolean handle(JSONObject json) {
-        System.out.println("Handler server/end");
-        ServerTest.code = Integer.parseInt(json.getString("statut"));
-        ServerTest.stop.set(true);
-        return true;
-    }
-    
-}

+ 0 - 42
BSWFX/src/test/ServerTest.java

@@ -1,42 +0,0 @@
-package test;
-
-import java.util.concurrent.atomic.AtomicBoolean;
-import org.json.JSONObject;
-import rsx.BomberStudentClient;
-
-/**
- * Exemple appel vers le serveur
- * @author Arthur Brandao
- */
-public class ServerTest {
-    
-    public static AtomicBoolean stop = new AtomicBoolean(false);
-    public static int code = -1;
-
-    /**
-     * @param args the command line arguments
-     */
-    public static void main(String[] args) {
-        //Creation client BomberStudent
-        BomberStudentClient bsc = new BomberStudentClient();
-        //Ajout handler
-        bsc.addHandler("server/end", new HandlerServerEnd());
-        //Recherche serveur actif
-        int nbRes = bsc.findServer();
-        if(nbRes == 0){
-            System.err.println("Aucun serveur");
-            return;
-        }
-        //Selectionne le 1er serveur qui à repondu
-        bsc.selectServer(0);
-        //Attend fin serveur
-        System.out.println("Attente");
-        while(!stop.get()){
-            
-        }
-        System.out.println("Code : " + code);
-        bsc.close();
-        //*/
-    }
-    
-}

+ 0 - 168
BSWFX/src/test/TestServer.java

@@ -1,168 +0,0 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
-package test;
-
-import org.json.JSONObject;
-import rsx.BomberStudentClient;
-
-/**
- *
- * @author loquicom
- */
-public class TestServer {
-
-    public static void main(String[] args) throws InterruptedException {
-        //Creation client BomberStudent
-        BomberStudentClient bsc = new BomberStudentClient();
-        //Ajout handler
-        bsc.addHandler("server/end", new HandlerServerEnd());
-        bsc.addHandler("game/newplayer", new HandlerPlayerJoin());
-        bsc.addHandler("game/quit", new HandlerPlayerQuit());
-        bsc.addHandler("player/position/update", new HandlerPlayerMove());
-        bsc.addHandler("player/major/end", new HandlerPlayerMajorEnd());
-        bsc.addHandler("attack/newbomb", new HandlerAttackBomb());
-        bsc.addHandler("attack/affect", new HandlerAttackAffect());
-        bsc.addHandler("attack/explose", new HandlerAttackExplode());
-        //Recherche serveur actif
-        int nbRes = bsc.findServer();
-        if (nbRes == 0) {
-            System.err.println("Aucun serveur");
-            return;
-        }
-        //Selectionne le 1er serveur qui à repondu
-        System.out.println("Connexion");
-        bsc.selectServer(0);
-        
-        //Execute une/des requetes(s)
-        /*
-        System.out.println("Envoi");
-        if(!bsc.send("GET", "nop")){
-            System.err.println("Impossible envoyer la requete");
-            return;
-        }
-        System.out.println("Reception");
-        print(bsc.receive());
-        //*/
-        /*
-        Thread.sleep(10000);
-        //*/
-        /*
-        bsc.send("GET", "game/list");
-        JSONObject json = bsc.receive();
-        System.out.println(json.toString(1));
-        //*/
-        /*
-        JSONObject param = new JSONObject();
-        param.put("name", "gameTest");
-        param.put("map", "map1");
-        bsc.send("POST", "game/create", param);
-        JSONObject json = bsc.receive();
-        System.out.println(json.toString(1));
-        Thread.sleep(30000);
-        bsc.send("GET", "game/list");
-        json = bsc.receive();
-        System.out.println(json.toString(1));
-        param = new JSONObject();
-        param.put("move", "right");
-        bsc.send("POST", "player/move", param);
-        //bsc.send("POST", "game/quit");
-        //*/
-        /*
-        JSONObject param = new JSONObject();
-        param.put("name", "gameTest");
-        bsc.send("POST", "game/join", param);
-        JSONObject json = bsc.receive();
-        System.out.println(json.toString(1));
-        bsc.send("GET", "game/list");
-        json = bsc.receive();
-        System.out.println(json.toString(1));
-        param = new JSONObject();
-        param.put("move", "right");
-        bsc.send("POST", "player/move", param);
-        param = new JSONObject();
-        param.put("move", "left");
-        bsc.send("POST", "player/move", param);
-        param = new JSONObject();
-        param.put("move", "up");
-        bsc.send("POST", "player/move", param);
-        //*/
-        /*
-        JSONObject param = new JSONObject();
-        param.put("name", "gameTest");
-        param.put("map", "map1");
-        bsc.send("POST", "game/create", param);
-        JSONObject json = bsc.receive();
-        System.out.println(json.toString(1));
-        Thread.sleep(2000);
-        param = new JSONObject();
-        param.put("class", "major");
-        bsc.send("POST", "object/new", param);
-        json = bsc.receive();
-        System.out.println(json.toString(1));
-        Thread.sleep(10000);
-        //*/
-        
-        /*
-        JSONObject param = new JSONObject();
-        param.put("name", "gameTest");
-        param.put("map", "map1");
-        bsc.send("POST", "game/create", param);
-        JSONObject json = bsc.receive();
-        System.out.println(json.toString(1));
-        Thread.sleep(20000);
-        //*/
-        /*
-        JSONObject param = new JSONObject();
-        param.put("name", "gameTest");
-        bsc.send("POST", "game/join", param);
-        JSONObject json = bsc.receive();
-        System.out.println(json.toString(1));
-        param = new JSONObject();
-        param.put("class", "mine");
-        param.put("pos", "2,1");
-        bsc.send("POST", "attack/bomb", param);
-        json = bsc.receive();
-        System.out.println(json.toString(1));
-        //*/
-        
-        JSONObject param = new JSONObject();
-        param.put("name", "gameTest");
-        param.put("map", "map1");
-        bsc.send("POST", "game/create", param);
-        JSONObject json = bsc.receive();
-        System.out.println(json.toString(1));
-        param = new JSONObject();
-        param.put("class", "remote");
-        param.put("pos", "2,1");
-        bsc.send("POST", "attack/bomb", param);
-        json = bsc.receive();
-        System.out.println(json.toString(1));
-        param.put("class", "classic");
-        param.put("pos", "3,1");
-        bsc.send("POST", "attack/bomb", param);
-        json = bsc.receive();
-        System.out.println(json.toString(1));
-        bsc.send("POST", "attack/remote/go");
-        Thread.sleep(5000);
-        param = new JSONObject();
-        param.put("class", "remote");
-        param.put("pos", "3,5");
-        bsc.send("POST", "attack/bomb", param);
-        json = bsc.receive();
-        System.out.println(json.toString(1));
-        bsc.send("POST", "attack/remote/go");
-        
-        bsc.close();
-    }
-
-    public static void print(JSONObject json) {
-        if (json != null) {
-            System.out.println("Code : " + json.getString("statut"));
-            System.out.println("Message : " + json.getString("message"));
-        }
-    }
-
-}