Last active
August 29, 2015 13:59
-
-
Save DemkaAge/10962018 to your computer and use it in GitHub Desktop.
вызов тестов
This file contains hidden or 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
package ru.brbpm.testutils; | |
import org.junit.Assert; | |
import org.junit.Assume; | |
import org.junit.BeforeClass; | |
import ru.brbpm.lecm.utils.server.filenet.CeConnection; | |
/** | |
* User: dshahovkin | |
* Date: 23.05.13 | |
* Time: 16:13 | |
*/ | |
public abstract class AbstractTest extends Assert { | |
protected static TestManager manager; | |
protected static CeConnection ceConnection; | |
@BeforeClass | |
public static void failFast() { | |
Assume.assumeTrue(TestManager.hasRemoteConnectionProperties()); | |
//попытка распарсить настройки, если они заданы | |
manager = TestManager.getInstance(); | |
//это если кому понадобится коннектиться к СЕ в своем @BeforeClass | |
ceConnection = new CeConnection(manager.getConnectionProperties()); | |
} | |
} |
This file contains hidden or 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
package ru.brbpm.lecm.server.config_service.logic; | |
import com.filenet.api.core.Factory; | |
import com.filenet.api.security.User; | |
import org.junit.Ignore; | |
import org.junit.Test; | |
import ru.brbpm.lecm.shared.jaxb.JaxbDtoMarker; | |
import ru.brbpm.lecm.shared.jaxb.StorageBrowserConfig; | |
import ru.brbpm.lecm.shared.jaxb.toolbar.MenuActions; | |
import ru.brbpm.testutils.AbstractTest; | |
/** | |
* User: dshahovkin | |
* Date: 22.05.13 | |
* Time: 16:58 | |
*/ | |
public class ConfigServiceRemoteTest extends AbstractTest { | |
@Ignore | |
@Test | |
public void test() { | |
String userName = ceConnection.new UserAction<String>() { | |
@Override | |
public String action() { | |
User user = Factory.User.fetchCurrent(ceConnection.getFnConnection(), null); | |
return user.get_Name(); | |
} | |
}.exec(); | |
System.out.println(userName); | |
String adminUserName = ceConnection.new AdminUserAction<String>() { | |
@Override | |
public String action() { | |
User user = Factory.User.fetchCurrent(ceConnection.getFnConnection(), null); | |
return user.get_Name(); | |
} | |
}.exec(); | |
System.out.println(adminUserName); | |
} | |
@Test | |
public void testGetValidatedConfig() throws Exception { | |
JaxbDtoMarker jaxbDtoMarker = ceConnection.new ExceptionThrowableAction<JaxbDtoMarker>() { | |
@Override | |
public JaxbDtoMarker action() throws Exception { | |
ConfigServiceHelper helper = ConfigServiceHelper.getInstance(ceConnection.getFnConnection(), null, "System"); | |
return helper.getValidatedConfig("MenuActions.xml", MenuActions.class.getName(), "MenuActions.xsd"); | |
} | |
}.exec(); | |
System.out.println(jaxbDtoMarker); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment