Commits

Miroslav Stencel committed f6f8fac Merge

Comments (0)

Files changed (13)

 6b7370966c26a76a56124f23ebc1ccb720aa9816 jira-dvcs-connector-parent-1.2.3
 87b78d1660110780d2bdb8a69fdb5f1be526889b jira-dvcs-connector-parent-1.2.4
 bbb0ecd976b5c35f208655f094097dfa9fc54205 jira-dvcs-connector-parent-1.2.4.2
+2ec38eff2c40a15d1d19b54a162d14e24fce4c8d jira-dvcs-connector-parent-1.2.5

bitbucket-client/pom.xml

File contents unchanged.

bitbucket-client/src/main/java/com/atlassian/jira/plugins/dvcs/spi/bitbucket/clientlibrary/restpoints/ChangesetRemoteRestpoint.java

 import java.util.Map;
 import java.util.NoSuchElementException;
 
-
 import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.client.ClientUtils;
 import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.model.BitbucketChangeset;
 import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.model.BitbucketChangesetEnvelope;
         public boolean hasNext() // hasNext() cannot modify the state of queue, otherwise multiple calls would cause side-effect !!!
         {           
             return !(changesetQueue.isEmpty() || // the queue is empty when we iterated over all changesets or repository is empty
-                   changesetQueue.peek().getNode().equals(lastChangesetNode));
+                   changesetQueue.peek().getRawNode().equals(lastChangesetNode));
         }//TODO node vs rawNode => preco vobec existuje node ak vsetko sa da robit cez rawNode??? dat prec aby nevznikli chyby
 
         @Override

bitbucket-client/src/test/java/com/atlassian/jira/plugins/dvcs/spi/bitbucket/clientlibrary/restpoints/ChangesetRemoteRestpointTest.java

 package com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints;
 
 
+import static com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.BitbucketChangesetIterableAssert.assertThat;
+
 import java.util.Iterator;
 import java.util.NoSuchElementException;
+
+import org.fest.assertions.api.Assertions;
 import org.testng.annotations.BeforeClass;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.AuthProvider;
 import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.NoAuthAuthProvider;
 
-import org.fest.assertions.api.Assertions;
-
-import static com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.restpoints.BitbucketChangesetIterableAssert.*;
-
 
 /**
  * @author Martin Skurla mskurla@atlassian.com
     private static final String BITBUCKET_EMPTY_REPO = "testemptyrepo";
 
     // all 6 changesets are numbered from bottom of the same page
-    private static final String TIP_CHANGESET_NODE  = "cf40601136f6";
-    private static final String _5TH_CHANGESET_NODE = "de66ffafa5ca";
-    private static final String _4TH_CHANGESET_NODE = "b597361d8735";
-    private static final String _3RD_CHANGESET_NODE = "d2088255ee40";
-    private static final String _2ND_CHANGESET_NODE = "7c029943eb97";
-    private static final String _1ST_CHANGESET_NODE = "c02f3167afcc";
+    private static final String TIP_CHANGESET_NODE  = "cf40601136f64613a3eaf4607e92b3a44b5b4fe8";
+    private static final String _5TH_CHANGESET_NODE = "de66ffafa5ca9cceef7d46f04c3d1c0a679866f2";
+    private static final String _4TH_CHANGESET_NODE = "b597361d87353e0d0ecabe69ad37fdcda706f973";
+    private static final String _3RD_CHANGESET_NODE = "d2088255ee407de438d8e2d895e611bde6d4878a";
+    private static final String _2ND_CHANGESET_NODE = "7c029943eb977dedda6742bd4306f1f45b5e0982";
+    private static final String _1ST_CHANGESET_NODE = "c02f3167afccfa6468cb584c5563d22b20a2b61e";
 
     private static final int NUMBER_OF_ALL_CHANGESETS = 6;
     
                                                                     _3RD_CHANGESET_NODE, _2ND_CHANGESET_NODE, _1ST_CHANGESET_NODE);
     }
     
-    @Test(timeOut=10000, dataProvider="provideVariousChangesetPaginations")
+    @Test(dataProvider="provideVariousChangesetPaginations")
     public void gettingChangesetsUntilChangesetNodeWithPagination_ShouldReturnCorrectChangesets(int pagination)
     {
         Iterable<BitbucketChangeset> changesetIterable = bitbucketRemoteClient.getChangesetsRest()

jira-dvcs-connector-api/pom.xml

File contents unchanged.

jira-dvcs-connector-bitbucket/pom.xml

File contents unchanged.

jira-dvcs-connector-github/pom.xml

File contents unchanged.

jira-dvcs-connector-plugin/pom.xml

File contents unchanged.

jira-dvcs-connector-plugin/src/aps/log4j.properties

 
 log4j.logger.com.atlassian.jira.plugins.dvcs.dao.impl.RepositoryDaoImpl = WARN, console
 log4j.additivity.com.atlassian.jira.plugins.dvcs.dao.impl.RepositoryDaoImpl = false
+
+log4j.logger.com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.scribe.ScribeOauthRemoteRequestor = WARN, console
+log4j.additivity.com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.scribe.ScribeOauthRemoteRequestor = false
+
+log4j.logger.com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BaseRemoteRequestor = WARN, console
+log4j.additivity.com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BaseRemoteRequestor = false
+

jira-dvcs-connector-plugin/src/main/java/com/atlassian/jira/plugins/dvcs/sync/impl/DefaultSynchronisationOperation.java

File contents unchanged.

jira-dvcs-connector-plugin/src/test/java/com/atlassian/jira/plugins/dvcs/pageobjects/page/BaseConfigureOrganizationsPage.java

 import javax.inject.Inject;
 
 import org.hamcrest.Matcher;
-import org.hamcrest.text.StringEndsWith;
 import org.openqa.selenium.By;
 
 import com.atlassian.jira.plugins.dvcs.pageobjects.component.BitBucketOrganization;
 import com.atlassian.pageobjects.elements.PageElementFinder;
 import com.atlassian.pageobjects.elements.SelectElement;
 import com.atlassian.pageobjects.elements.query.Poller;
-import com.atlassian.pageobjects.elements.query.TimedCondition;
-import com.atlassian.pageobjects.elements.query.TimedQuery;
 import com.atlassian.webdriver.jira.JiraTestedProduct;
 
 /**
 
     protected void checkSyncProcessSuccess()
     {
+        // maybe we should do the rest call to server
+        // to find out the status of syncing
+        boolean syncFinished;
+        do {
+            // TODO the idea for waiting for all icons not to have "running" class doesn't work because
+            // the javascript doesn't run onLoad stuff. 
+            // The onload is broken by Raphael trying to do something with svg icons.
+            // The error in the js console:
+            //    this.join is not a function
+            //    [Break on this error] return this.join(",").replace(p2s, "$1"); 
+            sleep(1000);
+            syncFinished = true;
+            List<PageElement> syncIcons = organizationsElement.findAll(By.className("syncrepoicon"));
+            System.out.println("Found some syncicons: " +syncIcons.size());
+            
+            for (PageElement syncIcon : syncIcons)
+            {
+                if (syncIcon.hasClass("running"))
+                {
+                    syncFinished = false;
+                    System.out.println("Running");
+                } else
+                {
+                    System.out.println("Not Running");
+                }
+            }
+            
+        } while (!syncFinished);
+        // syncing is now finished. TODO check for errors
+    }
 
-    	List<PageElement> allSyncMessages = organizationsElement.findAll(By.className("gh_messages"));
 
-    	for (PageElement syncMessage : allSyncMessages)
-		{
-    		// isPresent = true => repositories list is shown
-            TimedCondition isMsgVisibleCond = syncMessage.timed().isPresent();
-            Poller.waitUntilTrue("Expected sync status message to appear.", isMsgVisibleCond);
-
-            // isVisible = true => started sync => we will wait for result
-            if (syncMessage.timed().isVisible().now())
-            {
-                TimedQuery<String> syncFinishedCond = syncMessage.timed().getText();
-                Poller.waitUntil("Expected sync status message", syncFinishedCond, new StringEndsWith("2012")); // last commit date
-            }
-
-		}
-
-
+    private void sleep(long milis)
+    {
+        try
+        {
+            Thread.sleep(milis);
+        } catch (InterruptedException e)
+        {
+            // ignore
+        }
     }
 
     protected void waitFormBecomeVisible()

jira-dvcs-connector-plugin/src/test/java/com/atlassian/jira/plugins/dvcs/pageobjects/page/BitBucketConfigureOrganizationsPage.java

 
         organization.clear().type(organizationAccount);
 
-        if (!autoSync) {
+        if (!autoSync)
+        {
             autoLinkNewRepos.click();
         }
 
         Poller.waitUntilFalse(atlassianTokenMeta.timed().isPresent());
         pageBinder.bind(BitbucketGrandOAuthAccessPage.class).grantAccess();
 
-        if (autoSync) {
+        if (autoSync)
+        {
             checkSyncProcessSuccess();
         }
 
File contents unchanged.