This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Deque<T> { | |
private Element front, rear; | |
public Deque() { | |
setFrontPointerTo(null); | |
setRearPointerTo(null); | |
} | |
public void unshift(T data) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static org.hamcrest.CoreMatchers.is; | |
import static org.hamcrest.CoreMatchers.nullValue; | |
import static org.junit.Assert.assertThat; | |
import org.junit.Test; | |
public class DequeTest { | |
@Test | |
public void should_return_null_on_empty_deque() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Boolean canShip(int postalCode) { | |
//postalCodeDao operates on database to get list of postal codes | |
//there is a caching solution applied so that list is stored in memory | |
// and fetched only when database change | |
List<Integer> allPostalCodes = postalCodeDao.getAllPostalCodes(); | |
return allPostalCodes.contains(postalCode); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
driver.findElement(By.id("login_field")).sendKeys("text"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loginField.sendKeys("text"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@FindBy(id="login_field") | |
WebElement loginField; | |
@FindBy(name="password") | |
WebElement passwordField; | |
@FindBy(className="error_box") | |
WebElement errorBox; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GitHubLoginPage page = PageFactory.initElements(driver, GitHubLoginPage.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GitHubLoginPage extends GitHubPage { | |
@FindBy(id = "login_field") | |
WebElement loginField; | |
@FindBy(name = "password") | |
WebElement passwordField; | |
@FindBy(name = "commit") | |
WebElement commitButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void shouldNotLoginWithWrongCredentials() { | |
//given | |
GitHubLoginPage loginPage = new GitHubHomePage().open().goToLoginPage(); | |
//when | |
loginPage.login("user", "wrong_password"); | |
//then | |
assertThat(loginPage.isLoginError()).isTrue(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Script for deploying current branch to heroku app given as parameter | |
die () { | |
echo >&1 "$@" | |
echo usage $0 app-name | |
echo example: $0 dev-ml | |
exit 1 | |
} |
OlderNewer