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 getUserId() throws Exception { assertEquals(ids[0], user1.getUserId()); } | public int getUserId() { return userId; } | User { public int getUserId() { return userId; } } | User { public int getUserId() { return userId; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public int getUserId() { return userId; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUserId(int us... | User { public int getUserId() { return userId; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUserId(int us... |
@Test public void setUserId() throws Exception { user2.setUserId(12121); assertEquals(12121, user2.getUserId()); } | public void setUserId(int userId) { this.userId = userId; } | User { public void setUserId(int userId) { this.userId = userId; } } | User { public void setUserId(int userId) { this.userId = userId; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public void setUserId(int userId) { this.userId = userId; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); voi... | User { public void setUserId(int userId) { this.userId = userId; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); voi... |
@Test public void getUsername() throws Exception { assertEquals(names[0], user1.getUsername()); } | public String getUsername() { return username; } | User { public String getUsername() { return username; } } | User { public String getUsername() { return username; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public String getUsername() { return username; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUserId... | User { public String getUsername() { return username; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUserId... |
@Test public void setUsername() throws Exception { user2.setUsername("Wurst"); assertEquals("Wurst", user2.getUsername()); } | public void setUsername(String username) { this.username = username; } | User { public void setUsername(String username) { this.username = username; } } | User { public void setUsername(String username) { this.username = username; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public void setUsername(String username) { this.username = username; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUs... | User { public void setUsername(String username) { this.username = username; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUs... |
@Test public void isFriend() throws Exception { assertFalse(user1.isFriend()); } | public boolean isFriend() { return isFriend; } | User { public boolean isFriend() { return isFriend; } } | User { public boolean isFriend() { return isFriend; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public boolean isFriend() { return isFriend; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUserId(i... | User { public boolean isFriend() { return isFriend; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUserId(i... |
@Test public void setFriend() throws Exception { user2.setFriend(true); assertTrue(user2.isFriend()); } | public void setFriend(boolean friend) { isFriend = friend; } | User { public void setFriend(boolean friend) { isFriend = friend; } } | User { public void setFriend(boolean friend) { isFriend = friend; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public void setFriend(boolean friend) { isFriend = friend; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); vo... | User { public void setFriend(boolean friend) { isFriend = friend; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); vo... |
@Test public void isBlocked() throws Exception { assertFalse(user1.isBlocked()); } | public boolean isBlocked() { return isBlocked; } | User { public boolean isBlocked() { return isBlocked; } } | User { public boolean isBlocked() { return isBlocked; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public boolean isBlocked() { return isBlocked; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUserId... | User { public boolean isBlocked() { return isBlocked; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUserId... |
@Test public void setBlocked() throws Exception { user2.setBlocked(true); assertTrue(user2.isBlocked()); } | public void setBlocked(boolean blocked) { isBlocked = blocked; } | User { public void setBlocked(boolean blocked) { isBlocked = blocked; } } | User { public void setBlocked(boolean blocked) { isBlocked = blocked; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public void setBlocked(boolean blocked) { isBlocked = blocked; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId()... | User { public void setBlocked(boolean blocked) { isBlocked = blocked; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId()... |
@Test public void isRequesting() throws Exception { assertFalse(user1.isRequesting()); } | public boolean isRequesting() { return isRequesting; } | User { public boolean isRequesting() { return isRequesting; } } | User { public boolean isRequesting() { return isRequesting; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public boolean isRequesting() { return isRequesting; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void set... | User { public boolean isRequesting() { return isRequesting; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void set... |
@Test public void applyUpdate() throws Exception { PositionChangeUpdate update = new PositionChangeUpdate(date, creator1, lat, lon, date.getTime()); update.applyUpdate(mockRepos); verify(mockUserRepository).getUser(creator1); verify(mockUser).setLocation(any(Location.class)); verify(mockUserRepository).updateUser(mockU... | @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } | PositionChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } } | PositionChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } PositionChangeUpdate(@JsonProperty("time-cre... | PositionChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } PositionChangeUpdate(@JsonProperty("time-cre... | PositionChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(creator); user.setLocation(toLocation(latitude, longitude, timeMeasured)); repositorySet.userRepository.updateUser(user); } PositionChangeUpdate(@JsonProperty("time-cre... |
@Test public void setRequesting() throws Exception { user2.setRequesting(true); assertTrue(user2.isRequesting()); } | public void setRequesting(boolean requesting) { this.isRequesting = requesting; } | User { public void setRequesting(boolean requesting) { this.isRequesting = requesting; } } | User { public void setRequesting(boolean requesting) { this.isRequesting = requesting; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location)... | User { public void setRequesting(boolean requesting) { this.isRequesting = requesting; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location)... | User { public void setRequesting(boolean requesting) { this.isRequesting = requesting; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location)... |
@Test public void isRequestPending() throws Exception { assertFalse(user1.isRequestPending()); } | public boolean isRequestPending() { return requestPending; } | User { public boolean isRequestPending() { return requestPending; } } | User { public boolean isRequestPending() { return requestPending; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public boolean isRequestPending() { return requestPending; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); vo... | User { public boolean isRequestPending() { return requestPending; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); vo... |
@Test public void setRequestPending() throws Exception { user2.setRequestPending(true); assertTrue(user2.isRequestPending()); } | public void setRequestPending(boolean requestPending) { this.requestPending = requestPending; } | User { public void setRequestPending(boolean requestPending) { this.requestPending = requestPending; } } | User { public void setRequestPending(boolean requestPending) { this.requestPending = requestPending; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Loca... | User { public void setRequestPending(boolean requestPending) { this.requestPending = requestPending; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Loca... | User { public void setRequestPending(boolean requestPending) { this.requestPending = requestPending; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Loca... |
@Test public void getLocation() throws Exception { assertEquals(mockLocation, user1.getLocation()); } | public Location getLocation() { return location; } | User { public Location getLocation() { return location; } } | User { public Location getLocation() { return location; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public Location getLocation() { return location; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUser... | User { public Location getLocation() { return location; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int getUserId(); void setUser... |
@Test public void setLocation() throws Exception { Location location = new Location(LocationManager.PASSIVE_PROVIDER); user2.setLocation(location); assertEquals(location, user2.getLocation()); } | public void setLocation(Location location) { this.location = location; } | User { public void setLocation(Location location) { this.location = location; } } | User { public void setLocation(Location location) { this.location = location; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); } | User { public void setLocation(Location location) { this.location = location; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int get... | User { public void setLocation(Location location) { this.location = location; } User(int userId,
String username,
boolean isFriend,
boolean isBlocked,
boolean isRequesting,
boolean requestPending,
Location location); int get... |
@Test public void equals() throws Exception { assertTrue(user1.equals(user1)); assertTrue(user1.equals(user3)); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.isRequest... | User { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.is... | User { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.is... | User { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.is... | User { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (userId != user.userId) return false; if (isFriend != user.isFriend) return false; if (isBlocked != user.isBlocked) return false; if (isRequesting != user.is... |
@Test public void getUserId() throws Exception { assertEquals(ids[0], groupMembership1.getUserId()); } | public int getUserId() { return userId; } | GroupMembership { public int getUserId() { return userId; } } | GroupMembership { public int getUserId() { return userId; } GroupMembership(int userId, int groupId); } | GroupMembership { public int getUserId() { return userId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sharing); @Over... | GroupMembership { public int getUserId() { return userId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sharing); @Over... |
@Test public void setUserId() throws Exception { groupMembership2.setUserId(65656); assertEquals(65656, groupMembership2.getUserId()); } | public void setUserId(int userId) { this.userId = userId; } | GroupMembership { public void setUserId(int userId) { this.userId = userId; } } | GroupMembership { public void setUserId(int userId) { this.userId = userId; } GroupMembership(int userId, int groupId); } | GroupMembership { public void setUserId(int userId) { this.userId = userId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boole... | GroupMembership { public void setUserId(int userId) { this.userId = userId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boole... |
@Test public void getGroupId() throws Exception { assertEquals(ids[1], groupMembership1.getGroupId()); } | public int getGroupId() { return groupId; } | GroupMembership { public int getGroupId() { return groupId; } } | GroupMembership { public int getGroupId() { return groupId; } GroupMembership(int userId, int groupId); } | GroupMembership { public int getGroupId() { return groupId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sharing); @Ov... | GroupMembership { public int getGroupId() { return groupId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sharing); @Ov... |
@Test public void setGroupId() throws Exception { groupMembership2.setGroupId(78787); assertEquals(78787, groupMembership2.getGroupId()); } | public void setGroupId(int groupId) { this.groupId = groupId; } | GroupMembership { public void setGroupId(int groupId) { this.groupId = groupId; } } | GroupMembership { public void setGroupId(int groupId) { this.groupId = groupId; } GroupMembership(int userId, int groupId); } | GroupMembership { public void setGroupId(int groupId) { this.groupId = groupId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(b... | GroupMembership { public void setGroupId(int groupId) { this.groupId = groupId; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(b... |
@Test public void applyUpdate() throws Exception { ContactRequestAnswerUpdate update = new ContactRequestAnswerUpdate(date, creator1, true); update.applyUpdate(mockRepos); verify(mockUserRepository).setIsPending(creator1, false); verify(mockUserRepository).setIsFriend(creator1, true); } | @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsPending(creator, false); repositorySet.userRepository.setIsFriend(creator, answer); } | ContactRequestAnswerUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsPending(creator, false); repositorySet.userRepository.setIsFriend(creator, answer); } } | ContactRequestAnswerUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsPending(creator, false); repositorySet.userRepository.setIsFriend(creator, answer); } ContactRequestAnswerUpdate(@JsonProperty("time-created") Date timeCreated,
... | ContactRequestAnswerUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsPending(creator, false); repositorySet.userRepository.setIsFriend(creator, answer); } ContactRequestAnswerUpdate(@JsonProperty("time-created") Date timeCreated,
... | ContactRequestAnswerUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsPending(creator, false); repositorySet.userRepository.setIsFriend(creator, answer); } ContactRequestAnswerUpdate(@JsonProperty("time-created") Date timeCreated,
... |
@Test public void getSharingUntil() throws Exception { assertEquals(date1, groupMembership1.getSharingUntil()); } | public Date getSharingUntil() { return sharingUntil; } | GroupMembership { public Date getSharingUntil() { return sharingUntil; } } | GroupMembership { public Date getSharingUntil() { return sharingUntil; } GroupMembership(int userId, int groupId); } | GroupMembership { public Date getSharingUntil() { return sharingUntil; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sh... | GroupMembership { public Date getSharingUntil() { return sharingUntil; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sh... |
@Test public void setSharingUntil() throws Exception { groupMembership2.setSharingUntil(date2); assertEquals(date2, groupMembership2.getSharingUntil()); } | public void setSharingUntil(Date sharingUntil) { this.sharingUntil = sharingUntil; } | GroupMembership { public void setSharingUntil(Date sharingUntil) { this.sharingUntil = sharingUntil; } } | GroupMembership { public void setSharingUntil(Date sharingUntil) { this.sharingUntil = sharingUntil; } GroupMembership(int userId, int groupId); } | GroupMembership { public void setSharingUntil(Date sharingUntil) { this.sharingUntil = sharingUntil; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing... | GroupMembership { public void setSharingUntil(Date sharingUntil) { this.sharingUntil = sharingUntil; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing... |
@Test public void isSharing() throws Exception { assertTrue(!groupMembership1.isSharing()); } | public boolean isSharing() { return sharing; } | GroupMembership { public boolean isSharing() { return sharing; } } | GroupMembership { public boolean isSharing() { return sharing; } GroupMembership(int userId, int groupId); } | GroupMembership { public boolean isSharing() { return sharing; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sharing); ... | GroupMembership { public boolean isSharing() { return sharing; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setSharing(boolean sharing); ... |
@Test public void setSharing() throws Exception { groupMembership2.setSharing(true); assertTrue(groupMembership2.isSharing()); } | public void setSharing(boolean sharing) { this.sharing = sharing; } | GroupMembership { public void setSharing(boolean sharing) { this.sharing = sharing; } } | GroupMembership { public void setSharing(boolean sharing) { this.sharing = sharing; } GroupMembership(int userId, int groupId); } | GroupMembership { public void setSharing(boolean sharing) { this.sharing = sharing; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setShari... | GroupMembership { public void setSharing(boolean sharing) { this.sharing = sharing; } GroupMembership(int userId, int groupId); int getUserId(); void setUserId(int userId); int getGroupId(); void setGroupId(int groupId); Date getSharingUntil(); void setSharingUntil(Date sharingUntil); boolean isSharing(); void setShari... |
@Test public void equals() throws Exception { assertTrue(groupMembership1.equals(groupMembership1)); assertTrue(groupMembership1.equals(groupMembership3)); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GroupMembership that = (GroupMembership) o; if (userId != that.userId) return false; return groupId == that.groupId; } | GroupMembership { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GroupMembership that = (GroupMembership) o; if (userId != that.userId) return false; return groupId == that.groupId; } } | GroupMembership { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GroupMembership that = (GroupMembership) o; if (userId != that.userId) return false; return groupId == that.groupId; } GroupMembership(int userId, int groupId); } | GroupMembership { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GroupMembership that = (GroupMembership) o; if (userId != that.userId) return false; return groupId == that.groupId; } GroupMembership(int userId, int groupId); int getUse... | GroupMembership { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; GroupMembership that = (GroupMembership) o; if (userId != that.userId) return false; return groupId == that.groupId; } GroupMembership(int userId, int groupId); int getUse... |
@Test public void getGroupId() throws Exception { assertEquals(ids[0], userGroup1.getGroupId()); } | public int getGroupId() { return groupId; } | UserGroup { public int getGroupId() { return groupId; } } | UserGroup { public int getGroupId() { return groupId; } UserGroup(int groupId, String name); } | UserGroup { public int getGroupId() { return groupId; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Override boolean equals(O... | UserGroup { public int getGroupId() { return groupId; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Override boolean equals(O... |
@Test public void setGroupId() throws Exception { userGroup2.setGroupId(ids[3]); assertEquals(ids[3], userGroup2.getGroupId()); } | public void setGroupId(int groupId) { this.groupId = groupId; } | UserGroup { public void setGroupId(int groupId) { this.groupId = groupId; } } | UserGroup { public void setGroupId(int groupId) { this.groupId = groupId; } UserGroup(int groupId, String name); } | UserGroup { public void setGroupId(int groupId) { this.groupId = groupId; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Overr... | UserGroup { public void setGroupId(int groupId) { this.groupId = groupId; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Overr... |
@Test public void getName() throws Exception { assertEquals(groupNames[0], userGroup1.getName()); } | public String getName() { return name; } | UserGroup { public String getName() { return name; } } | UserGroup { public String getName() { return name; } UserGroup(int groupId, String name); } | UserGroup { public String getName() { return name; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Override boolean equals(Obje... | UserGroup { public String getName() { return name; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Override boolean equals(Obje... |
@Test public void setName() throws Exception { userGroup2.setName(groupNames[2]); assertEquals(groupNames[2], userGroup2.getName()); } | public void setName(String name) { this.name = name; } | UserGroup { public void setName(String name) { this.name = name; } } | UserGroup { public void setName(String name) { this.name = name; } UserGroup(int groupId, String name); } | UserGroup { public void setName(String name) { this.name = name; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Override boole... | UserGroup { public void setName(String name) { this.name = name; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Override boole... |
@Test public void isSharingLocation() throws Exception { assertFalse(userGroup1.isSharingLocation()); } | public boolean isSharingLocation() { return isSharingLocation; } | UserGroup { public boolean isSharingLocation() { return isSharingLocation; } } | UserGroup { public boolean isSharingLocation() { return isSharingLocation; } UserGroup(int groupId, String name); } | UserGroup { public boolean isSharingLocation() { return isSharingLocation; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Over... | UserGroup { public boolean isSharingLocation() { return isSharingLocation; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Over... |
@Test public void applyUpdate() throws Exception { EventDeletionUpdate update = new EventDeletionUpdate(date, creator1, group1, event1); update.applyUpdate(mockRepos); verify(mockEventRepository).deleteEvent(event1); } | @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.eventRepository.deleteEvent(eventID); } | EventDeletionUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.eventRepository.deleteEvent(eventID); } } | EventDeletionUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.eventRepository.deleteEvent(eventID); } EventDeletionUpdate(@JsonProperty("time-created") Date timeCreated,
@JsonProperty("creator") int creator,
... | EventDeletionUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.eventRepository.deleteEvent(eventID); } EventDeletionUpdate(@JsonProperty("time-created") Date timeCreated,
@JsonProperty("creator") int creator,
... | EventDeletionUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.eventRepository.deleteEvent(eventID); } EventDeletionUpdate(@JsonProperty("time-created") Date timeCreated,
@JsonProperty("creator") int creator,
... |
@Test public void setSharingLocation() throws Exception { userGroup2.setSharingLocation(true); assertTrue(userGroup2.isSharingLocation()); } | public void setSharingLocation(boolean sharingLocation) { isSharingLocation = sharingLocation; } | UserGroup { public void setSharingLocation(boolean sharingLocation) { isSharingLocation = sharingLocation; } } | UserGroup { public void setSharingLocation(boolean sharingLocation) { isSharingLocation = sharingLocation; } UserGroup(int groupId, String name); } | UserGroup { public void setSharingLocation(boolean sharingLocation) { isSharingLocation = sharingLocation; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @O... | UserGroup { public void setSharingLocation(boolean sharingLocation) { isSharingLocation = sharingLocation; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @O... |
@Test public void testToString() throws Exception { assertEquals(groupNames[0], userGroup1.toString()); } | @Override public String toString() { return name; } | UserGroup { @Override public String toString() { return name; } } | UserGroup { @Override public String toString() { return name; } UserGroup(int groupId, String name); } | UserGroup { @Override public String toString() { return name; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Override boolean ... | UserGroup { @Override public String toString() { return name; } UserGroup(int groupId, String name); int getGroupId(); void setGroupId(int groupId); String getName(); void setName(String name); boolean isSharingLocation(); void setSharingLocation(boolean sharingLocation); @Override String toString(); @Override boolean ... |
@Test public void equals() throws Exception { assertTrue(userGroup1.equals(userGroup1)); assertTrue(userGroup1.equals(userGroup3)); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserGroup group = (UserGroup) o; if (groupId != group.groupId) return false; return name.equals(group.name); } | UserGroup { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserGroup group = (UserGroup) o; if (groupId != group.groupId) return false; return name.equals(group.name); } } | UserGroup { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserGroup group = (UserGroup) o; if (groupId != group.groupId) return false; return name.equals(group.name); } UserGroup(int groupId, String name); } | UserGroup { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserGroup group = (UserGroup) o; if (groupId != group.groupId) return false; return name.equals(group.name); } UserGroup(int groupId, String name); int getGroupId(); void setGro... | UserGroup { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; UserGroup group = (UserGroup) o; if (groupId != group.groupId) return false; return name.equals(group.name); } UserGroup(int groupId, String name); int getGroupId(); void setGro... |
@Test public void testToDate() { assertEquals(dateZero, DateConverter.toDate(timestampZero)); assertEquals(datePresentation, DateConverter.toDate(timestampPresentation)); assertEquals(dateZero, DateConverter.toDate(timestampNull)); } | @TypeConverter public static Date toDate(Long timestamp) { return timestamp == null ? null : new Date(timestamp); } | DateConverter { @TypeConverter public static Date toDate(Long timestamp) { return timestamp == null ? null : new Date(timestamp); } } | DateConverter { @TypeConverter public static Date toDate(Long timestamp) { return timestamp == null ? null : new Date(timestamp); } } | DateConverter { @TypeConverter public static Date toDate(Long timestamp) { return timestamp == null ? null : new Date(timestamp); } @TypeConverter static Date toDate(Long timestamp); @TypeConverter static Long toTimestamp(Date date); } | DateConverter { @TypeConverter public static Date toDate(Long timestamp) { return timestamp == null ? null : new Date(timestamp); } @TypeConverter static Date toDate(Long timestamp); @TypeConverter static Long toTimestamp(Date date); } |
@Test public void testToTimestamp() { long testTimestamp1 = DateConverter.toTimestamp(dateZero); assertEquals(timestampZero, testTimestamp1); long testTimestamp2 = DateConverter.toTimestamp(datePresentation); assertEquals(timestampPresentation, testTimestamp2); boolean exception = false; try { long testTimestamp3 = Dat... | @TypeConverter public static Long toTimestamp(Date date) { return date == null ? null : date.getTime(); } | DateConverter { @TypeConverter public static Long toTimestamp(Date date) { return date == null ? null : date.getTime(); } } | DateConverter { @TypeConverter public static Long toTimestamp(Date date) { return date == null ? null : date.getTime(); } } | DateConverter { @TypeConverter public static Long toTimestamp(Date date) { return date == null ? null : date.getTime(); } @TypeConverter static Date toDate(Long timestamp); @TypeConverter static Long toTimestamp(Date date); } | DateConverter { @TypeConverter public static Long toTimestamp(Date date) { return date == null ? null : date.getTime(); } @TypeConverter static Date toDate(Long timestamp); @TypeConverter static Long toTimestamp(Date date); } |
@Test public void toLocation() throws Exception { PositionConverter.toLocation(positionString); verify(mockLocation).setLatitude(55.55); verify(mockLocation).setLongitude(90.0); verify(mockLocation).setTime((long)1521158400); } | @TypeConverter public static Location toLocation(String location) { if (location == null) return null; String[] split = location.split("#"); double lat = Double.parseDouble(split[0]); double lon = Double.parseDouble(split[1]); long time = Long.parseLong(split[2]); Location l = new Location(LocationManager.GPS_PROVIDER)... | PositionConverter { @TypeConverter public static Location toLocation(String location) { if (location == null) return null; String[] split = location.split("#"); double lat = Double.parseDouble(split[0]); double lon = Double.parseDouble(split[1]); long time = Long.parseLong(split[2]); Location l = new Location(LocationM... | PositionConverter { @TypeConverter public static Location toLocation(String location) { if (location == null) return null; String[] split = location.split("#"); double lat = Double.parseDouble(split[0]); double lon = Double.parseDouble(split[1]); long time = Long.parseLong(split[2]); Location l = new Location(LocationM... | PositionConverter { @TypeConverter public static Location toLocation(String location) { if (location == null) return null; String[] split = location.split("#"); double lat = Double.parseDouble(split[0]); double lon = Double.parseDouble(split[1]); long time = Long.parseLong(split[2]); Location l = new Location(LocationM... | PositionConverter { @TypeConverter public static Location toLocation(String location) { if (location == null) return null; String[] split = location.split("#"); double lat = Double.parseDouble(split[0]); double lon = Double.parseDouble(split[1]); long time = Long.parseLong(split[2]); Location l = new Location(LocationM... |
@Test public void toDoubles() throws Exception { when(mockLocation.getLatitude()).thenReturn(55.55); when(mockLocation.getLongitude()).thenReturn(90.00); when(mockLocation.getTime()).thenReturn((long)1521158400); assertEquals(positionString ,PositionConverter.toDoubles(mockLocation)); } | @TypeConverter public static String toDoubles(Location location) { if (location == null) return null; return location.getLatitude() + "#" + location.getLongitude() + "#" + location.getTime(); } | PositionConverter { @TypeConverter public static String toDoubles(Location location) { if (location == null) return null; return location.getLatitude() + "#" + location.getLongitude() + "#" + location.getTime(); } } | PositionConverter { @TypeConverter public static String toDoubles(Location location) { if (location == null) return null; return location.getLatitude() + "#" + location.getLongitude() + "#" + location.getTime(); } } | PositionConverter { @TypeConverter public static String toDoubles(Location location) { if (location == null) return null; return location.getLatitude() + "#" + location.getLongitude() + "#" + location.getTime(); } @TypeConverter static Location toLocation(String location); @TypeConverter static String toDoubles(Locati... | PositionConverter { @TypeConverter public static String toDoubles(Location location) { if (location == null) return null; return location.getLatitude() + "#" + location.getLongitude() + "#" + location.getTime(); } @TypeConverter static Location toLocation(String location); @TypeConverter static String toDoubles(Locati... |
@Test public void testToSet() { assertEquals(emptySet, IntegerSetConverter.toSet(emptyString)); assertEquals(null, IntegerSetConverter.toSet(nullString)); assertEquals(oneElementSet, IntegerSetConverter.toSet(oneElementString)); assertEquals(largeSet, IntegerSetConverter.toSet(largeString)); } | @TypeConverter public static Set<Integer> toSet(String string) { if (string == null) return null; if (string.length() == 0) return new HashSet<>(); Set<Integer> set = new HashSet<>(); String[] ints = string.split("#"); for (String s : ints) { set.add(Integer.parseInt(s)); } return set; } | IntegerSetConverter { @TypeConverter public static Set<Integer> toSet(String string) { if (string == null) return null; if (string.length() == 0) return new HashSet<>(); Set<Integer> set = new HashSet<>(); String[] ints = string.split("#"); for (String s : ints) { set.add(Integer.parseInt(s)); } return set; } } | IntegerSetConverter { @TypeConverter public static Set<Integer> toSet(String string) { if (string == null) return null; if (string.length() == 0) return new HashSet<>(); Set<Integer> set = new HashSet<>(); String[] ints = string.split("#"); for (String s : ints) { set.add(Integer.parseInt(s)); } return set; } } | IntegerSetConverter { @TypeConverter public static Set<Integer> toSet(String string) { if (string == null) return null; if (string.length() == 0) return new HashSet<>(); Set<Integer> set = new HashSet<>(); String[] ints = string.split("#"); for (String s : ints) { set.add(Integer.parseInt(s)); } return set; } @TypeCon... | IntegerSetConverter { @TypeConverter public static Set<Integer> toSet(String string) { if (string == null) return null; if (string.length() == 0) return new HashSet<>(); Set<Integer> set = new HashSet<>(); String[] ints = string.split("#"); for (String s : ints) { set.add(Integer.parseInt(s)); } return set; } @TypeCon... |
@Test public void testToString() { assertEquals(nullString, IntegerSetConverter.toString(nullSet)); assertEquals(emptyString, IntegerSetConverter.toString(emptySet)); assertEquals(oneElementString + "#", IntegerSetConverter.toString(oneElementSet)); assertEquals(largeStringSorted, IntegerSetConverter.toString(largeSet)... | @TypeConverter public static String toString(Set<Integer> set) { if (set == null) return null; String string = ""; for (Integer i : set) { string += i; string += "#"; } return string; } | IntegerSetConverter { @TypeConverter public static String toString(Set<Integer> set) { if (set == null) return null; String string = ""; for (Integer i : set) { string += i; string += "#"; } return string; } } | IntegerSetConverter { @TypeConverter public static String toString(Set<Integer> set) { if (set == null) return null; String string = ""; for (Integer i : set) { string += i; string += "#"; } return string; } } | IntegerSetConverter { @TypeConverter public static String toString(Set<Integer> set) { if (set == null) return null; String string = ""; for (Integer i : set) { string += i; string += "#"; } return string; } @TypeConverter static Set<Integer> toSet(String string); @TypeConverter static String toString(Set<Integer> set... | IntegerSetConverter { @TypeConverter public static String toString(Set<Integer> set) { if (set == null) return null; String string = ""; for (Integer i : set) { string += i; string += "#"; } return string; } @TypeConverter static Set<Integer> toSet(String string); @TypeConverter static String toString(Set<Integer> set... |
@Test public void getMessageId() throws Exception { assertEquals(0, message1.getMessageId()); } | public int getMessageId() { return messageId; } | ChatMessage { public int getMessageId() { return messageId; } } | ChatMessage { public int getMessageId() { return messageId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public int getMessageId() { return messageId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void set... | ChatMessage { public int getMessageId() { return messageId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void set... |
@Test public void applyUpdate() throws Exception { AccountChangeUpdate update1 = new AccountChangeUpdate(date, creator1, account1); update1.applyUpdate(mockRepos); verify(mockUserRepository).addUser(mockUser); AccountChangeUpdate update2 = new AccountChangeUpdate(date, creator1, account2); update2.applyUpdate(mockRepos... | @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(account.id); if (user != null) { user.setUsername(account.username); repositorySet.userRepository.updateUser(user); } else { user = new User(account.id, account.username, false, false, false, false, new Loc... | AccountChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(account.id); if (user != null) { user.setUsername(account.username); repositorySet.userRepository.updateUser(user); } else { user = new User(account.id, account.username... | AccountChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(account.id); if (user != null) { user.setUsername(account.username); repositorySet.userRepository.updateUser(user); } else { user = new User(account.id, account.username... | AccountChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(account.id); if (user != null) { user.setUsername(account.username); repositorySet.userRepository.updateUser(user); } else { user = new User(account.id, account.username... | AccountChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User user = repositorySet.userRepository.getUser(account.id); if (user != null) { user.setUsername(account.username); repositorySet.userRepository.updateUser(user); } else { user = new User(account.id, account.username... |
@Test public void setMessageId() throws Exception { message2.setMessageId(1); assertEquals(1, message2.getMessageId()); } | public void setMessageId(int messageId) { this.messageId = messageId; } | ChatMessage { public void setMessageId(int messageId) { this.messageId = messageId; } } | ChatMessage { public void setMessageId(int messageId) { this.messageId = messageId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public void setMessageId(int messageId) { this.messageId = messageId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); in... | ChatMessage { public void setMessageId(int messageId) { this.messageId = messageId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); in... |
@Test public void getGroupId() throws Exception { assertEquals(69, message1.getGroupId()); } | public int getGroupId() { return groupId; } | ChatMessage { public int getGroupId() { return groupId; } } | ChatMessage { public int getGroupId() { return groupId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public int getGroupId() { return groupId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void setGrou... | ChatMessage { public int getGroupId() { return groupId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void setGrou... |
@Test public void setGroupId() throws Exception { message2.setGroupId(9997); assertEquals(9997, message2.getGroupId()); } | public void setGroupId(int groupId) { this.groupId = groupId; } | ChatMessage { public void setGroupId(int groupId) { this.groupId = groupId; } } | ChatMessage { public void setGroupId(int groupId) { this.groupId = groupId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public void setGroupId(int groupId) { this.groupId = groupId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGro... | ChatMessage { public void setGroupId(int groupId) { this.groupId = groupId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGro... |
@Test public void getContent() throws Exception { assertEquals("Hallo", message1.getContent()); } | public String getContent() { return content; } | ChatMessage { public String getContent() { return content; } } | ChatMessage { public String getContent() { return content; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public String getContent() { return content; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void setG... | ChatMessage { public String getContent() { return content; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void setG... |
@Test public void setContent() throws Exception { message2.setContent("NEIN"); assertEquals("NEIN", message2.getContent()); } | public void setContent(String content) { this.content = content; } | ChatMessage { public void setContent(String content) { this.content = content; } } | ChatMessage { public void setContent(String content) { this.content = content; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public void setContent(String content) { this.content = content; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int get... | ChatMessage { public void setContent(String content) { this.content = content; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int get... |
@Test public void getUserId() throws Exception { assertEquals(88, message1.getUserId()); } | public int getUserId() { return userId; } | ChatMessage { public int getUserId() { return userId; } } | ChatMessage { public int getUserId() { return userId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public int getUserId() { return userId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void setGroupI... | ChatMessage { public int getUserId() { return userId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void setGroupI... |
@Test public void setUserId() throws Exception { message2.setUserId(99143); assertEquals(99143, message2.getUserId()); } | public void setUserId(int userId) { this.userId = userId; } | ChatMessage { public void setUserId(int userId) { this.userId = userId; } } | ChatMessage { public void setUserId(int userId) { this.userId = userId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public void setUserId(int userId) { this.userId = userId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId... | ChatMessage { public void setUserId(int userId) { this.userId = userId; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId... |
@Test public void getUsername() throws Exception { assertEquals("Hans", message1.getUsername()); } | public String getUsername() { return username; } | ChatMessage { public String getUsername() { return username; } } | ChatMessage { public String getUsername() { return username; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public String getUsername() { return username; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void se... | ChatMessage { public String getUsername() { return username; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void se... |
@Test public void setUsername() throws Exception { message2.setUsername("Wurst"); assertEquals("Wurst", message2.getUsername()); } | public void setUsername(String username) { this.username = username; } | ChatMessage { public void setUsername(String username) { this.username = username; } } | ChatMessage { public void setUsername(String username) { this.username = username; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public void setUsername(String username) { this.username = username; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int... | ChatMessage { public void setUsername(String username) { this.username = username; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int... |
@Test public void getTimeSent() throws Exception { assertEquals(date1, message1.getTimeSent()); } | public Date getTimeSent() { return timeSent; } | ChatMessage { public Date getTimeSent() { return timeSent; } } | ChatMessage { public Date getTimeSent() { return timeSent; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public Date getTimeSent() { return timeSent; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void setG... | ChatMessage { public Date getTimeSent() { return timeSent; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int getGroupId(); void setG... |
@Test public void applyUpdate() throws Exception { CancelContactRequestUpdate update = new CancelContactRequestUpdate(date, creator1); update.applyUpdate(mockRepos); verify(mockUserRepository).setIsRequesting(creator1, false); } | @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsRequesting(creator, false); } | CancelContactRequestUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsRequesting(creator, false); } } | CancelContactRequestUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsRequesting(creator, false); } CancelContactRequestUpdate(@JsonProperty("time-created") Date timeCreated,
@JsonProperty("creator") int creat... | CancelContactRequestUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsRequesting(creator, false); } CancelContactRequestUpdate(@JsonProperty("time-created") Date timeCreated,
@JsonProperty("creator") int creat... | CancelContactRequestUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { repositorySet.userRepository.setIsRequesting(creator, false); } CancelContactRequestUpdate(@JsonProperty("time-created") Date timeCreated,
@JsonProperty("creator") int creat... |
@Test public void setTimeSent() throws Exception { message2.setTimeSent(date2); assertEquals(date2, message2.getTimeSent()); } | public void setTimeSent(Date timeSent) { this.timeSent = timeSent; } | ChatMessage { public void setTimeSent(Date timeSent) { this.timeSent = timeSent; } } | ChatMessage { public void setTimeSent(Date timeSent) { this.timeSent = timeSent; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); } | ChatMessage { public void setTimeSent(Date timeSent) { this.timeSent = timeSent; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int g... | ChatMessage { public void setTimeSent(Date timeSent) { this.timeSent = timeSent; } ChatMessage(int groupId,
String content,
int userId,
String username,
Date timeSent); int getMessageId(); void setMessageId(int messageId); int g... |
@Test public void equalContent() throws Exception { assertTrue("same message", message1.equalContent(message1)); assertTrue("different messages", message1.equalContent(message3)); } | public boolean equalContent(ChatMessage o) { if (groupId != o.groupId) return false; if (userId != o.userId) return false; if (content != null ? !content.equals(o.content) : o.content != null) { return false; } return timeSent != null ? timeSent.equals(o.timeSent) : o.timeSent == null; } | ChatMessage { public boolean equalContent(ChatMessage o) { if (groupId != o.groupId) return false; if (userId != o.userId) return false; if (content != null ? !content.equals(o.content) : o.content != null) { return false; } return timeSent != null ? timeSent.equals(o.timeSent) : o.timeSent == null; } } | ChatMessage { public boolean equalContent(ChatMessage o) { if (groupId != o.groupId) return false; if (userId != o.userId) return false; if (content != null ? !content.equals(o.content) : o.content != null) { return false; } return timeSent != null ? timeSent.equals(o.timeSent) : o.timeSent == null; } ChatMessage(int g... | ChatMessage { public boolean equalContent(ChatMessage o) { if (groupId != o.groupId) return false; if (userId != o.userId) return false; if (content != null ? !content.equals(o.content) : o.content != null) { return false; } return timeSent != null ? timeSent.equals(o.timeSent) : o.timeSent == null; } ChatMessage(int g... | ChatMessage { public boolean equalContent(ChatMessage o) { if (groupId != o.groupId) return false; if (userId != o.userId) return false; if (content != null ? !content.equals(o.content) : o.content != null) { return false; } return timeSent != null ? timeSent.equals(o.timeSent) : o.timeSent == null; } ChatMessage(int g... |
@Test public void equals() throws Exception { assertTrue("same message", message1.equals(message1)); assertTrue("different messages", message1.equals(message3)); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ChatMessage that = (ChatMessage) o; if (messageId != that.messageId) return false; if (groupId != that.groupId) return false; if (userId != that.userId) return false; if (content != null ? ... | ChatMessage { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ChatMessage that = (ChatMessage) o; if (messageId != that.messageId) return false; if (groupId != that.groupId) return false; if (userId != that.userId) return false; if (cont... | ChatMessage { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ChatMessage that = (ChatMessage) o; if (messageId != that.messageId) return false; if (groupId != that.groupId) return false; if (userId != that.userId) return false; if (cont... | ChatMessage { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ChatMessage that = (ChatMessage) o; if (messageId != that.messageId) return false; if (groupId != that.groupId) return false; if (userId != that.userId) return false; if (cont... | ChatMessage { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ChatMessage that = (ChatMessage) o; if (messageId != that.messageId) return false; if (groupId != that.groupId) return false; if (userId != that.userId) return false; if (cont... |
@Test public void getId() throws Exception { assertEquals(ids[0], event1.getId()); } | public int getId() { return id; } | Event extends Occasion { public int getId() { return id; } } | Event extends Occasion { public int getId() { return id; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public int getId() { return id; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void setEnd(Date... | Event extends Occasion { public int getId() { return id; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void setEnd(Date... |
@Test public void setId() throws Exception { event2.setId(1234); assertEquals(1234, event2.getId()); } | public void setId(int id) { this.id = id; } | Event extends Occasion { public void setId(int id) { this.id = id; } } | Event extends Occasion { public void setId(int id) { this.id = id; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public void setId(int id) { this.id = id; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void s... | Event extends Occasion { public void setId(int id) { this.id = id; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void s... |
@Test public void getEnd() throws Exception { assertEquals(date2, event1.getEnd()); } | public Date getEnd() { return end; } | Event extends Occasion { public Date getEnd() { return end; } } | Event extends Occasion { public Date getEnd() { return end; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public Date getEnd() { return end; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void setEnd(D... | Event extends Occasion { public Date getEnd() { return end; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void setEnd(D... |
@Test public void setEnd() throws Exception { event2.setEnd(date2); assertEquals(date2, event2.getEnd()); } | public void setEnd(Date end) { this.end = end; } | Event extends Occasion { public void setEnd(Date end) { this.end = end; } } | Event extends Occasion { public void setEnd(Date end) { this.end = end; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public void setEnd(Date end) { this.end = end; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); v... | Event extends Occasion { public void setEnd(Date end) { this.end = end; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); v... |
@Test public void getStart() throws Exception { assertEquals(date1, event1.getStart()); } | public Date getStart() { return start; } | Event extends Occasion { public Date getStart() { return start; } } | Event extends Occasion { public Date getStart() { return start; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public Date getStart() { return start; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void setE... | Event extends Occasion { public Date getStart() { return start; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void setE... |
@Test public void setStart() throws Exception { event2.setStart(date2); assertEquals(date2, event2.getStart()); } | public void setStart(Date start) { this.start = start; } | Event extends Occasion { public void setStart(Date start) { this.start = start; } } | Event extends Occasion { public void setStart(Date start) { this.start = start; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public void setStart(Date start) { this.start = start; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date get... | Event extends Occasion { public void setStart(Date start) { this.start = start; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date get... |
@Test public void getCreator() throws Exception { assertEquals(ids[1], event1.getCreator()); } | public int getCreator() { return creator; } | Event extends Occasion { public int getCreator() { return creator; } } | Event extends Occasion { public int getCreator() { return creator; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public int getCreator() { return creator; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void s... | Event extends Occasion { public int getCreator() { return creator; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void s... |
@Test public void applyUpdate() throws Exception { GroupMembershipChangeUpdate update = new GroupMembershipChangeUpdate(date, creator1, membership); update.applyUpdate(mockRepos); verify(mockGroupMembership).setSharingUntil(date); verify(mockUserGroupRepository).updateMembership(mockGroupMembership); } | @Override public void applyUpdate(RepositorySet repositorySet) { GroupMembership membership = new GroupMembership (membershipDescription.accountID, membershipDescription .groupID); membership.setSharingUntil(membershipDescription.sharingUntil); repositorySet.userGroupRepository.updateMembership(membership); } | GroupMembershipChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { GroupMembership membership = new GroupMembership (membershipDescription.accountID, membershipDescription .groupID); membership.setSharingUntil(membershipDescription.sharingUntil); repositorySet.userGroupReposit... | GroupMembershipChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { GroupMembership membership = new GroupMembership (membershipDescription.accountID, membershipDescription .groupID); membership.setSharingUntil(membershipDescription.sharingUntil); repositorySet.userGroupReposit... | GroupMembershipChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { GroupMembership membership = new GroupMembership (membershipDescription.accountID, membershipDescription .groupID); membership.setSharingUntil(membershipDescription.sharingUntil); repositorySet.userGroupReposit... | GroupMembershipChangeUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { GroupMembership membership = new GroupMembership (membershipDescription.accountID, membershipDescription .groupID); membership.setSharingUntil(membershipDescription.sharingUntil); repositorySet.userGroupReposit... |
@Test public void setCreator() throws Exception { event2.setCreator(54545); assertEquals(54545, event2.getCreator()); } | public void setCreator(int creator) { this.creator = creator; } | Event extends Occasion { public void setCreator(int creator) { this.creator = creator; } } | Event extends Occasion { public void setCreator(int creator) { this.creator = creator; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public void setCreator(int creator) { this.creator = creator; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); D... | Event extends Occasion { public void setCreator(int creator) { this.creator = creator; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); D... |
@Test public void getStartString() throws Exception { assertEquals(date1.toString().substring(0, 16), event1.getStartString()); } | public String getStartString() { return start.toString().substring(0, 16); } | Event extends Occasion { public String getStartString() { return start.toString().substring(0, 16); } } | Event extends Occasion { public String getStartString() { return start.toString().substring(0, 16); } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public String getStartString() { return start.toString().substring(0, 16); } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void set... | Event extends Occasion { public String getStartString() { return start.toString().substring(0, 16); } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void set... |
@Test public void getLocation() throws Exception { assertEquals(mockLocation, event1.getLocation()); } | public Location getLocation() { return location; } | Event extends Occasion { public Location getLocation() { return location; } } | Event extends Occasion { public Location getLocation() { return location; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public Location getLocation() { return location; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd();... | Event extends Occasion { public Location getLocation() { return location; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd();... |
@Test public void setLocation() throws Exception { Location location = new Location(LocationManager.PASSIVE_PROVIDER); event2.setLocation(location); assertEquals(location, event2.getLocation()); } | public void setLocation(Location location) { this.location = location; } | Event extends Occasion { public void setLocation(Location location) { this.location = location; } } | Event extends Occasion { public void setLocation(Location location) { this.location = location; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public void setLocation(Location location) { this.location = location; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(i... | Event extends Occasion { public void setLocation(Location location) { this.location = location; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(i... |
@Test public void getGroupId() throws Exception { assertEquals(ids[2], event1.getGroupId()); } | public int getGroupId() { return groupId; } | Event extends Occasion { public int getGroupId() { return groupId; } } | Event extends Occasion { public int getGroupId() { return groupId; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public int getGroupId() { return groupId; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void s... | Event extends Occasion { public int getGroupId() { return groupId; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); Date getEnd(); void s... |
@Test public void setGroupId() throws Exception { event2.setGroupId(98989); assertEquals(98989, event2.getGroupId()); } | public void setGroupId(int groupId) { this.groupId = groupId; } | Event extends Occasion { public void setGroupId(int groupId) { this.groupId = groupId; } } | Event extends Occasion { public void setGroupId(int groupId) { this.groupId = groupId; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); } | Event extends Occasion { public void setGroupId(int groupId) { this.groupId = groupId; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); D... | Event extends Occasion { public void setGroupId(int groupId) { this.groupId = groupId; } Event(int id,
String name,
Date start,
Date end,
Location location,
int creator,
int groupId); int getId(); void setId(int id); D... |
@Test public void equals() throws Exception { assertTrue(event1.equals(event1)); assertTrue(event1.equals(event3)); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) { return false; } if (sta... | Event extends Occasion { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) ... | Event extends Occasion { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) ... | Event extends Occasion { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) ... | Event extends Occasion { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Event event = (Event) o; if (id != event.id) return false; if (creator != event.creator) return false; if (end != null ? !end.equals(event.end) : event.end !=null) ... |
@Test public void serialize() throws IOException { StringWriter outputWriter = new StringWriter(); JsonGenerator jsonGenerator = new JsonFactory().createGenerator(outputWriter); jsonGenerator.useDefaultPrettyPrinter(); Poll poll = mock(Poll.class); when(poll.getID()).thenReturn(4); when(poll.getQuestion()).thenReturn("... | @Override public void serialize(Poll poll, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); gen.writeStringField("type", "poll"); gen.writeNumberField("id", poll.getID()); gen.writeNumberField("creator", poll.getCreator().getID()); gen.writeStringField("question", poll.get... | PollCompleteSerializer extends JsonSerializer<Poll> { @Override public void serialize(Poll poll, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); gen.writeStringField("type", "poll"); gen.writeNumberField("id", poll.getID()); gen.writeNumberField("creator", poll.getCreator... | PollCompleteSerializer extends JsonSerializer<Poll> { @Override public void serialize(Poll poll, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); gen.writeStringField("type", "poll"); gen.writeNumberField("id", poll.getID()); gen.writeNumberField("creator", poll.getCreator... | PollCompleteSerializer extends JsonSerializer<Poll> { @Override public void serialize(Poll poll, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); gen.writeStringField("type", "poll"); gen.writeNumberField("id", poll.getID()); gen.writeNumberField("creator", poll.getCreator... | PollCompleteSerializer extends JsonSerializer<Poll> { @Override public void serialize(Poll poll, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); gen.writeStringField("type", "poll"); gen.writeNumberField("id", poll.getID()); gen.writeNumberField("creator", poll.getCreator... |
@Test public void serialize() throws IOException { StringWriter outputWriter = new StringWriter(); JsonGenerator jsonGenerator = new JsonFactory().createGenerator(outputWriter); jsonGenerator.useDefaultPrettyPrinter(); PollOption pollOption = mock(PollOption.class); when(pollOption.getID()).thenReturn(77); when(pollOpt... | @Override public void serialize(PollOption pollOption, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); Position position = pollOption.getPosition(); gen.writeStringField("type", "polloption"); gen.writeNumberField("id", pollOption.getID()); gen.writeNumberField("latitude"... | PollOptionCompleteSerializer extends JsonSerializer<PollOption> { @Override public void serialize(PollOption pollOption, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); Position position = pollOption.getPosition(); gen.writeStringField("type", "polloption"); gen.writeNumb... | PollOptionCompleteSerializer extends JsonSerializer<PollOption> { @Override public void serialize(PollOption pollOption, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); Position position = pollOption.getPosition(); gen.writeStringField("type", "polloption"); gen.writeNumb... | PollOptionCompleteSerializer extends JsonSerializer<PollOption> { @Override public void serialize(PollOption pollOption, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); Position position = pollOption.getPosition(); gen.writeStringField("type", "polloption"); gen.writeNumb... | PollOptionCompleteSerializer extends JsonSerializer<PollOption> { @Override public void serialize(PollOption pollOption, JsonGenerator gen, SerializerProvider serializers) throws IOException { gen.writeStartObject(); Position position = pollOption.getPosition(); gen.writeStringField("type", "polloption"); gen.writeNumb... |
@Test public void applyUpdate() throws Exception { ChatUpdate update = new ChatUpdate(date, creator1, group1, message1); update.applyUpdate(mockRepos); verify(mockUserRepository).getUser(creator1); verify(mockUser).getUserId(); verify(mockChatRepository).addMessage(mockMessage); } | @Override public void applyUpdate(RepositorySet repositorySet) { User sender = repositorySet.userRepository.getUser(creator); if (sender == null) sender = User.getPlaceholderAndScheduleQuery(creator, repositorySet.userRepository); ChatMessage chatMessage = new ChatMessage(groupId, message, sender.getUserId(), sender.ge... | ChatUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User sender = repositorySet.userRepository.getUser(creator); if (sender == null) sender = User.getPlaceholderAndScheduleQuery(creator, repositorySet.userRepository); ChatMessage chatMessage = new ChatMessage(groupId, message, s... | ChatUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User sender = repositorySet.userRepository.getUser(creator); if (sender == null) sender = User.getPlaceholderAndScheduleQuery(creator, repositorySet.userRepository); ChatMessage chatMessage = new ChatMessage(groupId, message, s... | ChatUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User sender = repositorySet.userRepository.getUser(creator); if (sender == null) sender = User.getPlaceholderAndScheduleQuery(creator, repositorySet.userRepository); ChatMessage chatMessage = new ChatMessage(groupId, message, s... | ChatUpdate extends Update { @Override public void applyUpdate(RepositorySet repositorySet) { User sender = repositorySet.userRepository.getUser(creator); if (sender == null) sender = User.getPlaceholderAndScheduleQuery(creator, repositorySet.userRepository); ChatMessage chatMessage = new ChatMessage(groupId, message, s... |
@Test public void testReadFeature() throws IOException { BuilderFactory bf = Features.getBuilderFactory(); URL res = getClass().getResource("/features/test-feature.json"); try (Reader r = new InputStreamReader(res.openStream())) { Feature f = Features.readFeature(r); assertNull(f.getName()); assertEquals("The feature d... | public Feature readFeature(Reader jsonReader) throws IOException { JsonObject json = Json.createReader(jsonReader).readObject(); String id = json.getString("id"); FeatureBuilder builder = builderFactory.newFeatureBuilder(ID.fromMavenID(id)); builder.setName(json.getString("title", null)); builder.setDescription(json.ge... | FeatureServiceImpl { public Feature readFeature(Reader jsonReader) throws IOException { JsonObject json = Json.createReader(jsonReader).readObject(); String id = json.getString("id"); FeatureBuilder builder = builderFactory.newFeatureBuilder(ID.fromMavenID(id)); builder.setName(json.getString("title", null)); builder.s... | FeatureServiceImpl { public Feature readFeature(Reader jsonReader) throws IOException { JsonObject json = Json.createReader(jsonReader).readObject(); String id = json.getString("id"); FeatureBuilder builder = builderFactory.newFeatureBuilder(ID.fromMavenID(id)); builder.setName(json.getString("title", null)); builder.s... | FeatureServiceImpl { public Feature readFeature(Reader jsonReader) throws IOException { JsonObject json = Json.createReader(jsonReader).readObject(); String id = json.getString("id"); FeatureBuilder builder = builderFactory.newFeatureBuilder(ID.fromMavenID(id)); builder.setName(json.getString("title", null)); builder.s... | FeatureServiceImpl { public Feature readFeature(Reader jsonReader) throws IOException { JsonObject json = Json.createReader(jsonReader).readObject(); String id = json.getString("id"); FeatureBuilder builder = builderFactory.newFeatureBuilder(ID.fromMavenID(id)); builder.setName(json.getString("title", null)); builder.s... |
@Test public void testMergeFeatures() throws IOException { BuilderFactory bf = Features.getBuilderFactory(); URL res1 = getClass().getResource("/features/test-feature.json"); Feature f1; try (Reader r = new InputStreamReader(res1.openStream())) { f1 = Features.readFeature(r); } URL res2 = getClass().getResource("/featu... | public Feature mergeFeatures(ID targetID, Feature f1, Feature f2, MergeContext ctx) { FeatureBuilder fb = builderFactory.newFeatureBuilder(targetID); copyAttrs(f1, fb); copyAttrs(f2, fb); fb.addBundles(mergeBundles(f1, f2, ctx)); fb.addConfigurations(mergeConfigs(f1, f2, ctx)); fb.addExtensions(mergeExtensions(f1, f2, ... | FeatureServiceImpl { public Feature mergeFeatures(ID targetID, Feature f1, Feature f2, MergeContext ctx) { FeatureBuilder fb = builderFactory.newFeatureBuilder(targetID); copyAttrs(f1, fb); copyAttrs(f2, fb); fb.addBundles(mergeBundles(f1, f2, ctx)); fb.addConfigurations(mergeConfigs(f1, f2, ctx)); fb.addExtensions(mer... | FeatureServiceImpl { public Feature mergeFeatures(ID targetID, Feature f1, Feature f2, MergeContext ctx) { FeatureBuilder fb = builderFactory.newFeatureBuilder(targetID); copyAttrs(f1, fb); copyAttrs(f2, fb); fb.addBundles(mergeBundles(f1, f2, ctx)); fb.addConfigurations(mergeConfigs(f1, f2, ctx)); fb.addExtensions(mer... | FeatureServiceImpl { public Feature mergeFeatures(ID targetID, Feature f1, Feature f2, MergeContext ctx) { FeatureBuilder fb = builderFactory.newFeatureBuilder(targetID); copyAttrs(f1, fb); copyAttrs(f2, fb); fb.addBundles(mergeBundles(f1, f2, ctx)); fb.addConfigurations(mergeConfigs(f1, f2, ctx)); fb.addExtensions(mer... | FeatureServiceImpl { public Feature mergeFeatures(ID targetID, Feature f1, Feature f2, MergeContext ctx) { FeatureBuilder fb = builderFactory.newFeatureBuilder(targetID); copyAttrs(f1, fb); copyAttrs(f2, fb); fb.addBundles(mergeBundles(f1, f2, ctx)); fb.addConfigurations(mergeConfigs(f1, f2, ctx)); fb.addExtensions(mer... |
@Test public void testMergeExtensions() throws IOException { BuilderFactory bf = Features.getBuilderFactory(); URL res1 = getClass().getResource("/features/test-exfeat1.json"); Feature f1; try (Reader r = new InputStreamReader(res1.openStream())) { f1 = Features.readFeature(r); } URL res2 = getClass().getResource("/fea... | private FeatureExtension[] mergeExtensions(Feature f1, Feature f2, MergeContext ctx) { Map<String,FeatureExtension> extensions = new HashMap<>(f1.getExtensions()); Map<String,FeatureExtension> addExtensions = new HashMap<>(); for (Map.Entry<String,FeatureExtension> exEntry : f2.getExtensions().entrySet()) { String key ... | FeatureServiceImpl { private FeatureExtension[] mergeExtensions(Feature f1, Feature f2, MergeContext ctx) { Map<String,FeatureExtension> extensions = new HashMap<>(f1.getExtensions()); Map<String,FeatureExtension> addExtensions = new HashMap<>(); for (Map.Entry<String,FeatureExtension> exEntry : f2.getExtensions().entr... | FeatureServiceImpl { private FeatureExtension[] mergeExtensions(Feature f1, Feature f2, MergeContext ctx) { Map<String,FeatureExtension> extensions = new HashMap<>(f1.getExtensions()); Map<String,FeatureExtension> addExtensions = new HashMap<>(); for (Map.Entry<String,FeatureExtension> exEntry : f2.getExtensions().entr... | FeatureServiceImpl { private FeatureExtension[] mergeExtensions(Feature f1, Feature f2, MergeContext ctx) { Map<String,FeatureExtension> extensions = new HashMap<>(f1.getExtensions()); Map<String,FeatureExtension> addExtensions = new HashMap<>(); for (Map.Entry<String,FeatureExtension> exEntry : f2.getExtensions().entr... | FeatureServiceImpl { private FeatureExtension[] mergeExtensions(Feature f1, Feature f2, MergeContext ctx) { Map<String,FeatureExtension> extensions = new HashMap<>(f1.getExtensions()); Map<String,FeatureExtension> addExtensions = new HashMap<>(); for (Map.Entry<String,FeatureExtension> exEntry : f2.getExtensions().entr... |
@Test public void loadSingleResourceFromRoot() { Resource resource = context.resourceResolver().getResource("/md-test"); assertThat("resource", resource, notNullValue()); assertThat("resource.getValueMap()", resource.getValueMap(), notNullValue()); assertThat("resource.getMetadata()", resource.getResourceMetadata(), no... | @Override public Resource getResource(ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) { Path filePath = Paths.get(fsPath, path, INDEX_FILE_NAME); File backingFile = filePath.toFile(); if ( !backingFile.canRead() ) { filePath = Paths.get(fsPath, path + MARKDOWN_EXTENSION); back... | MarkdownResourceProvider extends ResourceProvider<Object> { @Override public Resource getResource(ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) { Path filePath = Paths.get(fsPath, path, INDEX_FILE_NAME); File backingFile = filePath.toFile(); if ( !backingFile.canRead() ) { f... | MarkdownResourceProvider extends ResourceProvider<Object> { @Override public Resource getResource(ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) { Path filePath = Paths.get(fsPath, path, INDEX_FILE_NAME); File backingFile = filePath.toFile(); if ( !backingFile.canRead() ) { f... | MarkdownResourceProvider extends ResourceProvider<Object> { @Override public Resource getResource(ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) { Path filePath = Paths.get(fsPath, path, INDEX_FILE_NAME); File backingFile = filePath.toFile(); if ( !backingFile.canRead() ) { f... | MarkdownResourceProvider extends ResourceProvider<Object> { @Override public Resource getResource(ResolveContext<Object> ctx, String path, ResourceContext resourceContext, Resource parent) { Path filePath = Paths.get(fsPath, path, INDEX_FILE_NAME); File backingFile = filePath.toFile(); if ( !backingFile.canRead() ) { f... |
@Test public void listChildren() { Resource resource = context.resourceResolver().getResource("/md-test/child-listing"); List<Resource> children = new ArrayList<>(); resource.getChildren().forEach( children::add ); assertThat("children", children, hasSize(3)); assertThat("children.paths", children.stream().map( r -> r.... | @Override public Iterator<Resource> listChildren(ResolveContext<Object> ctx, Resource parent) { Path root = Paths.get(fsPath, parent.getPath()); try { return Files.list(root) .map( p -> asResource(p, Paths.get(parent.getPath()), ctx)) .filter( r -> r != null ) .collect(Collectors.toList()) .iterator(); } catch (IOExcep... | MarkdownResourceProvider extends ResourceProvider<Object> { @Override public Iterator<Resource> listChildren(ResolveContext<Object> ctx, Resource parent) { Path root = Paths.get(fsPath, parent.getPath()); try { return Files.list(root) .map( p -> asResource(p, Paths.get(parent.getPath()), ctx)) .filter( r -> r != null )... | MarkdownResourceProvider extends ResourceProvider<Object> { @Override public Iterator<Resource> listChildren(ResolveContext<Object> ctx, Resource parent) { Path root = Paths.get(fsPath, parent.getPath()); try { return Files.list(root) .map( p -> asResource(p, Paths.get(parent.getPath()), ctx)) .filter( r -> r != null )... | MarkdownResourceProvider extends ResourceProvider<Object> { @Override public Iterator<Resource> listChildren(ResolveContext<Object> ctx, Resource parent) { Path root = Paths.get(fsPath, parent.getPath()); try { return Files.list(root) .map( p -> asResource(p, Paths.get(parent.getPath()), ctx)) .filter( r -> r != null )... | MarkdownResourceProvider extends ResourceProvider<Object> { @Override public Iterator<Resource> listChildren(ResolveContext<Object> ctx, Resource parent) { Path root = Paths.get(fsPath, parent.getPath()); try { return Files.list(root) .map( p -> asResource(p, Paths.get(parent.getPath()), ctx)) .filter( r -> r != null )... |
@Test public void testNull() throws Exception { registerOakDescriptorSource(); assertNotNull(source.getCapabilities()); assertNull(source.getCapabilities().get("foo")); } | @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } @Override Map<String, Object> getCapab... | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } @Override Map<String, Object> getCapab... |
@Test public void testDefaultJcrDescriptors_listed() throws Exception { registerOakDescriptorSource(Repository.REP_NAME_DESC, Repository.REP_VENDOR_DESC); assertNotNull(source.getCapabilities()); assertEquals("Apache Jackrabbit Oak", source.getCapabilities().get(Repository.REP_NAME_DESC)); assertEquals("The Apache Soft... | @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } @Override Map<String, Object> getCapab... | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } @Override Map<String, Object> getCapab... |
@Test public void testDefaultJcrDescriptors_filtered() throws Exception { registerOakDescriptorSource(Repository.REP_NAME_DESC); assertNotNull(source.getCapabilities()); assertEquals("Apache Jackrabbit Oak", source.getCapabilities().get(Repository.REP_NAME_DESC)); assertNull(source.getCapabilities().get(Repository.REP_... | @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } } | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } @Override Map<String, Object> getCapab... | OakDescriptorSource implements CapabilitiesSource { @Override public Map<String, Object> getCapabilities() throws Exception { final SlingRepository localRepo = repository; if (localRepo == null) { return Collections.emptyMap(); } refreshCachedValues(); return cachedReadOnlyMap; } @Override Map<String, Object> getCapab... |
@SuppressWarnings("ConstantConditions") @Test public void instantiate() { TestClass testClass = ReflectionHelper.instantiate(TestClass.class); Assert.assertEquals(0, testClass.getA()); Assert.assertEquals("", testClass.getS()); Assert.assertEquals(1, ReflectionHelper.instantiate(TestClass.class, 1).getA()); Assert.asse... | static <T> T instantiate(Class<T> type, Object... args) { try { if (args.length == 0) { return type.getDeclaredConstructor().newInstance(); } else { Class<?>[] classes = toClasses(args); return type.getDeclaredConstructor(classes).newInstance(args); } } catch (InstantiationException | IllegalAccessException | NoSuchMet... | ReflectionHelper { static <T> T instantiate(Class<T> type, Object... args) { try { if (args.length == 0) { return type.getDeclaredConstructor().newInstance(); } else { Class<?>[] classes = toClasses(args); return type.getDeclaredConstructor(classes).newInstance(args); } } catch (InstantiationException | IllegalAccessEx... | ReflectionHelper { static <T> T instantiate(Class<T> type, Object... args) { try { if (args.length == 0) { return type.getDeclaredConstructor().newInstance(); } else { Class<?>[] classes = toClasses(args); return type.getDeclaredConstructor(classes).newInstance(args); } } catch (InstantiationException | IllegalAccessEx... | ReflectionHelper { static <T> T instantiate(Class<T> type, Object... args) { try { if (args.length == 0) { return type.getDeclaredConstructor().newInstance(); } else { Class<?>[] classes = toClasses(args); return type.getDeclaredConstructor(classes).newInstance(args); } } catch (InstantiationException | IllegalAccessEx... | ReflectionHelper { static <T> T instantiate(Class<T> type, Object... args) { try { if (args.length == 0) { return type.getDeclaredConstructor().newInstance(); } else { Class<?>[] classes = toClasses(args); return type.getDeclaredConstructor(classes).newInstance(args); } } catch (InstantiationException | IllegalAccessEx... |
@Test public void testRead() { GlusterOpenOption openOption = GlusterOpenOption.READ(); openOption.append().create().createNew().dsync().sync().truncate(); assertEquals(rd | all, openOption.getValue()); } | public static GlusterOpenOption READ() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_RDONLY; o.options.add("read"); return o; } | GlusterOpenOption { public static GlusterOpenOption READ() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_RDONLY; o.options.add("read"); return o; } } | GlusterOpenOption { public static GlusterOpenOption READ() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_RDONLY; o.options.add("read"); return o; } } | GlusterOpenOption { public static GlusterOpenOption READ() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_RDONLY; o.options.add("read"); return o; } static GlusterOpenOption READ(); static GlusterOpenOption WRITE(); static GlusterOpenOption READWRITE(); GlusterOpenOption create(); GlusterOpenOption creat... | GlusterOpenOption { public static GlusterOpenOption READ() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_RDONLY; o.options.add("read"); return o; } static GlusterOpenOption READ(); static GlusterOpenOption WRITE(); static GlusterOpenOption READWRITE(); GlusterOpenOption create(); GlusterOpenOption creat... |
@Test(dependsOnMethods = "testCreate") public void testSymlink() { int sym = glfs_symlink(vol, SYMLINK_TARGET, SYMLINK); System.out.println("SYMLINK create: " + sym); assertEquals(0, sym); } | @JniMethod public static final native int glfs_symlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String oldpath, @JniArg(cast = "const char *") String newpath ); | GLFS { @JniMethod public static final native int glfs_symlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String oldpath, @JniArg(cast = "const char *") String newpath ); } | GLFS { @JniMethod public static final native int glfs_symlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String oldpath, @JniArg(cast = "const char *") String newpath ); } | GLFS { @JniMethod public static final native int glfs_symlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String oldpath, @JniArg(cast = "const char *") String newpath ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
... | GLFS { @JniMethod public static final native int glfs_symlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String oldpath, @JniArg(cast = "const char *") String newpath ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
... |
@Test(dependsOnMethods = "testSymlink") public void testReadlink() { int length = SYMLINK_TARGET.length(); byte[] content = new byte[length]; long read = glfs_readlink(vol, SYMLINK, content, length); String readValue = new String(content); System.out.println("SYMLINK val: " + readValue); System.out.println("SYMLINK len... | @JniMethod public static final native int glfs_readlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(cast = "char *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long bufsiz ); | GLFS { @JniMethod public static final native int glfs_readlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(cast = "char *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long bufsiz ); } | GLFS { @JniMethod public static final native int glfs_readlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(cast = "char *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long bufsiz ); } | GLFS { @JniMethod public static final native int glfs_readlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(cast = "char *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long bufsiz ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniA... | GLFS { @JniMethod public static final native int glfs_readlink ( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(cast = "char *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long bufsiz ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniA... |
@Test(dependsOnMethods = "testReadlink") public void testWriteNew() { int length = HELLO_.length(); int write = glfs_write(file, HELLO_.getBytes(), length, 0); System.out.println("WRITE: " + write); assertEquals(length, write); } | @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); | GLFS { @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); } | GLFS { @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); } | GLFS { @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMetho... | GLFS { @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMetho... |
@Test(dependsOnMethods = "testWriteNew") public void testClose_new() { int close = glfs_close(file); System.out.println("CLOSE: " + close); assertEquals(0, close); } | @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); | GLFS { @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); } | GLFS { @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); } | GLFS { @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int glfs_set_volfile_server(
@JniArg(cast = "g... | GLFS { @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int glfs_set_volfile_server(
@JniArg(cast = "g... |
@Test(dependsOnMethods = "testClose_new") public void testOpen_existing() { int flags = GlusterOpenOption.READWRITE().append().getValue(); System.out.println("OPENEx flags: " + Integer.toOctalString(flags)); file = glfs_open(vol, FILE_PATH, flags); System.out.println("OPENEx: " + file); assertTrue(0 < file); } | @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_open( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char*") String path, int flags); | GLFS { @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_open( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char*") String path, int flags); } | GLFS { @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_open( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char*") String path, int flags); } | GLFS { @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_open( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char*") String path, int flags); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod stati... | GLFS { @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_open( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char*") String path, int flags); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod stati... |
@Test(dependsOnMethods = "testOpen_existing") public void testWrite_existing() { int length = WORLD.length(); int write = glfs_write(file, WORLD.getBytes(), length, 0); System.out.println("WRITEEx: " + write); assertEquals(length, write); } | @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); | GLFS { @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); } | GLFS { @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); } | GLFS { @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMetho... | GLFS { @JniMethod public static final native int glfs_write( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "const char*", flags = NO_OUT) byte[] buf, int count, int flags); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMetho... |
@Test(dependsOnMethods = "testWrite_existing") public void testSeek() { int seek = glfs_lseek(file, 0, 0); System.out.println("SEEK: " + seek); assertEquals(0, seek); } | @JniMethod(cast = "off_t") public static final native int glfs_lseek( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "off_t") long offset, int whence ); | GLFS { @JniMethod(cast = "off_t") public static final native int glfs_lseek( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "off_t") long offset, int whence ); } | GLFS { @JniMethod(cast = "off_t") public static final native int glfs_lseek( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "off_t") long offset, int whence ); } | GLFS { @JniMethod(cast = "off_t") public static final native int glfs_lseek( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "off_t") long offset, int whence ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final... | GLFS { @JniMethod(cast = "off_t") public static final native int glfs_lseek( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "off_t") long offset, int whence ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final... |
@Test(dependsOnMethods = "testSeek") public void testRead() { String helloWorld = HELLO_ + WORLD; int length = helloWorld.length(); byte[] content = new byte[length]; long read = glfs_read(file, content, length, 0); String readValue = new String(content); System.out.println("READ val: " + readValue); System.out.println... | @JniMethod(cast = "ssize_t") public static final native long glfs_read( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "void *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long count, int flags ); | GLFS { @JniMethod(cast = "ssize_t") public static final native long glfs_read( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "void *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long count, int flags ); } | GLFS { @JniMethod(cast = "ssize_t") public static final native long glfs_read( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "void *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long count, int flags ); } | GLFS { @JniMethod(cast = "ssize_t") public static final native long glfs_read( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "void *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long count, int flags ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const ... | GLFS { @JniMethod(cast = "ssize_t") public static final native long glfs_read( @JniArg(cast = "glfs_fd_t *") long fd, @JniArg(cast = "void *", flags = NO_IN) byte[] buf, @JniArg(cast = "size_t") long count, int flags ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const ... |
@Test(dependsOnMethods = "testChmod") public void testFromGlfd() { long glfs = glfs_from_glfd(file); System.out.println("GLFS_GLFD: " + glfs); assertEquals(vol, glfs); } | @JniMethod(cast = "glfs_t *") public static final native long glfs_from_glfd( @JniArg(cast = "glfs_fd_t *") long fd); | GLFS { @JniMethod(cast = "glfs_t *") public static final native long glfs_from_glfd( @JniArg(cast = "glfs_fd_t *") long fd); } | GLFS { @JniMethod(cast = "glfs_t *") public static final native long glfs_from_glfd( @JniArg(cast = "glfs_fd_t *") long fd); } | GLFS { @JniMethod(cast = "glfs_t *") public static final native long glfs_from_glfd( @JniArg(cast = "glfs_fd_t *") long fd); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int glfs_set_volfile_server(
... | GLFS { @JniMethod(cast = "glfs_t *") public static final native long glfs_from_glfd( @JniArg(cast = "glfs_fd_t *") long fd); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int glfs_set_volfile_server(
... |
@Test(dependsOnMethods = "testFromGlfd") public void testStatvfs() { statvfs buf = new statvfs(); int statvfs = glfs_statvfs(vol, "/", buf); System.out.println("STATVFS: " + statvfs); System.out.println(buf.toString()); assertEquals(0, statvfs); assertEquals(4096, buf.f_bsize); } | @JniMethod public static final native int glfs_statvfs( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(flags = NO_IN) statvfs buf); | GLFS { @JniMethod public static final native int glfs_statvfs( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(flags = NO_IN) statvfs buf); } | GLFS { @JniMethod public static final native int glfs_statvfs( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(flags = NO_IN) statvfs buf); } | GLFS { @JniMethod public static final native int glfs_statvfs( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(flags = NO_IN) statvfs buf); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod... | GLFS { @JniMethod public static final native int glfs_statvfs( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, @JniArg(flags = NO_IN) statvfs buf); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod... |
@Test public void testWrite() { GlusterOpenOption openOption = GlusterOpenOption.WRITE(); openOption.append().create().createNew().dsync().sync().truncate(); assertEquals(wr | all, openOption.getValue()); } | public static GlusterOpenOption WRITE() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_WRONLY; o.options.add("write"); return o; } | GlusterOpenOption { public static GlusterOpenOption WRITE() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_WRONLY; o.options.add("write"); return o; } } | GlusterOpenOption { public static GlusterOpenOption WRITE() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_WRONLY; o.options.add("write"); return o; } } | GlusterOpenOption { public static GlusterOpenOption WRITE() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_WRONLY; o.options.add("write"); return o; } static GlusterOpenOption READ(); static GlusterOpenOption WRITE(); static GlusterOpenOption READWRITE(); GlusterOpenOption create(); GlusterOpenOption cre... | GlusterOpenOption { public static GlusterOpenOption WRITE() { GlusterOpenOption o = new GlusterOpenOption(); o.value = O_WRONLY; o.options.add("write"); return o; } static GlusterOpenOption READ(); static GlusterOpenOption WRITE(); static GlusterOpenOption READWRITE(); GlusterOpenOption create(); GlusterOpenOption cre... |
@Test(dependsOnMethods = "testStatvfs") public void testFsync() { int fsync = glfs_fsync(file); System.out.println("FSYNC: " + fsync); assertEquals(0, fsync); } | @JniMethod public static final native int glfs_fsync( @JniArg(cast = "glfs_fd_t *") long fd); | GLFS { @JniMethod public static final native int glfs_fsync( @JniArg(cast = "glfs_fd_t *") long fd); } | GLFS { @JniMethod public static final native int glfs_fsync( @JniArg(cast = "glfs_fd_t *") long fd); } | GLFS { @JniMethod public static final native int glfs_fsync( @JniArg(cast = "glfs_fd_t *") long fd); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int glfs_set_volfile_server(
@JniArg(cast = "g... | GLFS { @JniMethod public static final native int glfs_fsync( @JniArg(cast = "glfs_fd_t *") long fd); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int glfs_set_volfile_server(
@JniArg(cast = "g... |
@Test(dependsOnMethods = "testFsync") public void testClose() { int close = glfs_close(file); System.out.println("CLOSE: " + close); assertEquals(0, close); } | @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); | GLFS { @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); } | GLFS { @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); } | GLFS { @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int glfs_set_volfile_server(
@JniArg(cast = "g... | GLFS { @JniMethod public static final native int glfs_close( @JniArg(cast = "glfs_fd_t *") long fd); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int glfs_set_volfile_server(
@JniArg(cast = "g... |
@Test(dependsOnMethods = "testClose") public void testAccess() { int acc = glfs_access(vol, FILE_PATH, 0777); System.out.println("ACCESS 777: " + acc); int errno = UtilJNI.errno(); System.out.println("ERRNO: " + errno); String strerror = UtilJNI.strerror(); System.out.println("STRERROR: " + strerror); assertEquals(-1, ... | @JniMethod public static final native int glfs_access( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, int mode ); | GLFS { @JniMethod public static final native int glfs_access( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, int mode ); } | GLFS { @JniMethod public static final native int glfs_access( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, int mode ); } | GLFS { @JniMethod public static final native int glfs_access( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, int mode ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int g... | GLFS { @JniMethod public static final native int glfs_access( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path, int mode ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static final native int g... |
@Test(dependsOnMethods = "testAccess") public void testOpendir() { dir = glfs_opendir(vol, "/"); System.out.println("OPENDIR: " + dir); assertTrue(dir > 0); } | @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_opendir( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path ); | GLFS { @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_opendir( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path ); } | GLFS { @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_opendir( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path ); } | GLFS { @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_opendir( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static fina... | GLFS { @JniMethod(cast = "glfs_fd_t *") public static final native long glfs_opendir( @JniArg(cast = "glfs_t *") long fs, @JniArg(cast = "const char *") String path ); @JniMethod(cast = "glfs_t *") static final native long glfs_new(
@JniArg(cast = "const char*") String volname
); @JniMethod static fina... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.