target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void computeTargetSizeWidth0Height1() { Bitmap bitmap = ShadowBitmapFactory.create("AndroidGodEye", null, new Point(25, 50)); int[] targetSize0 = ImageUtil.computeTargetSize(bitmap, 30, 30); Assert.assertEquals(15, targetSize0[0]); Assert.assertEquals(30, targetSize0[1]); }
@VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); float scaleH...
ImageUtil { @VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); ...
ImageUtil { @VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); ...
ImageUtil { @VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); ...
ImageUtil { @VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); ...
@Test public void onPageLoadedCannotBeNull() { try { GodEye.instance().uninstall(); GodEyeHelper.onPageLoaded(null); fail(); } catch (RuntimeException ignore) { } catch (UninstallException e) { fail(); } }
public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOA...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
@Test public void computeTargetSizeWidth0Height0() { Bitmap bitmap = ShadowBitmapFactory.create("AndroidGodEye", null, new Point(20, 10)); int[] targetSize0 = ImageUtil.computeTargetSize(bitmap, 30, 30); Assert.assertEquals(20, targetSize0[0]); Assert.assertEquals(10, targetSize0[1]); }
@VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); float scaleH...
ImageUtil { @VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); ...
ImageUtil { @VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); ...
ImageUtil { @VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); ...
ImageUtil { @VisibleForTesting static int[] computeTargetSize(Bitmap bitmap, int maxWidth, int maxHeight) { int width = bitmap.getWidth(); int height = bitmap.getHeight(); float targetWidth = width; float targetHeight = height; if (width > maxWidth || height > maxHeight) { float scaleWidth = (width * 1.0f / maxWidth); ...
@Test public void isMainThread() { boolean isMainThread = ThreadUtil.isMainThread(); assertTrue(isMainThread); final boolean[] isMainThreadInThread = {true}; Thread thread = new Thread(new Runnable() { @Override public void run() { isMainThreadInThread[0] = ThreadUtil.isMainThread(); } }); thread.start(); try { thread....
public static boolean isMainThread() { return Looper.myLooper() == Looper.getMainLooper(); }
ThreadUtil { public static boolean isMainThread() { return Looper.myLooper() == Looper.getMainLooper(); } }
ThreadUtil { public static boolean isMainThread() { return Looper.myLooper() == Looper.getMainLooper(); } }
ThreadUtil { public static boolean isMainThread() { return Looper.myLooper() == Looper.getMainLooper(); } static void setNeedDetectRunningThread(boolean sNeedDetect); static void setMainScheduler(Scheduler sMainScheduler); static void setComputationScheduler(Scheduler sComputationScheduler); static Scheduler mainSched...
ThreadUtil { public static boolean isMainThread() { return Looper.myLooper() == Looper.getMainLooper(); } static void setNeedDetectRunningThread(boolean sNeedDetect); static void setMainScheduler(Scheduler sMainScheduler); static void setComputationScheduler(Scheduler sComputationScheduler); static Scheduler mainSched...
@Test public void myProcessName() { String myProcessName = ProcessUtils.myProcessName(ApplicationProvider.getApplicationContext()); Assert.assertEquals("cn.hikyson.godeye.core", myProcessName); String myProcessName2 = ProcessUtils.myProcessName(ApplicationProvider.getApplicationContext()); Assert.assertEquals("cn.hikys...
public static String myProcessName(Context context) { if (sProcessName != null) { return sProcessName; } synchronized (sNameLock) { if (sProcessName != null) { return sProcessName; } sProcessName = obtainProcessName(context); return sProcessName; } }
ProcessUtils { public static String myProcessName(Context context) { if (sProcessName != null) { return sProcessName; } synchronized (sNameLock) { if (sProcessName != null) { return sProcessName; } sProcessName = obtainProcessName(context); return sProcessName; } } }
ProcessUtils { public static String myProcessName(Context context) { if (sProcessName != null) { return sProcessName; } synchronized (sNameLock) { if (sProcessName != null) { return sProcessName; } sProcessName = obtainProcessName(context); return sProcessName; } } }
ProcessUtils { public static String myProcessName(Context context) { if (sProcessName != null) { return sProcessName; } synchronized (sNameLock) { if (sProcessName != null) { return sProcessName; } sProcessName = obtainProcessName(context); return sProcessName; } } static String myProcessName(Context context); static ...
ProcessUtils { public static String myProcessName(Context context) { if (sProcessName != null) { return sProcessName; } synchronized (sNameLock) { if (sProcessName != null) { return sProcessName; } sProcessName = obtainProcessName(context); return sProcessName; } } static String myProcessName(Context context); static ...
@Test public void getCurrentPid() { int pid = ProcessUtils.getCurrentPid(); }
public static int getCurrentPid() { return android.os.Process.myPid(); }
ProcessUtils { public static int getCurrentPid() { return android.os.Process.myPid(); } }
ProcessUtils { public static int getCurrentPid() { return android.os.Process.myPid(); } }
ProcessUtils { public static int getCurrentPid() { return android.os.Process.myPid(); } static String myProcessName(Context context); static int getCurrentPid(); static int getCurrentUid(); static boolean isMainProcess(Application application); }
ProcessUtils { public static int getCurrentPid() { return android.os.Process.myPid(); } static String myProcessName(Context context); static int getCurrentPid(); static int getCurrentUid(); static boolean isMainProcess(Application application); }
@Test public void getCurrentUid() { int uid = ProcessUtils.getCurrentUid(); }
public static int getCurrentUid() { return android.os.Process.myUid(); }
ProcessUtils { public static int getCurrentUid() { return android.os.Process.myUid(); } }
ProcessUtils { public static int getCurrentUid() { return android.os.Process.myUid(); } }
ProcessUtils { public static int getCurrentUid() { return android.os.Process.myUid(); } static String myProcessName(Context context); static int getCurrentPid(); static int getCurrentUid(); static boolean isMainProcess(Application application); }
ProcessUtils { public static int getCurrentUid() { return android.os.Process.myUid(); } static String myProcessName(Context context); static int getCurrentPid(); static int getCurrentUid(); static boolean isMainProcess(Application application); }
@Test public void isMainProcess() { boolean isMainProcess = ProcessUtils.isMainProcess(ApplicationProvider.getApplicationContext()); Assert.assertTrue(isMainProcess); }
public static boolean isMainProcess(Application application) { int pid = android.os.Process.myPid(); String processName = ""; ActivityManager manager = (ActivityManager) application.getSystemService (Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo process : manager.getRunningAppProcesses()) { if (...
ProcessUtils { public static boolean isMainProcess(Application application) { int pid = android.os.Process.myPid(); String processName = ""; ActivityManager manager = (ActivityManager) application.getSystemService (Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo process : manager.getRunningAppProc...
ProcessUtils { public static boolean isMainProcess(Application application) { int pid = android.os.Process.myPid(); String processName = ""; ActivityManager manager = (ActivityManager) application.getSystemService (Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo process : manager.getRunningAppProc...
ProcessUtils { public static boolean isMainProcess(Application application) { int pid = android.os.Process.myPid(); String processName = ""; ActivityManager manager = (ActivityManager) application.getSystemService (Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo process : manager.getRunningAppProc...
ProcessUtils { public static boolean isMainProcess(Application application) { int pid = android.os.Process.myPid(); String processName = ""; ActivityManager manager = (ActivityManager) application.getSystemService (Context.ACTIVITY_SERVICE); for (ActivityManager.RunningAppProcessInfo process : manager.getRunningAppProc...
@Test public void stackTraceToStringArray() { List<String> stackTrace = StacktraceUtil.stackTraceToStringArray(Arrays.asList(Thread.currentThread().getStackTrace())); Assert.assertTrue(String.valueOf(stackTrace).contains(StacktraceUtilTest.class.getSimpleName())); }
public static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements) { List<String> stackList = new ArrayList<>(); for (StackTraceElement traceElement : stackTraceElements) { stackList.add(String.valueOf(traceElement)); } return stackList; }
StacktraceUtil { public static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements) { List<String> stackList = new ArrayList<>(); for (StackTraceElement traceElement : stackTraceElements) { stackList.add(String.valueOf(traceElement)); } return stackList; } }
StacktraceUtil { public static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements) { List<String> stackList = new ArrayList<>(); for (StackTraceElement traceElement : stackTraceElements) { stackList.add(String.valueOf(traceElement)); } return stackList; } }
StacktraceUtil { public static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements) { List<String> stackList = new ArrayList<>(); for (StackTraceElement traceElement : stackTraceElements) { stackList.add(String.valueOf(traceElement)); } return stackList; } static List<String> stackTraceToSt...
StacktraceUtil { public static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements) { List<String> stackList = new ArrayList<>(); for (StackTraceElement traceElement : stackTraceElements) { stackList.add(String.valueOf(traceElement)); } return stackList; } static List<String> stackTraceToSt...
@Test public void getStackTraceOfThread() { List<String> stackTrace = StacktraceUtil.getStackTraceOfThread(Thread.currentThread()); Assert.assertTrue(String.valueOf(stackTrace).contains(StacktraceUtilTest.class.getSimpleName())); }
public static List<String> getStackTraceOfThread(Thread thread) { StackTraceElement[] stackTraceElements = thread.getStackTrace(); return stackTraceToStringArray(Arrays.asList(stackTraceElements)); }
StacktraceUtil { public static List<String> getStackTraceOfThread(Thread thread) { StackTraceElement[] stackTraceElements = thread.getStackTrace(); return stackTraceToStringArray(Arrays.asList(stackTraceElements)); } }
StacktraceUtil { public static List<String> getStackTraceOfThread(Thread thread) { StackTraceElement[] stackTraceElements = thread.getStackTrace(); return stackTraceToStringArray(Arrays.asList(stackTraceElements)); } }
StacktraceUtil { public static List<String> getStackTraceOfThread(Thread thread) { StackTraceElement[] stackTraceElements = thread.getStackTrace(); return stackTraceToStringArray(Arrays.asList(stackTraceElements)); } static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements); static List<S...
StacktraceUtil { public static List<String> getStackTraceOfThread(Thread thread) { StackTraceElement[] stackTraceElements = thread.getStackTrace(); return stackTraceToStringArray(Arrays.asList(stackTraceElements)); } static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements); static List<S...
@Test public void getStringOfThrowable() { String detail = StacktraceUtil.getStringOfThrowable(new Throwable("AndroidGodEye-Exception")); Assert.assertTrue(detail.contains(StacktraceUtilTest.class.getSimpleName())); Assert.assertTrue(detail.contains("AndroidGodEye-Exception")); }
public static String getStringOfThrowable(Throwable throwable) { return throwable.getLocalizedMessage() + "\n" + stackTraceToString(throwable.getStackTrace()); }
StacktraceUtil { public static String getStringOfThrowable(Throwable throwable) { return throwable.getLocalizedMessage() + "\n" + stackTraceToString(throwable.getStackTrace()); } }
StacktraceUtil { public static String getStringOfThrowable(Throwable throwable) { return throwable.getLocalizedMessage() + "\n" + stackTraceToString(throwable.getStackTrace()); } }
StacktraceUtil { public static String getStringOfThrowable(Throwable throwable) { return throwable.getLocalizedMessage() + "\n" + stackTraceToString(throwable.getStackTrace()); } static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements); static List<String> getStackTraceOfThread(Thread th...
StacktraceUtil { public static String getStringOfThrowable(Throwable throwable) { return throwable.getLocalizedMessage() + "\n" + stackTraceToString(throwable.getStackTrace()); } static List<String> stackTraceToStringArray(List<StackTraceElement> stackTraceElements); static List<String> getStackTraceOfThread(Thread th...
@Test public void invokeStaticMethod() { Object result = ReflectUtil.invokeStaticMethod(ReflectUtilTest.class, "testMethod", new Class<?>[]{String.class, int.class, boolean.class}, new Object[]{"AndroidGodEye-String", 10, false}); Assert.assertTrue((Boolean) result); Object result2 = ReflectUtil.invokeStaticMethod(Refl...
public static <T> T invokeStaticMethod(String clsName, String methodName, Class<?>[] argsTypes, Object[] args) { return invokeStaticMethod(getClass(clsName), methodName, argsTypes, args); }
ReflectUtil { public static <T> T invokeStaticMethod(String clsName, String methodName, Class<?>[] argsTypes, Object[] args) { return invokeStaticMethod(getClass(clsName), methodName, argsTypes, args); } }
ReflectUtil { public static <T> T invokeStaticMethod(String clsName, String methodName, Class<?>[] argsTypes, Object[] args) { return invokeStaticMethod(getClass(clsName), methodName, argsTypes, args); } }
ReflectUtil { public static <T> T invokeStaticMethod(String clsName, String methodName, Class<?>[] argsTypes, Object[] args) { return invokeStaticMethod(getClass(clsName), methodName, argsTypes, args); } static T invokeStaticMethod(String clsName, String methodName, Class<?>[] argsTypes, Object[] args); @Nullable stat...
ReflectUtil { public static <T> T invokeStaticMethod(String clsName, String methodName, Class<?>[] argsTypes, Object[] args) { return invokeStaticMethod(getClass(clsName), methodName, argsTypes, args); } static T invokeStaticMethod(String clsName, String methodName, Class<?>[] argsTypes, Object[] args); @Nullable stat...
@Test public void onPageLoadedNotInstalled() { try { GodEye.instance().uninstall(); GodEyeHelper.onPageLoaded(new Activity()); fail(); } catch (UninstallException ignore) { } try { GodEye.instance().uninstall(); GodEyeHelper.onPageLoaded(new Fragment()); fail(); } catch (UninstallException ignore) { } }
public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOA...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
@Test public void noneConfig() { GodEyeConfig config0 = GodEyeConfig.noneConfig(); assertNull(config0.getAppSizeConfig()); assertNull(config0.getBatteryConfig()); assertNull(config0.getCpuConfig()); assertNull(config0.getCrashConfig()); assertNull(config0.getFpsConfig()); assertNull(config0.getHeapConfig()); assertNull...
public static GodEyeConfig noneConfig() { return noneConfigBuilder().build(); }
GodEyeConfig implements Serializable { public static GodEyeConfig noneConfig() { return noneConfigBuilder().build(); } }
GodEyeConfig implements Serializable { public static GodEyeConfig noneConfig() { return noneConfigBuilder().build(); } private GodEyeConfig(); }
GodEyeConfig implements Serializable { public static GodEyeConfig noneConfig() { return noneConfigBuilder().build(); } private GodEyeConfig(); static GodEyeConfigBuilder noneConfigBuilder(); static GodEyeConfig noneConfig(); static GodEyeConfigBuilder defaultConfigBuilder(); static GodEyeConfig defaultConfig(); static...
GodEyeConfig implements Serializable { public static GodEyeConfig noneConfig() { return noneConfigBuilder().build(); } private GodEyeConfig(); static GodEyeConfigBuilder noneConfigBuilder(); static GodEyeConfig noneConfig(); static GodEyeConfigBuilder defaultConfigBuilder(); static GodEyeConfig defaultConfig(); static...
@Test public void defaultConfig() { GodEyeConfig config0 = GodEyeConfig.defaultConfig(); assertEquals(JsonUtil.toJson(new AppSizeConfig()), JsonUtil.toJson(config0.getAppSizeConfig())); assertEquals(JsonUtil.toJson(new BatteryConfig()), JsonUtil.toJson(config0.getBatteryConfig())); assertEquals(JsonUtil.toJson(new CpuC...
public static GodEyeConfig defaultConfig() { return defaultConfigBuilder().build(); }
GodEyeConfig implements Serializable { public static GodEyeConfig defaultConfig() { return defaultConfigBuilder().build(); } }
GodEyeConfig implements Serializable { public static GodEyeConfig defaultConfig() { return defaultConfigBuilder().build(); } private GodEyeConfig(); }
GodEyeConfig implements Serializable { public static GodEyeConfig defaultConfig() { return defaultConfigBuilder().build(); } private GodEyeConfig(); static GodEyeConfigBuilder noneConfigBuilder(); static GodEyeConfig noneConfig(); static GodEyeConfigBuilder defaultConfigBuilder(); static GodEyeConfig defaultConfig(); ...
GodEyeConfig implements Serializable { public static GodEyeConfig defaultConfig() { return defaultConfigBuilder().build(); } private GodEyeConfig(); static GodEyeConfigBuilder noneConfigBuilder(); static GodEyeConfig noneConfig(); static GodEyeConfigBuilder defaultConfigBuilder(); static GodEyeConfig defaultConfig(); ...
@Test public void fromInputStream() { GodEyeConfig config = GodEyeConfigHelper.createFromResource(); assertConfig(config); try { GodEyeConfig.fromInputStream(null); } catch (Throwable ignore) { fail(); } }
public static GodEyeConfig fromInputStream(InputStream is) { GodEyeConfigBuilder builder = GodEyeConfigBuilder.godEyeConfig(); try { if (is == null) { throw new IllegalStateException("GodEyeConfig fromInputStream InputStream is null."); } Element root = DocumentBuilderFactory.newInstance().newDocumentBuilder() .parse(i...
GodEyeConfig implements Serializable { public static GodEyeConfig fromInputStream(InputStream is) { GodEyeConfigBuilder builder = GodEyeConfigBuilder.godEyeConfig(); try { if (is == null) { throw new IllegalStateException("GodEyeConfig fromInputStream InputStream is null."); } Element root = DocumentBuilderFactory.newI...
GodEyeConfig implements Serializable { public static GodEyeConfig fromInputStream(InputStream is) { GodEyeConfigBuilder builder = GodEyeConfigBuilder.godEyeConfig(); try { if (is == null) { throw new IllegalStateException("GodEyeConfig fromInputStream InputStream is null."); } Element root = DocumentBuilderFactory.newI...
GodEyeConfig implements Serializable { public static GodEyeConfig fromInputStream(InputStream is) { GodEyeConfigBuilder builder = GodEyeConfigBuilder.godEyeConfig(); try { if (is == null) { throw new IllegalStateException("GodEyeConfig fromInputStream InputStream is null."); } Element root = DocumentBuilderFactory.newI...
GodEyeConfig implements Serializable { public static GodEyeConfig fromInputStream(InputStream is) { GodEyeConfigBuilder builder = GodEyeConfigBuilder.godEyeConfig(); try { if (is == null) { throw new IllegalStateException("GodEyeConfig fromInputStream InputStream is null."); } Element root = DocumentBuilderFactory.newI...
@Test public void fromAssets() { Application originApplication = ApplicationProvider.getApplicationContext(); Application application = Mockito.spy(originApplication); Application godeyeApplication = GodEye.instance().getApplication(); GodEye.instance().internalInit(application); AssetManager assetManager = Mockito.spy...
public static GodEyeConfig fromAssets(String assetsPath) { InputStream is = null; try { is = GodEye.instance().getApplication().getAssets().open(assetsPath); return fromInputStream(is); } catch (Exception e) { L.e(e); return GodEyeConfig.noneConfig(); } finally { IoUtil.closeSilently(is); } }
GodEyeConfig implements Serializable { public static GodEyeConfig fromAssets(String assetsPath) { InputStream is = null; try { is = GodEye.instance().getApplication().getAssets().open(assetsPath); return fromInputStream(is); } catch (Exception e) { L.e(e); return GodEyeConfig.noneConfig(); } finally { IoUtil.closeSilen...
GodEyeConfig implements Serializable { public static GodEyeConfig fromAssets(String assetsPath) { InputStream is = null; try { is = GodEye.instance().getApplication().getAssets().open(assetsPath); return fromInputStream(is); } catch (Exception e) { L.e(e); return GodEyeConfig.noneConfig(); } finally { IoUtil.closeSilen...
GodEyeConfig implements Serializable { public static GodEyeConfig fromAssets(String assetsPath) { InputStream is = null; try { is = GodEye.instance().getApplication().getAssets().open(assetsPath); return fromInputStream(is); } catch (Exception e) { L.e(e); return GodEyeConfig.noneConfig(); } finally { IoUtil.closeSilen...
GodEyeConfig implements Serializable { public static GodEyeConfig fromAssets(String assetsPath) { InputStream is = null; try { is = GodEye.instance().getApplication().getAssets().open(assetsPath); return fromInputStream(is); } catch (Exception e) { L.e(e); return GodEyeConfig.noneConfig(); } finally { IoUtil.closeSilen...
@Test public void isDebugging() { long startTime = SystemClock.elapsedRealtime(); for (int i = 0; i < 1000; i++) { AndroidDebug.isDebugging(); } Log4Test.d(String.format("AndroidDebugTest isDebugging cost %sms for 1000 times.", SystemClock.elapsedRealtime() - startTime)); }
public static boolean isDebugging() { return Debug.isDebuggerConnected(); }
AndroidDebug { public static boolean isDebugging() { return Debug.isDebuggerConnected(); } }
AndroidDebug { public static boolean isDebugging() { return Debug.isDebuggerConnected(); } }
AndroidDebug { public static boolean isDebugging() { return Debug.isDebuggerConnected(); } static boolean isDebugging(); }
AndroidDebug { public static boolean isDebugging() { return Debug.isDebuggerConnected(); } static boolean isDebugging(); }
@Config(sdk = Build.VERSION_CODES.O) @Test @Ignore("local") public void noticeHigherThanO() { notice(); }
public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); }
Notifier { public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); } }
Notifier { public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); } }
Notifier { public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); } static Notification create(Context context, Config config); static int createNoticeId(); static int notice(Context context, Config config); static int notice(Context context, int i...
Notifier { public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); } static Notification create(Context context, Config config); static int createNoticeId(); static int notice(Context context, Config config); static int notice(Context context, int i...
@Config(sdk = Build.VERSION_CODES.LOLLIPOP) @Test public void noticeLowerThanO() { notice(); }
public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); }
Notifier { public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); } }
Notifier { public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); } }
Notifier { public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); } static Notification create(Context context, Config config); static int createNoticeId(); static int notice(Context context, Config config); static int notice(Context context, int i...
Notifier { public static int notice(Context context, Config config) { return notice(context, createNoticeId(), create(context, config)); } static Notification create(Context context, Config config); static int createNoticeId(); static int notice(Context context, Config config); static int notice(Context context, int i...
@Test public void onPageLoadedWhenNotCreated() { GodEye.instance().uninstall(); GodEye.instance().install(GodEyeConfig.noneConfigBuilder().withPageloadConfig(new PageloadConfig()).build()); try { TestObserver<PageLifecycleEventInfo> testObserver = GodEye.instance().<Pageload, PageLifecycleEventInfo>moduleObservable(God...
public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOA...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
@Test public void onPageLoadedSuccessForActivity() { try { GodEye.instance().uninstall(); GodEye.instance().install(GodEyeConfig.noneConfigBuilder().withPageloadConfig(new PageloadConfig()).build()); ActivityController<Test1Activity> activityController = Robolectric.buildActivity(Test1Activity.class).create().start().r...
public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOA...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
@Test public void onPageLoadedSuccessWithFragment() { try { GodEye.instance().uninstall(); GodEye.instance().install(GodEyeConfig.noneConfigBuilder().withPageloadConfig(new PageloadConfig()).build()); ActivityController<Test2Activity> activityController = Robolectric.buildActivity(Test2Activity.class).create().start()....
public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOA...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
GodEyeHelper { public static void onPageLoaded(Object page) throws UninstallException { if (page instanceof Fragment) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Load((Fragment) page); } else if (page instanceof android.app.Fragment) { GodEye.instance().<Pageload>getModule(GodEye.Mod...
@Test public void onFragmentPageVisibilityChangeWhenIllegal() { try { GodEye.instance().uninstall(); GodEyeHelper.onFragmentPageVisibilityChange(null, true); fail(); } catch (RuntimeException ignore) { } catch (UninstallException e) { fail(); } }
public static void onFragmentPageVisibilityChange(Object fragmentPage, boolean visible) throws UninstallException { if (fragmentPage instanceof Fragment) { if (visible) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Show((Fragment) fragmentPage); } else { GodEye.instance().<Pageload>get...
GodEyeHelper { public static void onFragmentPageVisibilityChange(Object fragmentPage, boolean visible) throws UninstallException { if (fragmentPage instanceof Fragment) { if (visible) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Show((Fragment) fragmentPage); } else { GodEye.instance(...
GodEyeHelper { public static void onFragmentPageVisibilityChange(Object fragmentPage, boolean visible) throws UninstallException { if (fragmentPage instanceof Fragment) { if (visible) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Show((Fragment) fragmentPage); } else { GodEye.instance(...
GodEyeHelper { public static void onFragmentPageVisibilityChange(Object fragmentPage, boolean visible) throws UninstallException { if (fragmentPage instanceof Fragment) { if (visible) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Show((Fragment) fragmentPage); } else { GodEye.instance(...
GodEyeHelper { public static void onFragmentPageVisibilityChange(Object fragmentPage, boolean visible) throws UninstallException { if (fragmentPage instanceof Fragment) { if (visible) { GodEye.instance().<Pageload>getModule(GodEye.ModuleName.PAGELOAD).onFragmentV4Show((Fragment) fragmentPage); } else { GodEye.instance(...
@Test public void testCustomizeServletContainer() { env.setActiveProfiles(JHipsterConstants.SPRING_PROFILE_PRODUCTION); UndertowEmbeddedServletContainerFactory container = new UndertowEmbeddedServletContainerFactory(); webConfigurer.customize(container); assertThat(container.getMimeMappings().get("abs")).isEqualTo("aud...
@Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;charset=utf-8"); container.setMimeMappings(mappings); setLocationForStaticAssets(container); ...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
WebConfigurer implements ServletContextInitializer, EmbeddedServletContainerCustomizer { @Override public void customize(ConfigurableEmbeddedServletContainer container) { MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT); mappings.add("html", "text/html;charset=utf-8"); mappings.add("json", "text/html;char...
@Test public void testGetMediaMimeType_fromValidCodecs_returnsCorrectMimeType() { assertThat(MimeTypes.getMediaMimeType("avc1")).isEqualTo(MimeTypes.VIDEO_H264); assertThat(MimeTypes.getMediaMimeType("avc1.42E01E")).isEqualTo(MimeTypes.VIDEO_H264); assertThat(MimeTypes.getMediaMimeType("avc1.42E01F")).isEqualTo(MimeTyp...
public static @Nullable String getMediaMimeType(@Nullable String codec) { if (codec == null) { return null; } codec = Util.toLowerInvariant(codec.trim()); if (codec.startsWith("avc1") || codec.startsWith("avc3")) { return MimeTypes.VIDEO_H264; } else if (codec.startsWith("hev1") || codec.startsWith("hvc1")) { return Mi...
MimeTypes { public static @Nullable String getMediaMimeType(@Nullable String codec) { if (codec == null) { return null; } codec = Util.toLowerInvariant(codec.trim()); if (codec.startsWith("avc1") || codec.startsWith("avc3")) { return MimeTypes.VIDEO_H264; } else if (codec.startsWith("hev1") || codec.startsWith("hvc1"))...
MimeTypes { public static @Nullable String getMediaMimeType(@Nullable String codec) { if (codec == null) { return null; } codec = Util.toLowerInvariant(codec.trim()); if (codec.startsWith("avc1") || codec.startsWith("avc3")) { return MimeTypes.VIDEO_H264; } else if (codec.startsWith("hev1") || codec.startsWith("hvc1"))...
MimeTypes { public static @Nullable String getMediaMimeType(@Nullable String codec) { if (codec == null) { return null; } codec = Util.toLowerInvariant(codec.trim()); if (codec.startsWith("avc1") || codec.startsWith("avc3")) { return MimeTypes.VIDEO_H264; } else if (codec.startsWith("hev1") || codec.startsWith("hvc1"))...
MimeTypes { public static @Nullable String getMediaMimeType(@Nullable String codec) { if (codec == null) { return null; } codec = Util.toLowerInvariant(codec.trim()); if (codec.startsWith("avc1") || codec.startsWith("avc3")) { return MimeTypes.VIDEO_H264; } else if (codec.startsWith("hev1") || codec.startsWith("hvc1"))...
@Test public void testGetMimeTypeFromMp4ObjectType_forValidObjectType_returnsCorrectMimeType() { assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0x60)).isEqualTo(MimeTypes.VIDEO_MPEG2); assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0x61)).isEqualTo(MimeTypes.VIDEO_MPEG2); assertThat(MimeTypes.getMimeTypeFromMp4Ob...
@Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO_MPEG2; case...
MimeTypes { @Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO...
MimeTypes { @Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO...
MimeTypes { @Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO...
MimeTypes { @Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO...
@Test public void testGetMimeTypeFromMp4ObjectType_forInvalidObjectType_returnsNull() { assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0)).isNull(); assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0x600)).isNull(); assertThat(MimeTypes.getMimeTypeFromMp4ObjectType(0x01)).isNull(); assertThat(MimeTypes.getMimeTypeF...
@Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO_MPEG2; case...
MimeTypes { @Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO...
MimeTypes { @Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO...
MimeTypes { @Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO...
MimeTypes { @Nullable public static String getMimeTypeFromMp4ObjectType(int objectType) { switch (objectType) { case 0x20: return MimeTypes.VIDEO_MP4V; case 0x21: return MimeTypes.VIDEO_H264; case 0x23: return MimeTypes.VIDEO_H265; case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: return MimeTypes.VIDEO...
@Test public void trimsStartFrames() throws Exception { configureDefaultAudioSink( CHANNEL_COUNT_STEREO, TRIM_100_MS_FRAME_COUNT, 0); defaultAudioSink.handleBuffer(createDefaultSilenceBuffer(), 0); assertThat(arrayAudioBufferSink.output) .hasLength( (BYTES_PER_FRAME_16_BIT * CHANNEL_COUNT_STEREO * (SAMPLE_RATE_44_1 - T...
@Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if (!drainAudioProcessorsToEndOfStream()) ...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
@Test public void trimsEndFrames() throws Exception { configureDefaultAudioSink( CHANNEL_COUNT_STEREO, 0, TRIM_10_MS_FRAME_COUNT); defaultAudioSink.handleBuffer(createDefaultSilenceBuffer(), 0); assertThat(arrayAudioBufferSink.output) .hasLength( (BYTES_PER_FRAME_16_BIT * CHANNEL_COUNT_STEREO * (SAMPLE_RATE_44_1 - TRIM...
@Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if (!drainAudioProcessorsToEndOfStream()) ...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
@Test public void trimsStartAndEndFrames() throws Exception { configureDefaultAudioSink( CHANNEL_COUNT_STEREO, TRIM_100_MS_FRAME_COUNT, TRIM_10_MS_FRAME_COUNT); defaultAudioSink.handleBuffer(createDefaultSilenceBuffer(), 0); assertThat(arrayAudioBufferSink.output) .hasLength( (BYTES_PER_FRAME_16_BIT * CHANNEL_COUNT_STE...
@Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if (!drainAudioProcessorsToEndOfStream()) ...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
DefaultAudioSink implements AudioSink { @Override @SuppressWarnings("ReferenceEquality") public boolean handleBuffer(ByteBuffer buffer, long presentationTimeUs) throws InitializationException, WriteException { Assertions.checkArgument(inputBuffer == null || buffer == inputBuffer); if (pendingConfiguration != null) { if...
@Config(minSdk = OLDEST_SDK, maxSdk = 20) @Test public void doesNotSupportFloatOutputBeforeApi21() { assertThat(defaultAudioSink.supportsOutput(CHANNEL_COUNT_STEREO, C.ENCODING_PCM_FLOAT)) .isFalse(); }
@Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding) && (channelCount == Format.NO_VALUE || ...
DefaultAudioSink implements AudioSink { @Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding)...
DefaultAudioSink implements AudioSink { @Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding)...
DefaultAudioSink implements AudioSink { @Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding)...
DefaultAudioSink implements AudioSink { @Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding)...
@Config(minSdk = 21, maxSdk = TARGET_SDK) @Test public void supportsFloatOutputFromApi21() { assertThat(defaultAudioSink.supportsOutput(CHANNEL_COUNT_STEREO, C.ENCODING_PCM_FLOAT)) .isTrue(); }
@Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding) && (channelCount == Format.NO_VALUE || ...
DefaultAudioSink implements AudioSink { @Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding)...
DefaultAudioSink implements AudioSink { @Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding)...
DefaultAudioSink implements AudioSink { @Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding)...
DefaultAudioSink implements AudioSink { @Override public boolean supportsOutput(int channelCount, @C.Encoding int encoding) { if (Util.isEncodingLinearPcm(encoding)) { return encoding != C.ENCODING_PCM_FLOAT || Util.SDK_INT >= 21; } else { return audioCapabilities != null && audioCapabilities.supportsEncoding(encoding)...
@Test public void validUri() { Hook cut = new Hook("http: assertTrue(cut.isValid()); }
boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; }
Hook { boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; } }
Hook { boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; } Hook(String uri, FtpEventName command); Hook(); }
Hook { boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; } Hook(String uri, FtpEventName command); Hook(); long getId(); String getUri(); FtpEventName getCommand(); void setCommand(FtpEventName command); }
Hook { boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; } Hook(String uri, FtpEventName command); Hook(); long getId(); String getUri(); FtpEventName getCommand(); void setCommand(FtpEventName command); static final String findByCommand; }
@Test public void invalidUri() { Hook cut = new Hook("asdf", FtpEventName.EVERYTHING); assertFalse(cut.isValid()); }
boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; }
Hook { boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; } }
Hook { boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; } Hook(String uri, FtpEventName command); Hook(); }
Hook { boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; } Hook(String uri, FtpEventName command); Hook(); long getId(); String getUri(); FtpEventName getCommand(); void setCommand(FtpEventName command); }
Hook { boolean isValid() { try { new URL(this.uri); } catch (MalformedURLException ex) { return false; } return this.command != null; } Hook(String uri, FtpEventName command); Hook(); long getId(); String getUri(); FtpEventName getCommand(); void setCommand(FtpEventName command); static final String findByCommand; }
@Test public void testReplacement() { RegexReplacement rr = new RegexReplacement("<version.light[a-z-]+4j>\\d*\\.\\d*\\.\\d*</version.light[a-z-]+4j>", "1.5.5", "1.5.6"); String result = rr.replace("<version.light-4j>1.5.5</version.light-4j>"); System.out.println(result); Assert.assertEquals("<version.light-4j>1.5.6</v...
public String replace(String in) { boolean matches = regex.matcher(in).find(); if(matches) { return in.replaceAll(original, replacement); } else { return in; } }
RegexReplacement { public String replace(String in) { boolean matches = regex.matcher(in).find(); if(matches) { return in.replaceAll(original, replacement); } else { return in; } } }
RegexReplacement { public String replace(String in) { boolean matches = regex.matcher(in).find(); if(matches) { return in.replaceAll(original, replacement); } else { return in; } } RegexReplacement(String regex, String original, String replacement); }
RegexReplacement { public String replace(String in) { boolean matches = regex.matcher(in).find(); if(matches) { return in.replaceAll(original, replacement); } else { return in; } } RegexReplacement(String regex, String original, String replacement); boolean match(String in); String replace(String in); }
RegexReplacement { public String replace(String in) { boolean matches = regex.matcher(in).find(); if(matches) { return in.replaceAll(original, replacement); } else { return in; } } RegexReplacement(String regex, String original, String replacement); boolean match(String in); String replace(String in); }
@Test public void testSimpleCommand() throws IOException, InterruptedException { List<String> commands = new ArrayList<String>(); commands.add("/bin/sh"); commands.add("-c"); commands.add("ls -l /var/tmp | wc -l"); Executor executor = SingletonServiceFactory.getBean(Executor.class); int result = executor.execute(comman...
@Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStream stdOutput = process.getOutputStream(...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
@Test public void testLsCommand() throws IOException, InterruptedException { List<String> commands = new ArrayList<>(); commands.add("ls"); Executor executor = SingletonServiceFactory.getBean(Executor.class); int result = executor.execute(commands, new File(System.getProperty("user.home"))); }
@Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStream stdOutput = process.getOutputStream(...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
@Test public void testGitClone() throws IOException, InterruptedException { List<String> commands = new ArrayList<>(); commands.add("bash"); commands.add("-c"); commands.add("rm -rf light-4j"); Executor executor = SingletonServiceFactory.getBean(Executor.class); int result = executor.execute(commands, new File(System.g...
@Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStream stdOutput = process.getOutputStream(...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
CommandExecutor implements Executor { @Override public int execute(final List<String> commandInformation, File workingDir) throws IOException, InterruptedException { int exitValue = -99; try { ProcessBuilder pb = new ProcessBuilder(commandInformation); pb.directory(workingDir); Process process = pb.start(); OutputStrea...
@Test public void testPutAll() { ExtendedProperties newProps = new ExtendedProperties(); newProps.putAll(props); assertProps(newProps); }
@Override public void putAll(final Map<? extends String, ? extends String> map) { for (Entry<? extends String, ? extends String> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public void putAll(final Map<? extends String, ? extends String> map) { for (Entry<? extends String, ? extends String> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } } }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public void putAll(final Map<? extends String, ? extends String> map) { for (Entry<? extends String, ? extends String> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } } ExtendedProperties(); ExtendedProperties(fin...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public void putAll(final Map<? extends String, ? extends String> map) { for (Entry<? extends String, ? extends String> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } } ExtendedProperties(); ExtendedProperties(fin...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public void putAll(final Map<? extends String, ? extends String> map) { for (Entry<? extends String, ? extends String> entry : map.entrySet()) { put(entry.getKey(), entry.getValue()); } } ExtendedProperties(); ExtendedProperties(fin...
@Test public void testGet() throws IOException { Configuration config = new Configuration(Charsets.UTF_8); Reader reader = null; try { reader = Resources.asCharSource(Resources.getResource("test_capabilities.properties"), Charsets.UTF_8) .openStream(); config.load(reader); CapabilitiesProvider provider = new Capabiliti...
@Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { String key = entry.getKey(); Matcher matcher = CAPABILITIES_PREFIX_PATTERN.matche...
CapabilitiesProvider implements Provider<Map<String, DesiredCapabilities>> { @Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { Stri...
CapabilitiesProvider implements Provider<Map<String, DesiredCapabilities>> { @Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { Stri...
CapabilitiesProvider implements Provider<Map<String, DesiredCapabilities>> { @Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { Stri...
CapabilitiesProvider implements Provider<Map<String, DesiredCapabilities>> { @Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { Stri...
@Test public void testGetWithProxyOnly() { Configuration config = new Configuration(Charsets.UTF_8); String proxyString = "localhost:8080"; config.put("webdriver.proxy.httpProxy", proxyString); CapabilitiesProvider provider = new CapabilitiesProvider(Providers.of(config)); Capabilities capabilities = provider.get().get...
@Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { String key = entry.getKey(); Matcher matcher = CAPABILITIES_PREFIX_PATTERN.matche...
CapabilitiesProvider implements Provider<Map<String, DesiredCapabilities>> { @Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { Stri...
CapabilitiesProvider implements Provider<Map<String, DesiredCapabilities>> { @Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { Stri...
CapabilitiesProvider implements Provider<Map<String, DesiredCapabilities>> { @Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { Stri...
CapabilitiesProvider implements Provider<Map<String, DesiredCapabilities>> { @Override public Map<String, DesiredCapabilities> get() { Configuration config = configProvider.get(); Map<String, Map<String, List<JFunkCapability>>> capabilitiesMap = newHashMap(); for (Entry<String, String> entry : config.entrySet()) { Stri...
@Test public void stringMustExistCaseSensitively() { CheckHtml4String checkHtml4String = new CheckHtml4String("Case-Sensitive"); checkHtml4String.setWebDriver(webDriver); checkHtml4String.execute(); }
@Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource.contains(string) : containsIgnoreCase(pag...
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
@Test public void stringMustExistNotCaseSensitively() { CheckHtml4String checkHtml4String = new CheckHtml4String("case-sensitive", false); checkHtml4String.setWebDriver(webDriver); checkHtml4String.execute(); }
@Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource.contains(string) : containsIgnoreCase(pag...
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
@Test public void stringMustNotExistCaseSensitively() { CheckHtml4String checkHtml4String = new CheckHtml4String("foo", true, false); checkHtml4String.setWebDriver(webDriver); checkHtml4String.execute(); }
@Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource.contains(string) : containsIgnoreCase(pag...
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
@Test public void stringMustNotExistNotCaseSensitively() { CheckHtml4String checkHtml4String = new CheckHtml4String("foo", false, false); checkHtml4String.setWebDriver(webDriver); checkHtml4String.execute(); }
@Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource.contains(string) : containsIgnoreCase(pag...
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
CheckHtml4String extends WebDriverStep { @Override public void execute() { log.info("String '{}' must {}exist in the page source. Search is {}case-sensitive.", string, mustExist ? "" : "not ", caseSensitive ? "" : "not "); String pageSource = getWebDriver().getPageSource(); boolean outcome = caseSensitive ? pageSource....
@Test public void testHasMoreData() { ExcelDataSource dataSource = createDataSource("src/test/resources/rowbased.xlsx", DataOrientation.rowbased); String dataSetKey = "sheet_0"; for (int i = 0; i < 3; ++i) { if (dataSource.hasMoreData(dataSetKey)) { dataSource.getNextDataSet(dataSetKey); } } assertThat(dataSource.hasMo...
@Override public boolean hasMoreData(final String dataSetKey) { for (ExcelFile excelFile : getExcelFiles()) { Map<String, List<Map<String, String>>> data = excelFile.getData(); List<Map<String, String>> dataList = data.get(dataSetKey); if (dataList != null) { MutableInt counter = dataSetIndices.get(dataSetKey); int siz...
ExcelDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { for (ExcelFile excelFile : getExcelFiles()) { Map<String, List<Map<String, String>>> data = excelFile.getData(); List<Map<String, String>> dataList = data.get(dataSetKey); if (dataList != null) { MutableInt counter ...
ExcelDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { for (ExcelFile excelFile : getExcelFiles()) { Map<String, List<Map<String, String>>> data = excelFile.getData(); List<Map<String, String>> dataList = data.get(dataSetKey); if (dataList != null) { MutableInt counter ...
ExcelDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { for (ExcelFile excelFile : getExcelFiles()) { Map<String, List<Map<String, String>>> data = excelFile.getData(); List<Map<String, String>> dataList = data.get(dataSetKey); if (dataList != null) { MutableInt counter ...
ExcelDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { for (ExcelFile excelFile : getExcelFiles()) { Map<String, List<Map<String, String>>> data = excelFile.getData(); List<Map<String, String>> dataList = data.get(dataSetKey); if (dataList != null) { MutableInt counter ...
@Test public void testHasMoreData() { int i = 0; while (ds.hasMoreData("bar")) { ds.getNextDataSet("bar"); ++i; } Assert.assertEquals(i, 2); i = 0; while (ds.hasMoreData("foo")) { ds.getNextDataSet("foo"); ++i; } Assert.assertEquals(i, 2); }
@Override public boolean hasMoreData(final String dataSetKey) { if (getCsvFiles().containsKey(dataSetKey)) { CsvFile csvFile = getCsvFiles().get(dataSetKey); if (csvFile.lines == null) { try { csvFile.load(); } catch (IOException e) { throw new IllegalArgumentException("Could not load CSV file " + csvFile.fileName, e);...
CsvDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { if (getCsvFiles().containsKey(dataSetKey)) { CsvFile csvFile = getCsvFiles().get(dataSetKey); if (csvFile.lines == null) { try { csvFile.load(); } catch (IOException e) { throw new IllegalArgumentException("Could not ...
CsvDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { if (getCsvFiles().containsKey(dataSetKey)) { CsvFile csvFile = getCsvFiles().get(dataSetKey); if (csvFile.lines == null) { try { csvFile.load(); } catch (IOException e) { throw new IllegalArgumentException("Could not ...
CsvDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { if (getCsvFiles().containsKey(dataSetKey)) { CsvFile csvFile = getCsvFiles().get(dataSetKey); if (csvFile.lines == null) { try { csvFile.load(); } catch (IOException e) { throw new IllegalArgumentException("Could not ...
CsvDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { if (getCsvFiles().containsKey(dataSetKey)) { CsvFile csvFile = getCsvFiles().get(dataSetKey); if (csvFile.lines == null) { try { csvFile.load(); } catch (IOException e) { throw new IllegalArgumentException("Could not ...
@Test public void testDataSetsAvailable() { DataSet data1 = ds.getNextDataSet("test1"); Assert.assertNotNull(data1); DataSet data2 = ds.getNextDataSet("test2"); Assert.assertNotNull(data2); }
@Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; }
ContainerDataSource implements DataSource { @Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; } }
ContainerDataSource implements DataSource { @Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; } @Inject ContainerDat...
ContainerDataSource implements DataSource { @Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; } @Inject ContainerDat...
ContainerDataSource implements DataSource { @Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; } @Inject ContainerDat...
@Test public void testDataSetNotAvailable() { DataSet data = ds.getNextDataSet("test3"); Assert.assertNull(data); }
@Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; }
ContainerDataSource implements DataSource { @Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; } }
ContainerDataSource implements DataSource { @Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; } @Inject ContainerDat...
ContainerDataSource implements DataSource { @Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; } @Inject ContainerDat...
ContainerDataSource implements DataSource { @Override public DataSet getNextDataSet(final String key) { List<? extends DataSource> dataSources = dataSourcesProvider.get(); for (DataSource ds : dataSources) { DataSet data = ds.getNextDataSet(key); if (data != null) { return data; } } return null; } @Inject ContainerDat...
@Test public void testToProperties() { Properties legacyProps = props.toProperties(); Assert.assertEquals(legacyProps.size(), 7); Assert.assertEquals(legacyProps.getProperty("prop1"), "öäü~@€^°é"); Assert.assertEquals(legacyProps.getProperty("prop2"), "testtest"); Assert.assertEquals(legacyProps.getProperty("prop3="), ...
public Properties toProperties() { Properties props = new Properties(); for (String key : keySet()) { props.put(key, get(key)); } return props; }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { public Properties toProperties() { Properties props = new Properties(); for (String key : keySet()) { props.put(key, get(key)); } return props; } }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { public Properties toProperties() { Properties props = new Properties(); for (String key : keySet()) { props.put(key, get(key)); } return props; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { public Properties toProperties() { Properties props = new Properties(); for (String key : keySet()) { props.put(key, get(key)); } return props; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedPro...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { public Properties toProperties() { Properties props = new Properties(); for (String key : keySet()) { props.put(key, get(key)); } return props; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedPro...
@Test(dataProvider = "dataSources") public void testHasMoreData(final DataSource ds) { Assert.assertTrue(ds.hasMoreData("countryId")); Assert.assertTrue(ds.hasMoreData("languageId")); Assert.assertTrue(ds.hasMoreData("searchTerm")); }
@Override public boolean hasMoreData(final String dataSetKey) { return true; }
ArchiveDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { return true; } }
ArchiveDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { return true; } @Inject ArchiveDataSource(final Configuration configuration); }
ArchiveDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { return true; } @Inject ArchiveDataSource(final Configuration configuration); @Override boolean hasMoreData(final String dataSetKey); @Override void doReset(); }
ArchiveDataSource extends BaseDataSource { @Override public boolean hasMoreData(final String dataSetKey) { return true; } @Inject ArchiveDataSource(final Configuration configuration); @Override boolean hasMoreData(final String dataSetKey); @Override void doReset(); }
@Test public void testMinimum() { String result = generator.generateLoremIpsum(1); assertEquals(result, "L"); }
public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(loremIpsum.substring(0,...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
@Test public void testMaximum() { String result = generator.generateLoremIpsum(loremIpsum.length()); assertEquals(result, loremIpsum); }
public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(loremIpsum.substring(0,...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
@Test public void testMultiple() { String result = generator.generateLoremIpsum(10000); assertEquals(result.length(), 10000); }
public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(loremIpsum.substring(0,...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
LoremIpsumGenerator { public String generateLoremIpsum(final int length) { if (loremLength < length) { int multiplier = length / loremLength; int remainder = length % loremLength; StrBuilder sb = new StrBuilder(multiplier * length + remainder); for (int i = 0; i < multiplier; ++i) { sb.append(loremIpsum); } sb.append(l...
@Test public void testMinimum() { String value = field.getString(new FieldCase(1)); assertEquals(value, "L"); }
@Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multiplier = size / loremLength; int ...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
@Test public void testMaximum() { String value = field.getString(new FieldCase(100)); assertEquals(value, loremIpsum.substring(0, 100)); }
@Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multiplier = size / loremLength; int ...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
@Test public void testVeryLongOne() { String value = field.getString(new FieldCase(10000)); assertEquals(value.length(), 10000); }
@Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multiplier = size / loremLength; int ...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
LoremIpsumField extends Field { @Override public String getString(final FieldCase c) { int size = c.getSize(); if (size == FieldCase.JUST_ABOVE_MAX) { size++; } else if (size == FieldCase.JUST_BELOW_MIN) { size--; } if (size <= 0) { return ""; } int loremLength = loremIpsum.length(); if (loremLength < size) { int multi...
@Test public void testExistingValues() { dataSource.getNextDataSet("test"); String testValue1 = adapter.get("test testKey1"); Assert.assertEquals(testValue1, "testValue1"); String testValue2 = adapter.get("test testKey2"); Assert.assertEquals(testValue2, "testValue2"); }
@Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No data set available: '" + dsKey + "'. Forgot to call 'gen...
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No d...
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No d...
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No d...
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No d...
@Test public void testNulls() { dataSource.getNextDataSet("test"); String testValue1 = adapter.get("keyWithoutValue"); Assert.assertNull(testValue1); String testValue2 = adapter.get("nonExistingDsKey foo"); Assert.assertNull(testValue2); }
@Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No data set available: '" + dsKey + "'. Forgot to call 'gen...
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No d...
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No d...
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No d...
DataSetAdapter extends ForwardingMap<String, String> { @Override public String get(final Object key) { String[] pair = getKeysPair(key); if (pair.length == 1) { return null; } String dsKey = pair[0]; DataSet currentDataSet = dataSourceProvider.get().getCurrentDataSet(dsKey); if (currentDataSet == null) { log.warn("No d...
@Test(groups = "excludeFromCI") public void testCaptureScreen() throws IOException { testFileOrDir = File.createTempFile("jFunkScreenCapture", ".png"); ScreenCapturer.captureScreen(testFileOrDir); assertThat(testFileOrDir).exists(); }
public static void captureScreen(final File file) { Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); captureScreenRect(file, rectangle); }
ScreenCapturer { public static void captureScreen(final File file) { Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); captureScreenRect(file, rectangle); } }
ScreenCapturer { public static void captureScreen(final File file) { Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); captureScreenRect(file, rectangle); } @Inject ScreenCapturer(@ModuleArchiveDir final Provider<File> moduleArchiveDirProvider, final Set<Class<? extends AbstractBaseE...
ScreenCapturer { public static void captureScreen(final File file) { Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); captureScreenRect(file, rectangle); } @Inject ScreenCapturer(@ModuleArchiveDir final Provider<File> moduleArchiveDirProvider, final Set<Class<? extends AbstractBaseE...
ScreenCapturer { public static void captureScreen(final File file) { Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()); captureScreenRect(file, rectangle); } @Inject ScreenCapturer(@ModuleArchiveDir final Provider<File> moduleArchiveDirProvider, final Set<Class<? extends AbstractBaseE...
@Test public void testClone() { ExtendedProperties clone = props.clone(); assertProps(clone); }
@Override public ExtendedProperties clone() { try { ExtendedProperties clone = (ExtendedProperties) super.clone(); clone.keySet = null; clone.entrySet = null; clone.values = null; clone.propsMap = new ConcurrentHashMap<String, String>(propsMap); if (defaults != null) { if (defaults instanceof ExtendedProperties) { clon...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public ExtendedProperties clone() { try { ExtendedProperties clone = (ExtendedProperties) super.clone(); clone.keySet = null; clone.entrySet = null; clone.values = null; clone.propsMap = new ConcurrentHashMap<String, String>(propsMap...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public ExtendedProperties clone() { try { ExtendedProperties clone = (ExtendedProperties) super.clone(); clone.keySet = null; clone.entrySet = null; clone.values = null; clone.propsMap = new ConcurrentHashMap<String, String>(propsMap...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public ExtendedProperties clone() { try { ExtendedProperties clone = (ExtendedProperties) super.clone(); clone.keySet = null; clone.entrySet = null; clone.values = null; clone.propsMap = new ConcurrentHashMap<String, String>(propsMap...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public ExtendedProperties clone() { try { ExtendedProperties clone = (ExtendedProperties) super.clone(); clone.keySet = null; clone.entrySet = null; clone.values = null; clone.propsMap = new ConcurrentHashMap<String, String>(propsMap...
@Test(dataProvider = "exception", groups = "excludeFromCI") public void testHandleEvent(final Exception ex) { testFileOrDir = new File(System.getProperty("java.io.tmpdir"), UUID.randomUUID().toString()); MutableInt counter = new MutableInt(); Set<Class<? extends AbstractBaseEvent>> eventClasses = ImmutableSet.<Class<? ...
@Subscribe @AllowConcurrentEvents public void handleEvent(final AbstractBaseEvent event) { Class<? extends AbstractBaseEvent> clazz = event.getClass(); boolean errorCapture = captureScreenOnError(event); boolean eventConfigured = screenCaptureEvents.contains(clazz); if (eventConfigured || errorCapture) { String screens...
ScreenCapturer { @Subscribe @AllowConcurrentEvents public void handleEvent(final AbstractBaseEvent event) { Class<? extends AbstractBaseEvent> clazz = event.getClass(); boolean errorCapture = captureScreenOnError(event); boolean eventConfigured = screenCaptureEvents.contains(clazz); if (eventConfigured || errorCapture)...
ScreenCapturer { @Subscribe @AllowConcurrentEvents public void handleEvent(final AbstractBaseEvent event) { Class<? extends AbstractBaseEvent> clazz = event.getClass(); boolean errorCapture = captureScreenOnError(event); boolean eventConfigured = screenCaptureEvents.contains(clazz); if (eventConfigured || errorCapture)...
ScreenCapturer { @Subscribe @AllowConcurrentEvents public void handleEvent(final AbstractBaseEvent event) { Class<? extends AbstractBaseEvent> clazz = event.getClass(); boolean errorCapture = captureScreenOnError(event); boolean eventConfigured = screenCaptureEvents.contains(clazz); if (eventConfigured || errorCapture)...
ScreenCapturer { @Subscribe @AllowConcurrentEvents public void handleEvent(final AbstractBaseEvent event) { Class<? extends AbstractBaseEvent> clazz = event.getClass(); boolean errorCapture = captureScreenOnError(event); boolean eventConfigured = screenCaptureEvents.contains(clazz); if (eventConfigured || errorCapture)...
@Test public void testCsvDataProcessor() { final Configuration config = new Configuration(Charsets.UTF_8); config.put("foo", "foovalue"); final DataSource dataSource = new TestDataSource(config); CsvDataProcessor csvProc = new CsvDataProcessor(Providers.of(config), Providers.of(dataSource)); final MutableInt counter = ...
@Inject CsvDataProcessor(final Provider<Configuration> configProvider, final Provider<DataSource> dataSourceProvider) { this.configProvider = configProvider; this.dataSourceProvider = dataSourceProvider; }
CsvDataProcessor { @Inject CsvDataProcessor(final Provider<Configuration> configProvider, final Provider<DataSource> dataSourceProvider) { this.configProvider = configProvider; this.dataSourceProvider = dataSourceProvider; } }
CsvDataProcessor { @Inject CsvDataProcessor(final Provider<Configuration> configProvider, final Provider<DataSource> dataSourceProvider) { this.configProvider = configProvider; this.dataSourceProvider = dataSourceProvider; } @Inject CsvDataProcessor(final Provider<Configuration> configProvider, final Provider<DataSour...
CsvDataProcessor { @Inject CsvDataProcessor(final Provider<Configuration> configProvider, final Provider<DataSource> dataSourceProvider) { this.configProvider = configProvider; this.dataSourceProvider = dataSourceProvider; } @Inject CsvDataProcessor(final Provider<Configuration> configProvider, final Provider<DataSour...
CsvDataProcessor { @Inject CsvDataProcessor(final Provider<Configuration> configProvider, final Provider<DataSource> dataSourceProvider) { this.configProvider = configProvider; this.dataSourceProvider = dataSourceProvider; } @Inject CsvDataProcessor(final Provider<Configuration> configProvider, final Provider<DataSour...
@Test public void testProvideEmailAddressPools() { Configuration config = new Configuration(Charsets.UTF_8); config.put("mail.default.user", "defaultuser"); config.put("mail.default.password", "defaultpass"); config.put("mail.default.domain", "defdom.com"); config.put("mail.pool.pool1.test.account.1", ""); config.put("...
@Provides @Singleton SetMultimap<String, MailAccount> provideEmailAddressPools(final Configuration config) { SetMultimap<String, MailAccount> result = HashMultimap.create(); Set<String> accountIdCache = newHashSet(); for (Entry<String, String> entry : config.entrySet()) { String key = entry.getKey(); Matcher matcher = ...
EmailModule extends BaseJFunkGuiceModule { @Provides @Singleton SetMultimap<String, MailAccount> provideEmailAddressPools(final Configuration config) { SetMultimap<String, MailAccount> result = HashMultimap.create(); Set<String> accountIdCache = newHashSet(); for (Entry<String, String> entry : config.entrySet()) { Stri...
EmailModule extends BaseJFunkGuiceModule { @Provides @Singleton SetMultimap<String, MailAccount> provideEmailAddressPools(final Configuration config) { SetMultimap<String, MailAccount> result = HashMultimap.create(); Set<String> accountIdCache = newHashSet(); for (Entry<String, String> entry : config.entrySet()) { Stri...
EmailModule extends BaseJFunkGuiceModule { @Provides @Singleton SetMultimap<String, MailAccount> provideEmailAddressPools(final Configuration config) { SetMultimap<String, MailAccount> result = HashMultimap.create(); Set<String> accountIdCache = newHashSet(); for (Entry<String, String> entry : config.entrySet()) { Stri...
EmailModule extends BaseJFunkGuiceModule { @Provides @Singleton SetMultimap<String, MailAccount> provideEmailAddressPools(final Configuration config) { SetMultimap<String, MailAccount> result = HashMultimap.create(); Set<String> accountIdCache = newHashSet(); for (Entry<String, String> entry : config.entrySet()) { Stri...
@Test public void mailboxShouldBePurgedOnReservation() { init(1); MailboxPurger purger = mock(MailboxPurger.class); eventBus.register(purger); try { MailAccount mailAccount = manager.reserveMailAccount(); verify(purger) .purgeMailbox( new MailAccountReservationEvent(MailAccountManager.DEFAULT_ACCOUNT_RESERVATION_KEY, m...
public MailAccount reserveMailAccount() { return reserveMailAccount(DEFAULT_ACCOUNT_RESERVATION_KEY); }
MailAccountManager { public MailAccount reserveMailAccount() { return reserveMailAccount(DEFAULT_ACCOUNT_RESERVATION_KEY); } }
MailAccountManager { public MailAccount reserveMailAccount() { return reserveMailAccount(DEFAULT_ACCOUNT_RESERVATION_KEY); } @Inject MailAccountManager(final SetMultimap<String, MailAccount> emailAddressPools, final MathRandom random, final Provider<EventBus> eventBusProvider, final Configuration config); }
MailAccountManager { public MailAccount reserveMailAccount() { return reserveMailAccount(DEFAULT_ACCOUNT_RESERVATION_KEY); } @Inject MailAccountManager(final SetMultimap<String, MailAccount> emailAddressPools, final MathRandom random, final Provider<EventBus> eventBusProvider, final Configuration config); MailAccou...
MailAccountManager { public MailAccount reserveMailAccount() { return reserveMailAccount(DEFAULT_ACCOUNT_RESERVATION_KEY); } @Inject MailAccountManager(final SetMultimap<String, MailAccount> emailAddressPools, final MathRandom random, final Provider<EventBus> eventBusProvider, final Configuration config); MailAccou...
@Test public void testFromProperties() { Properties p = new Properties(); p.setProperty("test1", "test1"); p.setProperty("test2", "test2"); p.setProperty("test3", "test3"); ExtendedProperties extProps = ExtendedProperties.fromProperties(p); Assert.assertEquals(extProps.size(), 3); Assert.assertEquals(extProps.get("test...
public static ExtendedProperties fromProperties(final Properties props) { ExtendedProperties result = new ExtendedProperties(); for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); String value = props.getProperty(key); result.put(key, value); } return result;...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { public static ExtendedProperties fromProperties(final Properties props) { ExtendedProperties result = new ExtendedProperties(); for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); St...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { public static ExtendedProperties fromProperties(final Properties props) { ExtendedProperties result = new ExtendedProperties(); for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); St...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { public static ExtendedProperties fromProperties(final Properties props) { ExtendedProperties result = new ExtendedProperties(); for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); St...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { public static ExtendedProperties fromProperties(final Properties props) { ExtendedProperties result = new ExtendedProperties(); for (Enumeration<?> en = props.propertyNames(); en.hasMoreElements();) { String key = (String) en.nextElement(); St...
@Test public void testKeySet() { Set<String> keySet = props.keySet(); Assert.assertEquals(props.size(), 7); Assert.assertEquals(keySet.size(), 7); Assert.assertTrue(keySet.contains("defProp2 ")); Assert.assertTrue(props.containsKey("defProp2 ")); props.put("newProp", "foo"); Assert.assertEquals(props.size(), 8); Assert...
@Override public Set<String> keySet() { if (keySet == null) { keySet = new KeySet(); } return keySet; }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Set<String> keySet() { if (keySet == null) { keySet = new KeySet(); } return keySet; } }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Set<String> keySet() { if (keySet == null) { keySet = new KeySet(); } return keySet; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Set<String> keySet() { if (keySet == null) { keySet = new KeySet(); } return keySet; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedProperties fromProperties(final Properties pr...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Set<String> keySet() { if (keySet == null) { keySet = new KeySet(); } return keySet; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedProperties fromProperties(final Properties pr...
@Test public void testValues() { Collection<String> values = props.values(); Assert.assertEquals(props.size(), 7); Assert.assertEquals(values.size(), 7); Assert.assertTrue(values.contains("öäü~@€^°é")); Assert.assertTrue(values.contains("testtest")); Assert.assertTrue(values.contains("test\\")); Assert.assertTrue(value...
@Override public Collection<String> values() { if (values == null) { values = new Values(); } return values; }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Collection<String> values() { if (values == null) { values = new Values(); } return values; } }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Collection<String> values() { if (values == null) { values = new Values(); } return values; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Collection<String> values() { if (values == null) { values = new Values(); } return values; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedProperties fromProperties(final Proper...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Collection<String> values() { if (values == null) { values = new Values(); } return values; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedProperties fromProperties(final Proper...
@Test public void testEntrySet() { SimpleEntry entry = new SimpleEntry("newProp", "foo"); Set<Entry<String, String>> entrySet = props.entrySet(); props.put("newProp", "foo"); Assert.assertEquals(props.size(), 8); Assert.assertEquals(entrySet.size(), 8); Assert.assertTrue(entrySet.contains(entry)); Assert.assertTrue(pro...
@Override public Set<Entry<String, String>> entrySet() { if (entrySet == null) { entrySet = new EntrySet(); } return entrySet; }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Set<Entry<String, String>> entrySet() { if (entrySet == null) { entrySet = new EntrySet(); } return entrySet; } }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Set<Entry<String, String>> entrySet() { if (entrySet == null) { entrySet = new EntrySet(); } return entrySet; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Set<Entry<String, String>> entrySet() { if (entrySet == null) { entrySet = new EntrySet(); } return entrySet; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedProperties fromPrope...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public Set<Entry<String, String>> entrySet() { if (entrySet == null) { entrySet = new EntrySet(); } return entrySet; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedProperties fromPrope...
@Test public void testContainsKey() { Assert.assertTrue(props.containsKey("prop1")); Assert.assertTrue(props.containsKey("prop2")); Assert.assertTrue(props.containsKey("prop3=")); Assert.assertTrue(props.containsKey("prop4test")); Assert.assertTrue(props.containsKey("def=Prop1:")); Assert.assertTrue(props.containsKey("...
@Override public boolean containsKey(final Object key) { return propsMap.containsKey(key) ? true : defaults != null && defaults.containsKey(key); }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public boolean containsKey(final Object key) { return propsMap.containsKey(key) ? true : defaults != null && defaults.containsKey(key); } }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public boolean containsKey(final Object key) { return propsMap.containsKey(key) ? true : defaults != null && defaults.containsKey(key); } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public boolean containsKey(final Object key) { return propsMap.containsKey(key) ? true : defaults != null && defaults.containsKey(key); } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedP...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public boolean containsKey(final Object key) { return propsMap.containsKey(key) ? true : defaults != null && defaults.containsKey(key); } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static ExtendedP...
@Test public void testContainsValue() { Assert.assertTrue(props.containsValue("öäü~@€^°é")); Assert.assertTrue(props.containsValue("testtest")); Assert.assertTrue(props.containsValue("test\\")); Assert.assertTrue(props.containsValue("")); Assert.assertTrue(props.containsValue("foo")); Assert.assertTrue(props.containsVa...
@Override public boolean containsValue(final Object value) { for (String key : keySet()) { if (value.equals(get(key))) { return true; } } return false; }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public boolean containsValue(final Object value) { for (String key : keySet()) { if (value.equals(get(key))) { return true; } } return false; } }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public boolean containsValue(final Object value) { for (String key : keySet()) { if (value.equals(get(key))) { return true; } } return false; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); }
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public boolean containsValue(final Object value) { for (String key : keySet()) { if (value.equals(get(key))) { return true; } } return false; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static Ext...
ExtendedProperties implements Map<String, String>, Serializable, Cloneable { @Override public boolean containsValue(final Object value) { for (String key : keySet()) { if (value.equals(get(key))) { return true; } } return false; } ExtendedProperties(); ExtendedProperties(final Map<String, String> defaults); static Ext...
@Test public void testToString() { ThreadScope scope = new ThreadScope(); Provider<String> prov = scope.scope(Key.get(String.class), new Provider<String>() { @Override public String get() { return "dummy"; } @Override public String toString() { return get(); } }); Assert.assertEquals(prov.toString(), "dummy[ThreadScope...
@Override public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) { return new Provider<T>() { @Override public T get() { Map<Key<?>, Object> map = getScopeMapForCurrentThread(); checkState(map != null, "No scope map found for the current thread. Forgot to call enterScope()?"); return getScopedObject...
ThreadScope extends BaseScope { @Override public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) { return new Provider<T>() { @Override public T get() { Map<Key<?>, Object> map = getScopeMapForCurrentThread(); checkState(map != null, "No scope map found for the current thread. Forgot to call enterSc...
ThreadScope extends BaseScope { @Override public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) { return new Provider<T>() { @Override public T get() { Map<Key<?>, Object> map = getScopeMapForCurrentThread(); checkState(map != null, "No scope map found for the current thread. Forgot to call enterSc...
ThreadScope extends BaseScope { @Override public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) { return new Provider<T>() { @Override public T get() { Map<Key<?>, Object> map = getScopeMapForCurrentThread(); checkState(map != null, "No scope map found for the current thread. Forgot to call enterSc...
ThreadScope extends BaseScope { @Override public <T> Provider<T> scope(final Key<T> key, final Provider<T> unscoped) { return new Provider<T>() { @Override public T get() { Map<Key<?>, Object> map = getScopeMapForCurrentThread(); checkState(map != null, "No scope map found for the current thread. Forgot to call enterSc...
@Test public void testCompareTo() { WmsVersion version111 = new WmsVersion("1.1.1"); WmsVersion version112 = new WmsVersion("1.1.2"); WmsVersion version110 = new WmsVersion("1.1"); WmsVersion version130 = new WmsVersion("1.3"); WmsVersion version200 = new WmsVersion("2.0"); assertThat(version111.compareTo(version112), ...
@Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : 1; } if (this.build != o.build) { return this.b...
WmsVersion implements Comparable<WmsVersion> { @Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : ...
WmsVersion implements Comparable<WmsVersion> { @Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : ...
WmsVersion implements Comparable<WmsVersion> { @Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : ...
WmsVersion implements Comparable<WmsVersion> { @Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : ...
@Test public void testTransparent() throws MalformedURLException { String url = basicRequestBuilder().toMapUrl().toExternalForm(); assertThat(url, containsString("TRANSPARENT=FALSE")); }
public WmsRequestBuilder transparent(boolean transparent) { parameters.put(WmsRequestParameter.TRANSPARENT, Boolean .valueOf(transparent) .toString()); return this; }
WmsRequestBuilder { public WmsRequestBuilder transparent(boolean transparent) { parameters.put(WmsRequestParameter.TRANSPARENT, Boolean .valueOf(transparent) .toString()); return this; } }
WmsRequestBuilder { public WmsRequestBuilder transparent(boolean transparent) { parameters.put(WmsRequestParameter.TRANSPARENT, Boolean .valueOf(transparent) .toString()); return this; } }
WmsRequestBuilder { public WmsRequestBuilder transparent(boolean transparent) { parameters.put(WmsRequestParameter.TRANSPARENT, Boolean .valueOf(transparent) .toString()); return this; } static WmsRequestBuilder createGetMapRequest(String serviceUrl); static WmsRequestBuilder createGetMapRequest( Map<WmsRequestP...
WmsRequestBuilder { public WmsRequestBuilder transparent(boolean transparent) { parameters.put(WmsRequestParameter.TRANSPARENT, Boolean .valueOf(transparent) .toString()); return this; } static WmsRequestBuilder createGetMapRequest(String serviceUrl); static WmsRequestBuilder createGetMapRequest( Map<WmsRequestP...
@Test public void testVersion() throws MalformedURLException { String url = basicRequestBuilder().toMapUrl().toExternalForm(); assertThat(url, containsString("VERSION=1.1.1")); }
public WmsRequestBuilder version(String version) { parameters.put(WmsRequestParameter.VERSION, version); return this; }
WmsRequestBuilder { public WmsRequestBuilder version(String version) { parameters.put(WmsRequestParameter.VERSION, version); return this; } }
WmsRequestBuilder { public WmsRequestBuilder version(String version) { parameters.put(WmsRequestParameter.VERSION, version); return this; } }
WmsRequestBuilder { public WmsRequestBuilder version(String version) { parameters.put(WmsRequestParameter.VERSION, version); return this; } static WmsRequestBuilder createGetMapRequest(String serviceUrl); static WmsRequestBuilder createGetMapRequest( Map<WmsRequestParameter, String> params); WmsRequestBuilder la...
WmsRequestBuilder { public WmsRequestBuilder version(String version) { parameters.put(WmsRequestParameter.VERSION, version); return this; } static WmsRequestBuilder createGetMapRequest(String serviceUrl); static WmsRequestBuilder createGetMapRequest( Map<WmsRequestParameter, String> params); WmsRequestBuilder la...
@Test(expected = NullPointerException.class) public void testCompareToNull() { WmsVersion version = new WmsVersion("1.1.1"); version.compareTo(null); }
@Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : 1; } if (this.build != o.build) { return this.b...
WmsVersion implements Comparable<WmsVersion> { @Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : ...
WmsVersion implements Comparable<WmsVersion> { @Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : ...
WmsVersion implements Comparable<WmsVersion> { @Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : ...
WmsVersion implements Comparable<WmsVersion> { @Override public int compareTo(WmsVersion o) { if (o == null) { throw new NullPointerException("Version to compare to must not be null"); } if (this.major != o.major) { return this.major < o.major ? -1 : 1; } if (this.minor != o.minor) { return this.minor < o.minor ? -1 : ...
@Test public void testToString() { WmsVersion version = new WmsVersion("1.3"); assertThat(version.toString(), is("1.3.0")); }
@Override public String toString() { return format("%d.%d.%d", major, minor, build); }
WmsVersion implements Comparable<WmsVersion> { @Override public String toString() { return format("%d.%d.%d", major, minor, build); } }
WmsVersion implements Comparable<WmsVersion> { @Override public String toString() { return format("%d.%d.%d", major, minor, build); } WmsVersion(String version); WmsVersion(int major, int minor, int build); }
WmsVersion implements Comparable<WmsVersion> { @Override public String toString() { return format("%d.%d.%d", major, minor, build); } WmsVersion(String version); WmsVersion(int major, int minor, int build); int getMajor(); int getMinor(); int getBuild(); @Override int compareTo(WmsVersion o); @Override String toString...
WmsVersion implements Comparable<WmsVersion> { @Override public String toString() { return format("%d.%d.%d", major, minor, build); } WmsVersion(String version); WmsVersion(int major, int minor, int build); int getMajor(); int getMinor(); int getBuild(); @Override int compareTo(WmsVersion o); @Override String toString...
@Test public void testToVersionString() { WmsVersion version1 = new WmsVersion(1, 0, 0); assertThat(version1.toVersionString(), is("1")); WmsVersion version13 = new WmsVersion(1, 3, 0); assertThat(version13.toVersionString(), is("1.3")); WmsVersion version111 = new WmsVersion(1, 1, 1); assertThat(version111.toVersionSt...
public String toVersionString() { StringBuilder version = new StringBuilder(); version.append(major); if (minor != 0) { version.append('.').append(minor); } if (build != 0) { version.append('.').append(build); } return version.toString(); }
WmsVersion implements Comparable<WmsVersion> { public String toVersionString() { StringBuilder version = new StringBuilder(); version.append(major); if (minor != 0) { version.append('.').append(minor); } if (build != 0) { version.append('.').append(build); } return version.toString(); } }
WmsVersion implements Comparable<WmsVersion> { public String toVersionString() { StringBuilder version = new StringBuilder(); version.append(major); if (minor != 0) { version.append('.').append(minor); } if (build != 0) { version.append('.').append(build); } return version.toString(); } WmsVersion(String version); Wms...
WmsVersion implements Comparable<WmsVersion> { public String toVersionString() { StringBuilder version = new StringBuilder(); version.append(major); if (minor != 0) { version.append('.').append(minor); } if (build != 0) { version.append('.').append(build); } return version.toString(); } WmsVersion(String version); Wms...
WmsVersion implements Comparable<WmsVersion> { public String toVersionString() { StringBuilder version = new StringBuilder(); version.append(major); if (minor != 0) { version.append('.').append(minor); } if (build != 0) { version.append('.').append(build); } return version.toString(); } WmsVersion(String version); Wms...
@Test public void testToExport() { assertTrue(handler.toExport(null)); }
@Override public boolean toExport(JRGenericPrintElement element) { return true; }
WmsMapElementHtmlHandler implements GenericElementHtmlHandler { @Override public boolean toExport(JRGenericPrintElement element) { return true; } }
WmsMapElementHtmlHandler implements GenericElementHtmlHandler { @Override public boolean toExport(JRGenericPrintElement element) { return true; } }
WmsMapElementHtmlHandler implements GenericElementHtmlHandler { @Override public boolean toExport(JRGenericPrintElement element) { return true; } static WmsMapElementHtmlHandler getInstance(); @Override String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element); @Override boolean toExpo...
WmsMapElementHtmlHandler implements GenericElementHtmlHandler { @Override public boolean toExport(JRGenericPrintElement element) { return true; } static WmsMapElementHtmlHandler getInstance(); @Override String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element); @Override boolean toExpo...
@Ignore("Moved test from generic element") @Test public void testGetHtmlFragment() { JRGenericPrintElement element = mock(JRGenericPrintElement.class); when(element.getParameterNames()).thenReturn(parameters.keySet()); when(element.getParameterValue(WmsRequestParameter.WMS_URL.name())) .thenReturn(BASE_URL); when(eleme...
@Override public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) { Map<String, Object> contextMap = new HashMap<String, Object>(); contextMap.put("mapCanvasId", "map_canvas_" + element.hashCode()); if (context.getExporter() instanceof JRXhtmlExporter) { contextMap.put("xhtml", "xhtm...
WmsMapElementHtmlHandler implements GenericElementHtmlHandler { @Override public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) { Map<String, Object> contextMap = new HashMap<String, Object>(); contextMap.put("mapCanvasId", "map_canvas_" + element.hashCode()); if (context.getExport...
WmsMapElementHtmlHandler implements GenericElementHtmlHandler { @Override public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) { Map<String, Object> contextMap = new HashMap<String, Object>(); contextMap.put("mapCanvasId", "map_canvas_" + element.hashCode()); if (context.getExport...
WmsMapElementHtmlHandler implements GenericElementHtmlHandler { @Override public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) { Map<String, Object> contextMap = new HashMap<String, Object>(); contextMap.put("mapCanvasId", "map_canvas_" + element.hashCode()); if (context.getExport...
WmsMapElementHtmlHandler implements GenericElementHtmlHandler { @Override public String getHtmlFragment(JRHtmlExporterContext context, JRGenericPrintElement element) { Map<String, Object> contextMap = new HashMap<String, Object>(); contextMap.put("mapCanvasId", "map_canvas_" + element.hashCode()); if (context.getExport...
@Ignore @Test public void testExportElement() throws JRException { JRGraphics2DExporter exporter = new JRGraphics2DExporter(); JRGraphics2DExporterContext context = mock(JRGraphics2DExporterContext.class); when(context.getExporter()).thenReturn(exporter); JRGenericPrintElement element = mock(JRGenericPrintElement.class...
@Override public void exportElement(JRGraphics2DExporterContext context, JRGenericPrintElement element, Graphics2D grx, Offset offset) { try { JRGraphics2DExporter exporter = (JRGraphics2DExporter) context .getExporter(); ImageDrawer imageDrawer = exporter.getFrameDrawer().getDrawVisitor() .getImageDrawer(); JRPrintIma...
WmsMapElementGraphics2DHandler implements GenericElementGraphics2DHandler { @Override public void exportElement(JRGraphics2DExporterContext context, JRGenericPrintElement element, Graphics2D grx, Offset offset) { try { JRGraphics2DExporter exporter = (JRGraphics2DExporter) context .getExporter(); ImageDrawer imageD...
WmsMapElementGraphics2DHandler implements GenericElementGraphics2DHandler { @Override public void exportElement(JRGraphics2DExporterContext context, JRGenericPrintElement element, Graphics2D grx, Offset offset) { try { JRGraphics2DExporter exporter = (JRGraphics2DExporter) context .getExporter(); ImageDrawer imageD...
WmsMapElementGraphics2DHandler implements GenericElementGraphics2DHandler { @Override public void exportElement(JRGraphics2DExporterContext context, JRGenericPrintElement element, Graphics2D grx, Offset offset) { try { JRGraphics2DExporter exporter = (JRGraphics2DExporter) context .getExporter(); ImageDrawer imageD...
WmsMapElementGraphics2DHandler implements GenericElementGraphics2DHandler { @Override public void exportElement(JRGraphics2DExporterContext context, JRGenericPrintElement element, Graphics2D grx, Offset offset) { try { JRGraphics2DExporter exporter = (JRGraphics2DExporter) context .getExporter(); ImageDrawer imageD...
@Test public void testToExport() { assertTrue(handler.toExport(mock(JRGenericPrintElement.class))); }
@Override public boolean toExport(JRGenericPrintElement element) { return true; }
WmsMapElementGraphics2DHandler implements GenericElementGraphics2DHandler { @Override public boolean toExport(JRGenericPrintElement element) { return true; } }
WmsMapElementGraphics2DHandler implements GenericElementGraphics2DHandler { @Override public boolean toExport(JRGenericPrintElement element) { return true; } }
WmsMapElementGraphics2DHandler implements GenericElementGraphics2DHandler { @Override public boolean toExport(JRGenericPrintElement element) { return true; } static WmsMapElementGraphics2DHandler getInstance(); @Override void exportElement(JRGraphics2DExporterContext context, JRGenericPrintElement element, G...
WmsMapElementGraphics2DHandler implements GenericElementGraphics2DHandler { @Override public boolean toExport(JRGenericPrintElement element) { return true; } static WmsMapElementGraphics2DHandler getInstance(); @Override void exportElement(JRGraphics2DExporterContext context, JRGenericPrintElement element, G...
@Test public void testStylesDefaults() throws MalformedURLException { String url = basicRequestBuilder() .toMapUrl().toExternalForm(); assertThat(url, containsString("STYLE=%2C%2C")); System.out.println(url); }
public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsUrl.indexOf("?") == -...
WmsRequestBuilder { public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsU...
WmsRequestBuilder { public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsU...
WmsRequestBuilder { public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsU...
WmsRequestBuilder { public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsU...
@Test public void testFormatDefault() throws MalformedURLException { String url = basicRequestBuilder().toMapUrl().toExternalForm(); assertThat(url, containsString("FORMAT=image%2Fpng")); }
public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsUrl.indexOf("?") == -...
WmsRequestBuilder { public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsU...
WmsRequestBuilder { public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsU...
WmsRequestBuilder { public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsU...
WmsRequestBuilder { public URL toMapUrl() throws MalformedURLException { StringBuilder url = new StringBuilder(); Map<WmsRequestParameter, String> params = new LinkedHashMap<WmsRequestParameter, String>(this.parameters); String wmsUrl = params.remove(WmsRequestParameter.WMS_URL).toString(); url.append(wmsUrl); if (wmsU...
@Test public void setTagsCommaSeparated() { Station testMe = new Station(); testMe.setTags("foo,bar,baz"); assertThat(Arrays.asList("foo", "bar", "baz"), is(testMe.getTagList())); }
@JsonSetter("tags") public void setTags(final String commaTags) { tagList = Arrays.asList(commaTags.split(",")); }
Station { @JsonSetter("tags") public void setTags(final String commaTags) { tagList = Arrays.asList(commaTags.split(",")); } }
Station { @JsonSetter("tags") public void setTags(final String commaTags) { tagList = Arrays.asList(commaTags.split(",")); } }
Station { @JsonSetter("tags") public void setTags(final String commaTags) { tagList = Arrays.asList(commaTags.split(",")); } @JsonGetter("tags") String getTags(); @JsonSetter("tags") void setTags(final String commaTags); @JsonGetter("language") String getLanguage(); @JsonSetter("language") void setLanguage(final Strin...
Station { @JsonSetter("tags") public void setTags(final String commaTags) { tagList = Arrays.asList(commaTags.split(",")); } @JsonGetter("tags") String getTags(); @JsonSetter("tags") void setTags(final String commaTags); @JsonGetter("language") String getLanguage(); @JsonSetter("language") void setLanguage(final Strin...
@Test public void discover(@Mocked Client clientMock, @Mocked ClientBuilder clientBuilderMock, @Mocked WebTarget webTargetMock, @Mocked InetAddress inetAddressMock) throws IOException { new Expectations() {{ ClientBuilder.newBuilder(); result = clientBuilderMock; clientBuilderMock.build(); result = clientMock; clientMo...
public Optional<String> discover() throws IOException { List<DiscoveryResult> discoveryResults = discoverApiUrls(apiUrls()); return discoveryResults .stream() .sorted(Comparator.comparingLong(o -> o.duration)) .map(DiscoveryResult::getEndpoint) .findFirst(); }
EndpointDiscovery { public Optional<String> discover() throws IOException { List<DiscoveryResult> discoveryResults = discoverApiUrls(apiUrls()); return discoveryResults .stream() .sorted(Comparator.comparingLong(o -> o.duration)) .map(DiscoveryResult::getEndpoint) .findFirst(); } }
EndpointDiscovery { public Optional<String> discover() throws IOException { List<DiscoveryResult> discoveryResults = discoverApiUrls(apiUrls()); return discoveryResults .stream() .sorted(Comparator.comparingLong(o -> o.duration)) .map(DiscoveryResult::getEndpoint) .findFirst(); } EndpointDiscovery(@NonNull final String...
EndpointDiscovery { public Optional<String> discover() throws IOException { List<DiscoveryResult> discoveryResults = discoverApiUrls(apiUrls()); return discoveryResults .stream() .sorted(Comparator.comparingLong(o -> o.duration)) .map(DiscoveryResult::getEndpoint) .findFirst(); } EndpointDiscovery(@NonNull final String...
EndpointDiscovery { public Optional<String> discover() throws IOException { List<DiscoveryResult> discoveryResults = discoverApiUrls(apiUrls()); return discoveryResults .stream() .sorted(Comparator.comparingLong(o -> o.duration)) .map(DiscoveryResult::getEndpoint) .findFirst(); } EndpointDiscovery(@NonNull final String...
@Test public void getStats(@Mocked Client clientMock, @Mocked ClientBuilder clientBuilderMock, @Mocked WebTarget webTargetMock, @Mocked Invocation.Builder invocationBuilderMock) { Stats myStats = new Stats(); new Expectations() {{ ClientBuilder.newBuilder(); result = clientBuilderMock; clientBuilderMock.build(); result...
Stats getStats(final String endpoint, final int timeout) { if (timeout <= 0) { throw new IllegalArgumentException( "timeout must be > 0, but is " + timeout); } Client client = ClientBuilder.newBuilder() .register(JacksonFeature.class) .build(); client.property(ClientProperties.CONNECT_TIMEOUT, timeout); client.property...
EndpointDiscovery { Stats getStats(final String endpoint, final int timeout) { if (timeout <= 0) { throw new IllegalArgumentException( "timeout must be > 0, but is " + timeout); } Client client = ClientBuilder.newBuilder() .register(JacksonFeature.class) .build(); client.property(ClientProperties.CONNECT_TIMEOUT, timeo...
EndpointDiscovery { Stats getStats(final String endpoint, final int timeout) { if (timeout <= 0) { throw new IllegalArgumentException( "timeout must be > 0, but is " + timeout); } Client client = ClientBuilder.newBuilder() .register(JacksonFeature.class) .build(); client.property(ClientProperties.CONNECT_TIMEOUT, timeo...
EndpointDiscovery { Stats getStats(final String endpoint, final int timeout) { if (timeout <= 0) { throw new IllegalArgumentException( "timeout must be > 0, but is " + timeout); } Client client = ClientBuilder.newBuilder() .register(JacksonFeature.class) .build(); client.property(ClientProperties.CONNECT_TIMEOUT, timeo...
EndpointDiscovery { Stats getStats(final String endpoint, final int timeout) { if (timeout <= 0) { throw new IllegalArgumentException( "timeout must be > 0, but is " + timeout); } Client client = ClientBuilder.newBuilder() .register(JacksonFeature.class) .build(); client.property(ClientProperties.CONNECT_TIMEOUT, timeo...
@Test public void listCountries() { Map<String, Integer> countries = browser.listCountries(); assertThat(countries, notNullValue()); assertThat(countries.size(), is(not(0))); assertThat(countries.get("Germany"), is(not(0))); }
public Map<String, Integer> listCountries() { return retrieveValueStationCountList("json/countries"); }
RadioBrowser { public Map<String, Integer> listCountries() { return retrieveValueStationCountList("json/countries"); } }
RadioBrowser { public Map<String, Integer> listCountries() { return retrieveValueStationCountList("json/countries"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, ...
RadioBrowser { public Map<String, Integer> listCountries() { return retrieveValueStationCountList("json/countries"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, ...
RadioBrowser { public Map<String, Integer> listCountries() { return retrieveValueStationCountList("json/countries"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, ...
@Test public void listCodecs() { Map<String, Integer> codecs = browser.listCodecs(); assertThat(codecs, notNullValue()); assertThat(codecs.size(), is(not(0))); assertThat(codecs.containsKey("AAC"), is(true)); }
public Map<String, Integer> listCodecs() { return retrieveValueStationCountList("json/codecs"); }
RadioBrowser { public Map<String, Integer> listCodecs() { return retrieveValueStationCountList("json/codecs"); } }
RadioBrowser { public Map<String, Integer> listCodecs() { return retrieveValueStationCountList("json/codecs"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, fi...
RadioBrowser { public Map<String, Integer> listCodecs() { return retrieveValueStationCountList("json/codecs"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, fi...
RadioBrowser { public Map<String, Integer> listCodecs() { return retrieveValueStationCountList("json/codecs"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, fi...
@Test public void listLanguages() { Map<String, Integer> languages = browser.listLanguages(); assertThat(languages, notNullValue()); assertThat(languages.size(), is(not(0))); assertThat(languages.containsKey("german"), is(true)); }
public Map<String, Integer> listLanguages() { return retrieveValueStationCountList("json/languages"); }
RadioBrowser { public Map<String, Integer> listLanguages() { return retrieveValueStationCountList("json/languages"); } }
RadioBrowser { public Map<String, Integer> listLanguages() { return retrieveValueStationCountList("json/languages"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, ...
RadioBrowser { public Map<String, Integer> listLanguages() { return retrieveValueStationCountList("json/languages"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, ...
RadioBrowser { public Map<String, Integer> listLanguages() { return retrieveValueStationCountList("json/languages"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, ...
@Test public void listTags() { Map<String, Integer> tags = browser.listTags(); assertThat(tags, notNullValue()); assertThat(tags.size(), is(not(0))); assertThat(tags.containsKey("80s"), is(true)); }
public Map<String, Integer> listTags() { return retrieveValueStationCountList("json/tags"); }
RadioBrowser { public Map<String, Integer> listTags() { return retrieveValueStationCountList("json/tags"); } }
RadioBrowser { public Map<String, Integer> listTags() { return retrieveValueStationCountList("json/tags"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, final ...
RadioBrowser { public Map<String, Integer> listTags() { return retrieveValueStationCountList("json/tags"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, final ...
RadioBrowser { public Map<String, Integer> listTags() { return retrieveValueStationCountList("json/tags"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); RadioBrowser(final int timeout, final ...
@Test public void listStations() { List<Station> firstStations = browser.listStations(FIRST_FIVE); assertThat(firstStations, notNullValue()); assertThat(firstStations.size(), is(FIRST_FIVE.getLimit())); List<Station> secondStations = browser.listStations(SECOND_FIVE); assertThat(secondStations, notNullValue()); assertT...
public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); }
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } }
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
@Test public void listStationsWithStream() { List<Station> stations = browser .listStations() .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); assertThat(stations.size(), is(256)); }
public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); }
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } }
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
@Test public void listStationsWithStreamAndOrder() { List<Station> stations = browser .listStations(ListParameter.create().order(FieldName.LASTCHECKTIME)) .limit(256) .collect(Collectors.toList()); assertThat(stations.size(), is(256)); Station last = null; for (Station station : stations) { if (station.getLastchecktime...
public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); }
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } }
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
@Test public void listStationsWithFullStream() { List<Station> stations = browser .listStations() .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); }
public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); }
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } }
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
RadioBrowser { public List<Station> listStations(@NonNull final Paging paging, final ListParameter...listParam) { return listStationsPathWithPaging(Optional.of(paging), "json/stations", listParam); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull...
@Test public void getTagsCommaSeparated() { Station testMe = new Station(); testMe.setTagList(Arrays.asList("foo", "bar", "baz")); assertThat("foo,bar,baz", is(testMe.getTags())); }
@JsonGetter("tags") public String getTags() { return String.join(",", tagList); }
Station { @JsonGetter("tags") public String getTags() { return String.join(",", tagList); } }
Station { @JsonGetter("tags") public String getTags() { return String.join(",", tagList); } }
Station { @JsonGetter("tags") public String getTags() { return String.join(",", tagList); } @JsonGetter("tags") String getTags(); @JsonSetter("tags") void setTags(final String commaTags); @JsonGetter("language") String getLanguage(); @JsonSetter("language") void setLanguage(final String commaLanguages); @Override Stri...
Station { @JsonGetter("tags") public String getTags() { return String.join(",", tagList); } @JsonGetter("tags") String getTags(); @JsonSetter("tags") void setTags(final String commaTags); @JsonGetter("language") String getLanguage(); @JsonSetter("language") void setLanguage(final String commaLanguages); @Override Stri...
@Test public void listBrokenStations() { List<Station> stations = browser.listBrokenStations(FIVE); assertThat(stations, notNullValue()); assertThat(stations.size(), is(FIVE.getSize())); }
public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); }
RadioBrowser { public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); } }
RadioBrowser { public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Radio...
RadioBrowser { public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Radio...
RadioBrowser { public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Radio...
@Test public void listBrokenStationsWithStream() { List<Station> stations = browser .listBrokenStations() .limit(256) .collect(Collectors.toList()); assertThat(stations, notNullValue()); assertThat(stations, is(not(Collections.emptyList()))); assertThat(stations.size(), is(256)); }
public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); }
RadioBrowser { public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); } }
RadioBrowser { public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Radio...
RadioBrowser { public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Radio...
RadioBrowser { public List<Station> listBrokenStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/broken" ); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Radio...
@Test public void listTopClickStations() { List<Station> stations = browser.listTopClickStations(FIVE); assertThat(stations, notNullValue()); assertThat(stations.size(), is(FIVE.getSize())); }
public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); }
RadioBrowser { public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } }
RadioBrowser { public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Ra...
RadioBrowser { public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Ra...
RadioBrowser { public List<Station> listTopClickStations(@NonNull final Limit limit) { return listStationsPathWithLimit(Optional.of(limit), "json/stations/topclick"); } RadioBrowser(@NonNull final String apiUrl, final int timeout, @NonNull final String myUserAgent); Ra...