Skip to content

Commit

Permalink
Add sphinx tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
nakag committed Apr 29, 2019
1 parent 0fd078c commit 69c4b59
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/tmdmaker.doc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
<outputDirectory>${project.reporting.outputDirectory}/jacoco/report/</outputDirectory>
<excludes>
<exclude>**/org/eclipse/gmf/**/*.class</exclude>
<exclude>**/jp/sourceforge/tmdmaker/**/*Test.class</exclude>
</excludes>
</configuration>
<goals>
Expand Down
3 changes: 2 additions & 1 deletion tests/tmdmaker.ui.test/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@ Require-Bundle: org.eclipse.swtbot.eclipse.finder,
org.eclipse.platform,
tmdmaker.core,
org.eclipse.swtbot.e4.finder,
tmdmaker.imagegenerator
tmdmaker.imagegenerator,
tmdmaker.sphinx
Automatic-Module-Name: tmdmaker.ui.test
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,7 @@ protected void createEntity(int x, int y, String identifierName, int type) {
wait.waitDefault();
}

protected String projectName() {
return PROJECT_NAME;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright 2009-2019 TMD-Maker Project <https://tmdmaker.osdn.jp/>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package jp.sourceforge.tmdmaker.ui.editor;

import java.io.File;
import java.util.Arrays;
import java.util.List;

import org.eclipse.core.runtime.Platform;
import org.eclipse.swtbot.swt.finder.junit.SWTBotJunit4ClassRunner;
import org.junit.Test;
import org.junit.runner.RunWith;

import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
import jp.sourceforge.tmdmaker.model.Entity;
import jp.sourceforge.tmdmaker.sphinx.generate.DocGenerator;

/**
* TMD-MakerのDocGeneratorテスト.
*
* SWTBotがFileDialogに対応していないので内部クラスを直接実行している.
*
* @author nakag
*
*/
@RunWith(SWTBotJunit4ClassRunner.class)
public class SphinxGeneratorTest extends AbstractUITest {
DocGenerator generator;

@Override
public void setUp() throws Exception {
super.setUp();
createEntity(50, 50, "顧客番号", 0);
wait.waitFor(10);
generator = new DocGenerator();
}

@Test
public void generateTest() {
Entity e = (Entity) tmdEditor.getRootModel().getChildren().get(0);
List<AbstractEntityModel> list = Arrays.asList(e);
String rootDir = Platform.getInstanceLocation().getURL().getPath() + projectName();
generator.execute(rootDir, list);
String docPath = Platform.getInstanceLocation().getURL().getPath() + projectName()
+ File.separator + "doc";
assertEquals(true, new File(docPath).exists());
}
}

0 comments on commit 69c4b59

Please sign in to comment.