Skip to content

Commit

Permalink
Try Fix Build Error
Browse files Browse the repository at this point in the history
  • Loading branch information
ggallotti committed Aug 31, 2023
1 parent 9c86ce7 commit af84053
Showing 1 changed file with 14 additions and 34 deletions.
48 changes: 14 additions & 34 deletions java/src/test/java/com/genexus/util/TestDateMethods.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
package com.genexus.util;

import com.genexus.Application;
import com.genexus.CommonUtil;
import com.genexus.LocalUtil;
import com.genexus.specific.java.Connect;
import org.junit.Assert;
import org.junit.Test;

import java.text.ParseException;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;

import com.genexus.specific.java.Connect;
import org.junit.Assert;
import org.junit.Test;

public class TestDateMethods {

@Test
public void testYearLimit(){
public void testYearLimit() {
Connect.init();
LocalUtil localUtil = new LocalUtil('.', "MDY", "24", 30, "eng");
Date testDate1 = CommonUtil.nullDate();
Expand All @@ -27,13 +25,10 @@ public void testYearLimit(){

GXSimpleDateFormat df = new GXSimpleDateFormat(pattern);
df.setTimeZone(TimeZone.getDefault());
try
{
try {
testDate1 = localUtil.applyYearLimit(df.parse("12/12/30"), pattern);
testDate2 = localUtil.applyYearLimit(df.parse("08/05/76"), pattern);
}
catch (ParseException e)
{
} catch (ParseException e) {

}
Calendar calendar = GregorianCalendar.getInstance();
Expand All @@ -44,21 +39,14 @@ public void testYearLimit(){
}

@Test
public void testCtotex(){
public void testCtotex() {
Connect.init();

LocalUtil localUtil = new LocalUtil('.', "MDY", "24", 30, "eng");
Date testDate1 = CommonUtil.nullDate();
Date testDate2 = CommonUtil.nullDate();
Date testDate3 = CommonUtil.nullDate();
try
{
testDate1 = localUtil.ctotex("1930-01-01T00:00", 0);
testDate2 = localUtil.ctotex("2023-01-01T00:00:00", 0);
testDate3 = localUtil.ctotex("2200-12-31T00:00:00.000", 0);
}
catch (Exception e)
{ }

Date testDate1 = localUtil.ctotex("1930-01-01T00:00", 0);
Date testDate2 = localUtil.ctotex("2023-01-01T00:00:00", 0);
Date testDate3 = localUtil.ctotex("2200-12-31T00:00:00.000", 0);

Calendar calendar = new GregorianCalendar();
calendar.setTime(testDate1);
Expand All @@ -70,17 +58,9 @@ public void testCtotex(){
calendar.setTime(testDate3);
Assert.assertEquals(2200, calendar.get(Calendar.YEAR));

testDate1 = CommonUtil.nullDate();
testDate2 = CommonUtil.nullDate();
testDate3 = CommonUtil.nullDate();
try
{
testDate1 = localUtil.ctotex("29-01-01", 0);
testDate2 = localUtil.ctotex("30-01-01T00", 0);
testDate3 = localUtil.ctotex("31-12-31T00:00", 0);
}
catch (Exception e)
{ }
testDate1 = localUtil.ctotex("29-01-01", 0);
testDate2 = localUtil.ctotex("30-01-01T00", 0);
testDate3 = localUtil.ctotex("31-12-31T00:00", 0);

calendar = new GregorianCalendar();
calendar.setTime(testDate1);
Expand Down

0 comments on commit af84053

Please sign in to comment.