Examples of PublishEvent


Examples of org.apache.ivy.core.event.publish.PublishEvent

            // test the proper sequence of events by comparing the number of pre-events,
            // post-events, and actual publications.
            assertTrue("event is of correct base type", event instanceof PublishEvent);

            PublishEvent pubEvent = (PublishEvent) event;
            Artifact expectedArtifact = test.currentTestCase.expectedArtifact;
            File expectedData = test.currentTestCase.expectedData;

            assertSameArtifact("event records correct artifact", expectedArtifact,
                pubEvent.getArtifact());
            try {
                assertEquals("event records correct file", expectedData.getCanonicalPath(),
                    pubEvent.getData().getCanonicalPath());

                assertEquals("event records correct overwrite setting", test.expectedOverwrite,
                    pubEvent.isOverwrite());
                assertSame("event presents correct resolver", resolver, pubEvent.getResolver());

                String[] attributes = {"organisation", "module", "revision", "artifact", "type",
                        "ext", "resolver", "overwrite"};
                String[] values = {"apache", "PublishEventsTest", "1.0-dev",
                        expectedArtifact.getName(), expectedArtifact.getType(),
View Full Code Here

Examples of org.apache.ivy.core.event.publish.PublishEvent

            //test the proper sequence of events by comparing the number of pre-events,
            //post-events, and actual publications.
            assertTrue("event is of correct base type",
                        event instanceof PublishEvent);
           
            PublishEvent pubEvent = (PublishEvent)event;
            Artifact expectedArtifact = test.currentTestCase.expectedArtifact;
            File expectedData = test.currentTestCase.expectedData;
           
            assertSameArtifact("event records correct artifact",
                               expectedArtifact, pubEvent.getArtifact());
            try {
                assertEquals("event records correct file",
                             expectedData.getCanonicalPath(), pubEvent.getData().getCanonicalPath());
           
                assertEquals("event records correct overwrite setting", test.expectedOverwrite, pubEvent.isOverwrite());
                assertSame("event presents correct resolver", resolver, pubEvent.getResolver());
   
                String[] attributes = {
                        "organisation", "module", "revision", "artifact", "type", "ext", "resolver", "overwrite"
                };
                String[] values = {
View Full Code Here

Examples of org.apache.ivy.core.event.publish.PublishEvent

            //test the proper sequence of events by comparing the number of pre-events,
            //post-events, and actual publications.
            assertTrue("event is of correct base type",
                        event instanceof PublishEvent);
           
            PublishEvent pubEvent = (PublishEvent)event;
            Artifact expectedArtifact = test.currentTestCase.expectedArtifact;
            File expectedData = test.currentTestCase.expectedData;
           
            assertSameArtifact("event records correct artifact",
                               expectedArtifact, pubEvent.getArtifact());
            try {
                assertEquals("event records correct file",
                             expectedData.getCanonicalPath(), pubEvent.getData().getCanonicalPath());
           
                assertEquals("event records correct overwrite setting", test.expectedOverwrite, pubEvent.isOverwrite());
                assertSame("event presents correct resolver", resolver, pubEvent.getResolver());
   
                String[] attributes = {
                        "organisation", "module", "revision", "artifact", "type", "ext", "resolver", "overwrite"
                };
                String[] values = {
View Full Code Here

Examples of org.apache.ivy.core.event.publish.PublishEvent

            //test the proper sequence of events by comparing the number of pre-events,
            //post-events, and actual publications.
            assertTrue("event is of correct base type",
                        event instanceof PublishEvent);
           
            PublishEvent pubEvent = (PublishEvent)event;
            Artifact expectedArtifact = test.currentTestCase.expectedArtifact;
            File expectedData = test.currentTestCase.expectedData;
           
            assertSameArtifact("event records correct artifact",
                               expectedArtifact, pubEvent.getArtifact());
            try {
                assertEquals("event records correct file",
                             expectedData.getCanonicalPath(), pubEvent.getData().getCanonicalPath());
           
                assertEquals("event records correct overwrite setting", test.expectedOverwrite, pubEvent.isOverwrite());
                assertSame("event presents correct resolver", resolver, pubEvent.getResolver());
   
                String[] attributes = {
                        "organisation", "module", "revision", "artifact", "type", "ext", "resolver", "overwrite"
                };
                String[] values = {
View Full Code Here

Examples of org.olat.course.editor.PublishEvent

   * Called at course publish.
   * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
   */
  public void event(Event event) {
    if (event instanceof PublishEvent) {
      PublishEvent pe = (PublishEvent) event;
      //FIXME: LD: temporary introduced the (pe.getCommand() == PublishEvent.EVENT_IDENTIFIER) to filter the events from the same VM
      if (pe.getState() == PublishEvent.PRE_PUBLISH && pe.getEventIdentifier() == PublishEvent.EVENT_IDENTIFIER) {
        // PRE PUBLISH -> check node for changes
        addToUpcomingWork(pe);
        return;
      } else if (pe.getState() == PublishEvent.PUBLISH && pe.getEventIdentifier() == PublishEvent.EVENT_IDENTIFIER) {
        // a publish event, check if it matches a previous checked
        boolean recalc = false;
        Long resId = pe.getPublishedCourseResId();
        synchronized (upcomingWork) { //o_clusterOK by:ld synchronized OK - only one cluster node must update the EfficiencyStatements (the course is locked for editing) (same as e.g. file indexer)
          recalc = upcomingWork.contains(resId);
          if (recalc) {
            upcomingWork.remove(resId);
          }
        }
        if (recalc) {
          ICourse pubCourse = CourseFactory.loadCourse(pe.getPublishedCourseResId());
          UpdateEfficiencyStatementsWorker worker = new UpdateEfficiencyStatementsWorker(pubCourse);
          updateESPool.execute(worker);
        }
      }
    }
View Full Code Here

Examples of org.olat.course.editor.PublishEvent

   *
   * @see org.olat.core.util.event.GenericEventListener#event(org.olat.core.gui.control.Event)
   */
  public void event(Event event) {   
    if (event instanceof PublishEvent) {
      PublishEvent pe = (PublishEvent) event;
      if (pe.getState() == PublishEvent.PRE_PUBLISH) {
        // so far not interested in PRE PUBLISH event, but one could add user
        // and the currently active BB information. This in turn could be used
        // by the publish event issuer to decide whether or not to publish...
        return;
      }
      if (!course.getResourceableId().equals(pe.getPublishedCourseResId())) throw new AssertException("not the same course");
      // long pts = pe.getLatestPublishTimestamp();
      // disable this controller and issue a information
      // FIXME:fj:b - implement the 'there are 5 users using this course at the
      // moment' warning (in the publishcontroller)
      if (isInEditor) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.