Example usage for java.util Calendar JUNE

List of usage examples for java.util Calendar JUNE

Introduction

In this page you can find the example usage for java.util Calendar JUNE.

Prototype

int JUNE

To view the source code for java.util Calendar JUNE.

Click Source Link

Document

Value of the #MONTH field indicating the sixth month of the year in the Gregorian and Julian calendars.

Usage

From source file:com.cemeterylistingswebtest.test.services.adminRegisterListingServiceTest.java

@Test
public void Test() {

    deadRepo = ctx.getBean(RequiresApprovalDeceasedListingRepository.class);
    adserv = ctx.getBean(AdminRegisterListingService.class);
    subRepo = ctx.getBean(SubscriberRepository.class);
    userRepo = ctx.getBean(UserRoleRepository.class);

    //Initialise date
    Calendar calendar = Calendar.getInstance();
    calendar.set(Calendar.YEAR, 2008);
    calendar.set(Calendar.MONTH, Calendar.MARCH);
    calendar.set(Calendar.DATE, 5);

    java.sql.Date javaSqlDate = new java.sql.Date(calendar.getTime().getTime());

    //Initialise date
    Calendar calendar2 = Calendar.getInstance();
    calendar2.set(Calendar.YEAR, 2014);
    calendar2.set(Calendar.MONTH, Calendar.JUNE);
    calendar2.set(Calendar.DATE, 20);

    java.sql.Date validDate = new java.sql.Date(calendar2.getTime().getTime());

    //Initialise user role                
    UserRole userRole = new UserRole.Builder().setLevel(2).build();

    Subscriber newSub = new Subscriber.Builder().setEmail("jackieChan@yahoo.com").setFirstName("jackie")
            .setSurname("Chan").setPwd("whaa").setUsername("jChan").setSubscriptionDate(javaSqlDate)
            .setUserRoleID(userRole).setValidUntil(validDate).build();
    subRepo.save(newSub);/*from   ww w . j a  va  2  s  .c o  m*/
    subID = newSub.getSubscriberID();

    long listId = adserv.registerDeceasedListingReturn("zaakir", "arendse", "maiden", "male", "date1", "date2",
            "blah", "27", "url", "zaakir27", "0474754", subID);

    Assert.assertFalse(deadRepo.findAll().isEmpty());
    subRepo.delete(newSub);
    deadRepo.delete(listId);

}

From source file:simpleserver.bot.BotController.java

public void ready() {
    spawnAt(Calendar.APRIL, 1);
    spawnAt(Calendar.JUNE, 1);
    spawnAt(Calendar.OCTOBER, 31);
}

From source file:com.cemeterylistingswebtest.test.services.PublishListingServiceTest.java

@Test()
public void publishTest() {
    pubServ = ctx.getBean(PublishListingService.class);
    repo = ctx.getBean(SubscriberRepository.class);
    repoList = ctx.getBean(RequiresApprovalDeceasedListingRepository.class);
    userRepo = ctx.getBean(UserRoleRepository.class);
    pubRepo = ctx.getBean(PublishedDeceasedListingRepository.class);

    //Initialise date
    Calendar calendar = Calendar.getInstance();
    calendar.set(Calendar.YEAR, 2010);
    calendar.set(Calendar.MONTH, Calendar.JUNE);
    calendar.set(Calendar.DATE, 14);

    java.sql.Date javaSqlDate = new java.sql.Date(calendar.getTime().getTime());

    //Initialise user role                
    UserRole userRole = new UserRole.Builder().setLevel(2).build();
    //userRepo.save(userRole);
    //userRoleID = userRole.getUserRoleID();

    //Initialise subscriber
    Subscriber newSub = new Subscriber.Builder().setEmail("bwillis@gmail.com").setFirstName("bruce")
            .setSurname("willis").setPwd("diehard").setUsername("bwillis").setSubscriptionDate(javaSqlDate)
            .setUserRoleID(userRole).build();
    repo.save(newSub);//from ww w .j a va2  s .  c o  m
    subID = newSub.getSubscriberID();

    //Finally Initialise RequiresApprovalDeceasedListing
    RequiresApprovalDeceasedListing newListing = new RequiresApprovalDeceasedListing.Builder()
            .setFirstName("maggie").setSurname("mcClain").setMaidenName("Gerber").setGender("Female")
            .setDateOfBirth("10/06/1967").setDateOfDeath("14/03/2006").setGraveInscription("was a mother")
            .setGraveNumber("2521").setImageOfBurialSite("/images/003.jpg").setLastKnownContactName("john")
            .setLastKnownContactNumber("07273218482").setSubscriberSubmitID(subID)
            //cemetery id

            //names

            .build();

    repoList.save(newListing);
    id = newListing.getRequiresApprovalDeceasedListingID();

    id2 = pubServ.publishListingsReturn(newListing);
    boolean empty = pubRepo.findAll().isEmpty();
    //Assert.assertEquals(repoList.findAll().size(), 1);
    Assert.assertFalse(empty);
    Assert.assertNotNull(pubRepo.findOne(id2).getPublishedListingID());
    repoList.delete(id);
    pubRepo.delete(id2);
    repo.delete(subID);

}

From source file:com.cemeterylistingswebtest.test.services.AdminPublishedListingServiceTest.java

@Test
public void hello() {
    pubRepo = ctx.getBean(PublishedDeceasedListingRepository.class);
    updatePubserv = ctx.getBean(AdminUpdatePublishedListingService.class);
    subRepo = ctx.getBean(SubscriberRepository.class);
    userRepo = ctx.getBean(UserRoleRepository.class);

    //Initialise date
    Calendar calendar = Calendar.getInstance();
    calendar.set(Calendar.YEAR, 2008);
    calendar.set(Calendar.MONTH, Calendar.MARCH);
    calendar.set(Calendar.DATE, 5);

    java.sql.Date javaSqlDate = new java.sql.Date(calendar.getTime().getTime());

    //Initialise date
    Calendar calendar2 = Calendar.getInstance();
    calendar2.set(Calendar.YEAR, 2014);
    calendar2.set(Calendar.MONTH, Calendar.JUNE);
    calendar2.set(Calendar.DATE, 20);

    java.sql.Date validDate = new java.sql.Date(calendar2.getTime().getTime());

    //Initialise user role                
    UserRole userRole = new UserRole.Builder().setLevel(2).build();

    Subscriber newSub = new Subscriber.Builder().setEmail("jackieChan@yahoo.com").setFirstName("jackie")
            .setSurname("Chan").setPwd("whaa").setUsername("jChan").setSubscriptionDate(javaSqlDate)
            .setUserRoleID(userRole).setValidUntil(validDate).build();
    subRepo.save(newSub);//  ww  w  .  j av a  2s  . com
    subID = newSub.getSubscriberID();

    PublishedDeceasedListing newListing = new PublishedDeceasedListing.Builder().setFirstName("Dean")
            .setSurname("Winchester")

            .setGender("Male").setDateOfBirth("27/07/1985").setDateOfDeath("14/10/2014")
            .setGraveInscription("will probably come back").setGraveNumber("2474")
            .setImageOfBurialSite("/images/004.jpg").setLastKnownContactName("sam")
            .setLastKnownContactNumber("07255718927")

            .setSubscriberSubmitID(subID).build();

    pubRepo.save(newListing);
    listingId = newListing.getPublishedListingID();

    PublishedDeceasedListing updateListing = new PublishedDeceasedListing.Builder()
            .PublishedDeceasedListing(newListing).setFirstName("Sam").setSurname(newListing.getSurname())
            .setMaidenName(newListing.getMaidenName()).setGender(newListing.getGender())
            .setDateOfBirth(newListing.getDateOfBirth()).setDateOfDeath(newListing.getDateOfDeath())
            .setGraveInscription(newListing.getGraveInscription()).setGraveNumber(newListing.getGraveNumber())
            .setLastKnownContactName(newListing.getLastKnownContactName())
            .setLastKnownContactNumber(newListing.getLastKnownContactNumber())
            .setCemeteryID(newListing.getCemeteryID())
            .setSubscriberApprovedID(newListing.getSubscriberApprovedID())
            .setSubscriberSubmitID(newListing.getSubscriberSubmitID()).setNames(newListing.getNames())

            .setSubscriberSubmitID(subID).build();
    //listingId, "Sam", "Winchester", "", "Male", "20/07/1980", "14/10/2014", "Came back", "2474", "/images/004.jpg", "Dean", "07255718927", subID, null
    id = updatePubserv.updatePublishedlistingReturn(updateListing);

    PublishedDeceasedListing pubUpdate = updatePubserv.find(id);
    Assert.assertNotNull(updatePubserv.find(id));
    Assert.assertEquals(pubUpdate.getFirstName(), "Sam");

    PublishedDeceasedListing pub = pubRepo.findOne(listingId);
    Assert.assertNotNull(pubRepo.findOne(listingId));
    Assert.assertEquals(pub.getFirstName(), "Sam");
    pubRepo.delete(newListing);
    subRepo.delete(newSub);
    updatePubserv.remove(updateListing);
}

From source file:util.MyUtils.java

public static String getMonthString(int month) {
    switch (month - 1) {
    case Calendar.JANUARY:
        return "Jan";
    case Calendar.FEBRUARY:
        return "Feb";
    case Calendar.MARCH:
        return "Mar";
    case Calendar.APRIL:
        return "Apr";
    case Calendar.MAY:
        return "May";
    case Calendar.JUNE:
        return "Jun";
    case Calendar.JULY:
        return "Jul";
    case Calendar.AUGUST:
        return "Aug";
    case Calendar.SEPTEMBER:
        return "Sep";
    case Calendar.OCTOBER:
        return "Oct";
    case Calendar.NOVEMBER:
        return "Nov";
    case Calendar.DECEMBER:
        return "Dec";
    }/*ww  w . java  2 s  .c o m*/
    return "";
}

From source file:net.audumla.astronomy.SeasonalEvent.java

protected static double summerStart(int year, double latitude) {
    Date t = Time.getZeroDate();
    t = DateUtils.setYears(t, year);//from  www .j av  a2s.  co m
    if (latitude >= 0) {
        t = DateUtils.setMonths(t, Calendar.JUNE);
    } else {
        t = DateUtils.setMonths(t, Calendar.DECEMBER);
    }
    return new JulianDate(t).julian();
}

From source file:moviemanager.backend.PersonManagerTest.java

/**
 * Unit test for removing person from database.
 *///from   www  .  j  a va 2 s .com
@Test
public void testRemovePerson() {
    log.info("Testing removing person...");
    try {
        Calendar calendar = new GregorianCalendar(1987, Calendar.JUNE, 17);
        Person person = new Person("John Doe (Remove)", calendar);

        personManager.createPerson(person);
        //check if person was added
        Person res = personManager.getPerson(person.getId());
        assertNotNull(res);
        assertTrue(person.equals(res));
        // if person was added remove it
        personManager.deletePerson(person.getId());
        assertNull(personManager.getPerson(person.getId()));
    } catch (ServiceFailureException ex) {
        Logger.getLogger(PersonManagerTest.class.getName()).log(Level.SEVERE, null, ex);
    }
}

From source file:org.projectforge.business.gantt.GanttTest.java

@Test
public void testTestDiagram() {
    final GanttTask root = createTestChart();
    assertDate(2010, Calendar.JUNE, 1, root.getCalculatedStartDate());
    assertDate(2010, Calendar.JUNE, 1, root.findByWorkpackageCode("001").getCalculatedStartDate());
    // 2010-06-03 is an holiday.
    assertDate(2010, Calendar.JUNE, 16, root.findByWorkpackageCode("001").getCalculatedEndDate()); // Duration of 10 working days
    assertDate(2010, Calendar.JUNE, 30, root.findByWorkpackageCode("002").getCalculatedStartDate()); // 10 days after EB.
}

From source file:com.cemeterylistingswebtest.test.services.ViewListingsBySubscriberServiceTest.java

@Test(enabled = false)
public void hello() {
    subserv = ctx.getBean(ViewListingBySubscriberService.class);
    repoList = ctx.getBean(PublishedDeceasedListingRepository.class);
    subRepo = ctx.getBean(SubscriberRepository.class);
    userRepo = ctx.getBean(UserRoleRepository.class);

    //Initialise date
    Calendar calendar = Calendar.getInstance();
    calendar.set(Calendar.YEAR, 2008);
    calendar.set(Calendar.MONTH, Calendar.MARCH);
    calendar.set(Calendar.DATE, 5);

    java.sql.Date javaSqlDate = new java.sql.Date(calendar.getTime().getTime());

    //Initialise date
    Calendar calendar2 = Calendar.getInstance();
    calendar2.set(Calendar.YEAR, 2014);
    calendar2.set(Calendar.MONTH, Calendar.JUNE);
    calendar2.set(Calendar.DATE, 20);

    java.sql.Date validDate = new java.sql.Date(calendar2.getTime().getTime());

    //Initialise user role                
    UserRole userRole = new UserRole.Builder().setLevel(2).build();
    //userRepo.save(userRole);
    //userRoleID = userRole.getUserRoleID();

    //Initialise subscriber
    Subscriber newSub = new Subscriber.Builder().setEmail("jackieChan@yahoo.com").setFirstName("jackie")
            .setSurname("Chan").setPwd("whaa").setUsername("jChan").setSubscriptionDate(javaSqlDate)
            .setUserRoleID(userRole).setValidUntil(validDate).build();
    subRepo.save(newSub);//from w  w  w  . ja  v  a  2 s  . co m
    subID = newSub.getSubscriberID();

    PublishedDeceasedListing newListing = new PublishedDeceasedListing.Builder().setFirstName("Julie")
            .setSurname("Romanov").setMaidenName("black").setGender("Female").setDateOfBirth("08/06/1974")
            .setDateOfDeath("14/02/2009").setGraveInscription("triple agent").setGraveNumber("2986")
            .setImageOfBurialSite("/images/001.jpg")

            .setSubscriberSubmitID(subID).build();

    repoList.save(newListing);

    List<PublishedDeceasedListing> pubListDod = subserv.findListingBySubscriber(javaSqlDate, validDate);
    Assert.assertFalse(pubListDod.isEmpty());
    //Assert.assertTrue(pubListDod.isEmpty());
    repoList.delete(newListing);
    subRepo.delete(newSub);

}

From source file:net.audumla.astronomy.SeasonalEvent.java

protected static double winterStart(int year, double latitude) {
    Date t = Time.getZeroDate();
    t = DateUtils.setYears(t, year);//from   www.  java 2s  . co  m
    if (latitude >= 0) {
        t = DateUtils.setMonths(t, Calendar.DECEMBER);
    } else {
        t = DateUtils.setMonths(t, Calendar.JUNE);
    }
    return new JulianDate(t).julian();
}