target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void size() { assertEquals(new Path("/").size(), 0); assertEquals(new Path("/foo").size(), 1); assertEquals(new Path("/foo/bar").size(), 2); assertEquals(new Path("/foo/bar/baz").size(), 3); }
public int size() { if (isRoot()) { return 0; } int size = 0; int pos = 0; while (pos >= 0) { size++; pos = path.indexOf(SEPARATOR, pos + 1); } return size; }
Path implements Iterable<String>, Serializable { public int size() { if (isRoot()) { return 0; } int size = 0; int pos = 0; while (pos >= 0) { size++; pos = path.indexOf(SEPARATOR, pos + 1); } return size; } }
Path implements Iterable<String>, Serializable { public int size() { if (isRoot()) { return 0; } int size = 0; int pos = 0; while (pos >= 0) { size++; pos = path.indexOf(SEPARATOR, pos + 1); } return size; } Path(String path); Path(String path, boolean canonize); }
Path implements Iterable<String>, Serializable { public int size() { if (isRoot()) { return 0; } int size = 0; int pos = 0; while (pos >= 0) { size++; pos = path.indexOf(SEPARATOR, pos + 1); } return size; } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot...
Path implements Iterable<String>, Serializable { public int size() { if (isRoot()) { return 0; } int size = 0; int pos = 0; while (pos >= 0) { size++; pos = path.indexOf(SEPARATOR, pos + 1); } return size; } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot...
@Test public void subpath() { Path path = new Path("/foo/bar/baz"); assertEquals(new Path("/foo/bar/baz"), path.subpath(4)); assertEquals(new Path("/foo/bar"), path.subpath(3)); assertEquals(new Path("/foo"), path.subpath(2)); assertEquals(new Path("/"), path.subpath(1)); try { path.subpath(5); fail("expect index out o...
public Path subpath(int idx) { if (idx <= 0) { throw new IndexOutOfBoundsException(); } final int size = size(); final boolean abs = isAbsolute(); int chunks = (abs) ? size + 1 : size; if (idx > chunks) { throw new IndexOutOfBoundsException(); } if (idx == chunks) { return this; } int iterations = ((abs) ? idx - 1 : id...
Path implements Iterable<String>, Serializable { public Path subpath(int idx) { if (idx <= 0) { throw new IndexOutOfBoundsException(); } final int size = size(); final boolean abs = isAbsolute(); int chunks = (abs) ? size + 1 : size; if (idx > chunks) { throw new IndexOutOfBoundsException(); } if (idx == chunks) { retu...
Path implements Iterable<String>, Serializable { public Path subpath(int idx) { if (idx <= 0) { throw new IndexOutOfBoundsException(); } final int size = size(); final boolean abs = isAbsolute(); int chunks = (abs) ? size + 1 : size; if (idx > chunks) { throw new IndexOutOfBoundsException(); } if (idx == chunks) { retu...
Path implements Iterable<String>, Serializable { public Path subpath(int idx) { if (idx <= 0) { throw new IndexOutOfBoundsException(); } final int size = size(); final boolean abs = isAbsolute(); int chunks = (abs) ? size + 1 : size; if (idx > chunks) { throw new IndexOutOfBoundsException(); } if (idx == chunks) { retu...
Path implements Iterable<String>, Serializable { public Path subpath(int idx) { if (idx <= 0) { throw new IndexOutOfBoundsException(); } final int size = size(); final boolean abs = isAbsolute(); int chunks = (abs) ? size + 1 : size; if (idx > chunks) { throw new IndexOutOfBoundsException(); } if (idx == chunks) { retu...
@Test public void toRelative() { try { new Path("/").toRelative(new Path("/")); fail(); } catch (IllegalStateException e) { } try { new Path("/foo/bar").toRelative(new Path("/bar")); fail(); } catch (IllegalArgumentException e) { } assertEquals(new Path("foo"), new Path("/foo").toRelative(new Path("/"))); assertEquals(...
public Path toRelative(Path ancestor) { if (isRoot()) { throw new IllegalStateException("Cannot make root path relative"); } if (!isDescendantOf(ancestor)) { throw new IllegalArgumentException("Cannot create relative path because this path: " + this + " is not descendant of ancestor argument: " + ancestor); } Path frag...
Path implements Iterable<String>, Serializable { public Path toRelative(Path ancestor) { if (isRoot()) { throw new IllegalStateException("Cannot make root path relative"); } if (!isDescendantOf(ancestor)) { throw new IllegalArgumentException("Cannot create relative path because this path: " + this + " is not descendant...
Path implements Iterable<String>, Serializable { public Path toRelative(Path ancestor) { if (isRoot()) { throw new IllegalStateException("Cannot make root path relative"); } if (!isDescendantOf(ancestor)) { throw new IllegalArgumentException("Cannot create relative path because this path: " + this + " is not descendant...
Path implements Iterable<String>, Serializable { public Path toRelative(Path ancestor) { if (isRoot()) { throw new IllegalStateException("Cannot make root path relative"); } if (!isDescendantOf(ancestor)) { throw new IllegalArgumentException("Cannot create relative path because this path: " + this + " is not descendant...
Path implements Iterable<String>, Serializable { public Path toRelative(Path ancestor) { if (isRoot()) { throw new IllegalStateException("Cannot make root path relative"); } if (!isDescendantOf(ancestor)) { throw new IllegalArgumentException("Cannot create relative path because this path: " + this + " is not descendant...
@Test public void containsParent() { assertTrue(!data.containsParent(new Path("/"))); assertTrue(data.containsParent(new Path("/foo"))); assertTrue(data.containsParent(new Path("/foo/baz"))); assertTrue(data.containsParent(new Path("/foo/bar/baz"))); assertTrue(data.containsParent(new Path("/foo/bar/baz/boz"))); assert...
public boolean containsParent(Path path) { for (Path p : this) { if (p.isParentOf(path)) { return true; } } return false; }
PathSet implements Set<Path> { public boolean containsParent(Path path) { for (Path p : this) { if (p.isParentOf(path)) { return true; } } return false; } }
PathSet implements Set<Path> { public boolean containsParent(Path path) { for (Path p : this) { if (p.isParentOf(path)) { return true; } } return false; } PathSet(); PathSet(Set<Path> delegate); }
PathSet implements Set<Path> { public boolean containsParent(Path path) { for (Path p : this) { if (p.isParentOf(path)) { return true; } } return false; } PathSet(); PathSet(Set<Path> delegate); boolean equals(Object o); int hashCode(); int size(); boolean isEmpty(); boolean contains(Object o); Object[] toArray(); T[]...
PathSet implements Set<Path> { public boolean containsParent(Path path) { for (Path p : this) { if (p.isParentOf(path)) { return true; } } return false; } PathSet(); PathSet(Set<Path> delegate); boolean equals(Object o); int hashCode(); int size(); boolean isEmpty(); boolean contains(Object o); Object[] toArray(); T[]...
@Test public void removeDescendants() { data.removeDescendants(new Path("/foo")); assertTrue(data.size() == 3); assertTrue(data.contains(new Path("/"))); assertTrue(data.contains(new Path("/bar"))); assertTrue(data.contains(new Path("/foo"))); data.removeDescendants(new Path("/")); assertTrue(data.size() == 1); assertT...
public void removeDescendants(Path path) { Iterator<Path> i = iterator(); while (i.hasNext()) { Path p = i.next(); if (p.isDescendantOf(path)) { i.remove(); } } }
PathSet implements Set<Path> { public void removeDescendants(Path path) { Iterator<Path> i = iterator(); while (i.hasNext()) { Path p = i.next(); if (p.isDescendantOf(path)) { i.remove(); } } } }
PathSet implements Set<Path> { public void removeDescendants(Path path) { Iterator<Path> i = iterator(); while (i.hasNext()) { Path p = i.next(); if (p.isDescendantOf(path)) { i.remove(); } } } PathSet(); PathSet(Set<Path> delegate); }
PathSet implements Set<Path> { public void removeDescendants(Path path) { Iterator<Path> i = iterator(); while (i.hasNext()) { Path p = i.next(); if (p.isDescendantOf(path)) { i.remove(); } } } PathSet(); PathSet(Set<Path> delegate); boolean equals(Object o); int hashCode(); int size(); boolean isEmpty(); boolean cont...
PathSet implements Set<Path> { public void removeDescendants(Path path) { Iterator<Path> i = iterator(); while (i.hasNext()) { Path p = i.next(); if (p.isDescendantOf(path)) { i.remove(); } } } PathSet(); PathSet(Set<Path> delegate); boolean equals(Object o); int hashCode(); int size(); boolean isEmpty(); boolean cont...
@Test public void removeWithDescendants() { data.removeWithDescendants(new Path("/foo")); assertTrue(data.size() == 2); assertTrue(data.contains(new Path("/"))); assertTrue(data.contains(new Path("/bar"))); data.removeWithDescendants(new Path("/")); assertTrue(data.isEmpty()); }
public boolean removeWithDescendants(Path path) { boolean ret = remove(path); removeDescendants(path); return ret; }
PathSet implements Set<Path> { public boolean removeWithDescendants(Path path) { boolean ret = remove(path); removeDescendants(path); return ret; } }
PathSet implements Set<Path> { public boolean removeWithDescendants(Path path) { boolean ret = remove(path); removeDescendants(path); return ret; } PathSet(); PathSet(Set<Path> delegate); }
PathSet implements Set<Path> { public boolean removeWithDescendants(Path path) { boolean ret = remove(path); removeDescendants(path); return ret; } PathSet(); PathSet(Set<Path> delegate); boolean equals(Object o); int hashCode(); int size(); boolean isEmpty(); boolean contains(Object o); Object[] toArray(); T[] toArra...
PathSet implements Set<Path> { public boolean removeWithDescendants(Path path) { boolean ret = remove(path); removeDescendants(path); return ret; } PathSet(); PathSet(Set<Path> delegate); boolean equals(Object o); int hashCode(); int size(); boolean isEmpty(); boolean contains(Object o); Object[] toArray(); T[] toArra...
@Test public void append() { assertEquals(new Path("/").append(new Path("foo")), new Path("/foo")); assertEquals(new Path("/").append(new Path("foo/bar")), new Path("/foo/bar")); assertEquals(new Path("/foo").append(new Path("bar")), new Path("/foo/bar")); assertEquals(new Path("/foo").append(new Path("../bar")), new P...
public Path append(Path relative) { if (relative == null) { throw new IllegalArgumentException("Argument 'relative' cannot be null"); } if (relative.isAbsolute()) { throw new IllegalArgumentException("Cannot append an absolute path"); } StringBuilder appended = new StringBuilder(path.length() + 1 + relative.path.length...
Path implements Iterable<String>, Serializable { public Path append(Path relative) { if (relative == null) { throw new IllegalArgumentException("Argument 'relative' cannot be null"); } if (relative.isAbsolute()) { throw new IllegalArgumentException("Cannot append an absolute path"); } StringBuilder appended = new Strin...
Path implements Iterable<String>, Serializable { public Path append(Path relative) { if (relative == null) { throw new IllegalArgumentException("Argument 'relative' cannot be null"); } if (relative.isAbsolute()) { throw new IllegalArgumentException("Cannot append an absolute path"); } StringBuilder appended = new Strin...
Path implements Iterable<String>, Serializable { public Path append(Path relative) { if (relative == null) { throw new IllegalArgumentException("Argument 'relative' cannot be null"); } if (relative.isAbsolute()) { throw new IllegalArgumentException("Cannot append an absolute path"); } StringBuilder appended = new Strin...
Path implements Iterable<String>, Serializable { public Path append(Path relative) { if (relative == null) { throw new IllegalArgumentException("Argument 'relative' cannot be null"); } if (relative.isAbsolute()) { throw new IllegalArgumentException("Cannot append an absolute path"); } StringBuilder appended = new Strin...
@Test public void construction() { assertEquals(new Path("/").toString(), "/"); assertEquals(new Path("/foo").toString(), "/foo"); assertEquals(new Path("/foo/").toString(), "/foo"); assertEquals(new Path("/foo/bar").toString(), "/foo/bar"); assertEquals(new Path("/foo/bar/").toString(), "/foo/bar"); assertEquals(new P...
@Override public String toString() { return path; }
Path implements Iterable<String>, Serializable { @Override public String toString() { return path; } }
Path implements Iterable<String>, Serializable { @Override public String toString() { return path; } Path(String path); Path(String path, boolean canonize); }
Path implements Iterable<String>, Serializable { @Override public String toString() { return path; } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); boolean isAbsolute(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String ...
Path implements Iterable<String>, Serializable { @Override public String toString() { return path; } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); boolean isAbsolute(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String ...
@Test public void getName() { assertEquals(new Path("/").getName(), "/"); assertEquals(new Path("/foo").getName(), "foo"); assertEquals(new Path("/foo/bar").getName(), "bar"); assertEquals(new Path("foo").getName(), "foo"); assertEquals(new Path("foo/bar").getName(), "bar"); }
public String getName() { if (path.equals(SEPARATOR)) { return path; } else { int last = path.lastIndexOf(SEPARATOR); return path.substring(last + 1); } }
Path implements Iterable<String>, Serializable { public String getName() { if (path.equals(SEPARATOR)) { return path; } else { int last = path.lastIndexOf(SEPARATOR); return path.substring(last + 1); } } }
Path implements Iterable<String>, Serializable { public String getName() { if (path.equals(SEPARATOR)) { return path; } else { int last = path.lastIndexOf(SEPARATOR); return path.substring(last + 1); } } Path(String path); Path(String path, boolean canonize); }
Path implements Iterable<String>, Serializable { public String getName() { if (path.equals(SEPARATOR)) { return path; } else { int last = path.lastIndexOf(SEPARATOR); return path.substring(last + 1); } } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); ...
Path implements Iterable<String>, Serializable { public String getName() { if (path.equals(SEPARATOR)) { return path; } else { int last = path.lastIndexOf(SEPARATOR); return path.substring(last + 1); } } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); ...
@Test public void isAbsolute() { assertTrue(new Path("/").isAbsolute()); assertTrue(new Path("/foo").isAbsolute()); assertTrue(new Path("/foo/bar").isAbsolute()); assertTrue(!new Path("foo").isAbsolute()); assertTrue(!new Path("foo/bar").isAbsolute()); }
public boolean isAbsolute() { return path.startsWith("/"); }
Path implements Iterable<String>, Serializable { public boolean isAbsolute() { return path.startsWith("/"); } }
Path implements Iterable<String>, Serializable { public boolean isAbsolute() { return path.startsWith("/"); } Path(String path); Path(String path, boolean canonize); }
Path implements Iterable<String>, Serializable { public boolean isAbsolute() { return path.startsWith("/"); } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); boolean isAbsolute(); @Override boolean equals(Object obj); @Override int hashCode(); @Overrid...
Path implements Iterable<String>, Serializable { public boolean isAbsolute() { return path.startsWith("/"); } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); boolean isAbsolute(); @Override boolean equals(Object obj); @Override int hashCode(); @Overrid...
@Test public void isCannonical() { assertTrue(new Path("/", false).isCanonical()); assertTrue(new Path("a", false).isCanonical()); assertTrue(new Path("a/b", false).isCanonical()); assertTrue(new Path("a/b/c", false).isCanonical()); assertTrue(new Path("a/..b/c", false).isCanonical()); assertTrue(new Path("a/b/c..", fa...
public boolean isCanonical() { int offset = 0; boolean text = false; if (path.equals(".")) { return true; } if (!isRoot() && path.endsWith("/")) { return false; } while (offset < path.length()) { String sub = path.substring(offset); if (sub.equals("/") || sub.equals("")) { break; } if (sub.startsWith("./") || sub.equal...
Path implements Iterable<String>, Serializable { public boolean isCanonical() { int offset = 0; boolean text = false; if (path.equals(".")) { return true; } if (!isRoot() && path.endsWith("/")) { return false; } while (offset < path.length()) { String sub = path.substring(offset); if (sub.equals("/") || sub.equals(""))...
Path implements Iterable<String>, Serializable { public boolean isCanonical() { int offset = 0; boolean text = false; if (path.equals(".")) { return true; } if (!isRoot() && path.endsWith("/")) { return false; } while (offset < path.length()) { String sub = path.substring(offset); if (sub.equals("/") || sub.equals(""))...
Path implements Iterable<String>, Serializable { public boolean isCanonical() { int offset = 0; boolean text = false; if (path.equals(".")) { return true; } if (!isRoot() && path.endsWith("/")) { return false; } while (offset < path.length()) { String sub = path.substring(offset); if (sub.equals("/") || sub.equals(""))...
Path implements Iterable<String>, Serializable { public boolean isCanonical() { int offset = 0; boolean text = false; if (path.equals(".")) { return true; } if (!isRoot() && path.endsWith("/")) { return false; } while (offset < path.length()) { String sub = path.substring(offset); if (sub.equals("/") || sub.equals(""))...
@Test public void isChildOf() { assertChild(new Path("/"), new Path("/foo")); assertNotChild(new Path("/"), new Path("/foo/bar")); assertChild(new Path("/foo/bar"), new Path("/foo/bar/baz")); assertNotChild(new Path("/foo/bar"), new Path("/foo/baz/bar")); assertNotChild(new Path("/"), new Path("/")); assertNotChild(new...
public boolean isChildOf(Path other) { return isDescendantOf(other) && size() == other.size() + 1; }
Path implements Iterable<String>, Serializable { public boolean isChildOf(Path other) { return isDescendantOf(other) && size() == other.size() + 1; } }
Path implements Iterable<String>, Serializable { public boolean isChildOf(Path other) { return isDescendantOf(other) && size() == other.size() + 1; } Path(String path); Path(String path, boolean canonize); }
Path implements Iterable<String>, Serializable { public boolean isChildOf(Path other) { return isDescendantOf(other) && size() == other.size() + 1; } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); boolean isAbsolute(); @Override boolean equals(Object ...
Path implements Iterable<String>, Serializable { public boolean isChildOf(Path other) { return isDescendantOf(other) && size() == other.size() + 1; } Path(String path); Path(String path, boolean canonize); Path canonical(); boolean isCanonical(); boolean isRoot(); boolean isAbsolute(); @Override boolean equals(Object ...
@Test public void createAlternateList() { List<OsmObject> alternateList = PoiList.getInstance().createAlternateList(); assertEquals(0, alternateList.size()); }
public List<OsmObject> createAlternateList() { return poiList.subList(1, poiList.size()); }
PoiList { public List<OsmObject> createAlternateList() { return poiList.subList(1, poiList.size()); } }
PoiList { public List<OsmObject> createAlternateList() { return poiList.subList(1, poiList.size()); } private PoiList(); }
PoiList { public List<OsmObject> createAlternateList() { return poiList.subList(1, poiList.size()); } private PoiList(); static synchronized PoiList getInstance(); List<OsmObject> getPoiList(); void setPoiList(List<OsmObject> poiList); List<OsmObject> createAlternateList(); void clearPoiList(); void sortList(final dou...
PoiList { public List<OsmObject> createAlternateList() { return poiList.subList(1, poiList.size()); } private PoiList(); static synchronized PoiList getInstance(); List<OsmObject> getPoiList(); void setPoiList(List<OsmObject> poiList); List<OsmObject> createAlternateList(); void clearPoiList(); void sortList(final dou...
@Test public void assessIntentData() { URI uri = null; try { uri = new URI("http: } catch (URISyntaxException e) { e.printStackTrace(); } questionsPresenter.assessIntentData(uri); verify(preferences).setStringPreference("oauth_verifier", "1"); verify(preferences).setStringPreference("oauth_token", "1"); verify(view).st...
@Override public void assessIntentData(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN).get(0); preferences.setStringPreference(PreferenceList.OAUTH_VERIFI...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void assessIntentData(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN)...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void assessIntentData(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN)...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void assessIntentData(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN)...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void assessIntentData(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN)...
@Test public void addPoiToTextview() { introPresenter.getDetails(); verify(view).showDetails("Kitchen", " ", R.drawable.ic_restaurant); }
@Override public void getDetails() { String address = getAddress(); view.showDetails(poi.getName(), address, poi.getDrawable()); }
IntroPresenter implements IntroFragmentContract.Presenter { @Override public void getDetails() { String address = getAddress(); view.showDetails(poi.getName(), address, poi.getDrawable()); } }
IntroPresenter implements IntroFragmentContract.Presenter { @Override public void getDetails() { String address = getAddress(); view.showDetails(poi.getName(), address, poi.getDrawable()); } IntroPresenter(IntroFragmentContract.View view); }
IntroPresenter implements IntroFragmentContract.Presenter { @Override public void getDetails() { String address = getAddress(); view.showDetails(poi.getName(), address, poi.getDrawable()); } IntroPresenter(IntroFragmentContract.View view); @Override void getDetails(); }
IntroPresenter implements IntroFragmentContract.Presenter { @Override public void getDetails() { String address = getAddress(); view.showDetails(poi.getName(), address, poi.getDrawable()); } IntroPresenter(IntroFragmentContract.View view); @Override void getDetails(); }
@Test public void checkPreferencesAreCleared() { presenter.clickedOsmLoginButton(); verify(view).startOAuth(); }
@Override public void clickedOsmLoginButton() { preferences.setStringPreference(PreferenceList.OAUTH_VERIFIER, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN_SECRET, ""); view.startOAuth(); }
OsmLoginPresenter implements OsmLoginFragmentContract.Presenter { @Override public void clickedOsmLoginButton() { preferences.setStringPreference(PreferenceList.OAUTH_VERIFIER, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN_SECRET, ""); v...
OsmLoginPresenter implements OsmLoginFragmentContract.Presenter { @Override public void clickedOsmLoginButton() { preferences.setStringPreference(PreferenceList.OAUTH_VERIFIER, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN_SECRET, ""); v...
OsmLoginPresenter implements OsmLoginFragmentContract.Presenter { @Override public void clickedOsmLoginButton() { preferences.setStringPreference(PreferenceList.OAUTH_VERIFIER, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN_SECRET, ""); v...
OsmLoginPresenter implements OsmLoginFragmentContract.Presenter { @Override public void clickedOsmLoginButton() { preferences.setStringPreference(PreferenceList.OAUTH_VERIFIER, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN, ""); preferences.setStringPreference(PreferenceList.OAUTH_TOKEN_SECRET, ""); v...
@Test public void getQuestionTest() { questionPresenter.getQuestion(); verify(view).showQuestion(anyInt(), anyString(), anyInt(), anyInt()); }
@Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.getColor(); int drawable = questionsContract.getIcon(); view.showQues...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.get...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.get...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.get...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.get...
@Test public void getPreviousAnswerTest() { questionPresenter.getQuestion(); verify(view).setPreviousAnswer(anyString()); }
@Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.getColor(); int drawable = questionsContract.getIcon(); view.showQues...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.get...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.get...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.get...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void getQuestion() { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int question = questionsContract.getQuestion(); int color = questionsContract.get...
@Test public void yesAnswerSelected() { questionPresenter.onAnswerSelected(R.id.answer_yes); verify(view).setBackgroundColor(anyInt(), anyInt(), anyInt()); }
@Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor = R.color.colorPrimary; String answer = null; switch (id) { case R...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
@Test public void noAnswerSelected() { questionPresenter.onAnswerSelected(R.id.answer_no); verify(view).setBackgroundColor(anyInt(), anyInt(), anyInt()); }
@Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor = R.color.colorPrimary; String answer = null; switch (id) { case R...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
@Test public void unsureAnswerSelected() { questionPresenter.onAnswerSelected(R.id.answer_unsure); Set<String> keySet = Answers.getAnswerMap().keySet(); String key = keySet.toArray(new String[keySet.size()])[0]; String actual_answer = Answers.getAnswerMap().get(key); String expected_answer = ""; verify(view).setBackgro...
@Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor = R.color.colorPrimary; String answer = null; switch (id) { case R...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
QuestionPresenter implements QuestionFragmentContract.Presenter { @Override public void onAnswerSelected(int id) { List<QuestionsContract> questions = this.listOfQuestions.getQuestion(); QuestionsContract questionsContract = questions.get(position); int selectedColor = questionsContract.getColor(); int unselectedColor ...
@Test public void checkIfInOAuthFlow() { URI url = null; try { url = new URI("http: } catch (URISyntaxException e) { e.printStackTrace(); } presenter.checkIfOauth(url); verify(view).startOAuth(); }
@Override public void checkIfOauth(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN).get(0); preferences.setStringPreference(PreferenceList.OAUTH_VERIFIER, ...
MainActivityPresenter implements MainActivityContract.Presenter { @Override public void checkIfOauth(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN).get(0...
MainActivityPresenter implements MainActivityContract.Presenter { @Override public void checkIfOauth(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN).get(0...
MainActivityPresenter implements MainActivityContract.Presenter { @Override public void checkIfOauth(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN).get(0...
MainActivityPresenter implements MainActivityContract.Presenter { @Override public void checkIfOauth(URI uri) { if (uri != null) { try { Map<String, List<String>> list = Utilities.splitQuery(uri); String verifier = list.get(PreferenceList.OAUTH_VERIFIER).get(0); String token = list.get(PreferenceList.OAUTH_TOKEN).get(0...
@Test public void checkIfUsernameIsSetCorrectly() { presenter.showIfLoggedIn(); verify(view).showIfLoggedIn(anyInt(), anyInt(), (String) any()); }
@Override public void showIfLoggedIn() { boolean loggedIn = preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM); int message; int button; String userName = getUserName(); if (loggedIn) { if ("".equals(userName)) { message = R.string.logged_in; } else { message = R.string.logged_in_as; } button = R.string....
MainActivityPresenter implements MainActivityContract.Presenter { @Override public void showIfLoggedIn() { boolean loggedIn = preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM); int message; int button; String userName = getUserName(); if (loggedIn) { if ("".equals(userName)) { message = R.string.logged_...
MainActivityPresenter implements MainActivityContract.Presenter { @Override public void showIfLoggedIn() { boolean loggedIn = preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM); int message; int button; String userName = getUserName(); if (loggedIn) { if ("".equals(userName)) { message = R.string.logged_...
MainActivityPresenter implements MainActivityContract.Presenter { @Override public void showIfLoggedIn() { boolean loggedIn = preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM); int message; int button; String userName = getUserName(); if (loggedIn) { if ("".equals(userName)) { message = R.string.logged_...
MainActivityPresenter implements MainActivityContract.Presenter { @Override public void showIfLoggedIn() { boolean loggedIn = preferences.getBooleanPreference(PreferenceList.LOGGED_IN_TO_OSM); int message; int button; String userName = getUserName(); if (loggedIn) { if ("".equals(userName)) { message = R.string.logged_...
@Test public void testGenerateOverpassUri() { double latitude = 53; double longitude = -7; float accuracy = 50; String expected_uri = "https: String uri = queryOverpass.getOverpassUri(latitude, longitude, accuracy); assertEquals(expected_uri, uri); }
@Override public String getOverpassUri(double latitude, double longitude, float accuracy) { float measuredAccuracy; if (accuracy < 20) { measuredAccuracy = 20; } else if (accuracy > 100) { measuredAccuracy = 100; } else { measuredAccuracy = accuracy; } String overpassLocation = String.format("around:%s,%s,%s", measured...
QueryOverpass implements SourceContract.Overpass { @Override public String getOverpassUri(double latitude, double longitude, float accuracy) { float measuredAccuracy; if (accuracy < 20) { measuredAccuracy = 20; } else if (accuracy > 100) { measuredAccuracy = 100; } else { measuredAccuracy = accuracy; } String overpassL...
QueryOverpass implements SourceContract.Overpass { @Override public String getOverpassUri(double latitude, double longitude, float accuracy) { float measuredAccuracy; if (accuracy < 20) { measuredAccuracy = 20; } else if (accuracy > 100) { measuredAccuracy = 100; } else { measuredAccuracy = accuracy; } String overpassL...
QueryOverpass implements SourceContract.Overpass { @Override public String getOverpassUri(double latitude, double longitude, float accuracy) { float measuredAccuracy; if (accuracy < 20) { measuredAccuracy = 20; } else if (accuracy > 100) { measuredAccuracy = 100; } else { measuredAccuracy = accuracy; } String overpassL...
QueryOverpass implements SourceContract.Overpass { @Override public String getOverpassUri(double latitude, double longitude, float accuracy) { float measuredAccuracy; if (accuracy < 20) { measuredAccuracy = 20; } else if (accuracy > 100) { measuredAccuracy = 100; } else { measuredAccuracy = accuracy; } String overpassL...
@Test public void checkVersionNameIsSet() { aboutPresenter.findVersion(); verify(view).setVersion(BuildConfig.VERSION_NAME); }
@Override public void findVersion() { String version = BuildConfig.VERSION_NAME; view.setVersion(version); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void findVersion() { String version = BuildConfig.VERSION_NAME; view.setVersion(version); } }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void findVersion() { String version = BuildConfig.VERSION_NAME; view.setVersion(version); } AboutPresenter(MainActivityContract.AboutView view); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void findVersion() { String version = BuildConfig.VERSION_NAME; view.setVersion(version); } AboutPresenter(MainActivityContract.AboutView view); @Override void findVersion(); @Override void getLicence(); @Override void getGitHub(); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void findVersion() { String version = BuildConfig.VERSION_NAME; view.setVersion(version); } AboutPresenter(MainActivityContract.AboutView view); @Override void findVersion(); @Override void getLicence(); @Override void getGitHub(); }
@Test public void checkLicenceDetailsAreSet() { aboutPresenter.getLicence(); verify(view).visitUri("http: }
@Override public void getLicence() { String uri = "http: view.visitUri(uri); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void getLicence() { String uri = "http: view.visitUri(uri); } }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void getLicence() { String uri = "http: view.visitUri(uri); } AboutPresenter(MainActivityContract.AboutView view); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void getLicence() { String uri = "http: view.visitUri(uri); } AboutPresenter(MainActivityContract.AboutView view); @Override void findVersion(); @Override void getLicence(); @Override void getGitHub(); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void getLicence() { String uri = "http: view.visitUri(uri); } AboutPresenter(MainActivityContract.AboutView view); @Override void findVersion(); @Override void getLicence(); @Override void getGitHub(); }
@Test public void checkSourceDetailsAreSet() { aboutPresenter.getGitHub(); verify(view).visitUri("https: }
@Override public void getGitHub() { String uri = "https: view.visitUri(uri); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void getGitHub() { String uri = "https: view.visitUri(uri); } }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void getGitHub() { String uri = "https: view.visitUri(uri); } AboutPresenter(MainActivityContract.AboutView view); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void getGitHub() { String uri = "https: view.visitUri(uri); } AboutPresenter(MainActivityContract.AboutView view); @Override void findVersion(); @Override void getLicence(); @Override void getGitHub(); }
AboutPresenter implements MainActivityContract.AboutPresenter { @Override public void getGitHub() { String uri = "https: view.visitUri(uri); } AboutPresenter(MainActivityContract.AboutView view); @Override void findVersion(); @Override void getLicence(); @Override void getGitHub(); }
@Test public void splitqueryValidUrl() throws URISyntaxException, UnsupportedEncodingException { String uri = "http: URI url = new URI(uri); Map<String, List<String>> map = Utilities.splitQuery(url); assertEquals("[out:json]", map.get("data").get(0)); }
public static Map<String, List<String>> splitQuery(URI url) throws UnsupportedEncodingException { final Map<String, List<String>> query_pairs = new LinkedHashMap<>(); final String[] pairs = url.getQuery().split("&"); for (String pair : pairs) { final int idx = pair.indexOf("="); final String key = idx > 0 ? URLDecoder....
Utilities { public static Map<String, List<String>> splitQuery(URI url) throws UnsupportedEncodingException { final Map<String, List<String>> query_pairs = new LinkedHashMap<>(); final String[] pairs = url.getQuery().split("&"); for (String pair : pairs) { final int idx = pair.indexOf("="); final String key = idx > 0 ?...
Utilities { public static Map<String, List<String>> splitQuery(URI url) throws UnsupportedEncodingException { final Map<String, List<String>> query_pairs = new LinkedHashMap<>(); final String[] pairs = url.getQuery().split("&"); for (String pair : pairs) { final int idx = pair.indexOf("="); final String key = idx > 0 ?...
Utilities { public static Map<String, List<String>> splitQuery(URI url) throws UnsupportedEncodingException { final Map<String, List<String>> query_pairs = new LinkedHashMap<>(); final String[] pairs = url.getQuery().split("&"); for (String pair : pairs) { final int idx = pair.indexOf("="); final String key = idx > 0 ?...
Utilities { public static Map<String, List<String>> splitQuery(URI url) throws UnsupportedEncodingException { final Map<String, List<String>> query_pairs = new LinkedHashMap<>(); final String[] pairs = url.getQuery().split("&"); for (String pair : pairs) { final int idx = pair.indexOf("="); final String key = idx > 0 ?...
@Test public void calculateDistance() { double lat1 = 53.1; double lon1 = -7.5; double lat2 = 53.2; double lon2 = -7.4; float distance = Utilities.computeDistance(lat1, lon1, lat2, lon2); assertEquals(12985, distance, 1); }
public static float computeDistance(double latitude1, double longitude1, double latitude2, double longitude2) { int MAXITERS = 20; double lat1 = latitude1 * (Math.PI / 180.0); double lat2 = latitude2 * (Math.PI / 180.0); double lon1 = longitude1 * (Math.PI / 180.0); double lon2 = longitude2 * (Math.PI / 180.0); double ...
Utilities { public static float computeDistance(double latitude1, double longitude1, double latitude2, double longitude2) { int MAXITERS = 20; double lat1 = latitude1 * (Math.PI / 180.0); double lat2 = latitude2 * (Math.PI / 180.0); double lon1 = longitude1 * (Math.PI / 180.0); double lon2 = longitude2 * (Math.PI / 180...
Utilities { public static float computeDistance(double latitude1, double longitude1, double latitude2, double longitude2) { int MAXITERS = 20; double lat1 = latitude1 * (Math.PI / 180.0); double lat2 = latitude2 * (Math.PI / 180.0); double lon1 = longitude1 * (Math.PI / 180.0); double lon2 = longitude2 * (Math.PI / 180...
Utilities { public static float computeDistance(double latitude1, double longitude1, double latitude2, double longitude2) { int MAXITERS = 20; double lat1 = latitude1 * (Math.PI / 180.0); double lat2 = latitude2 * (Math.PI / 180.0); double lon1 = longitude1 * (Math.PI / 180.0); double lon2 = longitude2 * (Math.PI / 180...
Utilities { public static float computeDistance(double latitude1, double longitude1, double latitude2, double longitude2) { int MAXITERS = 20; double lat1 = latitude1 * (Math.PI / 180.0); double lat2 = latitude2 * (Math.PI / 180.0); double lon1 = longitude1 * (Math.PI / 180.0); double lon2 = longitude2 * (Math.PI / 180...
@Test public void testGetOverpassResultPoiType() throws JSONException { String expected_result = "hairdresser"; JSONObject json = new JSONObject().put("amenity", expected_result); String result = queryOverpass.getType(json); assertEquals(expected_result, result); }
public String getType(JSONObject tags) throws JSONException { String type = ""; if (tags.has("amenity")) { type = tags.getString("amenity"); } if (tags.has("shop")) { type = tags.getString("shop"); } if (tags.has("tourism")) { type = tags.getString("tourism"); } if (tags.has("leisure")) { type = tags.getString("leisure...
QueryOverpass implements SourceContract.Overpass { public String getType(JSONObject tags) throws JSONException { String type = ""; if (tags.has("amenity")) { type = tags.getString("amenity"); } if (tags.has("shop")) { type = tags.getString("shop"); } if (tags.has("tourism")) { type = tags.getString("tourism"); } if (ta...
QueryOverpass implements SourceContract.Overpass { public String getType(JSONObject tags) throws JSONException { String type = ""; if (tags.has("amenity")) { type = tags.getString("amenity"); } if (tags.has("shop")) { type = tags.getString("shop"); } if (tags.has("tourism")) { type = tags.getString("tourism"); } if (ta...
QueryOverpass implements SourceContract.Overpass { public String getType(JSONObject tags) throws JSONException { String type = ""; if (tags.has("amenity")) { type = tags.getString("amenity"); } if (tags.has("shop")) { type = tags.getString("shop"); } if (tags.has("tourism")) { type = tags.getString("tourism"); } if (ta...
QueryOverpass implements SourceContract.Overpass { public String getType(JSONObject tags) throws JSONException { String type = ""; if (tags.has("amenity")) { type = tags.getString("amenity"); } if (tags.has("shop")) { type = tags.getString("shop"); } if (tags.has("tourism")) { type = tags.getString("tourism"); } if (ta...
@Test public void getKeyFromTag() { String tag = this.questionObject.getTag(); String expectedValue = this.questionObject.getAnswerYes(); String actualValue = Answers.getAnswerMap().get(tag); assertEquals(expectedValue, actualValue); }
public static Map<String, String> getAnswerMap() { getInstance(); return answerMap; }
Answers { public static Map<String, String> getAnswerMap() { getInstance(); return answerMap; } }
Answers { public static Map<String, String> getAnswerMap() { getInstance(); return answerMap; } private Answers(); }
Answers { public static Map<String, String> getAnswerMap() { getInstance(); return answerMap; } private Answers(); static Map<String, String> getAnswerMap(); static void addAnswer(String question, String answer); static void clearAnswerList(); static void setPoiDetails(OsmObject osmObject); static long getPoiId(); sta...
Answers { public static Map<String, String> getAnswerMap() { getInstance(); return answerMap; } private Answers(); static Map<String, String> getAnswerMap(); static void addAnswer(String question, String answer); static void clearAnswerList(); static void setPoiDetails(OsmObject osmObject); static long getPoiId(); sta...
@Test public void checkChangesetTagsAreSet() { Map<String, String> actualTags = Answers.getChangesetTags(); Map<String, String> expectedTags = new HashMap<>(); expectedTags.put("", ""); assertEquals(expectedTags, actualTags); }
public static Map<String, String> getChangesetTags() { getInstance(); return changesetTags; }
Answers { public static Map<String, String> getChangesetTags() { getInstance(); return changesetTags; } }
Answers { public static Map<String, String> getChangesetTags() { getInstance(); return changesetTags; } private Answers(); }
Answers { public static Map<String, String> getChangesetTags() { getInstance(); return changesetTags; } private Answers(); static Map<String, String> getAnswerMap(); static void addAnswer(String question, String answer); static void clearAnswerList(); static void setPoiDetails(OsmObject osmObject); static long getPoiI...
Answers { public static Map<String, String> getChangesetTags() { getInstance(); return changesetTags; } private Answers(); static Map<String, String> getAnswerMap(); static void addAnswer(String question, String answer); static void clearAnswerList(); static void setPoiDetails(OsmObject osmObject); static long getPoiI...
@Test public void addPoiToTextview() { notHerePresenter.getPoiDetails(); verify(view).setTextview("Kitchen"); }
@Override public void getPoiDetails() { String name = poiList.get(0).getName(); view.setTextview(name); view.setAdapter(alternateList); }
NotHerePresenter implements NotHereFragmentContract.Presenter { @Override public void getPoiDetails() { String name = poiList.get(0).getName(); view.setTextview(name); view.setAdapter(alternateList); } }
NotHerePresenter implements NotHereFragmentContract.Presenter { @Override public void getPoiDetails() { String name = poiList.get(0).getName(); view.setTextview(name); view.setAdapter(alternateList); } NotHerePresenter(NotHereFragmentContract.View view); }
NotHerePresenter implements NotHereFragmentContract.Presenter { @Override public void getPoiDetails() { String name = poiList.get(0).getName(); view.setTextview(name); view.setAdapter(alternateList); } NotHerePresenter(NotHereFragmentContract.View view); @Override void getPoiDetails(); @Override void onItemClicked(int ...
NotHerePresenter implements NotHereFragmentContract.Presenter { @Override public void getPoiDetails() { String name = poiList.get(0).getName(); view.setTextview(name); view.setAdapter(alternateList); } NotHerePresenter(NotHereFragmentContract.View view); @Override void getPoiDetails(); @Override void onItemClicked(int ...
@Test public void onClick() { notHerePresenter.onItemClicked(0); verify(view).startActivity(); }
@Override public void onItemClicked(int i) { ArrayList<OsmObject> intentList = new ArrayList<>(); intentList.add(0, this.alternateList.get(i)); PoiList.getInstance().setPoiList(intentList); view.startActivity(); }
NotHerePresenter implements NotHereFragmentContract.Presenter { @Override public void onItemClicked(int i) { ArrayList<OsmObject> intentList = new ArrayList<>(); intentList.add(0, this.alternateList.get(i)); PoiList.getInstance().setPoiList(intentList); view.startActivity(); } }
NotHerePresenter implements NotHereFragmentContract.Presenter { @Override public void onItemClicked(int i) { ArrayList<OsmObject> intentList = new ArrayList<>(); intentList.add(0, this.alternateList.get(i)); PoiList.getInstance().setPoiList(intentList); view.startActivity(); } NotHerePresenter(NotHereFragmentContract.V...
NotHerePresenter implements NotHereFragmentContract.Presenter { @Override public void onItemClicked(int i) { ArrayList<OsmObject> intentList = new ArrayList<>(); intentList.add(0, this.alternateList.get(i)); PoiList.getInstance().setPoiList(intentList); view.startActivity(); } NotHerePresenter(NotHereFragmentContract.V...
NotHerePresenter implements NotHereFragmentContract.Presenter { @Override public void onItemClicked(int i) { ArrayList<OsmObject> intentList = new ArrayList<>(); intentList.add(0, this.alternateList.get(i)); PoiList.getInstance().setPoiList(intentList); view.startActivity(); } NotHerePresenter(NotHereFragmentContract.V...
@Test public void addPoiNameToTextViewTestSinglePoiInList() { List<OsmObject> poiList = new ArrayList<>(); poiList.add(new OsmObject(1, "node", "", "restaurant", 1, 1, 1)); PoiList.getInstance().setPoiList(poiList); when(preferences.getBooleanPreference(anyString())).thenReturn(true); questionsPresenter.addPoiNameToTex...
@Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestions.shuffleQuestions(); if (preferences.getBooleanPreference(Preferen...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
@Test public void addPoiNameToTextViewTestMultiplePoiInList() { List<OsmObject> poiList = new ArrayList<>(); poiList.add(new OsmObject(1, "node", "Kitchen", "restaurant", 1, 1, 1)); poiList.add(new OsmObject(1, "node", "", "restaurant", 1, 1, 1)); PoiList.getInstance().setPoiList(poiList); when(preferences.getBooleanPr...
@Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestions.shuffleQuestions(); if (preferences.getBooleanPreference(Preferen...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
@Test public void addPoiNameToTextViewTestNotLoggedIn() { List<OsmObject> poiList = new ArrayList<>(); poiList.add(new OsmObject(1, "node", "Kitchen", "restaurant", 1, 1, 1)); poiList.add(new OsmObject(1, "node", "", "restaurant", 1, 1, 1)); PoiList.getInstance().setPoiList(poiList); when(preferences.getBooleanPreferen...
@Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestions.shuffleQuestions(); if (preferences.getBooleanPreference(Preferen...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
QuestionsPresenter implements QuestionsActivityContract.Presenter { @Override public void addPoiNameToTextview() { List<OsmObject> poiList = PoiList.getInstance().getPoiList(); if (poiList.size() != 0) { String poiType = poiList.get(0).getType(); PoiContract listOfQuestions = PoiTypes.getPoiType(poiType); listOfQuestio...
@Test public void testGetMigrationPairOfPNode() { MigrationRouter migrationRouter = new MigrationRouter(10000, 3, 4); System.out.println(migrationRouter.getMigrationPairOfPNode(0)); List<List<MigrationPair>> allNodeMigrationPairs = migrationRouter.getAllNodeMigrationPairs(); Assert.assertTrue( allNodeMigrationPairs.siz...
public List<MigrationPair> getMigrationPairOfPNode(int pNodeNo) { return allNodeMigrationPairs.get(pNodeNo); }
MigrationRouter { public List<MigrationPair> getMigrationPairOfPNode(int pNodeNo) { return allNodeMigrationPairs.get(pNodeNo); } }
MigrationRouter { public List<MigrationPair> getMigrationPairOfPNode(int pNodeNo) { return allNodeMigrationPairs.get(pNodeNo); } MigrationRouter(int vNodes, int oldPNodeCount, int newPNodeCount); }
MigrationRouter { public List<MigrationPair> getMigrationPairOfPNode(int pNodeNo) { return allNodeMigrationPairs.get(pNodeNo); } MigrationRouter(int vNodes, int oldPNodeCount, int newPNodeCount); int getNewPNodeCount(); int getOldPNodeCount(); List<MigrationPair> getMigrationPairOfPNode(int pNodeNo); List<List<Migratio...
MigrationRouter { public List<MigrationPair> getMigrationPairOfPNode(int pNodeNo) { return allNodeMigrationPairs.get(pNodeNo); } MigrationRouter(int vNodes, int oldPNodeCount, int newPNodeCount); int getNewPNodeCount(); int getOldPNodeCount(); List<MigrationPair> getMigrationPairOfPNode(int pNodeNo); List<List<Migratio...
@Test public void testQueryConsistentReport() { }
public List<ConsistentReportDO> queryConsistentReport(Map params) { return consistentReportDao.queryConsistentReport(params); }
ConsistentReportServiceImpl implements ConsistentReportService { public List<ConsistentReportDO> queryConsistentReport(Map params) { return consistentReportDao.queryConsistentReport(params); } }
ConsistentReportServiceImpl implements ConsistentReportService { public List<ConsistentReportDO> queryConsistentReport(Map params) { return consistentReportDao.queryConsistentReport(params); } }
ConsistentReportServiceImpl implements ConsistentReportService { public List<ConsistentReportDO> queryConsistentReport(Map params) { return consistentReportDao.queryConsistentReport(params); } void setConsistentReportDao(ConsistentReportDao consistentReportDao); Integer saveConsistentReport(ConsistentReportDO consiste...
ConsistentReportServiceImpl implements ConsistentReportService { public List<ConsistentReportDO> queryConsistentReport(Map params) { return consistentReportDao.queryConsistentReport(params); } void setConsistentReportDao(ConsistentReportDao consistentReportDao); Integer saveConsistentReport(ConsistentReportDO consiste...
@Test public void testGetVNodes() { PNode2VNodeMapping mapping = new PNode2VNodeMapping(12, 3); System.out.println( "vNodes: of (12,3): " + mapping); List<Integer> vNodes = mapping.getVNodes(1); System.out.println( "vNodes: of (12,3:1): " + vNodes ); Assert.assertEquals(6, vNodes.get(0).intValue()); Assert.assertEquals...
public List<Integer> getVNodes(int pNode) { return vpmMapping.get( pNode ); }
PNode2VNodeMapping { public List<Integer> getVNodes(int pNode) { return vpmMapping.get( pNode ); } }
PNode2VNodeMapping { public List<Integer> getVNodes(int pNode) { return vpmMapping.get( pNode ); } PNode2VNodeMapping(int vNodes, int pNodeCount); }
PNode2VNodeMapping { public List<Integer> getVNodes(int pNode) { return vpmMapping.get( pNode ); } PNode2VNodeMapping(int vNodes, int pNodeCount); List<Integer> getVNodes(int pNode); int getPNodeCount(); List<List<Integer>> getVpmMapping(); }
PNode2VNodeMapping { public List<Integer> getVNodes(int pNode) { return vpmMapping.get( pNode ); } PNode2VNodeMapping(int vNodes, int pNodeCount); List<Integer> getVNodes(int pNode); int getPNodeCount(); List<List<Integer>> getVpmMapping(); }
@Test public void testProperty() { Properties properties = PropertiesLoadUtil.loadProperties("./test/test/test/testp.properties"); assertEquals("value1", properties.get("key1")); }
public static Properties loadProperties(String propLocation) { Properties properties = null; properties = loadAsFile(propLocation); if( properties != null) return properties; properties = loadAsResource(propLocation); return properties; }
PropertiesLoadUtil { public static Properties loadProperties(String propLocation) { Properties properties = null; properties = loadAsFile(propLocation); if( properties != null) return properties; properties = loadAsResource(propLocation); return properties; } }
PropertiesLoadUtil { public static Properties loadProperties(String propLocation) { Properties properties = null; properties = loadAsFile(propLocation); if( properties != null) return properties; properties = loadAsResource(propLocation); return properties; } }
PropertiesLoadUtil { public static Properties loadProperties(String propLocation) { Properties properties = null; properties = loadAsFile(propLocation); if( properties != null) return properties; properties = loadAsResource(propLocation); return properties; } static Properties loadProperties(String propLocation); }
PropertiesLoadUtil { public static Properties loadProperties(String propLocation) { Properties properties = null; properties = loadAsFile(propLocation); if( properties != null) return properties; properties = loadAsResource(propLocation); return properties; } static Properties loadProperties(String propLocation); }
@Test public void testSerializeNull() { Serializer serializer = new JavaObjectSerializer(); byte[] bvalue = serializer.serialize(null, null); char c = (char) Byte.valueOf( (byte)0 ).byteValue(); byte s = "0".getBytes()[0] ; System.out.println("asc 0: " + s +", c: " + c); }
public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject( o ); bvalue = baos.toByteArray(...
JavaObjectSerializer implements Serializer { public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos...
JavaObjectSerializer implements Serializer { public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos...
JavaObjectSerializer implements Serializer { public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos...
JavaObjectSerializer implements Serializer { public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos...
@Test public void testSerialize() { Serializer serializer = new JavaObjectSerializer(); String stringObj = "key001"; byte[] bvalue = serializer.serialize(stringObj, null); Assert.assertTrue("string serialize result", bvalue != null); }
public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos.writeObject( o ); bvalue = baos.toByteArray(...
JavaObjectSerializer implements Serializer { public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos...
JavaObjectSerializer implements Serializer { public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos...
JavaObjectSerializer implements Serializer { public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos...
JavaObjectSerializer implements Serializer { public byte[] serialize(Object o, Object arg) { byte[] bvalue = null; if( o == null ) { bvalue = new byte[]{ Byte.valueOf( (byte) 0 )}; return bvalue; } ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ObjectOutputStream oos = new ObjectOutputStream(baos); oos...
@Test public void testDeserialize() { Serializer serializer = new JavaObjectSerializer(); String stringObj = "key001"; byte[] bvalue = serializer.serialize(stringObj, null); String result = (String) serializer.deserialize(bvalue, null); Assert.assertEquals("string serialize result",stringObj, result); }
public Object deserialize(byte[] bvalue, Object deserializeTarget) { if( bvalue == null) return null; ByteArrayInputStream bais = new ByteArrayInputStream( bvalue ); try { ObjectInputStream ois = new ObjectInputStream(bais); Object obj = ois.readObject(); return obj; } catch (Exception e) { throw new RuntimeException("...
JavaObjectSerializer implements Serializer { public Object deserialize(byte[] bvalue, Object deserializeTarget) { if( bvalue == null) return null; ByteArrayInputStream bais = new ByteArrayInputStream( bvalue ); try { ObjectInputStream ois = new ObjectInputStream(bais); Object obj = ois.readObject(); return obj; } catch...
JavaObjectSerializer implements Serializer { public Object deserialize(byte[] bvalue, Object deserializeTarget) { if( bvalue == null) return null; ByteArrayInputStream bais = new ByteArrayInputStream( bvalue ); try { ObjectInputStream ois = new ObjectInputStream(bais); Object obj = ois.readObject(); return obj; } catch...
JavaObjectSerializer implements Serializer { public Object deserialize(byte[] bvalue, Object deserializeTarget) { if( bvalue == null) return null; ByteArrayInputStream bais = new ByteArrayInputStream( bvalue ); try { ObjectInputStream ois = new ObjectInputStream(bais); Object obj = ois.readObject(); return obj; } catch...
JavaObjectSerializer implements Serializer { public Object deserialize(byte[] bvalue, Object deserializeTarget) { if( bvalue == null) return null; ByteArrayInputStream bais = new ByteArrayInputStream( bvalue ); try { ObjectInputStream ois = new ObjectInputStream(bais); Object obj = ois.readObject(); return obj; } catch...
@Test public void testLoadStorage() { StorageManager manager = new StorageManager(); }
protected void loadStorage(StorageConfig config) { driver.init(config); storage = driver.createStorage(); }
StorageManager { protected void loadStorage(StorageConfig config) { driver.init(config); storage = driver.createStorage(); } }
StorageManager { protected void loadStorage(StorageConfig config) { driver.init(config); storage = driver.createStorage(); } StorageManager(); }
StorageManager { protected void loadStorage(StorageConfig config) { driver.init(config); storage = driver.createStorage(); } StorageManager(); Storage getStorage(); StorageType getStorageType(); void registStorage(Class<?> storageDriverClass); }
StorageManager { protected void loadStorage(StorageConfig config) { driver.init(config); storage = driver.createStorage(); } StorageManager(); Storage getStorage(); StorageType getStorageType(); void registStorage(Class<?> storageDriverClass); }
@Test public void testGetTargetNodeOfVirtualNode() { List<MigrationRoutePair> migrationRoutePairs = new ArrayList<MigrationRoutePair>(); for (int i = 0; i < 1000 ; i++) { MigrationRoutePair pair = new MigrationRoutePair(); pair.setVnode( i ); pair.setTargetPhysicalId("127.0.0.1"); migrationRoutePairs.add( pair ); } Mig...
public String getTargetNodeOfVirtualNode(int vnode) { return index.get( vnode ); }
MigrationVirtualNodeFinder { public String getTargetNodeOfVirtualNode(int vnode) { return index.get( vnode ); } }
MigrationVirtualNodeFinder { public String getTargetNodeOfVirtualNode(int vnode) { return index.get( vnode ); } MigrationVirtualNodeFinder(List<MigrationRoutePair> migrationRoutePairs); }
MigrationVirtualNodeFinder { public String getTargetNodeOfVirtualNode(int vnode) { return index.get( vnode ); } MigrationVirtualNodeFinder(List<MigrationRoutePair> migrationRoutePairs); String getTargetNodeOfVirtualNode(int vnode); }
MigrationVirtualNodeFinder { public String getTargetNodeOfVirtualNode(int vnode) { return index.get( vnode ); } MigrationVirtualNodeFinder(List<MigrationRoutePair> migrationRoutePairs); String getTargetNodeOfVirtualNode(int vnode); }
@Test public void testGetGrossProgress() { List<MigrationRoutePair> migrationRoutePairs = new ArrayList<MigrationRoutePair>(); int t = 1, v = 10000 ; for (int i = 0; i < t; i++) { for (int j = 0; j < v; j++) { MigrationRoutePair pair = new MigrationRoutePair(j , "t"+i ); migrationRoutePairs.add( pair ); } } ProgressCom...
public int getGrossProgress() { reentrantLock.lock(); try { return grossProgress; }finally { reentrantLock.unlock(); } }
ProgressComputer { public int getGrossProgress() { reentrantLock.lock(); try { return grossProgress; }finally { reentrantLock.unlock(); } } }
ProgressComputer { public int getGrossProgress() { reentrantLock.lock(); try { return grossProgress; }finally { reentrantLock.unlock(); } } ProgressComputer(List<MigrationRoutePair> migrationRoutePairs); }
ProgressComputer { public int getGrossProgress() { reentrantLock.lock(); try { return grossProgress; }finally { reentrantLock.unlock(); } } ProgressComputer(List<MigrationRoutePair> migrationRoutePairs); synchronized boolean completeOneVNode(String targetNodeId, Integer vnodeId); int getGrossProgress(); int getFinishCo...
ProgressComputer { public int getGrossProgress() { reentrantLock.lock(); try { return grossProgress; }finally { reentrantLock.unlock(); } } ProgressComputer(List<MigrationRoutePair> migrationRoutePairs); synchronized boolean completeOneVNode(String targetNodeId, Integer vnodeId); int getGrossProgress(); int getFinishCo...
@Test public void testSaveConsistentReport() { }
public Integer saveConsistentReport(ConsistentReportDO consistentReportDO) { return consistentReportDao.insert(consistentReportDO); }
ConsistentReportServiceImpl implements ConsistentReportService { public Integer saveConsistentReport(ConsistentReportDO consistentReportDO) { return consistentReportDao.insert(consistentReportDO); } }
ConsistentReportServiceImpl implements ConsistentReportService { public Integer saveConsistentReport(ConsistentReportDO consistentReportDO) { return consistentReportDao.insert(consistentReportDO); } }
ConsistentReportServiceImpl implements ConsistentReportService { public Integer saveConsistentReport(ConsistentReportDO consistentReportDO) { return consistentReportDao.insert(consistentReportDO); } void setConsistentReportDao(ConsistentReportDao consistentReportDao); Integer saveConsistentReport(ConsistentReportDO co...
ConsistentReportServiceImpl implements ConsistentReportService { public Integer saveConsistentReport(ConsistentReportDO consistentReportDO) { return consistentReportDao.insert(consistentReportDO); } void setConsistentReportDao(ConsistentReportDao consistentReportDao); Integer saveConsistentReport(ConsistentReportDO co...
@Test public void testConversion(){ SimulationTreeTableToModelConverter converter = new SimulationTreeTableToModelConverter(); BPMNProcess process = converter.convertTreeToModel(tree); assertTrue("Should be 14, but was " + process.getBPMNElementsWithOutSequenceFlows().size(), process.getBPMNElementsWithOutSequenceFlows...
public BPMNProcess convertTreeToModel(SushiTree<Object> tree){ this.tree = tree; BPMNStartEvent startEvent = new BPMNStartEvent(createID(), "Start", null); process.addBPMNElement(startEvent); BPMNEndEvent endEvent = new BPMNEndEvent(createID(), "End", null); process.addBPMNElement(endEvent); convertTreeToBPMNTree(); Tu...
SimulationTreeTableToModelConverter { public BPMNProcess convertTreeToModel(SushiTree<Object> tree){ this.tree = tree; BPMNStartEvent startEvent = new BPMNStartEvent(createID(), "Start", null); process.addBPMNElement(startEvent); BPMNEndEvent endEvent = new BPMNEndEvent(createID(), "End", null); process.addBPMNElement(...
SimulationTreeTableToModelConverter { public BPMNProcess convertTreeToModel(SushiTree<Object> tree){ this.tree = tree; BPMNStartEvent startEvent = new BPMNStartEvent(createID(), "Start", null); process.addBPMNElement(startEvent); BPMNEndEvent endEvent = new BPMNEndEvent(createID(), "End", null); process.addBPMNElement(...
SimulationTreeTableToModelConverter { public BPMNProcess convertTreeToModel(SushiTree<Object> tree){ this.tree = tree; BPMNStartEvent startEvent = new BPMNStartEvent(createID(), "Start", null); process.addBPMNElement(startEvent); BPMNEndEvent endEvent = new BPMNEndEvent(createID(), "End", null); process.addBPMNElement(...
SimulationTreeTableToModelConverter { public BPMNProcess convertTreeToModel(SushiTree<Object> tree){ this.tree = tree; BPMNStartEvent startEvent = new BPMNStartEvent(createID(), "Start", null); process.addBPMNElement(startEvent); BPMNEndEvent endEvent = new BPMNEndEvent(createID(), "End", null); process.addBPMNElement(...
@Test public void testComplexProcess() throws XPathExpressionException, ParserConfigurationException, SAXException, IOException{ BPMNProcess BPMNProcess = BPMNParser.generateProcessFromXML(complexfilePath); assertNotNull(BPMNProcess); assertTrue(BPMNProcess.getBPMNElementsWithOutSequenceFlows().size() == 21); assertTru...
public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); }
BPMNParser extends AbstractXMLParser { public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); } }
BPMNParser extends AbstractXMLParser { public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); } }
BPMNParser extends AbstractXMLParser { public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); } static BPMNProcess generateProcessFromXML(String filePath); }
BPMNParser extends AbstractXMLParser { public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); } static BPMNProcess generateProcessFromXML(String filePath); }
@Test public void testSubProcessImport() { BPMNProcess BPMNProcess = BPMNParser.generateProcessFromXML(subProcessfilePath); assertNotNull(BPMNProcess); assertTrue(BPMNProcess.getBPMNElementsWithOutSequenceFlows().size() == 7); assertTrue(BPMNProcess.hasSubProcesses()); BPMNSubProcess subProcess = BPMNProcess.getSubProc...
public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); }
BPMNParser extends AbstractXMLParser { public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); } }
BPMNParser extends AbstractXMLParser { public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); } }
BPMNParser extends AbstractXMLParser { public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); } static BPMNProcess generateProcessFromXML(String filePath); }
BPMNParser extends AbstractXMLParser { public static BPMNProcess generateProcessFromXML(String filePath) { Document doc = readXMLDocument(filePath); return generateBPMNProcess(doc); } static BPMNProcess generateProcessFromXML(String filePath); }
@Test public void testXSDParsing() throws XPathExpressionException, ParserConfigurationException, SAXException, IOException{ SushiEventType eventType = null; try { eventType = XSDParser.generateEventTypeFromXSD(filePath, "EventTaxonomy"); } catch (XMLParsingException e) { fail(); } assertNotNull(eventType); }
public static SushiEventType generateEventTypeFromXSD(String filePath, String eventTypeName) throws XMLParsingException { Document doc = readXMLDocument(filePath); if (doc == null) { throw new XMLParsingException("could not read XSD: " + filePath); } return generateEventType(doc, eventTypeName); }
XSDParser extends AbstractXMLParser { public static SushiEventType generateEventTypeFromXSD(String filePath, String eventTypeName) throws XMLParsingException { Document doc = readXMLDocument(filePath); if (doc == null) { throw new XMLParsingException("could not read XSD: " + filePath); } return generateEventType(doc, e...
XSDParser extends AbstractXMLParser { public static SushiEventType generateEventTypeFromXSD(String filePath, String eventTypeName) throws XMLParsingException { Document doc = readXMLDocument(filePath); if (doc == null) { throw new XMLParsingException("could not read XSD: " + filePath); } return generateEventType(doc, e...
XSDParser extends AbstractXMLParser { public static SushiEventType generateEventTypeFromXSD(String filePath, String eventTypeName) throws XMLParsingException { Document doc = readXMLDocument(filePath); if (doc == null) { throw new XMLParsingException("could not read XSD: " + filePath); } return generateEventType(doc, e...
XSDParser extends AbstractXMLParser { public static SushiEventType generateEventTypeFromXSD(String filePath, String eventTypeName) throws XMLParsingException { Document doc = readXMLDocument(filePath); if (doc == null) { throw new XMLParsingException("could not read XSD: " + filePath); } return generateEventType(doc, e...
@Test public void testXMLParsing() throws XPathExpressionException, ParserConfigurationException, SAXException, IOException, XMLParsingException{ SushiEventType eventTyp = new SushiEventType("EventTaxonomy"); eventTyp.setXMLName("EventTaxonomy"); eventTyp.setTimestampName("timestamp"); eventTyp.save(); SushiEvent event...
public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } static SushiEvent generateEventFromXML(String filePath); static SushiEvent generateEventFromXML(String filePath,...
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } static SushiEvent generateEventFromXML(String filePath); static SushiEvent generateEventFromXML(String filePath,...
@Test public void testHierarchicalTimestampParsing() throws XMLParsingException { SushiEventType eventTyp = new SushiEventType("EventTaxonomy"); eventTyp.setXMLName("EventTaxonomy"); eventTyp.setTimestampName("location.timestamp"); eventTyp.save(); SushiEvent event = XMLParser.generateEventFromXML(filePathToXMLWithHier...
public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } static SushiEvent generateEventFromXML(String filePath); static SushiEvent generateEventFromXML(String filePath,...
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } static SushiEvent generateEventFromXML(String filePath); static SushiEvent generateEventFromXML(String filePath,...
@Test public void testNonHierarchicalTimestampParsing() throws XMLParsingException { SushiEventType eventTyp = new SushiEventType("EventTaxonomy"); eventTyp.setXMLName("EventTaxonomy"); eventTyp.setTimestampName("timestamp"); eventTyp.save(); SushiEvent event = XMLParser.generateEventFromXML(filePathToXMLWithHierarchic...
public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } }
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } static SushiEvent generateEventFromXML(String filePath); static SushiEvent generateEventFromXML(String filePath,...
XMLParser extends AbstractXMLParser { public static SushiEvent generateEventFromXML(String filePath) throws XMLParsingException { Document doc = readXMLDocument(filePath); return generateEvent(doc, null); } static SushiEvent generateEventFromXML(String filePath); static SushiEvent generateEventFromXML(String filePath,...
@Test public void testConversion(){ BPM2XMLToSignavioXMLConverter converter = new BPM2XMLToSignavioXMLConverter(emptyBpmn2FilePath); converter.generateSignavioXMLFromBPM2XML(); converter = new BPM2XMLToSignavioXMLConverter(startEventBpmn2FilePath); converter.generateSignavioXMLFromBPM2XML(); converter = new BPM2XMLToSi...
public String generateSignavioXMLFromBPM2XML(){ SignavioBPMNProcess process = parseBPM2XML(); File file = new File(pathToCoreComponentsFolder + fileNameWithoutExtenxions + ".signavio.xml"); try { FileWriter writer = new FileWriter(file ,false); writer.write("<?xml version=\"1.0\" encoding=\"utf-8\"?>"); writer.write(Sy...
BPM2XMLToSignavioXMLConverter extends AbstractXMLParser { public String generateSignavioXMLFromBPM2XML(){ SignavioBPMNProcess process = parseBPM2XML(); File file = new File(pathToCoreComponentsFolder + fileNameWithoutExtenxions + ".signavio.xml"); try { FileWriter writer = new FileWriter(file ,false); writer.write("<?x...
BPM2XMLToSignavioXMLConverter extends AbstractXMLParser { public String generateSignavioXMLFromBPM2XML(){ SignavioBPMNProcess process = parseBPM2XML(); File file = new File(pathToCoreComponentsFolder + fileNameWithoutExtenxions + ".signavio.xml"); try { FileWriter writer = new FileWriter(file ,false); writer.write("<?x...
BPM2XMLToSignavioXMLConverter extends AbstractXMLParser { public String generateSignavioXMLFromBPM2XML(){ SignavioBPMNProcess process = parseBPM2XML(); File file = new File(pathToCoreComponentsFolder + fileNameWithoutExtenxions + ".signavio.xml"); try { FileWriter writer = new FileWriter(file ,false); writer.write("<?x...
BPM2XMLToSignavioXMLConverter extends AbstractXMLParser { public String generateSignavioXMLFromBPM2XML(){ SignavioBPMNProcess process = parseBPM2XML(); File file = new File(pathToCoreComponentsFolder + fileNameWithoutExtenxions + ".signavio.xml"); try { FileWriter writer = new FileWriter(file ,false); writer.write("<?x...
@Test public void testParsing(){ BPM2XMLToSignavioXMLConverter converter = new BPM2XMLToSignavioXMLConverter(emptyBpmn2FilePath); converter.parseBPM2XML(); }
public SignavioBPMNProcess parseBPM2XML() { Document doc = readXMLDocument(bpm2FilePath); process = new SignavioBPMNProcess(); Node definitionNode = getDefinitionsElementFromBPM(doc); if(definitionNode != null){ process.addPropertyValue("targetnamespace", definitionNode.getAttributes().getNamedItem("targetNamespace").g...
BPM2XMLToSignavioXMLConverter extends AbstractXMLParser { public SignavioBPMNProcess parseBPM2XML() { Document doc = readXMLDocument(bpm2FilePath); process = new SignavioBPMNProcess(); Node definitionNode = getDefinitionsElementFromBPM(doc); if(definitionNode != null){ process.addPropertyValue("targetnamespace", defini...
BPM2XMLToSignavioXMLConverter extends AbstractXMLParser { public SignavioBPMNProcess parseBPM2XML() { Document doc = readXMLDocument(bpm2FilePath); process = new SignavioBPMNProcess(); Node definitionNode = getDefinitionsElementFromBPM(doc); if(definitionNode != null){ process.addPropertyValue("targetnamespace", defini...
BPM2XMLToSignavioXMLConverter extends AbstractXMLParser { public SignavioBPMNProcess parseBPM2XML() { Document doc = readXMLDocument(bpm2FilePath); process = new SignavioBPMNProcess(); Node definitionNode = getDefinitionsElementFromBPM(doc); if(definitionNode != null){ process.addPropertyValue("targetnamespace", defini...
BPM2XMLToSignavioXMLConverter extends AbstractXMLParser { public SignavioBPMNProcess parseBPM2XML() { Document doc = readXMLDocument(bpm2FilePath); process = new SignavioBPMNProcess(); Node definitionNode = getDefinitionsElementFromBPM(doc); if(definitionNode != null){ process.addPropertyValue("targetnamespace", defini...
@Test public void staticallyKnownAnnotation() throws Exception { TestUtils.makeSource(src, "impl.C", "import " + Marker.class.getName().replace('$', '.') + ";", "@Marker(stuff=\"hello\")", "public class C {}"); TestUtils.runApt(src, null, clz, new File[] { new File(URI.create(Marker.class.getProtectionDomain().getCodeS...
public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); }
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } }
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
@SuppressWarnings("unchecked") @Test public void methodsAndFields() throws Exception { TestUtils.makeSource(src, "x.A", "import java.lang.annotation.*;", "@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})", "@net.java.sezpoz.Indexable", "public @interface A {}"); TestUtils.makeSource(src, "y.C", "publi...
public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); }
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } }
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
@Test public void defaultValues() throws Exception { TestUtils.makeSource(src, "x.A", "import java.lang.annotation.*;", "@Retention(RetentionPolicy.RUNTIME)", "@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD})", "@net.java.sezpoz.Indexable", "public @interface A {", "int x() default 5;", "}"); TestUtil...
public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); }
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } }
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
Index implements Iterable<IndexItem<A,I>> { public static <A extends Annotation,I> Index<A,I> load(Class<A> annotation, Class<I> instanceType) throws IllegalArgumentException { return load(annotation, instanceType, Thread.currentThread().getContextClassLoader()); } private Index(Class<A> annotation, Class<I> instance,...
@Test public void testInit() { AbstractClient.init(); String[] keywords = {AbstractClient.HOST_ARGS, AbstractClient.HELP_ARGS, AbstractClient.PORT_ARGS, AbstractClient.PASSWORD_ARGS, AbstractClient.USERNAME_ARGS, AbstractClient.ISO8601_ARGS, AbstractClient.MAX_PRINT_ROW_COUNT_ARGS,}; for (String keyword : keywords) { i...
protected static void init() { keywordSet.add("-" + HOST_ARGS); keywordSet.add("-" + HELP_ARGS); keywordSet.add("-" + PORT_ARGS); keywordSet.add("-" + PASSWORD_ARGS); keywordSet.add("-" + USERNAME_ARGS); keywordSet.add("-" + ISO8601_ARGS); keywordSet.add("-" + MAX_PRINT_ROW_COUNT_ARGS); }
AbstractClient { protected static void init() { keywordSet.add("-" + HOST_ARGS); keywordSet.add("-" + HELP_ARGS); keywordSet.add("-" + PORT_ARGS); keywordSet.add("-" + PASSWORD_ARGS); keywordSet.add("-" + USERNAME_ARGS); keywordSet.add("-" + ISO8601_ARGS); keywordSet.add("-" + MAX_PRINT_ROW_COUNT_ARGS); } }
AbstractClient { protected static void init() { keywordSet.add("-" + HOST_ARGS); keywordSet.add("-" + HELP_ARGS); keywordSet.add("-" + PORT_ARGS); keywordSet.add("-" + PASSWORD_ARGS); keywordSet.add("-" + USERNAME_ARGS); keywordSet.add("-" + ISO8601_ARGS); keywordSet.add("-" + MAX_PRINT_ROW_COUNT_ARGS); } }
AbstractClient { protected static void init() { keywordSet.add("-" + HOST_ARGS); keywordSet.add("-" + HELP_ARGS); keywordSet.add("-" + PORT_ARGS); keywordSet.add("-" + PASSWORD_ARGS); keywordSet.add("-" + USERNAME_ARGS); keywordSet.add("-" + ISO8601_ARGS); keywordSet.add("-" + MAX_PRINT_ROW_COUNT_ARGS); } static void ...
AbstractClient { protected static void init() { keywordSet.add("-" + HOST_ARGS); keywordSet.add("-" + HELP_ARGS); keywordSet.add("-" + PORT_ARGS); keywordSet.add("-" + PASSWORD_ARGS); keywordSet.add("-" + USERNAME_ARGS); keywordSet.add("-" + ISO8601_ARGS); keywordSet.add("-" + MAX_PRINT_ROW_COUNT_ARGS); } static void ...
@Test public void testToString() { Pair<String, Integer> p1 = new Pair<String, Integer>("a", 123123); assertEquals("<a,123123>", p1.toString()); Pair<Float, Double> p2 = new Pair<Float, Double>(32.5f, 123.123d); assertEquals("<32.5,123.123>", p2.toString()); }
@Override public String toString() { return "<" + left + "," + right + ">"; }
Pair { @Override public String toString() { return "<" + left + "," + right + ">"; } }
Pair { @Override public String toString() { return "<" + left + "," + right + ">"; } Pair(L l, R r); }
Pair { @Override public String toString() { return "<" + left + "," + right + ">"; } Pair(L l, R r); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
Pair { @Override public String toString() { return "<" + left + "," + right + ">"; } Pair(L l, R r); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); public L left; public R right; }
@Test public void testIntToBytes() { int b = 123; byte[] bb = BytesUtils.intToBytes(b); int bf = BytesUtils.bytesToInt(bb); assertEquals("testBytesToFloat", b, bf); }
public static byte[] intToBytes(int i) { return new byte[]{(byte) ((i >> 24) & 0xFF), (byte) ((i >> 16) & 0xFF), (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF)}; }
BytesUtils { public static byte[] intToBytes(int i) { return new byte[]{(byte) ((i >> 24) & 0xFF), (byte) ((i >> 16) & 0xFF), (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF)}; } }
BytesUtils { public static byte[] intToBytes(int i) { return new byte[]{(byte) ((i >> 24) & 0xFF), (byte) ((i >> 16) & 0xFF), (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF)}; } }
BytesUtils { public static byte[] intToBytes(int i) { return new byte[]{(byte) ((i >> 24) & 0xFF), (byte) ((i >> 16) & 0xFF), (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF)}; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int ...
BytesUtils { public static byte[] intToBytes(int i) { return new byte[]{(byte) ((i >> 24) & 0xFF), (byte) ((i >> 16) & 0xFF), (byte) ((i >> 8) & 0xFF), (byte) (i & 0xFF)}; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int ...
@Test public void testFloatToBytes() throws Exception { float b = 25.0f; byte[] bb = BytesUtils.floatToBytes(b); float bf = BytesUtils.bytesToFloat(bb); assertEquals("testBytesToFloat", b, bf, CommonTestConstant.float_min_delta); }
public static byte[] floatToBytes(float x) { byte[] b = new byte[4]; int l = Float.floatToIntBits(x); for (int i = 3; i >= 0; i--) { b[i] = new Integer(l).byteValue(); l = l >> 8; } return b; }
BytesUtils { public static byte[] floatToBytes(float x) { byte[] b = new byte[4]; int l = Float.floatToIntBits(x); for (int i = 3; i >= 0; i--) { b[i] = new Integer(l).byteValue(); l = l >> 8; } return b; } }
BytesUtils { public static byte[] floatToBytes(float x) { byte[] b = new byte[4]; int l = Float.floatToIntBits(x); for (int i = 3; i >= 0; i--) { b[i] = new Integer(l).byteValue(); l = l >> 8; } return b; } }
BytesUtils { public static byte[] floatToBytes(float x) { byte[] b = new byte[4]; int l = Float.floatToIntBits(x); for (int i = 3; i >= 0; i--) { b[i] = new Integer(l).byteValue(); l = l >> 8; } return b; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToByte...
BytesUtils { public static byte[] floatToBytes(float x) { byte[] b = new byte[4]; int l = Float.floatToIntBits(x); for (int i = 3; i >= 0; i--) { b[i] = new Integer(l).byteValue(); l = l >> 8; } return b; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToByte...
@Test public void testBoolToBytes() throws Exception { boolean b = true; byte[] bb = BytesUtils.boolToBytes(b); boolean bf = BytesUtils.bytesToBool(bb); assertEquals("testBoolToBytes", b, bf); }
public static byte[] boolToBytes(boolean x) { byte[] b = new byte[1]; if (x) { b[0] = 1; } else { b[0] = 0; } return b; }
BytesUtils { public static byte[] boolToBytes(boolean x) { byte[] b = new byte[1]; if (x) { b[0] = 1; } else { b[0] = 0; } return b; } }
BytesUtils { public static byte[] boolToBytes(boolean x) { byte[] b = new byte[1]; if (x) { b[0] = 1; } else { b[0] = 0; } return b; } }
BytesUtils { public static byte[] boolToBytes(boolean x) { byte[] b = new byte[1]; if (x) { b[0] = 1; } else { b[0] = 0; } return b; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); static byte[] intToTwo...
BytesUtils { public static byte[] boolToBytes(boolean x) { byte[] b = new byte[1]; if (x) { b[0] = 1; } else { b[0] = 0; } return b; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); static byte[] intToTwo...
@Test public void testlongToBytes() { long lNum = 32143422454243342L; long iNum = 1032423424L; long lSNum = 10; assertEquals(lNum, BytesUtils.bytesToLong(BytesUtils.longToBytes(lNum, 8), 8)); assertEquals(iNum, BytesUtils.bytesToLong(BytesUtils.longToBytes(iNum, 8), 8)); assertEquals(iNum, BytesUtils.bytesToLong(BytesU...
public static byte[] longToBytes(long num) { return longToBytes(num, 8); }
BytesUtils { public static byte[] longToBytes(long num) { return longToBytes(num, 8); } }
BytesUtils { public static byte[] longToBytes(long num) { return longToBytes(num, 8); } }
BytesUtils { public static byte[] longToBytes(long num) { return longToBytes(num, 8); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); static byte[] intToTwoBytes(int i); static int twoBytesToInt(byte[] r...
BytesUtils { public static byte[] longToBytes(long num) { return longToBytes(num, 8); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); static byte[] intToTwoBytes(int i); static int twoBytesToInt(byte[] r...
@Test public void readLongTest() throws IOException { long l = 32143422454243342L; byte[] bs = BytesUtils.longToBytes(l); InputStream in = new ByteArrayInputStream(bs); assertEquals(l, BytesUtils.readLong(in)); }
public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); }
BytesUtils { public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); } }
BytesUtils { public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); } }
BytesUtils { public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width...
BytesUtils { public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width...
@Test public void testDoubleToBytes() { double b1 = 2745687.1253123d; byte[] ret = BytesUtils.doubleToBytes(b1); double rb1 = BytesUtils.bytesToDouble(ret); assertEquals(b1, rb1, CommonTestConstant.float_min_delta); }
public static byte[] doubleToBytes(double data) { byte[] bytes = new byte[8]; long value = Double.doubleToLongBits(data); for (int i = 7; i >= 0; i--) { bytes[i] = new Long(value).byteValue(); value = value >> 8; } return bytes; }
BytesUtils { public static byte[] doubleToBytes(double data) { byte[] bytes = new byte[8]; long value = Double.doubleToLongBits(data); for (int i = 7; i >= 0; i--) { bytes[i] = new Long(value).byteValue(); value = value >> 8; } return bytes; } }
BytesUtils { public static byte[] doubleToBytes(double data) { byte[] bytes = new byte[8]; long value = Double.doubleToLongBits(data); for (int i = 7; i >= 0; i--) { bytes[i] = new Long(value).byteValue(); value = value >> 8; } return bytes; } }
BytesUtils { public static byte[] doubleToBytes(double data) { byte[] bytes = new byte[8]; long value = Double.doubleToLongBits(data); for (int i = 7; i >= 0; i--) { bytes[i] = new Long(value).byteValue(); value = value >> 8; } return bytes; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] des...
BytesUtils { public static byte[] doubleToBytes(double data) { byte[] bytes = new byte[8]; long value = Double.doubleToLongBits(data); for (int i = 7; i >= 0; i--) { bytes[i] = new Long(value).byteValue(); value = value >> 8; } return bytes; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] des...
@Test public void testStringToBytes() { String b = "lqfkgv12KLDJSL1@#%"; byte[] ret = BytesUtils.stringToBytes(b); String rb1 = BytesUtils.bytesToString(ret); assertTrue(b.equals(rb1)); }
public static byte[] stringToBytes(String str) { try { return str.getBytes(TSFileConfig.STRING_ENCODING); } catch (UnsupportedEncodingException e) { LOG.error("catch UnsupportedEncodingException {}", str, e); return null; } }
BytesUtils { public static byte[] stringToBytes(String str) { try { return str.getBytes(TSFileConfig.STRING_ENCODING); } catch (UnsupportedEncodingException e) { LOG.error("catch UnsupportedEncodingException {}", str, e); return null; } } }
BytesUtils { public static byte[] stringToBytes(String str) { try { return str.getBytes(TSFileConfig.STRING_ENCODING); } catch (UnsupportedEncodingException e) { LOG.error("catch UnsupportedEncodingException {}", str, e); return null; } } }
BytesUtils { public static byte[] stringToBytes(String str) { try { return str.getBytes(TSFileConfig.STRING_ENCODING); } catch (UnsupportedEncodingException e) { LOG.error("catch UnsupportedEncodingException {}", str, e); return null; } } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, in...
BytesUtils { public static byte[] stringToBytes(String str) { try { return str.getBytes(TSFileConfig.STRING_ENCODING); } catch (UnsupportedEncodingException e) { LOG.error("catch UnsupportedEncodingException {}", str, e); return null; } } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, in...
@Test public void testConcatByteArray() { List<byte[]> list = new ArrayList<byte[]>(); float f1 = 12.4f; boolean b1 = true; list.add(BytesUtils.floatToBytes(f1)); list.add(BytesUtils.boolToBytes(b1)); byte[] ret = BytesUtils.concatByteArray(list.get(0), list.get(1)); float rf1 = BytesUtils.bytesToFloat(ret, 0); boolean...
public static byte[] concatByteArray(byte[] a, byte[] b) { byte[] c = new byte[a.length + b.length]; System.arraycopy(a, 0, c, 0, a.length); System.arraycopy(b, 0, c, a.length, b.length); return c; }
BytesUtils { public static byte[] concatByteArray(byte[] a, byte[] b) { byte[] c = new byte[a.length + b.length]; System.arraycopy(a, 0, c, 0, a.length); System.arraycopy(b, 0, c, a.length, b.length); return c; } }
BytesUtils { public static byte[] concatByteArray(byte[] a, byte[] b) { byte[] c = new byte[a.length + b.length]; System.arraycopy(a, 0, c, 0, a.length); System.arraycopy(b, 0, c, a.length, b.length); return c; } }
BytesUtils { public static byte[] concatByteArray(byte[] a, byte[] b) { byte[] c = new byte[a.length + b.length]; System.arraycopy(a, 0, c, 0, a.length); System.arraycopy(b, 0, c, a.length, b.length); return c; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void int...
BytesUtils { public static byte[] concatByteArray(byte[] a, byte[] b) { byte[] c = new byte[a.length + b.length]; System.arraycopy(a, 0, c, 0, a.length); System.arraycopy(b, 0, c, a.length, b.length); return c; } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void int...
@Test public void testConcatByteArrayList() { List<byte[]> list = new ArrayList<byte[]>(); float f1 = 12.4f; boolean b1 = true; int i1 = 12; list.add(BytesUtils.floatToBytes(f1)); list.add(BytesUtils.boolToBytes(b1)); list.add(BytesUtils.intToBytes(i1)); byte[] ret = BytesUtils.concatByteArrayList(list); float rf1 = By...
public static byte[] concatByteArrayList(List<byte[]> list) { int size = list.size(); int len = 0; for (byte[] cs : list) { len += cs.length; } byte[] result = new byte[len]; int pos = 0; for (int i = 0; i < size; i++) { int l = list.get(i).length; System.arraycopy(list.get(i), 0, result, pos, l); pos += l; } return re...
BytesUtils { public static byte[] concatByteArrayList(List<byte[]> list) { int size = list.size(); int len = 0; for (byte[] cs : list) { len += cs.length; } byte[] result = new byte[len]; int pos = 0; for (int i = 0; i < size; i++) { int l = list.get(i).length; System.arraycopy(list.get(i), 0, result, pos, l); pos += l...
BytesUtils { public static byte[] concatByteArrayList(List<byte[]> list) { int size = list.size(); int len = 0; for (byte[] cs : list) { len += cs.length; } byte[] result = new byte[len]; int pos = 0; for (int i = 0; i < size; i++) { int l = list.get(i).length; System.arraycopy(list.get(i), 0, result, pos, l); pos += l...
BytesUtils { public static byte[] concatByteArrayList(List<byte[]> list) { int size = list.size(); int len = 0; for (byte[] cs : list) { len += cs.length; } byte[] result = new byte[len]; int pos = 0; for (int i = 0; i < size; i++) { int l = list.get(i).length; System.arraycopy(list.get(i), 0, result, pos, l); pos += l...
BytesUtils { public static byte[] concatByteArrayList(List<byte[]> list) { int size = list.size(); int len = 0; for (byte[] cs : list) { len += cs.length; } byte[] result = new byte[len]; int pos = 0; for (int i = 0; i < size; i++) { int l = list.get(i).length; System.arraycopy(list.get(i), 0, result, pos, l); pos += l...
@Test public void testCheckRequiredArg() throws ParseException, ArgsErrorException { Options options = AbstractClient.createOptions(); CommandLineParser parser = new DefaultParser(); String[] args = new String[]{"-u", "user1"}; CommandLine commandLine = parser.parse(options, args); String str = AbstractClient .checkReq...
protected static String checkRequiredArg(String arg, String name, CommandLine commandLine, boolean isRequired, String defaultValue) throws ArgsErrorException { String str = commandLine.getOptionValue(arg); if (str == null) { if (isRequired) { String msg = String .format("%s: Required values for option '%s' not provided...
AbstractClient { protected static String checkRequiredArg(String arg, String name, CommandLine commandLine, boolean isRequired, String defaultValue) throws ArgsErrorException { String str = commandLine.getOptionValue(arg); if (str == null) { if (isRequired) { String msg = String .format("%s: Required values for option ...
AbstractClient { protected static String checkRequiredArg(String arg, String name, CommandLine commandLine, boolean isRequired, String defaultValue) throws ArgsErrorException { String str = commandLine.getOptionValue(arg); if (str == null) { if (isRequired) { String msg = String .format("%s: Required values for option ...
AbstractClient { protected static String checkRequiredArg(String arg, String name, CommandLine commandLine, boolean isRequired, String defaultValue) throws ArgsErrorException { String str = commandLine.getOptionValue(arg); if (str == null) { if (isRequired) { String msg = String .format("%s: Required values for option ...
AbstractClient { protected static String checkRequiredArg(String arg, String name, CommandLine commandLine, boolean isRequired, String defaultValue) throws ArgsErrorException { String str = commandLine.getOptionValue(arg); if (str == null) { if (isRequired) { String msg = String .format("%s: Required values for option ...
@Test public void testSubBytes() throws IOException { List<byte[]> list = new ArrayList<byte[]>(); float f1 = 12.4f; boolean b1 = true; int i1 = 12; list.add(BytesUtils.floatToBytes(f1)); list.add(BytesUtils.boolToBytes(b1)); list.add(BytesUtils.intToBytes(i1)); byte[] ret = BytesUtils.concatByteArrayList(list); boolea...
public static byte[] subBytes(byte[] src, int start, int length) { if ((start + length) > src.length) { return null; } if (length <= 0) { return null; } byte[] result = new byte[length]; for (int i = 0; i < length; i++) { result[i] = src[start + i]; } return result; }
BytesUtils { public static byte[] subBytes(byte[] src, int start, int length) { if ((start + length) > src.length) { return null; } if (length <= 0) { return null; } byte[] result = new byte[length]; for (int i = 0; i < length; i++) { result[i] = src[start + i]; } return result; } }
BytesUtils { public static byte[] subBytes(byte[] src, int start, int length) { if ((start + length) > src.length) { return null; } if (length <= 0) { return null; } byte[] result = new byte[length]; for (int i = 0; i < length; i++) { result[i] = src[start + i]; } return result; } }
BytesUtils { public static byte[] subBytes(byte[] src, int start, int length) { if ((start + length) > src.length) { return null; } if (length <= 0) { return null; } byte[] result = new byte[length]; for (int i = 0; i < length; i++) { result[i] = src[start + i]; } return result; } static byte[] intToBytes(int i); stat...
BytesUtils { public static byte[] subBytes(byte[] src, int start, int length) { if ((start + length) > src.length) { return null; } if (length <= 0) { return null; } byte[] result = new byte[length]; for (int i = 0; i < length; i++) { result[i] = src[start + i]; } return result; } static byte[] intToBytes(int i); stat...
@Test public void testGetByteN() { byte src = 120; byte dest = 0; for (int i = 0; i < 64; i++) { int a = BytesUtils.getByteN(src, i); dest = BytesUtils.setByteN(dest, i, a); } assertEquals(src, dest); }
public static int getByteN(byte data, int offset) { offset %= 8; if ((data & (1 << (7 - offset))) != 0) { return 1; } else { return 0; } }
BytesUtils { public static int getByteN(byte data, int offset) { offset %= 8; if ((data & (1 << (7 - offset))) != 0) { return 1; } else { return 0; } } }
BytesUtils { public static int getByteN(byte data, int offset) { offset %= 8; if ((data & (1 << (7 - offset))) != 0) { return 1; } else { return 0; } } }
BytesUtils { public static int getByteN(byte data, int offset) { offset %= 8; if ((data & (1 << (7 - offset))) != 0) { return 1; } else { return 0; } } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); stati...
BytesUtils { public static int getByteN(byte data, int offset) { offset %= 8; if ((data & (1 << (7 - offset))) != 0) { return 1; } else { return 0; } } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); stati...
@Test public void testGetLongN() { long src = (long) Math.pow(2, 33); long dest = 0; for (int i = 0; i < 64; i++) { int a = BytesUtils.getLongN(src, i); dest = BytesUtils.setLongN(dest, i, a); } assertEquals(src, dest); }
public static int getLongN(long data, int offset) { offset %= 64; if ((data & (1L << (offset))) != 0) { return 1; } else { return 0; } }
BytesUtils { public static int getLongN(long data, int offset) { offset %= 64; if ((data & (1L << (offset))) != 0) { return 1; } else { return 0; } } }
BytesUtils { public static int getLongN(long data, int offset) { offset %= 64; if ((data & (1L << (offset))) != 0) { return 1; } else { return 0; } } }
BytesUtils { public static int getLongN(long data, int offset) { offset %= 64; if ((data & (1L << (offset))) != 0) { return 1; } else { return 0; } } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); static ...
BytesUtils { public static int getLongN(long data, int offset) { offset %= 64; if ((data & (1L << (offset))) != 0) { return 1; } else { return 0; } } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); static ...
@Test public void testGetIntN() { int src = 54243342; int dest = 0; for (int i = 0; i < 32; i++) { int a = BytesUtils.getIntN(src, i); dest = BytesUtils.setIntN(dest, i, a); } assertEquals(src, dest); }
public static int getIntN(int data, int offset) { offset %= 32; if ((data & (1 << (offset))) != 0) { return 1; } else { return 0; } }
BytesUtils { public static int getIntN(int data, int offset) { offset %= 32; if ((data & (1 << (offset))) != 0) { return 1; } else { return 0; } } }
BytesUtils { public static int getIntN(int data, int offset) { offset %= 32; if ((data & (1 << (offset))) != 0) { return 1; } else { return 0; } } }
BytesUtils { public static int getIntN(int data, int offset) { offset %= 32; if ((data & (1 << (offset))) != 0) { return 1; } else { return 0; } } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); static byt...
BytesUtils { public static int getIntN(int data, int offset) { offset %= 32; if ((data & (1 << (offset))) != 0) { return 1; } else { return 0; } } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); static byt...
@Test public void testReadInt() throws IOException { int l = r.nextInt(); byte[] bs = BytesUtils.intToBytes(l); InputStream in = new ByteArrayInputStream(bs); assertEquals(l, BytesUtils.readInt(in)); }
public static int readInt(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToInt(b); }
BytesUtils { public static int readInt(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToInt(b); } }
BytesUtils { public static int readInt(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToInt(b); } }
BytesUtils { public static int readInt(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToInt(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); ...
BytesUtils { public static int readInt(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToInt(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width); ...
@Test public void testReadLong() throws IOException { long l = r.nextLong(); byte[] bs = BytesUtils.longToBytes(l); InputStream in = new ByteArrayInputStream(bs); assertEquals(l, BytesUtils.readLong(in)); }
public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); }
BytesUtils { public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); } }
BytesUtils { public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); } }
BytesUtils { public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width...
BytesUtils { public static long readLong(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToLong(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int width...
@Test public void testReadFloat() throws IOException { float l = r.nextFloat(); byte[] bs = BytesUtils.floatToBytes(l); InputStream in = new ByteArrayInputStream(bs); assertEquals(l, BytesUtils.readFloat(in), CommonTestConstant.float_min_delta); }
public static float readFloat(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToFloat(b); }
BytesUtils { public static float readFloat(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToFloat(b); } }
BytesUtils { public static float readFloat(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToFloat(b); } }
BytesUtils { public static float readFloat(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToFloat(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int wi...
BytesUtils { public static float readFloat(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(4, in); return BytesUtils.bytesToFloat(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int wi...
@Test public void testReadDouble() throws IOException { double l = r.nextDouble(); byte[] bs = BytesUtils.doubleToBytes(l); InputStream in = new ByteArrayInputStream(bs); assertEquals(l, BytesUtils.readDouble(in), CommonTestConstant.double_min_delta); }
public static double readDouble(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToDouble(b); }
BytesUtils { public static double readDouble(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToDouble(b); } }
BytesUtils { public static double readDouble(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToDouble(b); } }
BytesUtils { public static double readDouble(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToDouble(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int...
BytesUtils { public static double readDouble(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(8, in); return BytesUtils.bytesToDouble(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int...
@Test public void testReadBool() throws IOException { boolean l = r.nextBoolean(); byte[] bs = BytesUtils.boolToBytes(l); InputStream in = new ByteArrayInputStream(bs); assertEquals(l, BytesUtils.readBool(in)); }
public static boolean readBool(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(1, in); return BytesUtils.bytesToBool(b); }
BytesUtils { public static boolean readBool(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(1, in); return BytesUtils.bytesToBool(b); } }
BytesUtils { public static boolean readBool(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(1, in); return BytesUtils.bytesToBool(b); } }
BytesUtils { public static boolean readBool(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(1, in); return BytesUtils.bytesToBool(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int wi...
BytesUtils { public static boolean readBool(InputStream in) throws IOException { byte[] b = safeReadInputStreamToBytes(1, in); return BytesUtils.bytesToBool(b); } static byte[] intToBytes(int i); static byte[] intToBytes(int i, byte[] desc, int offset); static void intToBytes(int srcNum, byte[] result, int pos, int wi...
@Test public void testGetSubString() { StringContainer a = new StringContainer(); try { a.getSubString(0); } catch (Exception e) { assertTrue(e instanceof IndexOutOfBoundsException); } a.addHead("a", "bbb", "cc"); assertEquals("a", a.getSubString(0)); assertEquals("cc", a.getSubString(-1)); assertEquals("bbb", a.getSub...
public String getSubString(int index) { int realIndex = index >= 0 ? index : count + index; if (realIndex < 0 || realIndex >= count) { throw new IndexOutOfBoundsException( "Index: " + index + ", Real Index: " + realIndex + ", Size: " + count); } if (realIndex < reverseList.size()) { return reverseList.get(reverseList.s...
StringContainer { public String getSubString(int index) { int realIndex = index >= 0 ? index : count + index; if (realIndex < 0 || realIndex >= count) { throw new IndexOutOfBoundsException( "Index: " + index + ", Real Index: " + realIndex + ", Size: " + count); } if (realIndex < reverseList.size()) { return reverseList...
StringContainer { public String getSubString(int index) { int realIndex = index >= 0 ? index : count + index; if (realIndex < 0 || realIndex >= count) { throw new IndexOutOfBoundsException( "Index: " + index + ", Real Index: " + realIndex + ", Size: " + count); } if (realIndex < reverseList.size()) { return reverseList...
StringContainer { public String getSubString(int index) { int realIndex = index >= 0 ? index : count + index; if (realIndex < 0 || realIndex >= count) { throw new IndexOutOfBoundsException( "Index: " + index + ", Real Index: " + realIndex + ", Size: " + count); } if (realIndex < reverseList.size()) { return reverseList...
StringContainer { public String getSubString(int index) { int realIndex = index >= 0 ? index : count + index; if (realIndex < 0 || realIndex >= count) { throw new IndexOutOfBoundsException( "Index: " + index + ", Real Index: " + realIndex + ", Size: " + count); } if (realIndex < reverseList.size()) { return reverseList...
@Test public void testRemovePasswordArgs() { AbstractClient.init(); String[] input = new String[]{"-h", "127.0.0.1", "-p", "6667", "-u", "root", "-pw", "root"}; String[] res = new String[]{"-h", "127.0.0.1", "-p", "6667", "-u", "root", "-pw", "root"}; isTwoStringArrayEqual(res, AbstractClient.removePasswordArgs(input))...
protected static String[] removePasswordArgs(String[] args) { int index = -1; for (int i = 0; i < args.length; i++) { if (args[i].equals("-" + PASSWORD_ARGS)) { index = i; break; } } if (index >= 0) { if ((index + 1 >= args.length) || (index + 1 < args.length && keywordSet .contains(args[index + 1]))) { return ArrayUti...
AbstractClient { protected static String[] removePasswordArgs(String[] args) { int index = -1; for (int i = 0; i < args.length; i++) { if (args[i].equals("-" + PASSWORD_ARGS)) { index = i; break; } } if (index >= 0) { if ((index + 1 >= args.length) || (index + 1 < args.length && keywordSet .contains(args[index + 1]))) ...
AbstractClient { protected static String[] removePasswordArgs(String[] args) { int index = -1; for (int i = 0; i < args.length; i++) { if (args[i].equals("-" + PASSWORD_ARGS)) { index = i; break; } } if (index >= 0) { if ((index + 1 >= args.length) || (index + 1 < args.length && keywordSet .contains(args[index + 1]))) ...
AbstractClient { protected static String[] removePasswordArgs(String[] args) { int index = -1; for (int i = 0; i < args.length; i++) { if (args[i].equals("-" + PASSWORD_ARGS)) { index = i; break; } } if (index >= 0) { if ((index + 1 >= args.length) || (index + 1 < args.length && keywordSet .contains(args[index + 1]))) ...
AbstractClient { protected static String[] removePasswordArgs(String[] args) { int index = -1; for (int i = 0; i < args.length; i++) { if (args[i].equals("-" + PASSWORD_ARGS)) { index = i; break; } } if (index >= 0) { if ((index + 1 >= args.length) || (index + 1 < args.length && keywordSet .contains(args[index + 1]))) ...
@Test public void testGetSubStringContainer() { StringContainer a = new StringContainer(); try { a.getSubStringContainer(0, 1); } catch (Exception e) { assertTrue(e instanceof IndexOutOfBoundsException); } a.addTail("a", "bbb", "cc"); assertEquals("", a.getSubStringContainer(1, 0).toString()); assertEquals("a", a.getSu...
public StringContainer getSubStringContainer(int start, int end) { int realStartIndex = start >= 0 ? start : count + start; int realEndIndex = end >= 0 ? end : count + end; if (realStartIndex < 0 || realStartIndex >= count) { throw new IndexOutOfBoundsException( "start Index: " + start + ", Real start Index: " + realSt...
StringContainer { public StringContainer getSubStringContainer(int start, int end) { int realStartIndex = start >= 0 ? start : count + start; int realEndIndex = end >= 0 ? end : count + end; if (realStartIndex < 0 || realStartIndex >= count) { throw new IndexOutOfBoundsException( "start Index: " + start + ", Real start...
StringContainer { public StringContainer getSubStringContainer(int start, int end) { int realStartIndex = start >= 0 ? start : count + start; int realEndIndex = end >= 0 ? end : count + end; if (realStartIndex < 0 || realStartIndex >= count) { throw new IndexOutOfBoundsException( "start Index: " + start + ", Real start...
StringContainer { public StringContainer getSubStringContainer(int start, int end) { int realStartIndex = start >= 0 ? start : count + start; int realEndIndex = end >= 0 ? end : count + end; if (realStartIndex < 0 || realStartIndex >= count) { throw new IndexOutOfBoundsException( "start Index: " + start + ", Real start...
StringContainer { public StringContainer getSubStringContainer(int start, int end) { int realStartIndex = start >= 0 ? start : count + start; int realEndIndex = end >= 0 ? end : count + end; if (realStartIndex < 0 || realStartIndex >= count) { throw new IndexOutOfBoundsException( "start Index: " + start + ", Real start...
@Test public void testHashCode() { StringContainer c1 = new StringContainer(","); c1.addHead("a", "b", "c123"); c1.addTail("a", "12", "c"); c1.addTail("1284736", "b", "c"); StringContainer c2 = new StringContainer("."); c2.addHead("a", "b", "c123"); c2.addTail("a", "12", "c"); c2.addTail("1284736", "b", "c"); StringCon...
@Override public int hashCode() { final int prime = 31; int result = 1; if (joinSeparator != null) { result = prime * result + joinSeparator.hashCode(); } for (String string : reverseList) { result = prime * result + ((string == null) ? 0 : string.hashCode()); } for (String string : sequenceList) { result = prime * res...
StringContainer { @Override public int hashCode() { final int prime = 31; int result = 1; if (joinSeparator != null) { result = prime * result + joinSeparator.hashCode(); } for (String string : reverseList) { result = prime * result + ((string == null) ? 0 : string.hashCode()); } for (String string : sequenceList) { re...
StringContainer { @Override public int hashCode() { final int prime = 31; int result = 1; if (joinSeparator != null) { result = prime * result + joinSeparator.hashCode(); } for (String string : reverseList) { result = prime * result + ((string == null) ? 0 : string.hashCode()); } for (String string : sequenceList) { re...
StringContainer { @Override public int hashCode() { final int prime = 31; int result = 1; if (joinSeparator != null) { result = prime * result + joinSeparator.hashCode(); } for (String string : reverseList) { result = prime * result + ((string == null) ? 0 : string.hashCode()); } for (String string : sequenceList) { re...
StringContainer { @Override public int hashCode() { final int prime = 31; int result = 1; if (joinSeparator != null) { result = prime * result + joinSeparator.hashCode(); } for (String string : reverseList) { result = prime * result + ((string == null) ? 0 : string.hashCode()); } for (String string : sequenceList) { re...
@Test public void test() throws IOException { fileReader = new TsFileSequenceReader(FILE_PATH); MetadataQuerierByFileImpl metadataQuerierByFile = new MetadataQuerierByFileImpl(fileReader); List<ChunkMetaData> chunkMetaDataList = metadataQuerierByFile .getChunkMetaDataList(new Path("d2.s1")); for (ChunkMetaData chunkMet...
@Override public List<ChunkMetaData> getChunkMetaDataList(Path path) throws IOException { return chunkMetaDataCache.get(path); }
MetadataQuerierByFileImpl implements MetadataQuerier { @Override public List<ChunkMetaData> getChunkMetaDataList(Path path) throws IOException { return chunkMetaDataCache.get(path); } }
MetadataQuerierByFileImpl implements MetadataQuerier { @Override public List<ChunkMetaData> getChunkMetaDataList(Path path) throws IOException { return chunkMetaDataCache.get(path); } MetadataQuerierByFileImpl(TsFileSequenceReader tsFileReader); }
MetadataQuerierByFileImpl implements MetadataQuerier { @Override public List<ChunkMetaData> getChunkMetaDataList(Path path) throws IOException { return chunkMetaDataCache.get(path); } MetadataQuerierByFileImpl(TsFileSequenceReader tsFileReader); @Override List<ChunkMetaData> getChunkMetaDataList(Path path); @Override T...
MetadataQuerierByFileImpl implements MetadataQuerier { @Override public List<ChunkMetaData> getChunkMetaDataList(Path path) throws IOException { return chunkMetaDataCache.get(path); } MetadataQuerierByFileImpl(TsFileSequenceReader tsFileReader); @Override List<ChunkMetaData> getChunkMetaDataList(Path path); @Override T...
@Test public void startWith() throws Exception { Path path = new Path("a.b.c"); assertTrue(path.startWith(new Path(""))); assertTrue(path.startWith(new Path("a"))); assertTrue(path.startWith(new Path("a.b.c"))); }
public boolean startWith(String prefix) { return prefix != null && fullPath.startsWith(prefix); }
Path { public boolean startWith(String prefix) { return prefix != null && fullPath.startsWith(prefix); } }
Path { public boolean startWith(String prefix) { return prefix != null && fullPath.startsWith(prefix); } Path(StringContainer pathSc); Path(String pathSc); Path(String[] pathSc); Path(String device, String measurement); }
Path { public boolean startWith(String prefix) { return prefix != null && fullPath.startsWith(prefix); } Path(StringContainer pathSc); Path(String pathSc); Path(String[] pathSc); Path(String device, String measurement); static Path mergePath(Path prefix, Path suffix); static Path addPrefixPath(Path src, String prefi...
Path { public boolean startWith(String prefix) { return prefix != null && fullPath.startsWith(prefix); } Path(StringContainer pathSc); Path(String pathSc); Path(String[] pathSc); Path(String device, String measurement); static Path mergePath(Path prefix, Path suffix); static Path addPrefixPath(Path src, String prefi...
@Test public void mergePath() throws Exception { Path prefix = new Path("a.b.c"); Path suffix = new Path("d.e"); Path suffix1 = new Path(""); testPath(Path.mergePath(prefix, suffix), "a.b.c.d", "e", "a.b.c.d.e"); testPath(Path.mergePath(prefix, suffix1), "a.b", "c", "a.b.c"); }
public static Path mergePath(Path prefix, Path suffix) { StringContainer sc = new StringContainer(SystemConstant.PATH_SEPARATOR); sc.addTail(prefix); sc.addTail(suffix); return new Path(sc); }
Path { public static Path mergePath(Path prefix, Path suffix) { StringContainer sc = new StringContainer(SystemConstant.PATH_SEPARATOR); sc.addTail(prefix); sc.addTail(suffix); return new Path(sc); } }
Path { public static Path mergePath(Path prefix, Path suffix) { StringContainer sc = new StringContainer(SystemConstant.PATH_SEPARATOR); sc.addTail(prefix); sc.addTail(suffix); return new Path(sc); } Path(StringContainer pathSc); Path(String pathSc); Path(String[] pathSc); Path(String device, String measurement); }
Path { public static Path mergePath(Path prefix, Path suffix) { StringContainer sc = new StringContainer(SystemConstant.PATH_SEPARATOR); sc.addTail(prefix); sc.addTail(suffix); return new Path(sc); } Path(StringContainer pathSc); Path(String pathSc); Path(String[] pathSc); Path(String device, String measurement); st...
Path { public static Path mergePath(Path prefix, Path suffix) { StringContainer sc = new StringContainer(SystemConstant.PATH_SEPARATOR); sc.addTail(prefix); sc.addTail(suffix); return new Path(sc); } Path(StringContainer pathSc); Path(String pathSc); Path(String[] pathSc); Path(String device, String measurement); st...
@Test public void replace() throws Exception { Path src = new Path("a.b.c"); Path rep1 = new Path(""); Path rep2 = new Path("d"); Path rep3 = new Path("d.e.f"); Path rep4 = new Path("d.e.f.g"); testPath(Path.replace(rep1, src), "a.b", "c", "a.b.c"); testPath(Path.replace(rep2, src), "d.b", "c", "d.b.c"); testPath(Path....
public static Path replace(String srcPrefix, Path descPrefix) { if ("".equals(srcPrefix) || descPrefix.startWith(srcPrefix)) { return descPrefix; } int prefixSize = srcPrefix.split(SystemConstant.PATH_SEPARATER_NO_REGEX).length; String[] descArray = descPrefix.fullPath.split(SystemConstant.PATH_SEPARATER_NO_REGEX); if ...
Path { public static Path replace(String srcPrefix, Path descPrefix) { if ("".equals(srcPrefix) || descPrefix.startWith(srcPrefix)) { return descPrefix; } int prefixSize = srcPrefix.split(SystemConstant.PATH_SEPARATER_NO_REGEX).length; String[] descArray = descPrefix.fullPath.split(SystemConstant.PATH_SEPARATER_NO_REGE...
Path { public static Path replace(String srcPrefix, Path descPrefix) { if ("".equals(srcPrefix) || descPrefix.startWith(srcPrefix)) { return descPrefix; } int prefixSize = srcPrefix.split(SystemConstant.PATH_SEPARATER_NO_REGEX).length; String[] descArray = descPrefix.fullPath.split(SystemConstant.PATH_SEPARATER_NO_REGE...
Path { public static Path replace(String srcPrefix, Path descPrefix) { if ("".equals(srcPrefix) || descPrefix.startWith(srcPrefix)) { return descPrefix; } int prefixSize = srcPrefix.split(SystemConstant.PATH_SEPARATER_NO_REGEX).length; String[] descArray = descPrefix.fullPath.split(SystemConstant.PATH_SEPARATER_NO_REGE...
Path { public static Path replace(String srcPrefix, Path descPrefix) { if ("".equals(srcPrefix) || descPrefix.startWith(srcPrefix)) { return descPrefix; } int prefixSize = srcPrefix.split(SystemConstant.PATH_SEPARATER_NO_REGEX).length; String[] descArray = descPrefix.fullPath.split(SystemConstant.PATH_SEPARATER_NO_REGE...
@Test public void queryTest() throws IOException { Filter filter = TimeFilter.lt(1480562618100L); Filter filter2 = ValueFilter.gt(new Binary("dog")); Filter filter3 = FilterFactory .and(TimeFilter.gtEq(1480562618000L), TimeFilter.ltEq(1480562618100L)); IExpression IExpression = BinaryExpression .or(BinaryExpression.and...
public QueryDataSet query(QueryExpression queryExpression) throws IOException { return tsFileExecutor.execute(queryExpression); }
ReadOnlyTsFile { public QueryDataSet query(QueryExpression queryExpression) throws IOException { return tsFileExecutor.execute(queryExpression); } }
ReadOnlyTsFile { public QueryDataSet query(QueryExpression queryExpression) throws IOException { return tsFileExecutor.execute(queryExpression); } ReadOnlyTsFile(TsFileSequenceReader fileReader); }
ReadOnlyTsFile { public QueryDataSet query(QueryExpression queryExpression) throws IOException { return tsFileExecutor.execute(queryExpression); } ReadOnlyTsFile(TsFileSequenceReader fileReader); QueryDataSet query(QueryExpression queryExpression); void close(); }
ReadOnlyTsFile { public QueryDataSet query(QueryExpression queryExpression) throws IOException { return tsFileExecutor.execute(queryExpression); } ReadOnlyTsFile(TsFileSequenceReader fileReader); QueryDataSet query(QueryExpression queryExpression); void close(); }
@SuppressWarnings("resource") @Test public void ShowTimeseriesInJson() throws Exception { String metadataInJson = "=== Timeseries Tree ===\n" + "\n" + "root:{\n" + " vehicle:{\n" + " d0:{\n" + " s0:{\n" + " DataType: INT32,\n" + " Encoding: RLE,\n" + " args: {},\n" + " StorageGroup: root.vehicle \n" + " },\n" + " s1:{\...
public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { throw new SQLException("Failed to fetch all metadata ...
IoTDBDatabaseMetadata implements DatabaseMetaData { public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { t...
IoTDBDatabaseMetadata implements DatabaseMetaData { public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { t...
IoTDBDatabaseMetadata implements DatabaseMetaData { public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { t...
IoTDBDatabaseMetadata implements DatabaseMetaData { public String getMetadataInJson() throws SQLException { try { return getMetadataInJsonFunc(); } catch (TException e) { boolean flag = connection.reconnect(); this.client = connection.client; if (flag) { try { return getMetadataInJsonFunc(); } catch (TException e2) { t...
@SuppressWarnings("resource") @Test public void testNonParameterized() throws Exception { String sql = "SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < 24 and time > 2017-11-1 0:13:00"; IoTDBPrepareStatement ps = new IoTDBPrepareStatement(connection, client, sessHandle, sql, zoneId); ps.execute();...
@Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); }
IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { @Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); } }
IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { @Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); } IoTDBPrepareStatement(IoTDBConnection connection, Iface client, TS_SessionHandle sessionHandle, String sql, ZoneId ...
IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { @Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); } IoTDBPrepareStatement(IoTDBConnection connection, Iface client, TS_SessionHandle sessionHandle, String sql, ZoneId ...
IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { @Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); } IoTDBPrepareStatement(IoTDBConnection connection, Iface client, TS_SessionHandle sessionHandle, String sql, ZoneId ...
@SuppressWarnings("resource") @Test(expected = SQLException.class) public void unsetArgument() throws SQLException { String sql = "SELECT status, temperature FROM root.ln.wf01.wt01 WHERE temperature < 24 and time > ?"; IoTDBPrepareStatement ps = new IoTDBPrepareStatement(connection, client, sessHandle, sql, zoneId); ps...
@Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); }
IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { @Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); } }
IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { @Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); } IoTDBPrepareStatement(IoTDBConnection connection, Iface client, TS_SessionHandle sessionHandle, String sql, ZoneId ...
IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { @Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); } IoTDBPrepareStatement(IoTDBConnection connection, Iface client, TS_SessionHandle sessionHandle, String sql, ZoneId ...
IoTDBPrepareStatement extends IoTDBStatement implements PreparedStatement { @Override public boolean execute() throws SQLException { return super.execute(createCompleteSql(sql, parameters)); } IoTDBPrepareStatement(IoTDBConnection connection, Iface client, TS_SessionHandle sessionHandle, String sql, ZoneId ...
@Test public void testHandleInputInputCmd() { assertEquals(AbstractClient.handleInputInputCmd(AbstractClient.EXIT_COMMAND, connection), OperationResult.RETURN_OPER); assertEquals(AbstractClient.handleInputInputCmd(AbstractClient.QUIT_COMMAND, connection), OperationResult.RETURN_OPER); assertEquals( AbstractClient.handl...
protected static OperationResult handleInputInputCmd(String cmd, IoTDBConnection connection) { String specialCmd = cmd.toLowerCase().trim(); if (specialCmd.equals(QUIT_COMMAND) || specialCmd.equals(EXIT_COMMAND)) { System.out.println(specialCmd + " normally"); return OperationResult.RETURN_OPER; } if (specialCmd.equals...
AbstractClient { protected static OperationResult handleInputInputCmd(String cmd, IoTDBConnection connection) { String specialCmd = cmd.toLowerCase().trim(); if (specialCmd.equals(QUIT_COMMAND) || specialCmd.equals(EXIT_COMMAND)) { System.out.println(specialCmd + " normally"); return OperationResult.RETURN_OPER; } if (...
AbstractClient { protected static OperationResult handleInputInputCmd(String cmd, IoTDBConnection connection) { String specialCmd = cmd.toLowerCase().trim(); if (specialCmd.equals(QUIT_COMMAND) || specialCmd.equals(EXIT_COMMAND)) { System.out.println(specialCmd + " normally"); return OperationResult.RETURN_OPER; } if (...
AbstractClient { protected static OperationResult handleInputInputCmd(String cmd, IoTDBConnection connection) { String specialCmd = cmd.toLowerCase().trim(); if (specialCmd.equals(QUIT_COMMAND) || specialCmd.equals(EXIT_COMMAND)) { System.out.println(specialCmd + " normally"); return OperationResult.RETURN_OPER; } if (...
AbstractClient { protected static OperationResult handleInputInputCmd(String cmd, IoTDBConnection connection) { String specialCmd = cmd.toLowerCase().trim(); if (specialCmd.equals(QUIT_COMMAND) || specialCmd.equals(EXIT_COMMAND)) { System.out.println(specialCmd + " normally"); return OperationResult.RETURN_OPER; } if (...
@SuppressWarnings("resource") @Test(expected = SQLException.class) public void testExecuteSQL1() throws SQLException { IoTDBStatement stmt = new IoTDBStatement(connection, client, sessHandle, zoneID); stmt.execute("show timeseries"); }
@Override public boolean execute(String sql) throws SQLException { checkConnection("execute"); isClosed = false; try { return executeSQL(sql); } catch (TException e) { boolean flag = connection.reconnect(); reInit(); if (flag) { try { return executeSQL(sql); } catch (TException e2) { throw new SQLException( String.form...
IoTDBStatement implements Statement { @Override public boolean execute(String sql) throws SQLException { checkConnection("execute"); isClosed = false; try { return executeSQL(sql); } catch (TException e) { boolean flag = connection.reconnect(); reInit(); if (flag) { try { return executeSQL(sql); } catch (TException e2)...
IoTDBStatement implements Statement { @Override public boolean execute(String sql) throws SQLException { checkConnection("execute"); isClosed = false; try { return executeSQL(sql); } catch (TException e) { boolean flag = connection.reconnect(); reInit(); if (flag) { try { return executeSQL(sql); } catch (TException e2)...
IoTDBStatement implements Statement { @Override public boolean execute(String sql) throws SQLException { checkConnection("execute"); isClosed = false; try { return executeSQL(sql); } catch (TException e) { boolean flag = connection.reconnect(); reInit(); if (flag) { try { return executeSQL(sql); } catch (TException e2)...
IoTDBStatement implements Statement { @Override public boolean execute(String sql) throws SQLException { checkConnection("execute"); isClosed = false; try { return executeSQL(sql); } catch (TException e) { boolean flag = connection.reconnect(); reInit(); if (flag) { try { return executeSQL(sql); } catch (TException e2)...
@SuppressWarnings("resource") @Test public void testSetFetchSize3() throws SQLException { final int fetchSize = 10000; IoTDBStatement stmt = new IoTDBStatement(connection, client, sessHandle, fetchSize, zoneID); assertEquals(fetchSize, stmt.getFetchSize()); }
@Override public int getFetchSize() throws SQLException { checkConnection("getFetchSize"); return fetchSize; }
IoTDBStatement implements Statement { @Override public int getFetchSize() throws SQLException { checkConnection("getFetchSize"); return fetchSize; } }
IoTDBStatement implements Statement { @Override public int getFetchSize() throws SQLException { checkConnection("getFetchSize"); return fetchSize; } IoTDBStatement(IoTDBConnection connection, TSIService.Iface client, TS_SessionHandle sessionHandle, int fetchSize, ZoneId zoneId); IoTDBStatement(IoTDBConnect...
IoTDBStatement implements Statement { @Override public int getFetchSize() throws SQLException { checkConnection("getFetchSize"); return fetchSize; } IoTDBStatement(IoTDBConnection connection, TSIService.Iface client, TS_SessionHandle sessionHandle, int fetchSize, ZoneId zoneId); IoTDBStatement(IoTDBConnect...
IoTDBStatement implements Statement { @Override public int getFetchSize() throws SQLException { checkConnection("getFetchSize"); return fetchSize; } IoTDBStatement(IoTDBConnection connection, TSIService.Iface client, TS_SessionHandle sessionHandle, int fetchSize, ZoneId zoneId); IoTDBStatement(IoTDBConnect...
@SuppressWarnings("resource") @Test(expected = SQLException.class) public void testSetFetchSize4() throws SQLException { IoTDBStatement stmt = new IoTDBStatement(connection, client, sessHandle, zoneID); stmt.setFetchSize(-1); }
@Override public void setFetchSize(int fetchSize) throws SQLException { checkConnection("setFetchSize"); if (fetchSize < 0) { throw new SQLException(String.format("fetchSize %d must be >= 0!", fetchSize)); } this.fetchSize = fetchSize == 0 ? Config.fetchSize : fetchSize; }
IoTDBStatement implements Statement { @Override public void setFetchSize(int fetchSize) throws SQLException { checkConnection("setFetchSize"); if (fetchSize < 0) { throw new SQLException(String.format("fetchSize %d must be >= 0!", fetchSize)); } this.fetchSize = fetchSize == 0 ? Config.fetchSize : fetchSize; } }
IoTDBStatement implements Statement { @Override public void setFetchSize(int fetchSize) throws SQLException { checkConnection("setFetchSize"); if (fetchSize < 0) { throw new SQLException(String.format("fetchSize %d must be >= 0!", fetchSize)); } this.fetchSize = fetchSize == 0 ? Config.fetchSize : fetchSize; } IoTDBSta...
IoTDBStatement implements Statement { @Override public void setFetchSize(int fetchSize) throws SQLException { checkConnection("setFetchSize"); if (fetchSize < 0) { throw new SQLException(String.format("fetchSize %d must be >= 0!", fetchSize)); } this.fetchSize = fetchSize == 0 ? Config.fetchSize : fetchSize; } IoTDBSta...
IoTDBStatement implements Statement { @Override public void setFetchSize(int fetchSize) throws SQLException { checkConnection("setFetchSize"); if (fetchSize < 0) { throw new SQLException(String.format("fetchSize %d must be >= 0!", fetchSize)); } this.fetchSize = fetchSize == 0 ? Config.fetchSize : fetchSize; } IoTDBSta...
@SuppressWarnings("resource") @Test(expected = SQLException.class) public void testSetMaxRows2() throws SQLException { IoTDBStatement stmt = new IoTDBStatement(connection, client, sessHandle, zoneID); stmt.setMaxRows(-1); }
@Override public void setMaxRows(int num) throws SQLException { checkConnection("setMaxRows"); if (num < 0) { throw new SQLException(String.format("maxRows %d must be >= 0!", num)); } this.maxRows = num; }
IoTDBStatement implements Statement { @Override public void setMaxRows(int num) throws SQLException { checkConnection("setMaxRows"); if (num < 0) { throw new SQLException(String.format("maxRows %d must be >= 0!", num)); } this.maxRows = num; } }
IoTDBStatement implements Statement { @Override public void setMaxRows(int num) throws SQLException { checkConnection("setMaxRows"); if (num < 0) { throw new SQLException(String.format("maxRows %d must be >= 0!", num)); } this.maxRows = num; } IoTDBStatement(IoTDBConnection connection, TSIService.Iface client, TS...
IoTDBStatement implements Statement { @Override public void setMaxRows(int num) throws SQLException { checkConnection("setMaxRows"); if (num < 0) { throw new SQLException(String.format("maxRows %d must be >= 0!", num)); } this.maxRows = num; } IoTDBStatement(IoTDBConnection connection, TSIService.Iface client, TS...
IoTDBStatement implements Statement { @Override public void setMaxRows(int num) throws SQLException { checkConnection("setMaxRows"); if (num < 0) { throw new SQLException(String.format("maxRows %d must be >= 0!", num)); } this.maxRows = num; } IoTDBStatement(IoTDBConnection connection, TSIService.Iface client, TS...
@Test public void testGetColumnCount() throws SQLException { boolean flag = false; try { metadata = new IoTDBMetadataResultMetadata(null); assertEquals((long) metadata.getColumnCount(), 0); } catch (Exception e) { flag = true; } assertEquals(flag, true); flag = false; try { String[] nullArray = {}; metadata = new IoTDB...
@Override public int getColumnCount() throws SQLException { if (showLabels == null || showLabels.length == 0) { throw new SQLException("No column exists"); } return showLabels.length; }
IoTDBMetadataResultMetadata implements ResultSetMetaData { @Override public int getColumnCount() throws SQLException { if (showLabels == null || showLabels.length == 0) { throw new SQLException("No column exists"); } return showLabels.length; } }
IoTDBMetadataResultMetadata implements ResultSetMetaData { @Override public int getColumnCount() throws SQLException { if (showLabels == null || showLabels.length == 0) { throw new SQLException("No column exists"); } return showLabels.length; } IoTDBMetadataResultMetadata(String[] showLabels); }
IoTDBMetadataResultMetadata implements ResultSetMetaData { @Override public int getColumnCount() throws SQLException { if (showLabels == null || showLabels.length == 0) { throw new SQLException("No column exists"); } return showLabels.length; } IoTDBMetadataResultMetadata(String[] showLabels); @Override boolean isWrapp...
IoTDBMetadataResultMetadata implements ResultSetMetaData { @Override public int getColumnCount() throws SQLException { if (showLabels == null || showLabels.length == 0) { throw new SQLException("No column exists"); } return showLabels.length; } IoTDBMetadataResultMetadata(String[] showLabels); @Override boolean isWrapp...
@Test public void testGetColumnName() throws SQLException { boolean flag = false; metadata = new IoTDBMetadataResultMetadata(null); try { metadata.getColumnName(1); } catch (Exception e) { flag = true; } assertEquals(flag, true); try { String[] nullArray = {}; metadata = new IoTDBMetadataResultMetadata(nullArray); meta...
@Override public String getColumnName(int column) throws SQLException { return getColumnLabel(column); }
IoTDBMetadataResultMetadata implements ResultSetMetaData { @Override public String getColumnName(int column) throws SQLException { return getColumnLabel(column); } }
IoTDBMetadataResultMetadata implements ResultSetMetaData { @Override public String getColumnName(int column) throws SQLException { return getColumnLabel(column); } IoTDBMetadataResultMetadata(String[] showLabels); }
IoTDBMetadataResultMetadata implements ResultSetMetaData { @Override public String getColumnName(int column) throws SQLException { return getColumnLabel(column); } IoTDBMetadataResultMetadata(String[] showLabels); @Override boolean isWrapperFor(Class<?> arg0); @Override T unwrap(Class<T> arg0); @Override String getCata...
IoTDBMetadataResultMetadata implements ResultSetMetaData { @Override public String getColumnName(int column) throws SQLException { return getColumnLabel(column); } IoTDBMetadataResultMetadata(String[] showLabels); @Override boolean isWrapperFor(Class<?> arg0); @Override T unwrap(Class<T> arg0); @Override String getCata...