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 void testUnits() { final var context = new Context(); BundleLoader.loadSingle(context, CompositionBundle.class); context.functions().put("rate", context.functions().get("composition")); Value value; value = eval("rate(30) t = 1 sec", context); assertThat(value.asDouble(), closeTo(30, 0.0001)); value = eval("rate(... | @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", node.start(), node.end())); } | InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", no... | InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", no... | InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", no... | InterpreterVisitor implements ResultVisitor<Value, Context> { @Override public Value get(AccessNode node, Context context) { Value container = node.root.accept(this, context); return getContainer(node.indices, context, container) .orElseThrow(() -> new TypeException("Unable to get property from non-accessible type", no... |
@Test void testVirtualSize() { Composition composition; composition = new Composition(1280, 720, 30); assertThat(composition.getVirtualWidth(), is(1920)); composition = new Composition(1280, 1280, 30); assertThat(composition.getVirtualWidth(), is(1080)); } | public int getVirtualWidth() { return virtualWidth; } | Composition { public int getVirtualWidth() { return virtualWidth; } } | Composition { public int getVirtualWidth() { return virtualWidth; } Composition(); Composition(double frameRate); Composition(int sceneWidth, int sceneHeight); Composition(int sceneWidth, int sceneHeight, double frameRate); Composition(int sceneWidth, int sceneHeight, double frameRate, Paint background); } | Composition { public int getVirtualWidth() { return virtualWidth; } Composition(); Composition(double frameRate); Composition(int sceneWidth, int sceneHeight); Composition(int sceneWidth, int sceneHeight, double frameRate); Composition(int sceneWidth, int sceneHeight, double frameRate, Paint background); int getVir... | Composition { public int getVirtualWidth() { return virtualWidth; } Composition(); Composition(double frameRate); Composition(int sceneWidth, int sceneHeight); Composition(int sceneWidth, int sceneHeight, double frameRate); Composition(int sceneWidth, int sceneHeight, double frameRate, Paint background); int getVir... |
@Test public void getInstance() throws Exception { A proxyA = new CGLibProxy().proxy(A.class, new B()); Assert.assertTrue(proxyA instanceof A); } | public <T> T proxy(Class<T> clazz, Object shadowObject) { if (!ArgumentsUtils.hasNoArgumentsConstructor(clazz)) { Class[] argTypes = ArgumentsUtils.getConstructorsArgumensTypes(clazz); Object[] args = ArgumentsUtils.getArgumens(argTypes); return proxy(clazz, shadowObject, argTypes, args); } this.shadowObject = shadowOb... | CGLibProxy implements MethodInterceptor { public <T> T proxy(Class<T> clazz, Object shadowObject) { if (!ArgumentsUtils.hasNoArgumentsConstructor(clazz)) { Class[] argTypes = ArgumentsUtils.getConstructorsArgumensTypes(clazz); Object[] args = ArgumentsUtils.getArgumens(argTypes); return proxy(clazz, shadowObject, argTy... | CGLibProxy implements MethodInterceptor { public <T> T proxy(Class<T> clazz, Object shadowObject) { if (!ArgumentsUtils.hasNoArgumentsConstructor(clazz)) { Class[] argTypes = ArgumentsUtils.getConstructorsArgumensTypes(clazz); Object[] args = ArgumentsUtils.getArgumens(argTypes); return proxy(clazz, shadowObject, argTy... | CGLibProxy implements MethodInterceptor { public <T> T proxy(Class<T> clazz, Object shadowObject) { if (!ArgumentsUtils.hasNoArgumentsConstructor(clazz)) { Class[] argTypes = ArgumentsUtils.getConstructorsArgumensTypes(clazz); Object[] args = ArgumentsUtils.getArgumens(argTypes); return proxy(clazz, shadowObject, argTy... | CGLibProxy implements MethodInterceptor { public <T> T proxy(Class<T> clazz, Object shadowObject) { if (!ArgumentsUtils.hasNoArgumentsConstructor(clazz)) { Class[] argTypes = ArgumentsUtils.getConstructorsArgumensTypes(clazz); Object[] args = ArgumentsUtils.getArgumens(argTypes); return proxy(clazz, shadowObject, argTy... |
@Test public void bindDeleteArgs() { Object[] args = new Object[]{1}; String sql = "DELETE FROM person WHERE id = ?"; String boundSql = KbSqlParser.bindArgs(sql, args); Assert.assertEquals("DELETE FROM person WHERE id = 1", boundSql); } | public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpressions(statemen... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... |
@Test public void bindUpdateArgs() { Object[] args = new Object[]{"kk", 1}; String sql = "UPDATE person SET name = ? WHERE id = ?"; String boundSql = KbSqlParser.bindArgs(sql, args); Assert.assertEquals("UPDATE person SET name = 'kk' WHERE id = 1", boundSql); } | public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpressions(statemen... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... |
@Test public void getBindArgsCount() throws Exception { String sql0 = "select * from person where id=? and (uid BETWEEN ? and ?) and test LIKE ? order by id"; String sql1 = "INSERT INTO person (id, name) VALUES (?, ?)"; String sql2 = "DELETE FROM person WHERE id in (?,?)"; String sql3 = "UPDATE person SET name = ? WHER... | protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } | KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } } | KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } } | KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } static String bindArgs(String sql, @Nullable Object[] bindArgs); } | KbSqlParser { protected static int getBindArgsCount(String sql) { Set<Expression> expressionSet = findBindArgsExpressions(sql); int count = 0; for (Expression expression : expressionSet) { count += getBindArgsCount(expression); } return count; } static String bindArgs(String sql, @Nullable Object[] bindArgs); } |
@Test public void findJdbcParamExpressions() throws Exception { String sql = "DELETE FROM person WHERE id = ?"; Set<Expression> expressionSet = KbSqlParser.findBindArgsExpressions(sql); System.out.println(); } | protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpressions... | KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindA... | KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindA... | KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindA... | KbSqlParser { protected static Set<Expression> findBindArgsExpressions(String sql) { if (sql == null || sql.startsWith("PRAGMA") || !sql.contains("?")) { return new LinkedHashSet<>(); } KbSqlParserManager pm = new KbSqlParserManager(); try { Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindA... |
@Test public void getFilesDir() throws Exception { List<File> dirs = Arrays.asList(mShadowContext.getFilesDir(), mShadowContext.getCacheDir(), mShadowContext.getDataDir()); for (File dir : dirs) { Assert.assertTrue(dir.isDirectory()); Assert.assertTrue(dir.exists()); } } | public File getFilesDir() { return getAndCreateDir("build/files/"); } | ShadowContext implements Shadow { public File getFilesDir() { return getAndCreateDir("build/files/"); } } | ShadowContext implements Shadow { public File getFilesDir() { return getAndCreateDir("build/files/"); } ShadowContext(Resources resources); ShadowContext(Resources resources, ShadowResources shadowResources); } | ShadowContext implements Shadow { public File getFilesDir() { return getAndCreateDir("build/files/"); } ShadowContext(Resources resources); ShadowContext(Resources resources, ShadowResources shadowResources); @NonNull final String getString(@StringRes int resId); Resources getResources(); SharedPreferences getSharedPr... | ShadowContext implements Shadow { public File getFilesDir() { return getAndCreateDir("build/files/"); } ShadowContext(Resources resources); ShadowContext(Resources resources, ShadowResources shadowResources); @NonNull final String getString(@StringRes int resId); Resources getResources(); SharedPreferences getSharedPr... |
@Test public void getString() throws Exception { Assert.assertEquals("Yui Hatano", resources.getString(R.string.test_string)); } | public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } | ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } } | ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } ShadowResources(); } | ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } ShadowResources(); int getColor(@ColorRes int id); int getColor(@ColorRes int id, @Nullable Resources.Theme theme); String getString(@StringRes int id); @NonNull String[] getStringArray(@ArrayRes int... | ShadowResources { public String getString(@StringRes int id) throws NotFoundException { return getText(id).toString(); } ShadowResources(); int getColor(@ColorRes int id); int getColor(@ColorRes int id, @Nullable Resources.Theme theme); String getString(@StringRes int id); @NonNull String[] getStringArray(@ArrayRes int... |
@Test public void getStringArray() throws Exception { String[] array = resources.getStringArray(R.array.arrayName); Assert.assertEquals("item0", array[0]); Assert.assertEquals("item1", array[1]); } | @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.containsKey(name)) { Lis... | ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.contai... | ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.contai... | ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.contai... | ShadowResources { @NonNull public String[] getStringArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<String>> stringArrayMap = getResourceStringArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (stringArrayMap.contai... |
@Test public void getColor() throws Exception { int color = resources.getColor(R.color.my_color); int realColor = Color.parseColor("#47474d"); Assert.assertEquals(realColor, color); } | public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } | ShadowResources { public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } } | ShadowResources { public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } ShadowResources(); } | ShadowResources { public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } ShadowResources(); int getColor(@ColorRes int id); int getColor(@ColorRes int id, @Nullable Resources.Theme theme); String getString(@StringRes int id); @NonNull String[] getStringArray(@ArrayRes int id); @No... | ShadowResources { public int getColor(@ColorRes int id) throws NotFoundException { return getColor(id, null); } ShadowResources(); int getColor(@ColorRes int id); int getColor(@ColorRes int id, @Nullable Resources.Theme theme); String getString(@StringRes int id); @NonNull String[] getStringArray(@ArrayRes int id); @No... |
@Test public void getIntArray() { int[] intArray = resources.getIntArray(R.array.intArray); Assert.assertEquals(0, intArray[0]); Assert.assertEquals(1, intArray[1]); int[] intArrayNoItem = resources.getIntArray(R.array.intArrayNoItem); Assert.assertEquals(0, intArrayNoItem.length); } | @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) { List<Integer> int... | ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) {... | ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) {... | ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) {... | ShadowResources { @NonNull public int[] getIntArray(@ArrayRes int id) throws NotFoundException { Map<Integer, String> idNameMap = getIdTable(R_ARRAY); Map<String, List<Integer>> intArrayMap = getResourceIntArrayMap(); if (idNameMap.containsKey(id)) { String name = idNameMap.get(id); if (intArrayMap.containsKey(name)) {... |
@Test public void getPackageName() throws Exception { Assert.assertEquals("net.yui", resources.getPackageName()); } | public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = null; List<String> manifestPaths = Arrays.asList( "build/intermediates/manifests/aapt/debug/AndroidManifest.xml", "build/intermediates/manifests/aapt/release/AndroidManifest.xml", "build/intermediates/m... | ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = null; List<String> manifestPaths = Arrays.asList( "build/intermediates/manifests/aapt/debug/AndroidManifest.xml", "build/intermediates/manifests/aapt/release/AndroidManifest.xml", "bui... | ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = null; List<String> manifestPaths = Arrays.asList( "build/intermediates/manifests/aapt/debug/AndroidManifest.xml", "build/intermediates/manifests/aapt/release/AndroidManifest.xml", "bui... | ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = null; List<String> manifestPaths = Arrays.asList( "build/intermediates/manifests/aapt/debug/AndroidManifest.xml", "build/intermediates/manifests/aapt/release/AndroidManifest.xml", "bui... | ShadowResources { public String getPackageName() { if (!TextUtils.isEmpty(mPackageName)) { return mPackageName; } String manifestPath = null; List<String> manifestPaths = Arrays.asList( "build/intermediates/manifests/aapt/debug/AndroidManifest.xml", "build/intermediates/manifests/aapt/release/AndroidManifest.xml", "bui... |
@Test public void invokeStatic() { Assert.assertEquals("value", ReflectUtils.invokeStatic("net.yui.utils.MockHelper", "testStatic")); Assert.assertEquals("arg0", ReflectUtils.invokeStatic("net.yui.utils.MockHelper", "testStatic", "arg0")); MockHelper mockHelper = new MockHelper(); Assert.assertEquals("value", ReflectUt... | public static Object invokeStatic(String className, String methodName, Object... arguments) { try { Class clazz = Class.forName(className); return invokeStatic(clazz, methodName, arguments); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } | ReflectUtils { public static Object invokeStatic(String className, String methodName, Object... arguments) { try { Class clazz = Class.forName(className); return invokeStatic(clazz, methodName, arguments); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } } | ReflectUtils { public static Object invokeStatic(String className, String methodName, Object... arguments) { try { Class clazz = Class.forName(className); return invokeStatic(clazz, methodName, arguments); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } } | ReflectUtils { public static Object invokeStatic(String className, String methodName, Object... arguments) { try { Class clazz = Class.forName(className); return invokeStatic(clazz, methodName, arguments); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } static boolean hasClass(String classNa... | ReflectUtils { public static Object invokeStatic(String className, String methodName, Object... arguments) { try { Class clazz = Class.forName(className); return invokeStatic(clazz, methodName, arguments); } catch (ClassNotFoundException e) { e.printStackTrace(); } return null; } static boolean hasClass(String classNa... |
@Test public void deleteDir() throws Exception { File dir = new File("build/files"); dir.mkdirs(); File file = new File(dir, "myfile"); file.createNewFile(); Assert.assertTrue(file.exists()); Assert.assertFalse(dir.delete()); Assert.assertTrue(dir.exists()); FileUtils.deleteDir(dir); Assert.assertFalse(dir.exists()); } | public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); } | FileUtils { public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); } } | FileUtils { public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); } } | FileUtils { public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); } static boolean deleteDir(File dir); } | FileUtils { public static boolean deleteDir(File dir) { if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } return dir.delete(); } static boolean deleteDir(File dir); } |
@Test public void getConstructorsArgumensTypes() { ArgumentsUtils.getConstructorsArgumensTypes(Object.class); } | public static Class[] getConstructorsArgumensTypes(Class clazz) { Constructor[] constructors = getNotPrivateConstructors(clazz); if (constructors == null || constructors.length == 0) { return new Class[0]; } return constructors[0].getParameterTypes(); } | ArgumentsUtils { public static Class[] getConstructorsArgumensTypes(Class clazz) { Constructor[] constructors = getNotPrivateConstructors(clazz); if (constructors == null || constructors.length == 0) { return new Class[0]; } return constructors[0].getParameterTypes(); } } | ArgumentsUtils { public static Class[] getConstructorsArgumensTypes(Class clazz) { Constructor[] constructors = getNotPrivateConstructors(clazz); if (constructors == null || constructors.length == 0) { return new Class[0]; } return constructors[0].getParameterTypes(); } } | ArgumentsUtils { public static Class[] getConstructorsArgumensTypes(Class clazz) { Constructor[] constructors = getNotPrivateConstructors(clazz); if (constructors == null || constructors.length == 0) { return new Class[0]; } return constructors[0].getParameterTypes(); } static Class[] getConstructorsArgumensTypes(Clas... | ArgumentsUtils { public static Class[] getConstructorsArgumensTypes(Class clazz) { Constructor[] constructors = getNotPrivateConstructors(clazz); if (constructors == null || constructors.length == 0) { return new Class[0]; } return constructors[0].getParameterTypes(); } static Class[] getConstructorsArgumensTypes(Clas... |
@Test public void getObject() { List<Object> data0 = Arrays.asList((Object) 1, "kk"); cursor = new ShadowCursor(Arrays.asList("id", "name"), Arrays.asList(data0)); cursor.moveToFirst(); Assert.assertEquals(1, cursor.getObject(0)); Assert.assertEquals("kk", cursor.getObject(1)); } | protected Object getObject(int columnIndex, Object defaultValue) { Object value = getObject(columnIndex); if (value == null) { return defaultValue; } return value; } | ShadowCursor implements Cursor { protected Object getObject(int columnIndex, Object defaultValue) { Object value = getObject(columnIndex); if (value == null) { return defaultValue; } return value; } } | ShadowCursor implements Cursor { protected Object getObject(int columnIndex, Object defaultValue) { Object value = getObject(columnIndex); if (value == null) { return defaultValue; } return value; } ShadowCursor(List<String> colums, List<List<Object>> datas); } | ShadowCursor implements Cursor { protected Object getObject(int columnIndex, Object defaultValue) { Object value = getObject(columnIndex); if (value == null) { return defaultValue; } return value; } ShadowCursor(List<String> colums, List<List<Object>> datas); @Override int getCount(); @Override int getPosition(); @Over... | ShadowCursor implements Cursor { protected Object getObject(int columnIndex, Object defaultValue) { Object value = getObject(columnIndex); if (value == null) { return defaultValue; } return value; } ShadowCursor(List<String> colums, List<List<Object>> datas); @Override int getCount(); @Override int getPosition(); @Over... |
@Test public void getString() { List<Object> data0 = Arrays.asList((Object) 1, "kk"); List<Object> data1 = Arrays.asList((Object) 2, null); cursor = new ShadowCursor(Arrays.asList("id", "name"), Arrays.asList(data0, data1)); cursor.moveToFirst(); Assert.assertEquals("1", cursor.getString(0)); Assert.assertEquals("kk", ... | @Override public String getString(int columnIndex) { Object value = getObject(columnIndex); return value == null ? null : value.toString(); } | ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object value = getObject(columnIndex); return value == null ? null : value.toString(); } } | ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object value = getObject(columnIndex); return value == null ? null : value.toString(); } ShadowCursor(List<String> colums, List<List<Object>> datas); } | ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object value = getObject(columnIndex); return value == null ? null : value.toString(); } ShadowCursor(List<String> colums, List<List<Object>> datas); @Override int getCount(); @Override int getPosition(); @Override boolean move(int of... | ShadowCursor implements Cursor { @Override public String getString(int columnIndex) { Object value = getObject(columnIndex); return value == null ? null : value.toString(); } ShadowCursor(List<String> colums, List<List<Object>> datas); @Override int getCount(); @Override int getPosition(); @Override boolean move(int of... |
@Test public void bindSelectArgs() throws Exception { Object[] args = new Object[]{1, 10, 20, "test"}; String sql = "select * from person where id=? and (uid BETWEEN ? and ?) and test LIKE ? order by id"; String boundSql = KbSqlParser.bindArgs(sql, args); System.out.println(boundSql); Assert.assertEquals("SELECT * FROM... | public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpressions(statemen... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... |
@Test public void bindInsertArgs() { Object[] args = new Object[]{1, "kk"}; String sql = "INSERT INTO person (id, name) VALUES (?, ?)"; String boundSql = KbSqlParser.bindArgs(sql, args); Assert.assertEquals("INSERT INTO person (id, name) VALUES (1, 'kk')", boundSql); } | public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpressions(statemen... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... | KbSqlParser { public static String bindArgs(String sql, @Nullable Object[] bindArgs) { if (bindArgs == null || bindArgs.length == 0 || sql.startsWith("PRAGMA")) { return sql; } try { KbSqlParserManager pm = new KbSqlParserManager(); Statement statement = pm.parse(sql); Set<Expression> expressionSet = findBindArgsExpres... |
@Test public void testStringToDoc() throws IOException { XMLUtils.stringToDoc(XML_STRING); XMLUtils.stringToDoc(XML_STRING_HUGE); } | public static Document stringToDoc(String str) throws IOException { if (StringUtils.isNotEmpty(str)) { try { Reader reader = new StringReader(str); DocumentBuilder db = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); Document doc = db.parse(new InputSource(reader)); reader.close(); return doc; } catch (Exce... | XMLUtils { public static Document stringToDoc(String str) throws IOException { if (StringUtils.isNotEmpty(str)) { try { Reader reader = new StringReader(str); DocumentBuilder db = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); Document doc = db.parse(new InputSource(reader)); reader.close(); return doc; } ... | XMLUtils { public static Document stringToDoc(String str) throws IOException { if (StringUtils.isNotEmpty(str)) { try { Reader reader = new StringReader(str); DocumentBuilder db = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); Document doc = db.parse(new InputSource(reader)); reader.close(); return doc; } ... | XMLUtils { public static Document stringToDoc(String str) throws IOException { if (StringUtils.isNotEmpty(str)) { try { Reader reader = new StringReader(str); DocumentBuilder db = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); Document doc = db.parse(new InputSource(reader)); reader.close(); return doc; } ... | XMLUtils { public static Document stringToDoc(String str) throws IOException { if (StringUtils.isNotEmpty(str)) { try { Reader reader = new StringReader(str); DocumentBuilder db = DocumentBuilderFactory.newInstance() .newDocumentBuilder(); Document doc = db.parse(new InputSource(reader)); reader.close(); return doc; } ... |
@Test public void testGetDomain() { System.out.println("Not yet implemented"); } | public String getDomain() { return domain; } | JMXFactory { public String getDomain() { return domain; } } | JMXFactory { public String getDomain() { return domain; } } | JMXFactory { public String getDomain() { return domain; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); static MBeanServer getMB... | JMXFactory { public String getDomain() { return domain; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); static MBeanServer getMB... |
@Test public void testGetMBeanServer() { System.out.println("Not yet implemented"); } | public static MBeanServer getMBeanServer() { return mbs; } | JMXFactory { public static MBeanServer getMBeanServer() { return mbs; } } | JMXFactory { public static MBeanServer getMBeanServer() { return mbs; } } | JMXFactory { public static MBeanServer getMBeanServer() { return mbs; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); static MBe... | JMXFactory { public static MBeanServer getMBeanServer() { return mbs; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); static MBe... |
@Test public void testSetDomain() { System.out.println("Not yet implemented"); } | public void setDomain(String domain) { JMXFactory.domain = domain; } | JMXFactory { public void setDomain(String domain) { JMXFactory.domain = domain; } } | JMXFactory { public void setDomain(String domain) { JMXFactory.domain = domain; } } | JMXFactory { public void setDomain(String domain) { JMXFactory.domain = domain; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); ... | JMXFactory { public void setDomain(String domain) { JMXFactory.domain = domain; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); ... |
@Test public void testNewClient() { IClient client = reg.newClient(null); Assert.assertNotNull(client); Assert.assertTrue(client.getId() != null); Assert.assertTrue(Integer.valueOf(client.getId()) >= 0); } | public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException { String id = nextId(); IClient client = new Client(id, this); addClient(id, client); return client; } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException { String id = nextId(); IClient client = new Client(id, this); addClient(id, client); return client; } } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException { String id = nextId(); IClient client = new Client(id, this); addClient(id, client); return client; } ClientRegistry(); ClientRegistry(String name); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException { String id = nextId(); IClient client = new Client(id, this); addClient(id, client); return client; } ClientRegistry(); ClientRegistry(String name); Client... | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient newClient(Object[] params) throws ClientNotFoundException, ClientRejectedException { String id = nextId(); IClient client = new Client(id, this); addClient(id, client); return client; } ClientRegistry(); ClientRegistry(String name); Client... |
@Test public void testAddClient() { reg.addClient(new Client(reg.nextId(), reg)); Assert.assertNotNull(reg.getClient("1")); Assert.assertTrue(reg.getClients().size() >= 1); } | protected void addClient(IClient client) { addClient(client.getId(), client); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void addClient(IClient client) { addClient(client.getId(), client); } } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void addClient(IClient client) { addClient(client.getId(), client); } ClientRegistry(); ClientRegistry(String name); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void addClient(IClient client) { addClient(client.getId(), client); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IClient lookupClient(String id);... | ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void addClient(IClient client) { addClient(client.getId(), client); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IClient lookupClient(String id);... |
@Test public void testLookupClient() { IClient client = reg.lookupClient("0"); Assert.assertNotNull(client); } | public IClient lookupClient(String id) throws ClientNotFoundException { return getClient(id); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient lookupClient(String id) throws ClientNotFoundException { return getClient(id); } } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient lookupClient(String id) throws ClientNotFoundException { return getClient(id); } ClientRegistry(); ClientRegistry(String name); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient lookupClient(String id) throws ClientNotFoundException { return getClient(id); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IClient lookupCl... | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public IClient lookupClient(String id) throws ClientNotFoundException { return getClient(id); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IClient lookupCl... |
@Test public void testGetClient() { IClient client = reg.getClient("0"); Assert.assertNotNull(client); IClient client2 = null; try { client2 = reg.getClient("999999"); fail("An exception should occur here"); } catch (ClientNotFoundException e) { Assert.assertTrue(true); } Assert.assertNull(client2); } | public Client getClient(String id) throws ClientNotFoundException { final Client result = (Client) clients.get(id); if (result == null) { throw new ClientNotFoundException(id); } return result; } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public Client getClient(String id) throws ClientNotFoundException { final Client result = (Client) clients.get(id); if (result == null) { throw new ClientNotFoundException(id); } return result; } } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public Client getClient(String id) throws ClientNotFoundException { final Client result = (Client) clients.get(id); if (result == null) { throw new ClientNotFoundException(id); } return result; } ClientRegistry(); ClientRegistry(String name); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public Client getClient(String id) throws ClientNotFoundException { final Client result = (Client) clients.get(id); if (result == null) { throw new ClientNotFoundException(id); } return result; } ClientRegistry(); ClientRegistry(String name); Client getC... | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public Client getClient(String id) throws ClientNotFoundException { final Client result = (Client) clients.get(id); if (result == null) { throw new ClientNotFoundException(id); } return result; } ClientRegistry(); ClientRegistry(String name); Client getC... |
@Test public void testGetClientList() { ClientList<Client> clients = reg.getClientList(); int listSize = clients.size(); Assert.assertTrue(listSize > 0); System.out.println("List size: " + listSize); for (int c = 0; c < listSize; c++) { Client client = clients.get(c); System.out.println(client); Assert.assertTrue(clien... | public ClientList<Client> getClientList() { ClientList<Client> list = new ClientList<Client>(); for (IClient c : clients.values()) { list.add((Client) c); } return list; } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public ClientList<Client> getClientList() { ClientList<Client> list = new ClientList<Client>(); for (IClient c : clients.values()) { list.add((Client) c); } return list; } } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public ClientList<Client> getClientList() { ClientList<Client> list = new ClientList<Client>(); for (IClient c : clients.values()) { list.add((Client) c); } return list; } ClientRegistry(); ClientRegistry(String name); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public ClientList<Client> getClientList() { ClientList<Client> list = new ClientList<Client>(); for (IClient c : clients.values()) { list.add((Client) c); } return list; } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); Client... | ClientRegistry implements IClientRegistry, ClientRegistryMBean { public ClientList<Client> getClientList() { ClientList<Client> list = new ClientList<Client>(); for (IClient c : clients.values()) { list.add((Client) c); } return list; } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); Client... |
@Test public void testGetClients() { for (int c = 0; c < 10; c++) { reg.addClient(new Client(reg.nextId(), reg)); } Assert.assertNotNull(reg.getClient("2")); System.gc(); try { Thread.sleep(2000); System.gc(); } catch (InterruptedException e) { } Assert.assertTrue(reg.getClients().size() >= 10); } | @SuppressWarnings("unchecked") protected Collection<IClient> getClients() { if (!hasClients()) { return Collections.EMPTY_SET; } return Collections.unmodifiableCollection(clients.values()); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { @SuppressWarnings("unchecked") protected Collection<IClient> getClients() { if (!hasClients()) { return Collections.EMPTY_SET; } return Collections.unmodifiableCollection(clients.values()); } } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { @SuppressWarnings("unchecked") protected Collection<IClient> getClients() { if (!hasClients()) { return Collections.EMPTY_SET; } return Collections.unmodifiableCollection(clients.values()); } ClientRegistry(); ClientRegistry(String name); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { @SuppressWarnings("unchecked") protected Collection<IClient> getClients() { if (!hasClients()) { return Collections.EMPTY_SET; } return Collections.unmodifiableCollection(clients.values()); } ClientRegistry(); ClientRegistry(String name); Client getClien... | ClientRegistry implements IClientRegistry, ClientRegistryMBean { @SuppressWarnings("unchecked") protected Collection<IClient> getClients() { if (!hasClients()) { return Collections.EMPTY_SET; } return Collections.unmodifiableCollection(clients.values()); } ClientRegistry(); ClientRegistry(String name); Client getClien... |
@Test public void testRemoveClient() { IClient client = reg.lookupClient("1"); Assert.assertNotNull(client); reg.removeClient(client); IClient client2 = null; try { client2 = reg.getClient("1"); fail("An exception should occur here"); } catch (ClientNotFoundException e) { Assert.assertTrue(true); } Assert.assertNull(cl... | protected void removeClient(IClient client) { clients.remove(client.getId()); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void removeClient(IClient client) { clients.remove(client.getId()); } } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void removeClient(IClient client) { clients.remove(client.getId()); } ClientRegistry(); ClientRegistry(String name); } | ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void removeClient(IClient client) { clients.remove(client.getId()); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IClient lookupClient(String id);... | ClientRegistry implements IClientRegistry, ClientRegistryMBean { protected void removeClient(IClient client) { clients.remove(client.getId()); } ClientRegistry(); ClientRegistry(String name); Client getClient(String id); ClientList<Client> getClientList(); boolean hasClient(String id); IClient lookupClient(String id);... |
@Test @Ignore public void testDocToString() { fail("Not yet implemented"); } | public static String docToString(Document dom) { return XMLUtils.docToString1(dom); } | XMLUtils { public static String docToString(Document dom) { return XMLUtils.docToString1(dom); } } | XMLUtils { public static String docToString(Document dom) { return XMLUtils.docToString1(dom); } } | XMLUtils { public static String docToString(Document dom) { return XMLUtils.docToString1(dom); } static Document stringToDoc(String str); static String docToString(Document dom); static String docToString1(Document dom); static String docToString2(Document domDoc); } | XMLUtils { public static String docToString(Document dom) { return XMLUtils.docToString1(dom); } static Document stringToDoc(String str); static String docToString(Document dom); static String docToString1(Document dom); static String docToString2(Document domDoc); } |
@Test public void testBasic() { Object result = ConversionUtils.convert(new Integer(42), String.class); if (!(result instanceof String)) { fail("Should be a string"); } String str = (String) result; assertEquals("42", str); } | public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to convert null to primi... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... |
@Test public void testConvertListToStringArray() { ArrayList<String> source = new ArrayList<String>(); source.add("Testing 1"); source.add("Testing 2"); source.add("Testing 3"); Class<? extends String[]> target = (new String[0]).getClass(); Object result = ConversionUtils.convert(source, target); if (!(result.getClass(... | public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to convert null to primi... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... |
@Test public void testConvertObjectArrayToStringArray() { Object[] source = new Object[3]; source[0] = new Integer(21); source[1] = Boolean.FALSE; source[2] = "Woot"; Class<? extends String[]> target = (new String[0]).getClass(); Object result = ConversionUtils.convert(source, target); if (!(result.getClass().isArray()... | public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to convert null to primi... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... |
@Test public void testConvertToSet() { Object[] source = new Object[3]; source[0] = new Integer(21); source[1] = Boolean.FALSE; source[2] = "Woot"; Object result = ConversionUtils.convert(source, Set.class); if (!(result instanceof Set)) { fail("Should be a set"); } Set<?> results = (Set<?>) result; assertEquals(result... | public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to convert null to primi... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... |
@Test public void testNoOppConvert() { TestJavaBean source = new TestJavaBean(); Object result = ConversionUtils.convert(source, TestJavaBean.class); assertEquals(result, source); } | public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to convert null to primi... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... |
@Test public void testNullConvert() { Object result = ConversionUtils.convert(null, TestJavaBean.class); assertNull(result); } | public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to convert null to primi... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... |
@Test(expected=ConversionException.class) public void testNullConvertNoClass() { ConversionUtils.convert(new TestJavaBean(), null); } | public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to convert null to primi... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... | ConversionUtils { public static Object convert(Object source, Class<?> target) throws ConversionException { if (target == null) { throw new ConversionException("Unable to perform conversion, target was null"); } if (source == null) { if (target.isPrimitive()) { throw new ConversionException(String.format("Unable to con... |
@Test public void testCreateServerStream() { System.out.println("Not yet implemented"); } | public static IServerStream createServerStream(IScope scope, String name) { logger.debug("Creating server stream: {} scope: {}", name, scope); ServerStream stream = new ServerStream(); stream.setScope(scope); stream.setName(name); stream.setPublishedName(name); String key = scope.getName() + '/' + name; serverStreamMap... | StreamUtils { public static IServerStream createServerStream(IScope scope, String name) { logger.debug("Creating server stream: {} scope: {}", name, scope); ServerStream stream = new ServerStream(); stream.setScope(scope); stream.setName(name); stream.setPublishedName(name); String key = scope.getName() + '/' + name; s... | StreamUtils { public static IServerStream createServerStream(IScope scope, String name) { logger.debug("Creating server stream: {} scope: {}", name, scope); ServerStream stream = new ServerStream(); stream.setScope(scope); stream.setName(name); stream.setPublishedName(name); String key = scope.getName() + '/' + name; s... | StreamUtils { public static IServerStream createServerStream(IScope scope, String name) { logger.debug("Creating server stream: {} scope: {}", name, scope); ServerStream stream = new ServerStream(); stream.setScope(scope); stream.setName(name); stream.setPublishedName(name); String key = scope.getName() + '/' + name; s... | StreamUtils { public static IServerStream createServerStream(IScope scope, String name) { logger.debug("Creating server stream: {} scope: {}", name, scope); ServerStream stream = new ServerStream(); stream.setScope(scope); stream.setName(name); stream.setPublishedName(name); String key = scope.getName() + '/' + name; s... |
@Test public void testGetServerStream() { System.out.println("Not yet implemented"); } | public static IServerStream getServerStream(IScope scope, String name) { logger.debug("Looking up server stream: {} scope: {}", name, scope); String key = scope.getName() + '/' + name; if (serverStreamMap.containsKey(key)) { return serverStreamMap.get(key); } else { logger.warn("Server stream not found with key: {}", k... | StreamUtils { public static IServerStream getServerStream(IScope scope, String name) { logger.debug("Looking up server stream: {} scope: {}", name, scope); String key = scope.getName() + '/' + name; if (serverStreamMap.containsKey(key)) { return serverStreamMap.get(key); } else { logger.warn("Server stream not found wi... | StreamUtils { public static IServerStream getServerStream(IScope scope, String name) { logger.debug("Looking up server stream: {} scope: {}", name, scope); String key = scope.getName() + '/' + name; if (serverStreamMap.containsKey(key)) { return serverStreamMap.get(key); } else { logger.warn("Server stream not found wi... | StreamUtils { public static IServerStream getServerStream(IScope scope, String name) { logger.debug("Looking up server stream: {} scope: {}", name, scope); String key = scope.getName() + '/' + name; if (serverStreamMap.containsKey(key)) { return serverStreamMap.get(key); } else { logger.warn("Server stream not found wi... | StreamUtils { public static IServerStream getServerStream(IScope scope, String name) { logger.debug("Looking up server stream: {} scope: {}", name, scope); String key = scope.getName() + '/' + name; if (serverStreamMap.containsKey(key)) { return serverStreamMap.get(key); } else { logger.warn("Server stream not found wi... |
@Test public void testGetExecutor() { System.out.println("testGetExecutor"); assertTrue(pss.getExecutor() != null); } | public ScheduledThreadPoolExecutor getExecutor() { if (executor == null) { log.warn("ScheduledThreadPoolExecutor was null on request"); } return executor; } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public ScheduledThreadPoolExecutor getExecutor() { if (executor == null) { log.warn("ScheduledThreadPoolExecutor was null on request"); } return executor; } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public ScheduledThreadPoolExecutor getExecutor() { if (executor == null) { log.warn("ScheduledThreadPoolExecutor was null on request"); } return executor; } PlaylistSubscriberStream(); } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public ScheduledThreadPoolExecutor getExecutor() { if (executor == null) { log.warn("ScheduledThreadPoolExecutor was null on request"); } return executor; } PlaylistSubscriberStream(); voi... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public ScheduledThreadPoolExecutor getExecutor() { if (executor == null) { log.warn("ScheduledThreadPoolExecutor was null on request"); } return executor; } PlaylistSubscriberStream(); voi... |
@Test @Ignore public void testDocToString1() { fail("Not yet implemented"); } | public static String docToString1(Document dom) { StringWriter sw = new StringWriter(); DOM2Writer.serializeAsXML(dom, sw); return sw.toString(); } | XMLUtils { public static String docToString1(Document dom) { StringWriter sw = new StringWriter(); DOM2Writer.serializeAsXML(dom, sw); return sw.toString(); } } | XMLUtils { public static String docToString1(Document dom) { StringWriter sw = new StringWriter(); DOM2Writer.serializeAsXML(dom, sw); return sw.toString(); } } | XMLUtils { public static String docToString1(Document dom) { StringWriter sw = new StringWriter(); DOM2Writer.serializeAsXML(dom, sw); return sw.toString(); } static Document stringToDoc(String str); static String docToString(Document dom); static String docToString1(Document dom); static String docToString2(Document ... | XMLUtils { public static String docToString1(Document dom) { StringWriter sw = new StringWriter(); DOM2Writer.serializeAsXML(dom, sw); return sw.toString(); } static Document stringToDoc(String str); static String docToString(Document dom); static String docToString1(Document dom); static String docToString2(Document ... |
@Test public void testStart() { System.out.println("testStart"); SimplePlayItem item = new SimplePlayItem(); item.setName("DarkKnight.flv"); pss.addItem(item); pss.start(); } | public void start() { if (engine == null) { IScope scope = getScope(); if (scope != null) { IContext ctx = scope.getContext(); ISchedulingService schedulingService = (ISchedulingService) ctx.getBean(ISchedulingService.BEAN_NAME); IConsumerService consumerService = (IConsumerService) ctx.getBean(IConsumerService.KEY); I... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void start() { if (engine == null) { IScope scope = getScope(); if (scope != null) { IContext ctx = scope.getContext(); ISchedulingService schedulingService = (ISchedulingService) c... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void start() { if (engine == null) { IScope scope = getScope(); if (scope != null) { IContext ctx = scope.getContext(); ISchedulingService schedulingService = (ISchedulingService) c... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void start() { if (engine == null) { IScope scope = getScope(); if (scope != null) { IContext ctx = scope.getContext(); ISchedulingService schedulingService = (ISchedulingService) c... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void start() { if (engine == null) { IScope scope = getScope(); if (scope != null) { IContext ctx = scope.getContext(); ISchedulingService schedulingService = (ISchedulingService) c... |
@Test public void testPlay() throws Exception { System.out.println("testPlay"); pss.play(); } | public void play() throws IOException { int count = items.size(); if (count == 0) { return; } if (currentItemIndex == -1) { moveToNext(); } while (count-- > 0) { IPlayItem item = null; read.lock(); try { item = items.get(currentItemIndex); engine.play(item); break; } catch (StreamNotFoundException e) { moveToNext(); if... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void play() throws IOException { int count = items.size(); if (count == 0) { return; } if (currentItemIndex == -1) { moveToNext(); } while (count-- > 0) { IPlayItem item = null; rea... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void play() throws IOException { int count = items.size(); if (count == 0) { return; } if (currentItemIndex == -1) { moveToNext(); } while (count-- > 0) { IPlayItem item = null; rea... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void play() throws IOException { int count = items.size(); if (count == 0) { return; } if (currentItemIndex == -1) { moveToNext(); } while (count-- > 0) { IPlayItem item = null; rea... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void play() throws IOException { int count = items.size(); if (count == 0) { return; } if (currentItemIndex == -1) { moveToNext(); } while (count-- > 0) { IPlayItem item = null; rea... |
@Test public void testPause() { System.out.println("testPause"); long sent = pss.getBytesSent(); pss.pause((int) sent); } | public void pause(int position) { try { engine.pause(position); } catch (IllegalStateException e) { log.debug("pause caught an IllegalStateException"); } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void pause(int position) { try { engine.pause(position); } catch (IllegalStateException e) { log.debug("pause caught an IllegalStateException"); } } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void pause(int position) { try { engine.pause(position); } catch (IllegalStateException e) { log.debug("pause caught an IllegalStateException"); } } PlaylistSubscriberStream(); } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void pause(int position) { try { engine.pause(position); } catch (IllegalStateException e) { log.debug("pause caught an IllegalStateException"); } } PlaylistSubscriberStream(); void... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void pause(int position) { try { engine.pause(position); } catch (IllegalStateException e) { log.debug("pause caught an IllegalStateException"); } } PlaylistSubscriberStream(); void... |
@Test public void testResume() { System.out.println("testResume"); long sent = pss.getBytesSent(); pss.resume((int) sent); } | public void resume(int position) { try { engine.resume(position); } catch (IllegalStateException e) { log.debug("resume caught an IllegalStateException"); } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void resume(int position) { try { engine.resume(position); } catch (IllegalStateException e) { log.debug("resume caught an IllegalStateException"); } } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void resume(int position) { try { engine.resume(position); } catch (IllegalStateException e) { log.debug("resume caught an IllegalStateException"); } } PlaylistSubscriberStream(); } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void resume(int position) { try { engine.resume(position); } catch (IllegalStateException e) { log.debug("resume caught an IllegalStateException"); } } PlaylistSubscriberStream(); v... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void resume(int position) { try { engine.resume(position); } catch (IllegalStateException e) { log.debug("resume caught an IllegalStateException"); } } PlaylistSubscriberStream(); v... |
@Test public void testSeek() { System.out.println("testSeek"); long sent = pss.getBytesSent(); try { pss.seek((int) (sent * 2)); } catch (OperationNotSupportedException e) { e.printStackTrace(); } } | public void seek(int position) throws OperationNotSupportedException { try { engine.seek(position); } catch (IllegalStateException e) { log.debug("seek caught an IllegalStateException"); } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void seek(int position) throws OperationNotSupportedException { try { engine.seek(position); } catch (IllegalStateException e) { log.debug("seek caught an IllegalStateException"); }... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void seek(int position) throws OperationNotSupportedException { try { engine.seek(position); } catch (IllegalStateException e) { log.debug("seek caught an IllegalStateException"); }... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void seek(int position) throws OperationNotSupportedException { try { engine.seek(position); } catch (IllegalStateException e) { log.debug("seek caught an IllegalStateException"); }... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void seek(int position) throws OperationNotSupportedException { try { engine.seek(position); } catch (IllegalStateException e) { log.debug("seek caught an IllegalStateException"); }... |
@Test public void testAddItemIPlayItem() { System.out.println("testAddItemIPlayItem"); SimplePlayItem item = new SimplePlayItem(); item.setName("IronMan.flv"); pss.addItem(item); } | public void addItem(IPlayItem item) { write.lock(); try { items.add(item); } finally { write.unlock(); } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void addItem(IPlayItem item) { write.lock(); try { items.add(item); } finally { write.unlock(); } } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void addItem(IPlayItem item) { write.lock(); try { items.add(item); } finally { write.unlock(); } } PlaylistSubscriberStream(); } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void addItem(IPlayItem item) { write.lock(); try { items.add(item); } finally { write.unlock(); } } PlaylistSubscriberStream(); void setExecutor(ScheduledThreadPoolExecutor executor... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void addItem(IPlayItem item) { write.lock(); try { items.add(item); } finally { write.unlock(); } } PlaylistSubscriberStream(); void setExecutor(ScheduledThreadPoolExecutor executor... |
@Test public void testPreviousItem() { log.error("Not yet implemented -- get on that"); } | public void previousItem() { stop(); moveToPrevious(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { item = items.get(currentItemIndex); engine.play(item); break; } catch (IOException err) { log.error("Error while starting to play item,... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void previousItem() { stop(); moveToPrevious(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { ite... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void previousItem() { stop(); moveToPrevious(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { ite... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void previousItem() { stop(); moveToPrevious(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { ite... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void previousItem() { stop(); moveToPrevious(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { ite... |
@Test public void testNextItem() { log.error("Not yet implemented -- get on that"); } | public void nextItem() { moveToNext(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { item = items.get(currentItemIndex); engine.play(item, false); break; } catch (IOException err) { log.error("Error while starting to play item, moving t... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void nextItem() { moveToNext(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { item = items.get(cu... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void nextItem() { moveToNext(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { item = items.get(cu... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void nextItem() { moveToNext(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { item = items.get(cu... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void nextItem() { moveToNext(); if (currentItemIndex == -1) { return; } IPlayItem item = null; int count = items.size(); while (count-- > 0) { read.lock(); try { item = items.get(cu... |
@Test public void testSetItem() { log.error("Not yet implemented -- get on that"); } | public void setItem(int index) { if (index < 0 || index >= items.size()) { return; } stop(); currentItemIndex = index; read.lock(); try { IPlayItem item = items.get(currentItemIndex); engine.play(item); } catch (IOException e) { log.error("setItem caught a IOException", e); } catch (StreamNotFoundException e) { log.deb... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void setItem(int index) { if (index < 0 || index >= items.size()) { return; } stop(); currentItemIndex = index; read.lock(); try { IPlayItem item = items.get(currentItemIndex); engi... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void setItem(int index) { if (index < 0 || index >= items.size()) { return; } stop(); currentItemIndex = index; read.lock(); try { IPlayItem item = items.get(currentItemIndex); engi... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void setItem(int index) { if (index < 0 || index >= items.size()) { return; } stop(); currentItemIndex = index; read.lock(); try { IPlayItem item = items.get(currentItemIndex); engi... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void setItem(int index) { if (index < 0 || index >= items.size()) { return; } stop(); currentItemIndex = index; read.lock(); try { IPlayItem item = items.get(currentItemIndex); engi... |
@Test public void testStop() { System.out.println("testStop"); pss.stop(); } | public void stop() { try { engine.stop(); } catch (IllegalStateException e) { log.debug("stop caught an IllegalStateException"); } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void stop() { try { engine.stop(); } catch (IllegalStateException e) { log.debug("stop caught an IllegalStateException"); } } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void stop() { try { engine.stop(); } catch (IllegalStateException e) { log.debug("stop caught an IllegalStateException"); } } PlaylistSubscriberStream(); } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void stop() { try { engine.stop(); } catch (IllegalStateException e) { log.debug("stop caught an IllegalStateException"); } } PlaylistSubscriberStream(); void setExecutor(ScheduledT... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void stop() { try { engine.stop(); } catch (IllegalStateException e) { log.debug("stop caught an IllegalStateException"); } } PlaylistSubscriberStream(); void setExecutor(ScheduledT... |
@Test @Ignore public void testDocToString2() { fail("Not yet implemented"); } | public static String docToString2(Document domDoc) throws IOException { try { TransformerFactory transFact = TransformerFactory.newInstance(); Transformer trans = transFact.newTransformer(); trans.setOutputProperty(OutputKeys.INDENT, "no"); StringWriter sw = new StringWriter(); Result result = new StreamResult(sw); tra... | XMLUtils { public static String docToString2(Document domDoc) throws IOException { try { TransformerFactory transFact = TransformerFactory.newInstance(); Transformer trans = transFact.newTransformer(); trans.setOutputProperty(OutputKeys.INDENT, "no"); StringWriter sw = new StringWriter(); Result result = new StreamResu... | XMLUtils { public static String docToString2(Document domDoc) throws IOException { try { TransformerFactory transFact = TransformerFactory.newInstance(); Transformer trans = transFact.newTransformer(); trans.setOutputProperty(OutputKeys.INDENT, "no"); StringWriter sw = new StringWriter(); Result result = new StreamResu... | XMLUtils { public static String docToString2(Document domDoc) throws IOException { try { TransformerFactory transFact = TransformerFactory.newInstance(); Transformer trans = transFact.newTransformer(); trans.setOutputProperty(OutputKeys.INDENT, "no"); StringWriter sw = new StringWriter(); Result result = new StreamResu... | XMLUtils { public static String docToString2(Document domDoc) throws IOException { try { TransformerFactory transFact = TransformerFactory.newInstance(); Transformer trans = transFact.newTransformer(); trans.setOutputProperty(OutputKeys.INDENT, "no"); StringWriter sw = new StringWriter(); Result result = new StreamResu... |
@Test public void testClose() { System.out.println("testClose"); pss.close(); } | public void close() { engine.close(); bwController.unregisterBWControllable(bwContext); notifySubscriberClose(); } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void close() { engine.close(); bwController.unregisterBWControllable(bwContext); notifySubscriberClose(); } } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void close() { engine.close(); bwController.unregisterBWControllable(bwContext); notifySubscriberClose(); } PlaylistSubscriberStream(); } | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void close() { engine.close(); bwController.unregisterBWControllable(bwContext); notifySubscriberClose(); } PlaylistSubscriberStream(); void setExecutor(ScheduledThreadPoolExecutor ... | PlaylistSubscriberStream extends AbstractClientStream implements
IPlaylistSubscriberStream, IPlaylistSubscriberStreamStatistics { public void close() { engine.close(); bwController.unregisterBWControllable(bwContext); notifySubscriberClose(); } PlaylistSubscriberStream(); void setExecutor(ScheduledThreadPoolExecutor ... |
@Test public void testScope() { if (appScope == null) { appScope = (WebScope) applicationContext.getBean("web.scope"); log.debug("Application / web scope: {}", appScope); } TestCase.assertTrue(appScope.createChildScope("room1")); IScope room1 = appScope.getScope("room1"); log.debug("Room 1: {}", room1); IContext rmCtx1... | public Scope() { this(null); } | Scope extends BasicScope implements IScope, IScopeStatistics,
ScopeMBean { public Scope() { this(null); } } | Scope extends BasicScope implements IScope, IScopeStatistics,
ScopeMBean { public Scope() { this(null); } Scope(); Scope(String name); } | Scope extends BasicScope implements IScope, IScopeStatistics,
ScopeMBean { public Scope() { this(null); } Scope(); Scope(String name); boolean addChildScope(IBasicScope scope); boolean connect(IConnection conn); boolean connect(IConnection conn, Object[] params); boolean createChildScope(String name); void destroy()... | Scope extends BasicScope implements IScope, IScopeStatistics,
ScopeMBean { public Scope() { this(null); } Scope(); Scope(String name); boolean addChildScope(IBasicScope scope); boolean connect(IConnection conn); boolean connect(IConnection conn, Object[] params); boolean createChildScope(String name); void destroy()... |
@Test public void testLocationsProperty() { ExtendedPropertyPlaceholderConfigurer configurer = (ExtendedPropertyPlaceholderConfigurer)context.getBean( "boringPlaceholderConfig" ); assertEquals( testProperties, configurer.getMergedProperties() ); } | public Properties getMergedProperties() { return mergedProperties; } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } Properties getMergedProperties(); void setWildcardLocations( String[] locations ); static synchronized void addGlobalProperty( String key, String val ); } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } Properties getMergedProperties(); void setWildcardLocations( String[] locations ); static synchronized void addGlobalProperty( String key, String val ); } |
@Test public void testWildcardLocationsProperty() { ExtendedPropertyPlaceholderConfigurer configurer = (ExtendedPropertyPlaceholderConfigurer)context.getBean( "wildcard1PlaceholderConfig" ); Properties mergedProp = new Properties(); mergedProp.putAll( testProperties ); mergedProp.putAll( testAProperties ); mergedProp.p... | public Properties getMergedProperties() { return mergedProperties; } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } Properties getMergedProperties(); void setWildcardLocations( String[] locations ); static synchronized void addGlobalProperty( String key, String val ); } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } Properties getMergedProperties(); void setWildcardLocations( String[] locations ); static synchronized void addGlobalProperty( String key, String val ); } |
@Test public void testLocationsPropertyOverridesWildcardLocationsProperty() { ExtendedPropertyPlaceholderConfigurer configurer = (ExtendedPropertyPlaceholderConfigurer)context.getBean( "locationsOverridesWildcardLocationsPlaceholderConfig" ); Properties mergedProp = new Properties(); mergedProp.putAll( testProperties )... | public Properties getMergedProperties() { return mergedProperties; } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } Properties getMergedProperties(); void setWildcardLocations( String[] locations ); static synchronized void addGlobalProperty( String key, String val ); } | ExtendedPropertyPlaceholderConfigurer extends PropertyPlaceholderConfigurer { public Properties getMergedProperties() { return mergedProperties; } Properties getMergedProperties(); void setWildcardLocations( String[] locations ); static synchronized void addGlobalProperty( String key, String val ); } |
@Test public void testHMAC() { HMAC h1 = new HMAC(); assertNotNull(h1); try { Provider sp = new com.sun.crypto.provider.SunJCE(); Security.addProvider(sp); } catch (Exception e) { fail("Problem loading crypto provider" + e); } byte[] hmac = h1.computeMac(); assertNull("Currently HMAC is broken since you can't actually ... | public byte[] computeMac() { Mac hm = null; byte[] result = null; if (log.isDebugEnabled()) { log.debug("Key data: {}", byteArrayToHex(keyBytes)); log.debug("Hash data: {}", byteArrayToHex(dataBytes)); log.debug("Algorithm: {}", ALGORITHM_ID); } try { hm = Mac.getInstance(ALGORITHM_ID); Key k1 = new SecretKeySpec(keyBy... | HMAC { public byte[] computeMac() { Mac hm = null; byte[] result = null; if (log.isDebugEnabled()) { log.debug("Key data: {}", byteArrayToHex(keyBytes)); log.debug("Hash data: {}", byteArrayToHex(dataBytes)); log.debug("Algorithm: {}", ALGORITHM_ID); } try { hm = Mac.getInstance(ALGORITHM_ID); Key k1 = new SecretKeySpe... | HMAC { public byte[] computeMac() { Mac hm = null; byte[] result = null; if (log.isDebugEnabled()) { log.debug("Key data: {}", byteArrayToHex(keyBytes)); log.debug("Hash data: {}", byteArrayToHex(dataBytes)); log.debug("Algorithm: {}", ALGORITHM_ID); } try { hm = Mac.getInstance(ALGORITHM_ID); Key k1 = new SecretKeySpe... | HMAC { public byte[] computeMac() { Mac hm = null; byte[] result = null; if (log.isDebugEnabled()) { log.debug("Key data: {}", byteArrayToHex(keyBytes)); log.debug("Hash data: {}", byteArrayToHex(dataBytes)); log.debug("Algorithm: {}", ALGORITHM_ID); } try { hm = Mac.getInstance(ALGORITHM_ID); Key k1 = new SecretKeySpe... | HMAC { public byte[] computeMac() { Mac hm = null; byte[] result = null; if (log.isDebugEnabled()) { log.debug("Key data: {}", byteArrayToHex(keyBytes)); log.debug("Hash data: {}", byteArrayToHex(dataBytes)); log.debug("Algorithm: {}", ALGORITHM_ID); } try { hm = Mac.getInstance(ALGORITHM_ID); Key k1 = new SecretKeySpe... |
@Test public void testInit() { System.out.println("Not yet implemented"); } | public void init() { HashMap<String, Object> env = null; if (enableRmiAdapter) { log.debug("Create an RMI connector server"); System.setProperty("java.rmi.server.hostname", rmiAdapterHost); try { Registry r = null; try { r = LocateRegistry.getRegistry(Integer .valueOf(rmiAdapterPort)); for (String regName : r.list()) {... | JMXAgent implements NotificationListener { public void init() { HashMap<String, Object> env = null; if (enableRmiAdapter) { log.debug("Create an RMI connector server"); System.setProperty("java.rmi.server.hostname", rmiAdapterHost); try { Registry r = null; try { r = LocateRegistry.getRegistry(Integer .valueOf(rmiAdapt... | JMXAgent implements NotificationListener { public void init() { HashMap<String, Object> env = null; if (enableRmiAdapter) { log.debug("Create an RMI connector server"); System.setProperty("java.rmi.server.hostname", rmiAdapterHost); try { Registry r = null; try { r = LocateRegistry.getRegistry(Integer .valueOf(rmiAdapt... | JMXAgent implements NotificationListener { public void init() { HashMap<String, Object> env = null; if (enableRmiAdapter) { log.debug("Create an RMI connector server"); System.setProperty("java.rmi.server.hostname", rmiAdapterHost); try { Registry r = null; try { r = LocateRegistry.getRegistry(Integer .valueOf(rmiAdapt... | JMXAgent implements NotificationListener { public void init() { HashMap<String, Object> env = null; if (enableRmiAdapter) { log.debug("Create an RMI connector server"); System.setProperty("java.rmi.server.hostname", rmiAdapterHost); try { Registry r = null; try { r = LocateRegistry.getRegistry(Integer .valueOf(rmiAdapt... |
@Test public void testUnregisterMBean() throws Exception { logger.info("Default jmx domain: {}", JMXFactory.getDefaultDomain()); JMXAgent agent = new JMXAgent(); agent.init(); MBeanServer mbs = JMXFactory.getMBeanServer(); ObjectName oName = JMXFactory.createMBean( "org.red5.server.net.rtmp.RTMPMinaConnection", "connec... | public static boolean unregisterMBean(ObjectName oName) { boolean unregistered = false; if (null != oName) { try { if (mbs.isRegistered(oName)) { log.debug("Mbean is registered"); mbs.unregisterMBean(oName); unregistered = !mbs.isRegistered(oName); } else { log.debug("Mbean is not currently registered"); } } catch (Exc... | JMXAgent implements NotificationListener { public static boolean unregisterMBean(ObjectName oName) { boolean unregistered = false; if (null != oName) { try { if (mbs.isRegistered(oName)) { log.debug("Mbean is registered"); mbs.unregisterMBean(oName); unregistered = !mbs.isRegistered(oName); } else { log.debug("Mbean is... | JMXAgent implements NotificationListener { public static boolean unregisterMBean(ObjectName oName) { boolean unregistered = false; if (null != oName) { try { if (mbs.isRegistered(oName)) { log.debug("Mbean is registered"); mbs.unregisterMBean(oName); unregistered = !mbs.isRegistered(oName); } else { log.debug("Mbean is... | JMXAgent implements NotificationListener { public static boolean unregisterMBean(ObjectName oName) { boolean unregistered = false; if (null != oName) { try { if (mbs.isRegistered(oName)) { log.debug("Mbean is registered"); mbs.unregisterMBean(oName); unregistered = !mbs.isRegistered(oName); } else { log.debug("Mbean is... | JMXAgent implements NotificationListener { public static boolean unregisterMBean(ObjectName oName) { boolean unregistered = false; if (null != oName) { try { if (mbs.isRegistered(oName)) { log.debug("Mbean is registered"); mbs.unregisterMBean(oName); unregistered = !mbs.isRegistered(oName); } else { log.debug("Mbean is... |
@Test public void testCreateMBean() { ObjectName objectName = null; try { objectName = JMXFactory.createMBean( "org.red5.server.jmx.JMXFactoryTest", "test=1"); assertNotNull(objectName); objectName = JMXFactory.createMBean( "org.red5.server.jmx.JMXFactoryTest", "test=2"); assertNotNull(objectName); objectName = JMXFact... | public static ObjectName createMBean(String className, String attributes) { log.info("Create the {} MBean within the MBeanServer", className); ObjectName objectName = null; try { StringBuilder objectNameStr = new StringBuilder(domain); objectNameStr.append(":type="); objectNameStr.append(className .substring(className.... | JMXFactory { public static ObjectName createMBean(String className, String attributes) { log.info("Create the {} MBean within the MBeanServer", className); ObjectName objectName = null; try { StringBuilder objectNameStr = new StringBuilder(domain); objectNameStr.append(":type="); objectNameStr.append(className .substri... | JMXFactory { public static ObjectName createMBean(String className, String attributes) { log.info("Create the {} MBean within the MBeanServer", className); ObjectName objectName = null; try { StringBuilder objectNameStr = new StringBuilder(domain); objectNameStr.append(":type="); objectNameStr.append(className .substri... | JMXFactory { public static ObjectName createMBean(String className, String attributes) { log.info("Create the {} MBean within the MBeanServer", className); ObjectName objectName = null; try { StringBuilder objectNameStr = new StringBuilder(domain); objectNameStr.append(":type="); objectNameStr.append(className .substri... | JMXFactory { public static ObjectName createMBean(String className, String attributes) { log.info("Create the {} MBean within the MBeanServer", className); ObjectName objectName = null; try { StringBuilder objectNameStr = new StringBuilder(domain); objectNameStr.append(":type="); objectNameStr.append(className .substri... |
@Test public void testCreateSimpleMBean() { System.out.println("Not yet implemented"); } | public static ObjectName createSimpleMBean(String className, String objectNameStr) { log.info("Create the {} MBean within the MBeanServer", className); log.info("ObjectName = {}", objectNameStr); try { ObjectName objectName = ObjectName.getInstance(objectNameStr); if (!mbs.isRegistered(objectName)) { mbs.createMBean(cl... | JMXFactory { public static ObjectName createSimpleMBean(String className, String objectNameStr) { log.info("Create the {} MBean within the MBeanServer", className); log.info("ObjectName = {}", objectNameStr); try { ObjectName objectName = ObjectName.getInstance(objectNameStr); if (!mbs.isRegistered(objectName)) { mbs.c... | JMXFactory { public static ObjectName createSimpleMBean(String className, String objectNameStr) { log.info("Create the {} MBean within the MBeanServer", className); log.info("ObjectName = {}", objectNameStr); try { ObjectName objectName = ObjectName.getInstance(objectNameStr); if (!mbs.isRegistered(objectName)) { mbs.c... | JMXFactory { public static ObjectName createSimpleMBean(String className, String objectNameStr) { log.info("Create the {} MBean within the MBeanServer", className); log.info("ObjectName = {}", objectNameStr); try { ObjectName objectName = ObjectName.getInstance(objectNameStr); if (!mbs.isRegistered(objectName)) { mbs.c... | JMXFactory { public static ObjectName createSimpleMBean(String className, String objectNameStr) { log.info("Create the {} MBean within the MBeanServer", className); log.info("ObjectName = {}", objectNameStr); try { ObjectName objectName = ObjectName.getInstance(objectNameStr); if (!mbs.isRegistered(objectName)) { mbs.c... |
@Test public void testGetDefaultDomain() { System.out.println("Not yet implemented"); } | public static String getDefaultDomain() { return domain; } | JMXFactory { public static String getDefaultDomain() { return domain; } } | JMXFactory { public static String getDefaultDomain() { return domain; } } | JMXFactory { public static String getDefaultDomain() { return domain; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); static MBe... | JMXFactory { public static String getDefaultDomain() { return domain; } static ObjectName createMBean(String className, String attributes); static ObjectName createObjectName(String... strings); static ObjectName createSimpleMBean(String className,
String objectNameStr); static String getDefaultDomain(); static MBe... |
@Test public void testValueOf() { } | public static PhysicsUnit<?> valueOf(CharSequence charSequence) { return UCUMFormat.getCaseSensitiveInstance().parse(charSequence, new ParsePosition(0)); } | PhysicsUnit implements Unit<Q>, XMLSerializable { public static PhysicsUnit<?> valueOf(CharSequence charSequence) { return UCUMFormat.getCaseSensitiveInstance().parse(charSequence, new ParsePosition(0)); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { public static PhysicsUnit<?> valueOf(CharSequence charSequence) { return UCUMFormat.getCaseSensitiveInstance().parse(charSequence, new ParsePosition(0)); } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { public static PhysicsUnit<?> valueOf(CharSequence charSequence) { return UCUMFormat.getCaseSensitiveInstance().parse(charSequence, new ParsePosition(0)); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(... | PhysicsUnit implements Unit<Q>, XMLSerializable { public static PhysicsUnit<?> valueOf(CharSequence charSequence) { return UCUMFormat.getCaseSensitiveInstance().parse(charSequence, new ParsePosition(0)); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(... |
@Test public void testGetConverterToAny() { } | @Override public final UnitConverter getConverterToAny(Unit<?> that) throws IncommensurableException, UnconvertibleException { if (!isCompatible(that)) throw new IncommensurableException(this + " is not compatible with " + that); PhysicsUnit thatPhysics = (PhysicsUnit)that; DimensionalModel model = DimensionalModel.get... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final UnitConverter getConverterToAny(Unit<?> that) throws IncommensurableException, UnconvertibleException { if (!isCompatible(that)) throw new IncommensurableException(this + " is not compatible with " + that); PhysicsUnit thatPhysics = (PhysicsUnit)t... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final UnitConverter getConverterToAny(Unit<?> that) throws IncommensurableException, UnconvertibleException { if (!isCompatible(that)) throw new IncommensurableException(this + " is not compatible with " + that); PhysicsUnit thatPhysics = (PhysicsUnit)t... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final UnitConverter getConverterToAny(Unit<?> that) throws IncommensurableException, UnconvertibleException { if (!isCompatible(that)) throw new IncommensurableException(this + " is not compatible with " + that); PhysicsUnit thatPhysics = (PhysicsUnit)t... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final UnitConverter getConverterToAny(Unit<?> that) throws IncommensurableException, UnconvertibleException { if (!isCompatible(that)) throw new IncommensurableException(this + " is not compatible with " + that); PhysicsUnit thatPhysics = (PhysicsUnit)t... |
@Test public void testAlternate() { } | @Override public final PhysicsUnit<?> alternate(String symbol) { return new AlternateUnit(this, symbol); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> alternate(String symbol) { return new AlternateUnit(this, symbol); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> alternate(String symbol) { return new AlternateUnit(this, symbol); } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> alternate(String symbol) { return new AlternateUnit(this, symbol); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); ... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> alternate(String symbol) { return new AlternateUnit(this, symbol); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); ... |
@Test public void testTransform() { } | @Override public final PhysicsUnit<Q> transform(UnitConverter operation) { PhysicsUnit<Q> systemUnit = this.getSystemUnit(); UnitConverter cvtr = this.getConverterToSI().concatenate(operation); if (cvtr.equals(PhysicsConverter.IDENTITY)) return systemUnit; return new TransformedUnit<Q>(systemUnit, cvtr); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> transform(UnitConverter operation) { PhysicsUnit<Q> systemUnit = this.getSystemUnit(); UnitConverter cvtr = this.getConverterToSI().concatenate(operation); if (cvtr.equals(PhysicsConverter.IDENTITY)) return systemUnit; return new Tr... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> transform(UnitConverter operation) { PhysicsUnit<Q> systemUnit = this.getSystemUnit(); UnitConverter cvtr = this.getConverterToSI().concatenate(operation); if (cvtr.equals(PhysicsConverter.IDENTITY)) return systemUnit; return new Tr... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> transform(UnitConverter operation) { PhysicsUnit<Q> systemUnit = this.getSystemUnit(); UnitConverter cvtr = this.getConverterToSI().concatenate(operation); if (cvtr.equals(PhysicsConverter.IDENTITY)) return systemUnit; return new Tr... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> transform(UnitConverter operation) { PhysicsUnit<Q> systemUnit = this.getSystemUnit(); UnitConverter cvtr = this.getConverterToSI().concatenate(operation); if (cvtr.equals(PhysicsConverter.IDENTITY)) return systemUnit; return new Tr... |
@Test public void testAdd() { } | @Override public final PhysicsUnit<Q> add(double offset) { if (offset == 0) return this; return transform(new AddConverter(offset)); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> add(double offset) { if (offset == 0) return this; return transform(new AddConverter(offset)); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> add(double offset) { if (offset == 0) return this; return transform(new AddConverter(offset)); } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> add(double offset) { if (offset == 0) return this; return transform(new AddConverter(offset)); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> a... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> add(double offset) { if (offset == 0) return this; return transform(new AddConverter(offset)); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> a... |
@Test public void testInverse() { } | @Override public final PhysicsUnit<?> inverse() { if (this.equals(SI.ONE)) return this; return ProductUnit.getQuotientInstance(SI.ONE, this); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> inverse() { if (this.equals(SI.ONE)) return this; return ProductUnit.getQuotientInstance(SI.ONE, this); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> inverse() { if (this.equals(SI.ONE)) return this; return ProductUnit.getQuotientInstance(SI.ONE, this); } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> inverse() { if (this.equals(SI.ONE)) return this; return ProductUnit.getQuotientInstance(SI.ONE, this); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); Annotated... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> inverse() { if (this.equals(SI.ONE)) return this; return ProductUnit.getQuotientInstance(SI.ONE, this); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); Annotated... |
@Test public void testRoot() { } | @Override public final PhysicsUnit<?> root(int n) { if (n > 0) return ProductUnit.getRootInstance(this, n); else if (n == 0) throw new ArithmeticException("Root's order of zero"); else return SI.ONE.divide(this.root(-n)); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> root(int n) { if (n > 0) return ProductUnit.getRootInstance(this, n); else if (n == 0) throw new ArithmeticException("Root's order of zero"); else return SI.ONE.divide(this.root(-n)); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> root(int n) { if (n > 0) return ProductUnit.getRootInstance(this, n); else if (n == 0) throw new ArithmeticException("Root's order of zero"); else return SI.ONE.divide(this.root(-n)); } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> root(int n) { if (n > 0) return ProductUnit.getRootInstance(this, n); else if (n == 0) throw new ArithmeticException("Root's order of zero"); else return SI.ONE.divide(this.root(-n)); } protected PhysicsUnit(); boolean isSI(); abst... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> root(int n) { if (n > 0) return ProductUnit.getRootInstance(this, n); else if (n == 0) throw new ArithmeticException("Root's order of zero"); else return SI.ONE.divide(this.root(-n)); } protected PhysicsUnit(); boolean isSI(); abst... |
@Test public void testPow() { } | @Override public final PhysicsUnit<?> pow(int n) { if (n > 0) return this.multiply(this.pow(n - 1)); else if (n == 0) return SI.ONE; else return SI.ONE.divide(this.pow(-n)); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> pow(int n) { if (n > 0) return this.multiply(this.pow(n - 1)); else if (n == 0) return SI.ONE; else return SI.ONE.divide(this.pow(-n)); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> pow(int n) { if (n > 0) return this.multiply(this.pow(n - 1)); else if (n == 0) return SI.ONE; else return SI.ONE.divide(this.pow(-n)); } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> pow(int n) { if (n > 0) return this.multiply(this.pow(n - 1)); else if (n == 0) return SI.ONE; else return SI.ONE.divide(this.pow(-n)); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConvert... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<?> pow(int n) { if (n > 0) return this.multiply(this.pow(n - 1)); else if (n == 0) return SI.ONE; else return SI.ONE.divide(this.pow(-n)); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConvert... |
@Test public void testHashCode() { } | @Override public abstract int hashCode(); | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract int hashCode(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract int hashCode(); protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract int hashCode(); protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(CharSequence charSequence); @Overri... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract int hashCode(); protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(CharSequence charSequence); @Overri... |
@Test public void testEquals() { } | @Override public abstract boolean equals(Object that); | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract boolean equals(Object that); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract boolean equals(Object that); protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract boolean equals(Object that); protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(CharSequence charSeque... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract boolean equals(Object that); protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(CharSequence charSeque... |
@Test public void testAnnotate() { } | public AnnotatedUnit<Q> annotate(String annotation) { return new AnnotatedUnit<Q>(this, annotation); } | PhysicsUnit implements Unit<Q>, XMLSerializable { public AnnotatedUnit<Q> annotate(String annotation) { return new AnnotatedUnit<Q>(this, annotation); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { public AnnotatedUnit<Q> annotate(String annotation) { return new AnnotatedUnit<Q>(this, annotation); } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { public AnnotatedUnit<Q> annotate(String annotation) { return new AnnotatedUnit<Q>(this, annotation); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); stat... | PhysicsUnit implements Unit<Q>, XMLSerializable { public AnnotatedUnit<Q> annotate(String annotation) { return new AnnotatedUnit<Q>(this, annotation); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); stat... |
@Test public void testToString() { } | @Override public String toString() { TextBuilder tmp = TextBuilder.newInstance(); try { return UCUMFormat.getCaseSensitiveInstance().format(this, tmp).toString(); } catch (IOException ioException) { throw new Error(ioException); } finally { TextBuilder.recycle(tmp); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public String toString() { TextBuilder tmp = TextBuilder.newInstance(); try { return UCUMFormat.getCaseSensitiveInstance().format(this, tmp).toString(); } catch (IOException ioException) { throw new Error(ioException); } finally { TextBuilder.recycle(tmp); } }... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public String toString() { TextBuilder tmp = TextBuilder.newInstance(); try { return UCUMFormat.getCaseSensitiveInstance().format(this, tmp).toString(); } catch (IOException ioException) { throw new Error(ioException); } finally { TextBuilder.recycle(tmp); } }... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public String toString() { TextBuilder tmp = TextBuilder.newInstance(); try { return UCUMFormat.getCaseSensitiveInstance().format(this, tmp).toString(); } catch (IOException ioException) { throw new Error(ioException); } finally { TextBuilder.recycle(tmp); } }... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public String toString() { TextBuilder tmp = TextBuilder.newInstance(); try { return UCUMFormat.getCaseSensitiveInstance().format(this, tmp).toString(); } catch (IOException ioException) { throw new Error(ioException); } finally { TextBuilder.recycle(tmp); } }... |
@Test public void testGetSymbol() { } | @Override public String getSymbol() { return null; } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public String getSymbol() { return null; } } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public String getSymbol() { return null; } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public String getSymbol() { return null; } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(CharSequence charSequenc... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public String getSymbol() { return null; } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(CharSequence charSequenc... |
@Test public void testGetSystemUnit() { } | @Override public final PhysicsUnit<Q> getSystemUnit() { return toSI(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> getSystemUnit() { return toSI(); } } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> getSystemUnit() { return toSI(); } protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> getSystemUnit() { return toSI(); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(Char... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final PhysicsUnit<Q> getSystemUnit() { return toSI(); } protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(Char... |
@Test public void testGetProductUnits() { } | @Override public abstract Map<? extends PhysicsUnit, Integer> getProductUnits(); | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract Map<? extends PhysicsUnit, Integer> getProductUnits(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract Map<? extends PhysicsUnit, Integer> getProductUnits(); protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract Map<? extends PhysicsUnit, Integer> getProductUnits(); protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valu... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract Map<? extends PhysicsUnit, Integer> getProductUnits(); protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valu... |
@Test public void testGetDimension() { } | @Override public abstract PhysicsDimension getDimension(); | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract PhysicsDimension getDimension(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract PhysicsDimension getDimension(); protected PhysicsUnit(); } | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract PhysicsDimension getDimension(); protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(CharSequence charS... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public abstract PhysicsDimension getDimension(); protected PhysicsUnit(); boolean isSI(); abstract PhysicsUnit<Q> toSI(); abstract UnitConverter getConverterToSI(); AnnotatedUnit<Q> annotate(String annotation); static PhysicsUnit<?> valueOf(CharSequence charS... |
@Test public void testIsCompatible() { } | @Override public final boolean isCompatible(Unit<?> that) { if ((this == that) || this.equals(that)) return true; if (!(that instanceof PhysicsUnit)) return false; PhysicsDimension thisDimension = this.getDimension(); PhysicsDimension thatDimension = ((PhysicsUnit)that).getDimension(); if (thisDimension.equals(thatDime... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final boolean isCompatible(Unit<?> that) { if ((this == that) || this.equals(that)) return true; if (!(that instanceof PhysicsUnit)) return false; PhysicsDimension thisDimension = this.getDimension(); PhysicsDimension thatDimension = ((PhysicsUnit)that)... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final boolean isCompatible(Unit<?> that) { if ((this == that) || this.equals(that)) return true; if (!(that instanceof PhysicsUnit)) return false; PhysicsDimension thisDimension = this.getDimension(); PhysicsDimension thatDimension = ((PhysicsUnit)that)... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final boolean isCompatible(Unit<?> that) { if ((this == that) || this.equals(that)) return true; if (!(that instanceof PhysicsUnit)) return false; PhysicsDimension thisDimension = this.getDimension(); PhysicsDimension thatDimension = ((PhysicsUnit)that)... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final boolean isCompatible(Unit<?> that) { if ((this == that) || this.equals(that)) return true; if (!(that instanceof PhysicsUnit)) return false; PhysicsDimension thisDimension = this.getDimension(); PhysicsDimension thatDimension = ((PhysicsUnit)that)... |
@Test public void testAsType() { } | @Override public final <T extends Quantity<T>> PhysicsUnit<T> asType(Class<T> type) { PhysicsDimension typeDimension = PhysicsDimension.getDimension(type); if ((typeDimension != null) && (!this.getDimension().equals(typeDimension))) throw new ClassCastException("The unit: " + this + " is not compatible with quantities ... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final <T extends Quantity<T>> PhysicsUnit<T> asType(Class<T> type) { PhysicsDimension typeDimension = PhysicsDimension.getDimension(type); if ((typeDimension != null) && (!this.getDimension().equals(typeDimension))) throw new ClassCastException("The uni... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final <T extends Quantity<T>> PhysicsUnit<T> asType(Class<T> type) { PhysicsDimension typeDimension = PhysicsDimension.getDimension(type); if ((typeDimension != null) && (!this.getDimension().equals(typeDimension))) throw new ClassCastException("The uni... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final <T extends Quantity<T>> PhysicsUnit<T> asType(Class<T> type) { PhysicsDimension typeDimension = PhysicsDimension.getDimension(type); if ((typeDimension != null) && (!this.getDimension().equals(typeDimension))) throw new ClassCastException("The uni... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final <T extends Quantity<T>> PhysicsUnit<T> asType(Class<T> type) { PhysicsDimension typeDimension = PhysicsDimension.getDimension(type); if ((typeDimension != null) && (!this.getDimension().equals(typeDimension))) throw new ClassCastException("The uni... |
@Test public void testGetConverterTo() { } | @Override public final UnitConverter getConverterTo(Unit<Q> that) throws UnconvertibleException { if ((this == that) || this.equals(that)) return PhysicsConverter.IDENTITY; Unit<Q> thisSystemUnit = this.getSystemUnit(); Unit<Q> thatSystemUnit = that.getSystemUnit(); if (!thisSystemUnit.equals(thatSystemUnit)) return ge... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final UnitConverter getConverterTo(Unit<Q> that) throws UnconvertibleException { if ((this == that) || this.equals(that)) return PhysicsConverter.IDENTITY; Unit<Q> thisSystemUnit = this.getSystemUnit(); Unit<Q> thatSystemUnit = that.getSystemUnit(); if ... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final UnitConverter getConverterTo(Unit<Q> that) throws UnconvertibleException { if ((this == that) || this.equals(that)) return PhysicsConverter.IDENTITY; Unit<Q> thisSystemUnit = this.getSystemUnit(); Unit<Q> thatSystemUnit = that.getSystemUnit(); if ... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final UnitConverter getConverterTo(Unit<Q> that) throws UnconvertibleException { if ((this == that) || this.equals(that)) return PhysicsConverter.IDENTITY; Unit<Q> thisSystemUnit = this.getSystemUnit(); Unit<Q> thatSystemUnit = that.getSystemUnit(); if ... | PhysicsUnit implements Unit<Q>, XMLSerializable { @Override public final UnitConverter getConverterTo(Unit<Q> that) throws UnconvertibleException { if ((this == that) || this.equals(that)) return PhysicsConverter.IDENTITY; Unit<Q> thisSystemUnit = this.getSystemUnit(); Unit<Q> thatSystemUnit = that.getSystemUnit(); if ... |
@Test public void shouldReturnDependencyWithClientAndServerSpans() { SpansToDependencyLinks spansToDependencyLinks = new SpansToDependencyLinks(""); Set<Span> sharedSpans = new HashSet<>(); sharedSpans.add(createSpan("clientName", Tags.SPAN_KIND_CLIENT)); sharedSpans.add(createSpan("serverName", Tags.SPAN_KIND_SERVER))... | protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(tag.getValueString()) || Tags.SPAN_KIND_PRODUCER.equals(tag.getValueString())) { cli... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... |
@Test public void shouldReturnDependencyWithConsumerAndProducer() { SpansToDependencyLinks spansToDependencyLinks = new SpansToDependencyLinks(""); Set<Span> sharedSpans = new HashSet<>(); sharedSpans.add(createSpan("consumerName", Tags.SPAN_KIND_CONSUMER)); sharedSpans.add(createSpan("producerName", Tags.SPAN_KIND_PRO... | protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(tag.getValueString()) || Tags.SPAN_KIND_PRODUCER.equals(tag.getValueString())) { cli... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... |
@Test public void shouldReturnEmptyDependencyForSpansWithoutSpanKindDefinition() { SpansToDependencyLinks spansToDependencyLinks = new SpansToDependencyLinks(""); Set<Span> sharedSpans = new HashSet<>(); sharedSpans.add(createSpan("consumerName", "tag")); sharedSpans.add(createSpan("producerName", "tag")); Optional<Dep... | protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(tag.getValueString()) || Tags.SPAN_KIND_PRODUCER.equals(tag.getValueString())) { cli... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... | SpansToDependencyLinks implements Function<Iterable<Span>, Iterable<Dependency>> { protected Optional<Dependency> sharedSpanDependency(Set<Span> sharedSpans) { String clientService = null; String serverService = null; for (Span span: sharedSpans) { for (KeyValue tag: span.getTags()) { if (Tags.SPAN_KIND_CLIENT.equals(t... |
@Test public void primitives1Metadata() { unsafeClassHeaderSize64BitCompressedOops(new Primitives1()); SerializationMetadata serializationMetadata = extractMetadata(Introspect.fields(Primitives1.class)); assertEquals(OBJECT_HEADER_SIZE, serializationMetadata.start); assertEquals(4, serializationMetadata.length); } | public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjectAlignment(totalSize) - OBJECT... | DirectSerializationMetadata { public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjec... | DirectSerializationMetadata { public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjec... | DirectSerializationMetadata { public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjec... | DirectSerializationMetadata { public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjec... |
@Test public void staticPrimitivesAreNotEligible() { List<Field> field = fieldsNamed("staticIntField"); assertTrue(stopAtFirstIneligibleField(field).isEmpty()); } | public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : eligibleFields; } | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... |
@Test public void staticPrimitiveArraysAreNotEligible() { List<Field> field = fieldsNamed("staticDoubleArray"); assertTrue(stopAtFirstIneligibleField(field).isEmpty()); } | public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : eligibleFields; } | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... |
@Test public void staticReferencesAreNotEligible() { List<Field> field = fieldsNamed("staticStringList"); assertTrue(stopAtFirstIneligibleField(field).isEmpty()); } | public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : eligibleFields; } | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... |
@Test public void staticReferenceArraysAreNotEligible() { List<Field> field = fieldsNamed("staticObjectArray"); assertTrue(stopAtFirstIneligibleField(field).isEmpty()); } | public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : eligibleFields; } | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... |
@Test public void transientPrimitivesAreNotEligible() { List<Field> field = fieldsNamed("transientShort"); assertTrue(stopAtFirstIneligibleField(field).isEmpty()); } | public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : eligibleFields; } | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... |
@Test public void transientReferencsAreNotEligible() { List<Field> field = fieldsNamed("transientObject"); assertTrue(stopAtFirstIneligibleField(field).isEmpty()); } | public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : eligibleFields; } | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... |
@Test public void includesAllEligibleFields() { List<Field> fields = fieldsNamed("intField", "shortField", "longField", "byteField", "stringList"); List<Field> expectedfields = fields.subList(0, 4); assertEquals(expectedfields, stopAtFirstIneligibleField(fields)); } | public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : eligibleFields; } | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... | DirectSerializationFilter { public static List<Field> stopAtFirstIneligibleField(List<Field> fields) { ArrayList<Field> eligibleFields = new ArrayList<Field>(); for (Field f : fields) { if (checkEligible(f)) { eligibleFields.add(f); } else { break; } } return eligibleFields.isEmpty() ? Collections.<Field>emptyList() : ... |
@Test public void testStartEnd() { RawCopier<A> aRawCopier = RawCopier.copies(A.class); if (aRawCopier.start != 8) assertEquals(12, aRawCopier.start); assertEquals(aRawCopier.start + 3 * 4, aRawCopier.end); RawCopier<B> bRawCopier = RawCopier.copies(B.class); if (aRawCopier.start != 8) assertEquals(16, bRawCopier.start... | public static <T> RawCopier<T> copies(Class<T> tClass) { return new RawCopier<T>(tClass); } | RawCopier { public static <T> RawCopier<T> copies(Class<T> tClass) { return new RawCopier<T>(tClass); } } | RawCopier { public static <T> RawCopier<T> copies(Class<T> tClass) { return new RawCopier<T>(tClass); } private RawCopier(Class<T> tClass); } | RawCopier { public static <T> RawCopier<T> copies(Class<T> tClass) { return new RawCopier<T>(tClass); } private RawCopier(Class<T> tClass); static RawCopier<T> copies(Class<T> tClass); int start(); int end(); void toBytes(Object obj, Bytes bytes); void fromBytes(Bytes bytes, Object obj); void copy(T from, T to); } | RawCopier { public static <T> RawCopier<T> copies(Class<T> tClass) { return new RawCopier<T>(tClass); } private RawCopier(Class<T> tClass); static RawCopier<T> copies(Class<T> tClass); int start(); int end(); void toBytes(Object obj, Bytes bytes); void fromBytes(Bytes bytes, Object obj); void copy(T from, T to); } |
@Test public void testResizableMappedStore() throws IOException { File file = MappedStoreTest.getStoreFile("resizable-mapped-store.tmp"); final int smallSize = 1024, largeSize = 10 * smallSize; { ResizeableMappedStore ms = new ResizeableMappedStore(file, FileChannel.MapMode.READ_WRITE, smallSize); DirectBytes slice1 = ... | public void resize(long newSize) throws IOException { validateSize(newSize); unmapAndSyncToDisk(); resizeIfNeeded(0L, newSize); this.mmapInfoHolder.setSize(newSize); map(0L); } | ResizeableMappedStore extends AbstractMappedStore { public void resize(long newSize) throws IOException { validateSize(newSize); unmapAndSyncToDisk(); resizeIfNeeded(0L, newSize); this.mmapInfoHolder.setSize(newSize); map(0L); } } | ResizeableMappedStore extends AbstractMappedStore { public void resize(long newSize) throws IOException { validateSize(newSize); unmapAndSyncToDisk(); resizeIfNeeded(0L, newSize); this.mmapInfoHolder.setSize(newSize); map(0L); } ResizeableMappedStore(File file, FileChannel.MapMode mode, long size); ResizeableMappedSto... | ResizeableMappedStore extends AbstractMappedStore { public void resize(long newSize) throws IOException { validateSize(newSize); unmapAndSyncToDisk(); resizeIfNeeded(0L, newSize); this.mmapInfoHolder.setSize(newSize); map(0L); } ResizeableMappedStore(File file, FileChannel.MapMode mode, long size); ResizeableMappedSto... | ResizeableMappedStore extends AbstractMappedStore { public void resize(long newSize) throws IOException { validateSize(newSize); unmapAndSyncToDisk(); resizeIfNeeded(0L, newSize); this.mmapInfoHolder.setSize(newSize); map(0L); } ResizeableMappedStore(File file, FileChannel.MapMode mode, long size); ResizeableMappedSto... |
@Test public void testMappedCache3() throws IOException { VanillaMappedCache<Integer> cache = new VanillaMappedCache(32, false); VanillaMappedBytes buffer = null; File file = null; for (int j = 0; j < 5; j++) { long start = System.nanoTime(); int maxRuns = 10000, runs; for (runs = 0; runs < maxRuns; runs++) { file = ne... | @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } | VanillaMappedFile implements VanillaMappedResource { @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } } | VanillaMappedFile implements VanillaMappedResource { @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } VanillaMappedFile... | VanillaMappedFile implements VanillaMappedResource { @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } VanillaMappedFile... | VanillaMappedFile implements VanillaMappedResource { @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } VanillaMappedFile... |
@Test public void primitives2Metadata() { unsafeClassHeaderSize64BitCompressedOops(new Primitives2()); SerializationMetadata serializationMetadata = extractMetadata(Introspect.fields(Primitives2.class)); assertEquals(OBJECT_HEADER_SIZE, serializationMetadata.start); assertEquals(12, serializationMetadata.length); } | public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjectAlignment(totalSize) - OBJECT... | DirectSerializationMetadata { public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjec... | DirectSerializationMetadata { public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjec... | DirectSerializationMetadata { public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjec... | DirectSerializationMetadata { public static SerializationMetadata extractMetadata(List<Field> fields) { if (fields.isEmpty()) return EmptyObjectMetadata; Offsets offsets = minMaxOffsets(fields); long totalSize = OBJECT_HEADER_SIZE + offsets.max - offsets.min + 1; return new SerializationMetadata(offsets.min, padToObjec... |
@Test public void testMappedCache4() throws IOException { VanillaMappedCache<Integer> cache = new VanillaMappedCache(10000, true); VanillaMappedBytes buffer = cache.put(1, newTempraryFile("vmc-4"), 256, 1); buffer.reserve(); assertEquals(2, buffer.refCount()); buffer.release(); assertEquals(1, buffer.refCount()); cache... | @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } | VanillaMappedFile implements VanillaMappedResource { @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } } | VanillaMappedFile implements VanillaMappedResource { @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } VanillaMappedFile... | VanillaMappedFile implements VanillaMappedResource { @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } VanillaMappedFile... | VanillaMappedFile implements VanillaMappedResource { @Override public synchronized void close() throws IOException { if (this.fileChannel.isOpen()) { long start = System.nanoTime(); this.fileChannel.close(); this.fileLifecycleListener.onEvent(EventType.CLOSE, this.path, System.nanoTime() - start); } } VanillaMappedFile... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.