Java Code Examples for java.util.Locale.GERMANY

The following are Jave code examples for showing how to use GERMANY of the java.util.Locale class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: parabuild-ci   File: QuarterTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Quarter q = new Quarter(3, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(1001890799999L, q.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        q.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 2
Project: parabuild-ci   File: WeekTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Week w = new Week(1, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(978307200000L, w.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        w.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 3
Project: parabuild-ci   File: WeekTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Week w = new Week(52, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(1009756799999L, w.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        w.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 4
Project: parabuild-ci   File: MonthTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Month m = new Month(1, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(978307200000L, m.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        m.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 5
Project: parabuild-ci   File: MonthTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Month m = new Month(3, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(986079599999L, m.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        m.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 6
Project: parabuild-ci   File: MillisecondTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Millisecond m = new Millisecond(500, 55, 40, 2, 15, 4, 2000);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(955762855500L, m.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        m.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 7
Project: parabuild-ci   File: MillisecondTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Millisecond m = new Millisecond(250, 50, 45, 21, 21, 4, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(987885950250L, m.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        m.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 8
Project: parabuild-ci   File: YearTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Year y = new Year(2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(978307200000L, y.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        y.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 9
Project: parabuild-ci   File: YearTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Year y = new Year(2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(1009843199999L, y.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        y.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 10
Project: parabuild-ci   File: HourTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Hour h = new Hour(21, 21, 4, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(987886799999L, h.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        h.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 11
Project: parabuild-ci   File: SecondTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Second s = new Second(55, 40, 2, 15, 4, 2000);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(955762855000L, s.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        s.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 12
Project: parabuild-ci   File: DayTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Day d = new Day(1, 12, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(1007164800000L, d.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        d.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 13
Project: parabuild-ci   File: DayTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getLastMillisecond(TimeZone) method.
 */
public void testGetLastMillisecondWithCalendar() {
    Day d = new Day(4, 5, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(989017199999L, d.getLastMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        d.getLastMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 14
Project: parabuild-ci   File: QuarterTests.java   View Source Code Vote up 6 votes
/**
 * Some checks for the getFirstMillisecond(TimeZone) method.
 */
public void testGetFirstMillisecondWithCalendar() {
    Quarter q = new Quarter(1, 2001);
    GregorianCalendar calendar = new GregorianCalendar(Locale.GERMANY);
    assertEquals(978307200000L, q.getFirstMillisecond(calendar));
    
    // try null calendar
    boolean pass = false;
    try {
        q.getFirstMillisecond((Calendar) null);
    }
    catch (NullPointerException e) {
        pass = true;
    }
    assertTrue(pass);
}
 
Example 15
Project: incubator-netbeans   File: UpdateItemTest.java   View Source Code Vote up 5 votes
public void testCreateLocalization() {
    String codeName = "test-localization";
    String specificationVersion = "1.0";
    String moduleSpecificationVersion = "1.0";
    Locale locale = Locale.GERMANY;
    String branding = "";
    String localizedName = "Lokal";
    String localizedDescription = "Lokal-modul";
    URL distribution = null;
    try {
        new URL ("http://netbeans.de/localization.nbm");
    } catch (MalformedURLException ex) {
        fail (ex.getMessage ());
    }
    UpdateLicense license = UpdateLicense.createUpdateLicense ("none-license", "no-license");
    
    UpdateItem result = UpdateItem.createLocalization(codeName,
                                                      specificationVersion,
                                                      moduleSpecificationVersion,
                                                      locale, branding,
                                                      localizedName,
                                                      localizedDescription,
                                                      "test-category",
                                                      distribution,
                                                      false, false, null,
                                                      license);

    assertNotNull ("Localization UpdateItem was created.", result);
}
 
Example 16
Project: VS2Labor   File: Tweet.java   View Source Code Vote up 5 votes
public void setDate(String date) throws ParseException {
	try {
		DateFormat format = new SimpleDateFormat("HH:mm:ss", Locale.GERMANY);

		Date date1 = format.parse(date);

		this.date = date1;
	} catch (ParseException e) {
		System.out.println("date2");
		e.printStackTrace();
	}
}
 
Example 17
Project: homeworkManager-android   File: BaseActivity.java   View Source Code Vote up 5 votes
private static void updateLabel(EditText dueDateEditText, Context context, Calendar calendar) {
    if (calendar.getTime().before(Calendar.getInstance().getTime())) {
        Snackbar.make(null,"Selected date is already over",Snackbar.LENGTH_LONG);
        return;
    }

    String myFormat = "EEE, dd.MM.yyyy"; //In which you need put here
    SimpleDateFormat sdf = new SimpleDateFormat(myFormat,Locale.GERMANY);

    dueDateEditText.setText(sdf.format(calendar.getTime()));
}
 
Example 18
Project: otter-G   File: ObjectProfiler.java   View Source Code Vote up 5 votes
private static boolean isSharedFlyweight(Object obj) {
    if (obj == null) {
        return true;
    }
    if (obj == Boolean.TRUE || obj == Boolean.FALSE) {
        return true;
    }
    if (/* obj == Locale.ROOT || *//* Java 6 */
    obj == Locale.ENGLISH || obj == Locale.FRENCH || obj == Locale.GERMAN || obj == Locale.ITALIAN
            || obj == Locale.JAPANESE || obj == Locale.KOREAN || obj == Locale.CHINESE
            || obj == Locale.SIMPLIFIED_CHINESE || obj == Locale.TRADITIONAL_CHINESE || obj == Locale.FRANCE
            || obj == Locale.GERMANY || obj == Locale.ITALY || obj == Locale.JAPAN || obj == Locale.KOREA
            || obj == Locale.CHINA || obj == Locale.PRC || obj == Locale.TAIWAN || obj == Locale.UK
            || obj == Locale.US || obj == Locale.CANADA || obj == Locale.CANADA_FRENCH) {
        return true;
    }
    if (obj == Collections.EMPTY_SET || obj == Collections.EMPTY_LIST || obj == Collections.EMPTY_MAP) {
        return true;
    }
    if (obj == BigInteger.ZERO || obj == BigInteger.ONE) {
        return true;
    }
    if (obj == System.in || obj == System.out || obj == System.err) {
        return true;
    }
    if (obj == String.CASE_INSENSITIVE_ORDER) {
        return true;
    }
    if (obj == JarFile.MANIFEST_NAME) {
        return true;
    }
    return false;
}
 
Example 19
Project: openjdk-jdk10   File: TestNarrowMonthNamesAndDayNames.java   View Source Code Vote up 5 votes
/**
 * Locale en_US, de_DE, fr_FR, no_NO will have different Narrow and
 * Narrow_Standalone Day Names for COMPAT Provider.
 */
@DataProvider(name = "DayNarrows")
public Object[][] dayNameData() {
    return new Object[][]{
        {Locale.US, new String[]{"M", "T", "W", "T", "F", "S", "S"}},
        {Locale.GERMANY, new String[]{"M", "D", "M", "D", "F", "S", "S"}},
        {Locale.FRANCE, new String[]{"L", "M", "M", "J", "V", "S", "D"}},
        {new Locale("no", "NO"), new String[]{"M", "T", "O", "T", "F", "L", "S"}},};
}
 
Example 20
Project: leoapp-sources   File: NotificationServiceWrapper.java   View Source Code Vote up 5 votes
private void sendNotificationIfNecessary() {
    if (!Utils.getController().getPreferences().getBoolean("pref_key_status_loggedin", false))
        return;
    SQLiteConnectorEssensbons db     = new SQLiteConnectorEssensbons(this);
    SQLiteDatabase            dbw    = db.getReadableDatabase();
    Cursor                    cursor = dbw.rawQuery("SELECT MAX(ID) as id FROM STATISTICS", null);
    if (cursor.getCount() == 0) {
        cursor.close();
        new NotificationHandler.EssensbonsNotification().send();
        return;
    }
    cursor.moveToFirst();
    int maxid = cursor.getInt(cursor.getColumnIndex("id"));
    cursor.close();
    cursor = dbw.rawQuery("SELECT o.DATEU as date FROM USERORDERS o JOIN STATISTICS s ON s.LASTORDER = o.ID WHERE s.ID = " + maxid, null);
    if (cursor.getCount() == 0) {
        cursor.close();
        new NotificationHandler.EssensbonsNotification().send();
        return;
    }
    cursor.moveToFirst();
    String date = cursor.getString(cursor.getColumnIndex("date"));
    cursor.close();
    SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd", Locale.GERMANY);
    try {
        Date dateD = df.parse(date);
        if (dateD.before(new Date()))
            new NotificationHandler.EssensbonsNotification().send();
    } catch (ParseException e) {
        Utils.logError(e);
    }
}