forked from Karm/mandrel-integration-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add integration test for Calendar building.
Related to quarkusio/quarkus#36975
- Loading branch information
Showing
6 changed files
with
138 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>calendars</groupId> | ||
<artifactId>calendars</artifactId> | ||
<version>1</version> | ||
|
||
<name>calendars</name> | ||
|
||
<parent> | ||
<groupId>org.graalvm.tests.integration</groupId> | ||
<artifactId>parent</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
<relativePath>../../pom.xml</relativePath> | ||
</parent> | ||
|
||
<properties> | ||
<maven-jar-plugin.version>3.2.0</maven-jar-plugin.version> | ||
</properties> | ||
|
||
<build> | ||
<finalName>calendars</finalName> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>${maven-jar-plugin.version}</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<mainClass>calendar.Main</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (c) 2023, Red Hat Inc. All rights reserved. | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information regarding copyright ownership. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* You may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
package calendar; | ||
|
||
import java.util.Calendar; | ||
import java.util.Locale; | ||
|
||
/** | ||
* @author Severin Gehwolf <[email protected]> | ||
*/ | ||
public class Main { | ||
|
||
private static void doCalTest(String type) { | ||
Calendar cal = new Calendar.Builder() | ||
.setCalendarType(type) | ||
.setFields(Calendar.YEAR, 1, Calendar.DAY_OF_YEAR, 1) | ||
.build(); | ||
int year = cal.get(Calendar.YEAR); | ||
String t = cal.getCalendarType(); | ||
int dayOfYear = cal.get(Calendar.DAY_OF_YEAR); | ||
System.out.printf("Year: %d, dayOfYear: %d, type: %s%n", year, dayOfYear, t); | ||
} | ||
|
||
public static void main(String[] args) { | ||
Locale.setDefault(Locale.US); // Don't rely on the default locale of the system. | ||
String[] types = new String[] { "japanese", "buddhist", "gregory" }; | ||
for (String t : types) { | ||
doCalTest(t); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters