Skip to content

Commit

Permalink
Add @test annotations, rename test classes
Browse files Browse the repository at this point in the history
Change-Id: Iac29db81c0c7ff425da73e7ae3d69eadabf5de77
  • Loading branch information
Teemu Suo-Anttila committed Mar 17, 2016
1 parent cf7de40 commit 11a2b52
Show file tree
Hide file tree
Showing 140 changed files with 1,321 additions and 530 deletions.
13 changes: 8 additions & 5 deletions client/tests/src/com/vaadin/client/DateTimeServiceTest.java
Expand Up @@ -5,9 +5,10 @@
import java.util.HashMap;
import java.util.Map;

import junit.framework.TestCase;
import org.junit.Assert;
import org.junit.Test;

public class DateTimeServiceTest extends TestCase {
public class DateTimeServiceTest {

final long MILLISECONDS_PER_DAY = 24 * 3600 * 1000;

Expand Down Expand Up @@ -66,6 +67,7 @@ public class DateTimeServiceTest extends TestCase {
* calculates the ISO week number like we do.
*
*/
@Test
public void testISOWeekNumbers() {
Calendar c = Calendar.getInstance();
c.set(1990, 1, 1);
Expand All @@ -75,7 +77,7 @@ public void testISOWeekNumbers() {
Date d = new Date(start + i * MILLISECONDS_PER_DAY);
int expected = getCalendarISOWeekNr(d);
int calculated = DateTimeService.getISOWeekNumber(d);
assertEquals(d + " should be week " + expected, expected,
Assert.assertEquals(d + " should be week " + expected, expected,
calculated);

}
Expand All @@ -86,15 +88,16 @@ public void testISOWeekNumbers() {
* {@link Calendar}).
*
*/
@Test
public void testSampleISOWeekNumbers() {
for (Date d : isoWeekNumbers.keySet()) {
// System.out.println("Sample: " + d);
int expected = isoWeekNumbers.get(d);
int calculated = DateTimeService.getISOWeekNumber(d);
assertEquals(d + " should be week " + expected
Assert.assertEquals(d + " should be week " + expected
+ " (Java Calendar is wrong?)", expected,
getCalendarISOWeekNr(d));
assertEquals(d + " should be week " + expected, expected,
Assert.assertEquals(d + " should be week " + expected, expected,
calculated);

}
Expand Down
13 changes: 10 additions & 3 deletions client/tests/src/com/vaadin/client/LocatorUtilTest.java
Expand Up @@ -15,56 +15,63 @@
*/
package com.vaadin.client;

import junit.framework.TestCase;

import org.junit.Assert;
import org.junit.Test;

import com.vaadin.client.componentlocator.LocatorUtil;

/*
* Test LocatorUtil.isUIElement() & isNotificaitonElement methods
*/
public class LocatorUtilTest extends TestCase {
public class LocatorUtilTest {

@Test
public void testIsUI1() {
boolean isUI = LocatorUtil.isUIElement("com.vaadin.ui.UI");
Assert.assertTrue(isUI);
}

@Test
public void testIsUI2() {
boolean isUI = LocatorUtil.isUIElement("/com.vaadin.ui.UI");
Assert.assertTrue(isUI);
}

@Test
public void testIsUI3() {
boolean isUI = LocatorUtil
.isUIElement("//com.vaadin.ui.UI[RandomString");
Assert.assertTrue(isUI);
}

@Test
public void testIsUI4() {
boolean isUI = LocatorUtil.isUIElement("//com.vaadin.ui.UI[0]");
Assert.assertTrue(isUI);
}

@Test
public void testIsNotification1() {
boolean isUI = LocatorUtil
.isNotificationElement("com.vaadin.ui.VNotification");
Assert.assertTrue(isUI);
}

@Test
public void testIsNotification2() {
boolean isUI = LocatorUtil
.isNotificationElement("com.vaadin.ui.Notification");
Assert.assertTrue(isUI);
}

@Test
public void testIsNotification3() {
boolean isUI = LocatorUtil
.isNotificationElement("/com.vaadin.ui.VNotification[");
Assert.assertTrue(isUI);
}

@Test
public void testIsNotification4() {
boolean isUI = LocatorUtil
.isNotificationElement("//com.vaadin.ui.VNotification[0]");
Expand Down

0 comments on commit 11a2b52

Please sign in to comment.