當前位置: 首頁>>代碼示例>>Java>>正文


Java GWTTestCase類代碼示例

本文整理匯總了Java中com.google.gwt.junit.client.GWTTestCase的典型用法代碼示例。如果您正苦於以下問題:Java GWTTestCase類的具體用法?Java GWTTestCase怎麽用?Java GWTTestCase使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GWTTestCase類屬於com.google.gwt.junit.client包,在下文中一共展示了GWTTestCase類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: convertClassNamesToClass

import com.google.gwt.junit.client.GWTTestCase; //導入依賴的package包/類
private static Set<Class<? extends GWTTestCase>> convertClassNamesToClass(final Collection<String> classNames) {
    Set<Class<? extends GWTTestCase>> allGwtTestCaseClasses = Sets.newHashSet();
    for (String className : classNames) {
        try {
            Class<? extends GWTTestCase> clazz = (Class<? extends GWTTestCase>) GWTTestCaseSuite.class.getClassLoader().loadClass(className);
            allGwtTestCaseClasses.add(clazz);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
    return allGwtTestCaseClasses;
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:13,代碼來源:GWTTestCaseSuite.java

示例2: addClass

import com.google.gwt.junit.client.GWTTestCase; //導入依賴的package包/類
public void addClass(Class<?> clazz) {
    if (!finished.add(clazz.getName())) {
        return;
    }
    addGwtModules(clazz);
    if (EntryPoint.class.isAssignableFrom(clazz)) {
        try {
            addMethod(clazz.getMethod("onModuleLoad"));
        } catch (Exception e) {
            X_Log.error(GwtcProjectGenerator.class, "Could not extract onModuleLoad method from ", clazz, e);
        }
    } else if (GWTTestCase.class.isAssignableFrom(clazz)) {
        addGwtTestCase(clazz.asSubclass(GWTTestCase.class));
    } else if (GWTTestSuite.class.isAssignableFrom(clazz)) {
        addGwtTestSuite(clazz.asSubclass(GWTTestSuite.class));
    } else if (RunAsyncCallback.class.isAssignableFrom(clazz)) {
        addAsyncBlock(clazz.asSubclass(RunAsyncCallback.class));
    } else {
        // Check if this class has methods annotated w/ junit @Test
        for (Method m : clazz.getMethods()) {
            if (m.getAnnotation(Test.class) != null) {
                finished.remove(clazz.getName());
                addJUnitClass(clazz);
                return;
            }
        }
        try {
            addMethod(clazz.getMethod("main", String[].class));
        } catch (Exception ignored){
            X_Log.warn(getClass(), "Class",clazz," was added to Gwtc, "
                + "but that class was not a subclass of EntryPoint, RunAsync,"
                + " GWTTestCase, GWTTestSuite, nor did it have a main method, or"
                + " any JUnit 4 annotated @Test method.");
        }
    }
}
 
開發者ID:WeTheInternet,項目名稱:xapi,代碼行數:37,代碼來源:GwtcProjectGeneratorDefault.java

示例3: isGwtTestCase

import com.google.gwt.junit.client.GWTTestCase; //導入依賴的package包/類
private boolean isGwtTestCase(Class<?> clazz) {
    return GWTTestCase.class.isAssignableFrom(clazz);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:4,代碼來源:GwtTestCaseScanner.java

示例4: getTestClasses

import com.google.gwt.junit.client.GWTTestCase; //導入依賴的package包/類
private static Set<Class<? extends GWTTestCase>> getTestClasses() {
    return Sets.filter(getAllTestClasses(), unsupportedClazzFilter);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:4,代碼來源:GWTTestCaseSuite.java

示例5: getAllTestClasses

import com.google.gwt.junit.client.GWTTestCase; //導入依賴的package包/類
private static Set<Class<? extends GWTTestCase>> getAllTestClasses() {
    Reflections reflections = createReflectionsForGwtTestCase();
    Collection<String> classNames = getGwtTestCaseClassNames(reflections);
    return convertClassNamesToClass(classNames);
}
 
開發者ID:YoungDigitalPlanet,項目名稱:empiria.player,代碼行數:6,代碼來源:GWTTestCaseSuite.java

示例6: addGwtTestCase

import com.google.gwt.junit.client.GWTTestCase; //導入依賴的package包/類
@Override
public void addGwtTestCase(Class<? extends GWTTestCase> subclass) {
    // TODO: setup a GWTTestSuite to add this test case to
    throw new NotYetImplemented("GwtTestCase not yet implemented");
}
 
開發者ID:WeTheInternet,項目名稱:xapi,代碼行數:6,代碼來源:GwtcProjectGeneratorDefault.java

示例7: addGwtTestCase

import com.google.gwt.junit.client.GWTTestCase; //導入依賴的package包/類
void addGwtTestCase(Class<? extends GWTTestCase> subclass); 
開發者ID:WeTheInternet,項目名稱:xapi,代碼行數:2,代碼來源:GwtcProjectGenerator.java


注:本文中的com.google.gwt.junit.client.GWTTestCase類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。