Skip to content

Instantly share code, notes, and snippets.

@rodrigojv
Last active November 21, 2016 15:39
Show Gist options
  • Select an option

  • Save rodrigojv/72483e1a74591b44b713e8793536ee2a to your computer and use it in GitHub Desktop.

Select an option

Save rodrigojv/72483e1a74591b44b713e8793536ee2a to your computer and use it in GitHub Desktop.
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());
}
}
public class HolaMundo {
public static void main(String[] args) {
System.out.println("Hola, Mundo");
}
}
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>
public class Saludo {
public static void main(String[] args) {
System.out.println("Hola, " + args[0]);
}
}
# 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