Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

extract utility functions to separate classes

  • Loading branch information...
commit 748499a244a3acb2b58fb61fc2061add6c868c03 1 parent 286fdeb
Sebastian Herold heroldus authored
12 nexus-yum-testsuite/src/test/java/org/sonatype/nexus/plugins/yum/NameUtil.java
... ... @@ -0,0 +1,12 @@
  1 +package org.sonatype.nexus.plugins.yum;
  2 +
  3 +import java.text.SimpleDateFormat;
  4 +import java.util.Date;
  5 +
  6 +public class NameUtil
  7 +{
  8 + public static String uniqueName()
  9 + {
  10 + return "repo_" + new SimpleDateFormat( "yyyyMMdd_HHmmss_SSS" ).format( new Date() );
  11 + }
  12 +}
12 nexus-yum-testsuite/src/test/java/org/sonatype/nexus/plugins/yum/TimeUtil.java
... ... @@ -0,0 +1,12 @@
  1 +package org.sonatype.nexus.plugins.yum;
  2 +
  3 +import java.util.concurrent.TimeUnit;
  4 +
  5 +public final class TimeUtil
  6 +{
  7 + public static void sleep( int timeout, TimeUnit unit )
  8 + throws InterruptedException
  9 + {
  10 + Thread.sleep( unit.toMillis( timeout ) );
  11 + }
  12 +}
10 nexus-yum-testsuite/src/test/java/org/sonatype/nexus/plugins/yum/plugin/AbstractIntegrationTestCase.java
@@ -15,9 +15,6 @@
15 15 import java.io.File;
16 16 import java.net.URISyntaxException;
17 17 import java.net.URL;
18   -import java.text.SimpleDateFormat;
19   -import java.util.Date;
20   -import java.util.concurrent.TimeUnit;
21 18
22 19 import org.sonatype.nexus.bundle.launcher.NexusBundleConfiguration;
23 20 import org.sonatype.nexus.plugins.yum.plugin.client.subsystem.YumClient;
@@ -55,11 +52,4 @@ private File getPluginFile() {
55 52 }
56 53 }
57 54
58   - protected void wait(int timeout, TimeUnit unit) throws InterruptedException {
59   - Thread.sleep(unit.toMillis(timeout));
60   - }
61   -
62   - protected String uniqueName() {
63   - return "repo_" + new SimpleDateFormat("yyyyMMdd_HHmmss_SSS").format(new Date());
64   - }
65 55 }
1  nexus-yum-testsuite/src/test/java/org/sonatype/nexus/plugins/yum/plugin/GroupRepositoryIT.java
@@ -14,6 +14,7 @@
14 14
15 15 import static org.hamcrest.Matchers.is;
16 16 import static org.junit.Assert.assertThat;
  17 +import static org.sonatype.nexus.plugins.yum.NameUtil.uniqueName;
17 18
18 19 import org.junit.Test;
19 20 import org.sonatype.nexus.client.core.subsystem.repository.GroupRepository;
1  nexus-yum-testsuite/src/test/java/org/sonatype/nexus/plugins/yum/plugin/SecurityIT.java
@@ -14,6 +14,7 @@
14 14
15 15 import static org.hamcrest.Matchers.is;
16 16 import static org.junit.Assert.assertThat;
  17 +import static org.sonatype.nexus.plugins.yum.NameUtil.uniqueName;
17 18
18 19 import org.junit.Test;
19 20 import org.sonatype.nexus.client.core.subsystem.security.Users;

0 comments on commit 748499a

Please sign in to comment.
Something went wrong with that request. Please try again.