Last active
November 21, 2016 15:39
-
-
Save rodrigojv/72483e1a74591b44b713e8793536ee2a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| package py.com.sodep; | |
| import junit.framework.Assert; | |
| import org.junit.Before; | |
| import org.junit.Test; | |
| public class BankAccountTest { | |
| @Test | |
| public void testDebitWithEnoughBalance() { | |
| BankAccount account = new BankAccount(10.0); | |
| double amount = account.debit(5.0); | |
| Assert.assertEquals(5.0, account.getBalance()); | |
| } | |
| @Test | |
| public void testDebitWithNotEnoughBalance() { | |
| BankAccount account = new BankAccount(10.0); | |
| double amount = account.debit(15.0); | |
| Assert.assertEquals(10.0, account.getBalance()); | |
| } | |
| } |
This file contains hidden or 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 HolaMundo { | |
| public static void main(String[] args) { | |
| System.out.println("Hola, Mundo"); | |
| } | |
| } |
This file contains hidden or 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
| project> | |
| <modelVersion>4.0.0</modelVersion> | |
| <groupId>py.com.sodep</groupId> | |
| <artifactId>jenkins-test</artifactId> | |
| <packaging>jar</packaging> | |
| <version>1.0-SNAPSHOT</version> | |
| <properties> | |
| <maven.compiler.source>8</maven.compiler.source> | |
| <maven.compiler.target>8</maven.compiler.target> | |
| </properties> | |
| <dependencies> | |
| <dependency> | |
| <groupId>junit</groupId> | |
| <artifactId>junit</artifactId> | |
| <version>4.11</version> | |
| </dependency> | |
| </dependencies> | |
| </project> |
This file contains hidden or 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 Saludo { | |
| public static void main(String[] args) { | |
| System.out.println("Hola, " + args[0]); | |
| } | |
| } |
This file contains hidden or 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
| # Compila clase con estructura de paquetes en el directorio actual | |
| javac -d . Application.java | |
| # Ejecuta la clase compilada | |
| java py.com.sodep.Application | |
| sudo chown -R jenkins:jenkins carpetaCreadaAnteriormente |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment