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 fr.barreverte.time; | |
import java.util.Date; | |
import org.junit.rules.ExternalResource; | |
static import fr.barreverte.BarreVerteDateUtils.*; | |
public class BarreVerteTimeRule extends ExternalResource { | |
public final String dateDeMaintenant; | |
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
@Before public void setup() { | |
BarreVerteTime.setMockTime(true); | |
BarreVerteTime.getInstance().setMockDate("2010-01-10 10:00:00"); | |
} | |
@After public void teardown() { | |
BarreVerteTime.setMockTime(false); | |
} | |
@Test public void unPremierTest() { /* ... */ } | |
@Test public void unDeuxiemeTest() { /* ... */ } |
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 MonObjet { | |
private int monAttributEntier = 3; | |
private String monAttributString = "attribut"; | |
public static void main(String[] args) { | |
System.out.println(new XStream().toXML(new MonObjet())); | |
} | |
} |
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
sudo update-alternatives --verbose --install /usr/bin/java java /opt/j2sdk1.4.2_18/bin/java 500 --slave /usr/share/man/man1/java.1 java.1 /opt/j2sdk1.4.2_18/man/man1/java.1 `for prog in *; do echo --slave /usr/bin/$prog $prog /opt/j2sdk1.4.2_18/bin/$prog; done | grep -v "java " | xargs` |
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
int h1 = "0-42L".hashCode(); | |
int h2 = "0-43-".hashCode(); | |
System.out.println("h1 = " + h1); | |
System.out.println("h2 = " + h2); | |
/* | |
results : | |
h1 = 45721201 | |
h2 = 45721201 | |
*/ |
NewerOlder