Package lesson6.test

Examples of lesson6.test.Test


            case 6: {
                // Rieffetto i test
                // Effettuo tutti i test per verificare il corretto funzionamento
                // del programma
                Layout.clearLogger();
                Test test = new Test();
                test.doAllTest();
                break;
            }
            case 7: {
                // Setto la modalità errore del layout
                // Eseguo le istruzioni che mi permettono di settare
View Full Code Here


            case 6: {
                // Rieffetto i test
                // Effettuo tutti i test per verificare il corretto funzionamento
                // del programma
                Layout.clearLogger();
                Test test = new Test();
                test.doAllTest();
                break;
            }
            case 7: {
                // Setto la modalità errore del layout
                // Eseguo le istruzioni che mi permettono di settare
View Full Code Here

     * @throws IllegalAccessException
     * @throws InstantiationException
     */
    private static JSONObject toJsonObject(Object o) throws IllegalAccessException, InstantiationException, JSONException, NoSuchMethodException {
        JSONObject m = new JSONObject();
        JsonDataAdapter jda;
        Class<?> c = o.getClass();

        Field[] fields = c.getDeclaredFields();
        for (Field f : fields){

            if (f.isAnnotationPresent(Ignore.class)) continue;
            f.setAccessible(true);

            if(!f.isAnnotationPresent(UseDataAdapter.class))
                m.put(f.getName(), JsonSerializer.serialize(f.get(o)));
            else{
                jda = f.getAnnotation(UseDataAdapter.class).value().newInstance();
                m.put(f.getName(), jda.toJson(f.get(o)));
            }
        }

        return m;
    }
View Full Code Here

   * @param args
   */
  public static void main(String[] args)
  {
   
    Test test = new Test();
    test.genericInput("generic", new Date());
 
//    Can't be compiled because treated as List<Object> - nowhere to retrieve type parameter:
//    inputList(test.genericReturn("test"));
   
//    Generic type is retrieved from returned parameter List<String> list 
    List<String> list = test.genericReturn("test");
    inputList(list);
  }
View Full Code Here

TOP

Related Classes of lesson6.test.Test

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.