Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix timezone issue on testing. #1770

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,19 @@
import java.sql.Time;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;

import org.junit.Before;
import org.junit.Test;

import com.google.common.collect.ImmutableList;
import com.querydsl.core.types.*;
import com.querydsl.core.types.ConstantImpl;
import com.querydsl.core.types.Expression;
import com.querydsl.core.types.Operator;
import com.querydsl.core.types.Ops;
import com.querydsl.core.types.Path;
import com.querydsl.core.types.PathMetadata;
import com.querydsl.core.types.Template;
import com.querydsl.core.util.BeanUtils;

public class ExpressionsTest {
Expand All @@ -36,6 +44,12 @@ private enum testEnum {
TEST;
}

@Before
public void before() {
System.setProperty("user.timezone", "UTC");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also reset in after block

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timowest
Yeah. I added setUp and tearDown.
I rewrote small bit of code.

TimeZone.setDefault(null);
}

@Test
public void Signature() throws NoSuchMethodException {
List<String> types = ImmutableList.of("boolean", "comparable", "date", "dsl", "dateTime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static org.junit.Assert.assertEquals;

import java.sql.Types;
import java.util.TimeZone;

import org.junit.Before;
import org.junit.Test;
Expand All @@ -14,6 +15,8 @@ public class ArrayTypesTest {
@Before
public void setUp() {
configuration = Configuration.DEFAULT;
System.setProperty("user.timezone", "UTC");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what failures do you have with this test?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@timowest
weird.
I remembered it was failed with testing on querydls-sql module.
but it's gone now.

TimeZone.setDefault(null);
}

@Test
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/querydsl_checks_base.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
<property name="fileExtensions" value="java, properties, xml"/>

<!-- maximum file length 2000 lines -->
<module name="FileLength"/>
<module name="FileLength">
<property name="max" value="2500"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is only overridden on a per-file basis.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rollbacked that.
I misunderstood it.

</module>

<!-- check that there are no tab characters in the file -->
<module name="FileTabCharacter">
Expand Down