1 package com.atlassian.plugin.loaders.classloading;
2
3 import junit.framework.TestCase;
4
5 import java.io.File;
6 import java.io.IOException;
7
8 public class TestDeploymentUnit extends TestCase
9 {
10 public void testCompareTo() throws IOException
11 {
12 File tmp = File.createTempFile("testDeploymentUnit", ".txt");
13 DeploymentUnit unit1 = new DeploymentUnit(tmp);
14 DeploymentUnit unit2 = new DeploymentUnit(tmp);
15 assertEquals(0, unit1.compareTo(unit2));
16
17
18 tmp.setLastModified(System.currentTimeMillis() + 1000);
19 unit2 = new DeploymentUnit(tmp);
20 assertEquals(-1, unit1.compareTo(unit2));
21
22 }
23 }