1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.kuali.common.jute.project;
17
18 import static com.google.common.base.Stopwatch.createStarted;
19 import static com.google.inject.Guice.createInjector;
20
21 import java.util.Date;
22
23 import org.junit.Test;
24 import org.kuali.common.jute.base.BaseUnitTest;
25 import org.kuali.common.jute.env.EnvModule;
26 import org.kuali.common.jute.json.jackson.JacksonModule;
27 import org.kuali.common.jute.project.maven.KualiJuteModule;
28 import org.kuali.common.jute.project.maven.ProjectMetadata;
29 import org.kuali.common.jute.project.maven.annotation.KualiJuteProjectMetadata;
30 import org.kuali.common.jute.system.SystemModule;
31
32 import com.google.common.base.Stopwatch;
33 import com.google.inject.Injector;
34 import com.google.inject.Key;
35
36 public class KualiJuteModuleTest extends BaseUnitTest {
37
38 @Test
39 public void test() {
40 try {
41 Stopwatch sw = createStarted();
42 Injector injector = createInjector(new SystemModule(), new EnvModule(), new JacksonModule(), new KualiJuteModule());
43 Key<ProjectMetadata> key = Key.get(ProjectMetadata.class, KualiJuteProjectMetadata.class);
44 ProjectMetadata metadata = injector.getInstance(key);
45 info("user -> %s", metadata.getBuild().getUser());
46 info("date -> %s", new Date(metadata.getBuild().getTimestamp()));
47 elapsed(sw);
48 } catch (Throwable e) {
49 e.printStackTrace();
50 }
51 }
52
53 }