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
const repeat = (fn, cond, counter) => { | |
console.log(counter); | |
if (counter == 0 || cond(1)) { | |
return; | |
} else { | |
setTimeout(() => { | |
fn(); | |
repeat(fn, cond, counter - 1); | |
}, 1000); | |
} |
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
let actionCreators { | |
save: (asd: string): SetSensorAction => { | |
return {type: "SET_SENSOR", payload: asd} | |
} | |
} | |
type EditProps = | |
RouteComponentProps<{}> | |
& type actionCreators |
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
import com.liferay.portal.model.*; | |
import com.liferay.portal.kernel.plugin.*; | |
import com.liferay.portal.service.*; | |
import com.liferay.portal.util.*; | |
List portlets = PortletLocalServiceUtil.getPortlets(10180, false, false); | |
//portlets = ListUtil.sort(portlets, new PortletTitleComparator(application, locale)); | |
int total = portlets.size(); | |
for (int i = 0; i < total; i++) { | |
Portlet portlet = portlets.get(i); |
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
import org.alfresco.repo.security.authentication.AuthenticationUtil | |
import org.alfresco.service.cmr.repository.NodeRef | |
import org.alfresco.service.cmr.repository.NodeService | |
NodeService nodeService = serviceRegistry.getNodeService(); | |
AuthenticationUtil.runAsSystem([ doWork: { | |
nodeService.deleteNode(new NodeRef("workspace://SpacesStore/86131ef6-4543-41d6-bc3e-4e18f1ac89fb")); | |
} ] as AuthenticationUtil.RunAsWork); |
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
import org.junit.Before; | |
import org.junit.Test; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
import java.net.URL; | |
public class SeleniumIETest { |
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
/** | |
* Discovers all JUnit tests and runs them in a suite. | |
*/ | |
@RunWith(AllTestsRunner.class) | |
public final class TestSuite { | |
} |
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
import com.opera.core.systems.OperaDesktopDriver; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import org.openqa.selenium.WebDriver; | |
public class MyTest { | |
private WebDriver driver; | |
@Rule public ScreenshotRule screenshotRule = new ScreenshotRule(); |
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
import org.junit.rules.TestRule; | |
import org.junit.runner.Description; | |
import org.junit.runners.model.Statement; | |
public class ScreenshotRule implements TestRule { | |
public Statement apply(final Statement statement, final Description description) { | |
return new Statement() { | |
@Override | |
public void evaluate() throws Throwable { |