summaryrefslogtreecommitdiffstats
path: root/container-di
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2018-03-02 15:34:39 +0100
committerJon Bratseth <bratseth@oath.com>2018-03-02 15:34:39 +0100
commit3844b4dbcc5e03489e82924ac2e1707897f9e43e (patch)
treefa450261161697fc44cd89b68ef97ed1afa5e575 /container-di
parent8ec5743e254b039fe860339fdc4b5ab4aa1f0364 (diff)
Remove junit.fdramework usage
Diffstat (limited to 'container-di')
-rw-r--r--container-di/src/test/java/com/yahoo/component/ComponentSpecTestCase.java14
-rw-r--r--container-di/src/test/java/com/yahoo/component/test/ComponentIdTestCase.java8
2 files changed, 17 insertions, 5 deletions
diff --git a/container-di/src/test/java/com/yahoo/component/ComponentSpecTestCase.java b/container-di/src/test/java/com/yahoo/component/ComponentSpecTestCase.java
index b22f5d60466..6fe58e99fda 100644
--- a/container-di/src/test/java/com/yahoo/component/ComponentSpecTestCase.java
+++ b/container-di/src/test/java/com/yahoo/component/ComponentSpecTestCase.java
@@ -1,13 +1,18 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.component;
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
/**
- * @author <a href="mailto:arnebef@yahoo-inc.com">Arne Bergene Fossaa</a>
+ * @author Arne Bergene Fossaa
*/
-public class ComponentSpecTestCase extends TestCase {
+public class ComponentSpecTestCase {
+ @Test
public void testMatches() {
ComponentId a = new ComponentId("test:1");
ComponentId b = new ComponentId("test:1.1.1");
@@ -46,6 +51,7 @@ public class ComponentSpecTestCase extends TestCase {
}
+ @Test
public void testMatchesWithNamespace() {
ComponentId namespace = new ComponentId("namespace:2");
@@ -61,6 +67,7 @@ public class ComponentSpecTestCase extends TestCase {
assertFalse(spec.matches(c));
}
+ @Test
public void testStringValue() {
assertStringValueEqualsInputSpec("a:1.0.0.alpha@namespace");
assertStringValueEqualsInputSpec("a:1.0.0.alpha");
@@ -72,4 +79,5 @@ public class ComponentSpecTestCase extends TestCase {
assertEquals(componentSpec,
new ComponentSpecification(componentSpec).stringValue());
}
+
}
diff --git a/container-di/src/test/java/com/yahoo/component/test/ComponentIdTestCase.java b/container-di/src/test/java/com/yahoo/component/test/ComponentIdTestCase.java
index 2d689d6e810..0842ee4a797 100644
--- a/container-di/src/test/java/com/yahoo/component/test/ComponentIdTestCase.java
+++ b/container-di/src/test/java/com/yahoo/component/test/ComponentIdTestCase.java
@@ -2,13 +2,16 @@
package com.yahoo.component.test;
import com.yahoo.component.ComponentId;
-import junit.framework.TestCase;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
/**
* @author bratseth
*/
-public class ComponentIdTestCase extends TestCase {
+public class ComponentIdTestCase {
+ @Test
public void testFileNameConversion() {
assertFileNameEquals("a","a");
assertFileNameEquals("a-1","a-1");
@@ -28,6 +31,7 @@ public class ComponentIdTestCase extends TestCase {
expected,ComponentId.fromFileName(initial).toFileName());
}
+ @Test
public void testCompareWithNameSpace() {
ComponentId withNS = ComponentId.fromString("foo@ns");
ComponentId withoutNS = ComponentId.fromString("foo"); // Should be less than withNs