You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TestServerTest.java 1.7KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*******************************************************************************
  2. * Copyright (c) 2006 IBM Corporation and others.
  3. * All rights reserved. This program and the accompanying materials
  4. * are made available under the terms of the Eclipse Public License v1.0
  5. * which accompanies this distribution, and is available at
  6. * http://www.eclipse.org/legal/epl-v10.html
  7. *
  8. * Contributors:
  9. * Matthew Webster - initial implementation
  10. *******************************************************************************/
  11. package org.aspectj.testing.server;
  12. import java.io.IOException;
  13. import junit.framework.TestCase;
  14. import static org.aspectj.testing.server.TestServer.REGEX_PROJECT_ROOT_FOLDER;
  15. public class TestServerTest extends TestCase {
  16. private TestServer server;
  17. protected void setUp() throws Exception {
  18. super.setUp();
  19. server = new TestServer();
  20. server.setExitOntError(false);
  21. }
  22. public void testInitialize() {
  23. try {
  24. server.setWorkingDirectory("../testing-client/testdata");
  25. server.initialize();
  26. }
  27. catch (IOException ex) {
  28. fail(ex.toString());
  29. }
  30. }
  31. public void testFindProjectRootDirectory() throws IOException {
  32. // Give developers some advice in the build log about why their LTW tests fail
  33. assertNotNull(
  34. "Cannot find AspectJ project root folder. " +
  35. "This will lead to subsequent failures in all tests using class TestServer. " +
  36. "Please make sure to name your project root folder 'org.aspectj', 'AspectJ' or " +
  37. "something else matching regex '"+ REGEX_PROJECT_ROOT_FOLDER+"'.",
  38. server.findProjectRootFolder()
  39. );
  40. }
  41. public void testSetWorkingDirectory() {
  42. server.setWorkingDirectory("../testing-client/testdata");
  43. }
  44. }