org.jboss.arquillian.core.spi.Validate Java Examples

The following examples show how to use org.jboss.arquillian.core.spi.Validate. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RedmineGovernorClient.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
@Override
public ExecutionDecision resolve(Redmine annotation) {
    Validate.notNull(redmineManager, "Redmine manager must be specified.");
    Validate.notNull(redmineGovernorStrategy, "Governor strategy must be specified. Have you already called setGovernorStrategy()?");

    final String redmineIssueKey = annotation.value();

    if (redmineIssueKey == null || redmineIssueKey.length() == 0) {
        return ExecutionDecision.execute();
    }

    final Issue redmineIssue = getIssue(redmineIssueKey);

    // when there is some error while we are getting the issue, we execute that test
    if (redmineIssue == null) {
        logger.warning(String.format("Redmine Issue %s couldn't be retrieved from configured repository.", redmineIssueKey));
        return ExecutionDecision.execute();
    }

    return redmineGovernorStrategy.annotation(annotation).issue(redmineIssue).resolve();
}
 
Example #2
Source File: GitHubGovernorClient.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
@Override
public void close(String issueId) {
    Validate.notNull(gitHubClient, "GitHub REST client must be specified.");

    Comment comment = null;

    try {
        final Issue issue = getIssue(issueId);
        issue.setState(IssueService.STATE_CLOSED);
        comment =
                this.issueService.createComment(this.gitHubGovernorConfiguration.getRepositoryUser(), this.gitHubGovernorConfiguration.getRepository(), issueId,
                        getClosingMessage());
        this.issueService.editIssue(this.gitHubGovernorConfiguration.getRepositoryUser(), this.gitHubGovernorConfiguration.getRepository(), issue);
    } catch (Exception e) {
        if (comment != null) {
            deleteComment(comment);
        }

        logger.warning(String.format("An exception has occured while closing the issue %s. Exception: %s", issueId, e.getMessage()));
    }
}
 
Example #3
Source File: GitHubGovernorClient.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
@Override
public ExecutionDecision resolve(GitHub annotation) {
    Validate.notNull(gitHubClient, "GitHub REST client must be specified.");
    Validate.notNull(gitHubGovernorStrategy, "Governor strategy must be specified. Have you already called setGovernorStrategy()?");

    final String gitHubIssueKey = annotation.value();

    if (gitHubIssueKey == null || gitHubIssueKey.length() == 0) {
        return ExecutionDecision.execute();
    }

    final Issue gitHubIssue = getIssue(gitHubIssueKey);

    // when there is some error while we are getting the issue, we execute that test
    if (gitHubIssue == null) {
        logger.warning(String.format("GitHub Issue %s couldn't be retrieved from configured repository.", gitHubIssueKey));
        return ExecutionDecision.execute();
    }

    return gitHubGovernorStrategy.annotation(annotation).issue(gitHubIssue).resolve();
}
 
Example #4
Source File: GovernorRegistryImpl.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
@Override
public List<Method> getMethodsForAnnotation(Class<? extends Annotation> annotationClass) {
    Validate.notNull(annotationClass, "An annotation class to get methods for must be specified.");

    if (annotationClass.getAnnotation(Governor.class) == null) {
        throw new IllegalStateException("Annotation class to get methods for is not annotated with Governor class.");
    }

    final List<Method> methods = new ArrayList<Method>();

    for (final Map.Entry<Method, List<Annotation>> entry : scannedTestMethods.entrySet()) {
        for (final Annotation methodAnnotation : entry.getValue()) {
            if (methodAnnotation.annotationType() == annotationClass) {
                methods.add(entry.getKey());
                break;
            }
        }
    }

    return methods;
}
 
Example #5
Source File: JiraGovernorClient.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
@Override
public void close(String id) {
    Validate.notNull(restClient, "Jira REST client must be specified.");

    try {
        final Issue issue = restClient.getIssueClient().getIssue(id).get();

        final Iterable<Transition> transitions = restClient.getIssueClient().getTransitions(issue.getTransitionsUri()).claim();
        final Transition resolveIssueTransition = getTransitionByName(transitions, "Resolve Issue");

        final Collection<FieldInput> fieldInputs;

        if (jiraBuildNumber > ServerVersionConstants.BN_JIRA_5) {
            fieldInputs = Arrays.asList(new FieldInput("resolution", ComplexIssueInputFieldValue.with("name", "Done")));
        } else {
            fieldInputs = Arrays.asList(new FieldInput("resolution", "Done"));
        }

        final Comment closingMessage = Comment.valueOf(getClosingMessage());
        final TransitionInput transitionInput = new TransitionInput(resolveIssueTransition.getId(), fieldInputs, closingMessage);

        restClient.getIssueClient().transition(issue.getTransitionsUri(), transitionInput).claim();
    } catch (Exception e) {
        // error while getting Issue to close, doing nothing
    }
}
 
Example #6
Source File: JiraGovernorClient.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
@Override
public ExecutionDecision resolve(final Jira annotation) {
    Validate.notNull(restClient, "Jira REST client must be specified.");
    Validate.notNull(jiraGovernorStrategy, "Governor strategy must be specified. Have you already called setGovernorStrategy()?");

    final String jiraIssueKey = annotation.value();

    if (jiraIssueKey == null || jiraIssueKey.length() == 0) {
        return ExecutionDecision.execute();
    }

    final Issue jiraIssue = getIssue(jiraIssueKey);

    // when there is some error while we are getting the issue, we execute that test
    if (jiraIssue == null) {
        return ExecutionDecision.execute();
    }

    return jiraGovernorStrategy.annotation(annotation).issue(jiraIssue).resolve();
}
 
Example #7
Source File: RedmineGovernorStrategy.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
@Override
public ExecutionDecision resolve() {
    Validate.notNull(redmineIssue, "Redmine issue must be specified.");
    Validate.notNull(annotation, "Annotation must be specified.");

    final Integer issueStatus = redmineIssue.getStatusId();

    if (issueStatus == null || IssueStatus.isClosed(issueStatus)) {
        if (annotation.openFailed()) {
            // if issue is closed and test fails, governor will reopen issue
            return ExecutionDecision.execute(FORCING_EXECUTION_OPEN_FAILED);
        }

        return ExecutionDecision.execute();
    }

    if (annotation.force() || redmineGovernorConfiguration.getForce()) {
        return ExecutionDecision.execute(FORCING_EXECUTION_REASON_STRING);
    }

    return ExecutionDecision.dontExecute(String.format(SKIPPING_EXECUTION_REASON_STRING, redmineIssue.getId(), issueStatus));
}
 
Example #8
Source File: RedmineGovernorClient.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
private String getOpeningMessage() {
    Validate.notNull(redmineGovernorConfiguration, "Redmine Governor configuration must be set.");

    String username = null;
    try {
        final User apiKeyUser = redmineManager.getUserManager().getCurrentUser();
        username = apiKeyUser.getLogin();
    } catch (RedmineException e) {
        logger.log(Level.WARNING, "Could not get redmine user.", e);
    }

    if (username == null || username.isEmpty()) {
        username = "unknown";
    }

    return String.format(redmineGovernorConfiguration.getOpeningMessage(), username);
}
 
Example #9
Source File: CacheStatisticsControllerEnricher.java    From keycloak with Apache License 2.0 6 votes vote down vote up
@Override
public void enrich(Object testCase) {
    Validate.notNull(registry.get(), "registry should not be null");
    Validate.notNull(jmxConnectorRegistry.get(), "jmxConnectorRegistry should not be null");
    Validate.notNull(suiteContext.get(), "suiteContext should not be null");

    for (Field field : FieldUtils.getAllFields(testCase.getClass())) {
        JmxInfinispanCacheStatistics annotation = field.getAnnotation(JmxInfinispanCacheStatistics.class);

        if (annotation == null) {
            continue;
        }

        try {
            FieldUtils.writeField(field, testCase, getInfinispanCacheStatistics(annotation), true);
        } catch (IOException | IllegalAccessException | MalformedObjectNameException e) {
            throw new RuntimeException("Could not set value on field " + field);
        }
    }
}
 
Example #10
Source File: RegistryCreator.java    From keycloak with Apache License 2.0 6 votes vote down vote up
@SuppressWarnings("rawtypes")
public static DeployableContainer<?> getContainerAdapter(String adapterImplClass, Collection<DeployableContainer> containers) {
    Validate.notNullOrEmpty(adapterImplClass, "The value of " + ADAPTER_IMPL_CONFIG_STRING + " can not be a null object "
            + "nor an empty string!");

    Class<?> foundAdapter;

    if (isClassPresent(adapterImplClass)) {
        foundAdapter = loadClass(adapterImplClass);
    } else {
        return null;
    }

    for (DeployableContainer<?> container : containers) {
        if (foundAdapter.isInstance(container)) {
            return container;
        }
    }

    return null;
}
 
Example #11
Source File: RedmineGovernorClient.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
@Override
public void close(String issueId) {
    Validate.notNull(redmineManager, "Redmine manager must be specified.");

    try {
        final Issue issue = getIssue(issueId);
        if (!IssueStatus.isClosed(issue.getStatusId())) {
            if (redmineGovernorConfiguration.getCloseOrder() != null && redmineGovernorConfiguration.getCloseOrder().length() > 0) {
                resolveIntermediateIssueTransitions(issue, redmineGovernorConfiguration.getCloseOrder());
            }
            issue.setStatusId(IssueStatus.CLOSED.getStatusCode());
            issue.setNotes(getClosingMessage());
            redmineManager.getIssueManager().update(issue);
            final boolean stillNotClosed = !IssueStatus.isClosed(getIssue(issueId).getStatusId());
            if (stillNotClosed) {
                printAvailableStatus();
                throw new RuntimeException("Arquillian governor redmine could not close issue. "
                        + "The status transition is probably invalid. Use property 'closeOrder' in arquillian.xml and provide a valid status transition for this issue.");
            }
        }
    } catch (Exception e) {
        logger.warning(String.format("An exception has occurred while closing the issue %s. Exception: %s", issueId, e.getMessage()));
    }
}
 
Example #12
Source File: RedmineGovernorClient.java    From arquillian-governor with Apache License 2.0 6 votes vote down vote up
private String getClosingMessage() {
    Validate.notNull(redmineGovernorConfiguration, "Redmine Governor configuration must be set.");

    String username = null;
    try {
        final User apiKeyUser = redmineManager.getUserManager().getCurrentUser();
        username = apiKeyUser.getLogin();
    } catch (RedmineException e) {
        logger.log(Level.WARNING, "Could not get redmine user.", e);
    }

    if (username == null || username.isEmpty()) {
        username = "unknown";
    }

    return String.format(redmineGovernorConfiguration.getClosingMessage(), username);
}
 
Example #13
Source File: TakeScreenshot.java    From arquillian-recorder with Apache License 2.0 5 votes vote down vote up
public TakeScreenshot(String fileName, ScreenshotMetaData metaData, When when, org.arquillian.extension.recorder.screenshooter.api.Screenshot annotation) {
    Validate.notNull(fileName, "File name is a null object!");
    Validate.notNull(metaData, "Meta data is a null object!");
    Validate.notNull(when, "When is a null object!");
    this.metaData = metaData;
    this.when = when;
    this.fileName = fileName;
    this.annotation = annotation;
}
 
Example #14
Source File: GitHubGovernorStrategy.java    From arquillian-governor with Apache License 2.0 5 votes vote down vote up
@Override
public ExecutionDecision resolve() {
    Validate.notNull(gitHubIssue, "GitHub issue must be specified.");
    Validate.notNull(annotation, "Annotation must be specified.");

    // Execute test if detector failed because GitHub issue is not related to specified environment.
    if (!(new DetectorProcessor().process(annotation))) {
        return ExecutionDecision.execute();
    }

    final String gitHubStatus = gitHubIssue.getState();

    if (gitHubStatus == null || gitHubStatus.length() == 0) {
        return ExecutionDecision.execute();
    }

    if (annotation.force()) {
        return ExecutionDecision.execute(FORCING_EXECUTION_REASON_STRING);
    }

    if (gitHubGovernorConfiguration.getForce()) {
        return ExecutionDecision.execute(FORCING_EXECUTION_REASON_STRING);
    }

    if (gitHubStatus.equals(GITHUB_CLOSED_STRING)) {
        return ExecutionDecision.execute();
    }

    return ExecutionDecision.dontExecute(String.format(SKIPPING_EXECUTION_REASON_STRING, gitHubIssue.getNumber(), gitHubStatus));
}
 
Example #15
Source File: Fuse63AppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public Fuse63AppServerProvider() {
    appServerHome = System.getProperty("app.server.home");
    appServerJavaHome = System.getProperty("app.server.java.home");
    managementUser = System.getProperty("app.server.management.user");
    managementPassword = System.getProperty("app.server.management.password");

    Validate.notNullOrEmpty(appServerHome, "app.server.home is not set.");
    Validate.notNullOrEmpty(appServerJavaHome, "app.server.java.home is not set.");
    Validate.notNullOrEmpty(managementUser, "app.server.management.user is not set.");
    Validate.notNullOrEmpty(managementPassword, "app.server.management.password is not set.");
}
 
Example #16
Source File: GitHubGovernorClient.java    From arquillian-governor with Apache License 2.0 5 votes vote down vote up
private String getClosingMessage() {
    Validate.notNull(gitHubGovernorConfiguration, "GitHub Governor configuration must be set.");

    String username = gitHubGovernorConfiguration.getUsername();

    if (username == null || username.isEmpty()) {
        username = "unknown";
    }

    return String.format(gitHubGovernorConfiguration.getClosingMessage(), username);
}
 
Example #17
Source File: EAP6AppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
private void addHaNodeContainer(Node group, int number) {
        String portOffset = System.getProperty("app.server." + number + ".port.offset");
        String managementPort = System.getProperty("app.server." + number + ".management.port");

        Validate.notNullOrEmpty(portOffset, "app.server." + number + ".port.offset is not set.");
        Validate.notNullOrEmpty(managementPort, "app.server." + number + ".management.port is not set.");

        Node container = group.createChild("container");
        container.attribute("mode", "manual");
        container.attribute("qualifier", AppServerContainerProvider.APP_SERVER + "-" + containerName + "-ha-node-" + number);

        configuration = container.createChild("configuration");
        createChild("enabled", "true");
        createChild("adapterImplClass", ManagedDeployableContainer.class.getName());
        createChild("jbossHome", appServerHome);
        createChild("javaHome", appServerJavaHome);
        //cleanServerBaseDir cannot be used until WFARQ-44 is fixed
//        createChild("cleanServerBaseDir", appServerHome + "/standalone-ha-node-" + number);
        createChild("serverConfig", "standalone-ha.xml");
        createChild("jbossArguments", 
                "-Djboss.server.base.dir=" + appServerHome + "/standalone-ha-node-" + number + " " +
                "-Djboss.socket.binding.port-offset=" + portOffset + " " +
                "-Djboss.node.name=ha-node-" + number + " " +
                System.getProperty("adapter.test.props", " ") +
                System.getProperty("kie.maven.settings", " ")
        );
        createChild("javaVmArguments", 
                "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=790" + number + " " +
                System.getProperty("app.server.memory.settings", "") + " " +
                "-Djava.net.preferIPv4Stack=true"
        );
        createChild("managementProtocol", managementProtocol);
        createChild("managementPort", managementPort);
        createChild("startupTimeoutInSeconds", startupTimeoutInSeconds);
    }
 
Example #18
Source File: TestMethodExecutionRegister.java    From arquillian-governor with Apache License 2.0 5 votes vote down vote up
public MethodExecutionDecision(String testMethod, Class<? extends Annotation> annotation, ExecutionDecision executionDecision) {
    Validate.notNull(testMethod, "Test method has to be specified.");
    Validate.notNull(annotation, "Annotation has to be specified.");
    Validate.notNull(executionDecision, "Execution decision has to be specified.");

    this.testMethod = testMethod;
    this.annotation = annotation;
    this.executionDecision = executionDecision;
}
 
Example #19
Source File: Registry.java    From keycloak with Apache License 2.0 5 votes vote down vote up
@Override
public Container getContainer(TargetDescription target) {
    Validate.notNull(target, "Target must be specified");
    if (TargetDescription.DEFAULT.equals(target)) {
        return findDefaultContainer();
    }
    return findMatchingContainer(target.getName());
}
 
Example #20
Source File: WildflyAppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
private void addHaNodeContainer(Node group, int number) {
        String portOffset = System.getProperty("app.server." + number + ".port.offset");
        String managementPort = System.getProperty("app.server." + number + ".management.port");

        Validate.notNullOrEmpty(portOffset, "app.server." + number + ".port.offset is not set.");
        Validate.notNullOrEmpty(managementPort, "app.server." + number + ".management.port is not set.");

        Node container = group.createChild("container");
        container.attribute("mode", "manual");
        container.attribute("qualifier", AppServerContainerProvider.APP_SERVER + "-" + containerName + "-ha-node-" + number);

        configuration = container.createChild("configuration");
        createChild("enabled", "true");
        createChild("adapterImplClass", ManagedDeployableContainer.class.getName());
        createChild("jbossHome", appServerHome);
        createChild("javaHome", appServerJavaHome);
        //cleanServerBaseDir cannot be used until WFARQ-44 is fixed
//        createChild("cleanServerBaseDir", appServerHome + "/standalone-ha-node-" + number);
        createChild("serverConfig", "standalone-ha.xml");
        createChild("jbossArguments", 
                "-Djboss.server.base.dir=" + appServerHome + "/standalone-ha-node-" + number + " " +
                "-Djboss.socket.binding.port-offset=" + portOffset + " " +
                "-Djboss.node.name=ha-node-" + number + " " +
                getCrossDCProperties(number, portOffset) +
                System.getProperty("adapter.test.props", " ") +
                System.getProperty("kie.maven.settings", " ")
        );
        createChild("javaVmArguments", 
                "-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=790" + number + " " +
                System.getProperty("app.server.memory.settings", "") + " " +
                "-Djava.net.preferIPv4Stack=true" + " " +
                System.getProperty("app.server.jvm.args.extra")
        );
        createChild("managementProtocol", managementProtocol);
        createChild("managementPort", managementPort);
        createChild("startupTimeoutInSeconds", startupTimeoutInSeconds);
    }
 
Example #21
Source File: EAPAppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
private String getCrossDCProperties(int number, String portOffset) {
    if (System.getProperty("cache.server") == null || System.getProperty("cache.server").equals("undefined")) {
        return "";
    }
    String cacheHotrodPortString = System.getProperty("cache.server." + number + ".port.offset");
    Validate.notNullOrEmpty(cacheHotrodPortString, "cache.server." + number + ".port.offset is not set.");

    int tcppingPort = 7600 + Integer.parseInt(portOffset);
    int cacheHotrodPort = 11222 + Integer.parseInt(cacheHotrodPortString);
    
    //properties used in servers/app-server/jboss/common/cli/configure-crossdc-config.cli
    return "-Dtcpping.port=" + tcppingPort + " -Dcache.hotrod.port=" + cacheHotrodPort + " ";
}
 
Example #22
Source File: Configuration.java    From arquillian-recorder with Apache License 2.0 5 votes vote down vote up
/**
 * Gets value of {@code name} property. In case a value for such name does not exist or is a null object or an empty string,
 * {@code defaultValue} is returned.
 *
 * @param name name of a property you want to get the value of
 * @param defaultValue value returned in case {@code name} is a null string or it is empty
 * @return value of a {@code name} property of {@code defaultValue} when {@code name} is null or empty string
 * @throws IllegalArgumentException if {@code name} is a null object or an empty string or if {@code defaultValue} is a null
 *         object
 */
public String getProperty(String name, String defaultValue) throws IllegalStateException {
    Validate.notNullOrEmpty(name, "Unable to get the configuration value of null or empty configuration key");
    Validate.notNull(defaultValue, "Unable to set configuration value of " + name + " to null object.");

    String found = getConfiguration().get(name);
    if (found == null || found.isEmpty()) {
        return defaultValue;
    } else {
        return found;
    }
}
 
Example #23
Source File: CrossDCTestEnricher.java    From keycloak with Apache License 2.0 5 votes vote down vote up
static void initializeSuiteContext(SuiteContext suiteContext) {
    Validate.notNull(suiteContext, "Suite context cannot be null.");
    CrossDCTestEnricher.suiteContext = suiteContext;

    if (AuthServerTestEnricher.AUTH_SERVER_CROSS_DC && suiteContext.getCacheServersInfo().isEmpty() && !AuthServerTestEnricher.CACHE_SERVER_LIFECYCLE_SKIP) {
        throw new IllegalStateException("Cache containers misconfiguration");
    }
}
 
Example #24
Source File: EAP6AppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public EAP6AppServerProvider() {
    appServerHome = System.getProperty("app.server.home");
    appServerJavaHome = System.getProperty("app.server.java.home");
    appServerPortOffset = System.getProperty("app.server.port.offset");
    managementProtocol = System.getProperty("app.server.management.protocol");
    managementPort = System.getProperty("app.server.management.port");
    startupTimeoutInSeconds = System.getProperty("app.server.startup.timeout");

    Validate.notNullOrEmpty(appServerHome, "app.server.home is not set.");
    Validate.notNullOrEmpty(appServerJavaHome, "app.server.java.home is not set.");
    Validate.notNullOrEmpty(appServerPortOffset, "app.server.port.offset is not set.");
    Validate.notNullOrEmpty(managementProtocol, "app.server.management.protocol is not set.");
    Validate.notNullOrEmpty(managementPort, "app.server.management.port is not set.");
    Validate.notNullOrEmpty(startupTimeoutInSeconds, "app.server.startup.timeout is not set.");
}
 
Example #25
Source File: Registry.java    From keycloak with Apache License 2.0 5 votes vote down vote up
@Override
public Container create(ContainerDef definition, ServiceLoader loader) {
    Validate.notNull(definition, "Definition must be specified");

    try {
        logger.log(Level.FINE, "Registering container: {0}", definition.getContainerName());

        @SuppressWarnings("rawtypes")
        Collection<DeployableContainer> containerAdapters = loader.all(DeployableContainer.class);

        DeployableContainer<?> dcService = null;

        if (containerAdapters.size() == 1) {
            // just one container on cp
            dcService = containerAdapters.iterator().next();
        } else {
            Container domainContainer = domainContainer(loader, definition);
            if (domainContainer != null) {
                return domainContainer;
            }
            if (dcService == null) {
                dcService = getContainerAdapter(getAdapterImplClassValue(definition), containerAdapters);
            }
            if (dcService == null) {
                throw new ConfigurationException("Unable to get container adapter from Arquillian configuration.");
            }
        }

        // before a Container is added to a collection of containers, inject into its injection point
        return addContainer(injector.inject(
                new ContainerImpl(definition.getContainerName(), dcService, definition)));

    } catch (ConfigurationException e) {
        throw new ContainerCreationException("Could not create Container " + definition.getContainerName(), e);
    }
}
 
Example #26
Source File: WildflyAppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public WildflyAppServerProvider() {
    appServerHome = System.getProperty("app.server.home");
    appServerJavaHome = System.getProperty("app.server.java.home");
    appServerPortOffset = System.getProperty("app.server.port.offset");
    managementProtocol = System.getProperty("app.server.management.protocol");
    managementPort = System.getProperty("app.server.management.port");
    startupTimeoutInSeconds = System.getProperty("app.server.startup.timeout");

    Validate.notNullOrEmpty(appServerHome, "app.server.home is not set.");
    Validate.notNullOrEmpty(appServerJavaHome, "app.server.java.home is not set.");
    Validate.notNullOrEmpty(appServerPortOffset, "app.server.port.offset is not set.");
    Validate.notNullOrEmpty(managementProtocol, "app.server.management.protocol is not set.");
    Validate.notNullOrEmpty(managementPort, "app.server.management.port is not set.");
    Validate.notNullOrEmpty(startupTimeoutInSeconds, "app.server.startup.timeout is not set.");
}
 
Example #27
Source File: AbstractTomcatAppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public AbstractTomcatAppServerProvider() {
    catalinaHome = System.getProperty("app.server.home");
    bindHttpPort = determineHttpPort();
    jmxPort = System.getProperty("app.server.management.port");
    startupTimeoutInSeconds = System.getProperty("app.server.startup.timeout");

    Validate.notNullOrEmpty(catalinaHome, "app.server.home is not set.");
    Validate.notNullOrEmpty(bindHttpPort, "app.server.http.port is not set.");
    Validate.notNullOrEmpty(jmxPort, "app.server.management.port is not set.");
    Validate.notNullOrEmpty(startupTimeoutInSeconds, "app.server.startup.timeout is not set.");
}
 
Example #28
Source File: WildflyDeprecatedAppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
private String getCrossDCProperties(int number, String portOffset) {
    if (System.getProperty("cache.server") == null || System.getProperty("cache.server").equals("undefined")) {
        return "";
    }
    String cacheHotrodPortString = System.getProperty("cache.server." + number + ".port.offset");
    Validate.notNullOrEmpty(cacheHotrodPortString, "cache.server." + number + ".port.offset is not set.");

    int tcppingPort = 7600 + Integer.parseInt(portOffset);
    int cacheHotrodPort = 11222 + Integer.parseInt(cacheHotrodPortString);
    
    //properties used in servers/app-server/jboss/common/cli/configure-crossdc-config.cli
    return "-Dtcpping.port=" + tcppingPort + " -Dcache.hotrod.port=" + cacheHotrodPort + " ";
}
 
Example #29
Source File: WildflyDeprecatedAppServerProvider.java    From keycloak with Apache License 2.0 5 votes vote down vote up
public WildflyDeprecatedAppServerProvider() {
    appServerHome = System.getProperty("app.server.home");
    appServerJavaHome = System.getProperty("app.server.java.home");
    appServerPortOffset = System.getProperty("app.server.port.offset");
    managementProtocol = System.getProperty("app.server.management.protocol");
    managementPort = System.getProperty("app.server.management.port");
    startupTimeoutInSeconds = System.getProperty("app.server.startup.timeout");

    Validate.notNullOrEmpty(appServerHome, "app.server.home is not set.");
    Validate.notNullOrEmpty(appServerJavaHome, "app.server.java.home is not set.");
    Validate.notNullOrEmpty(appServerPortOffset, "app.server.port.offset is not set.");
    Validate.notNullOrEmpty(managementProtocol, "app.server.management.protocol is not set.");
    Validate.notNullOrEmpty(managementPort, "app.server.management.port is not set.");
    Validate.notNullOrEmpty(startupTimeoutInSeconds, "app.server.startup.timeout is not set.");
}
 
Example #30
Source File: DesktopVideoRecorder.java    From arquillian-recorder with Apache License 2.0 5 votes vote down vote up
@Override
public Recorder setVideoTargetDir(File videoTargetDir) {
    Validate.notNull(videoTargetDir, "File is a null object!");
    RecorderFileUtils.createDirectory(videoTargetDir);
    this.videoTargetDir = videoTargetDir;
    return this;
}