Skip to content

Commit

Permalink
[TRAVIS] Test apisupport modules
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorespert committed Jan 12, 2020
1 parent f27be83 commit 069f646
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 21 deletions.
15 changes: 15 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,21 @@ matrix:
- ant $OPTS build
script:
- ant $OPTS -f java/java.completion test

- name: Test apisupport modules
jdk: openjdk8
env:
- OPTS="-quiet -Dcluster.config=release -Djavac.compilerargs=-nowarn -Dbuild.compiler.deprecation=false"
before_script:
- ant $OPTS clean
- ant $OPTS build
script:
#- ant $OPTS -f apisupport/apisupport.ant test
- ant $OPTS -f apisupport/apisupport.project test
- ant $OPTS -f apisupport/apisupport.refactoring test
- ant $OPTS -f apisupport/apisupport.wizards test
- ant $OPTS -f apisupport/maven.apisupport test
- ant $OPTS -f apisupport/timers test -Dtest.config=stable

- name: Test ergonomics modules
jdk: openjdk8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,75 +29,81 @@

public class HelpCtxHintTest {

@Test public void literalString() throws Exception {
@Test
public void literalString() throws Exception {
HintTest.create().classpath(cp()).
input("package test;\n" +
"class Test {\n" +
" Object _ = new org.openide.util.HelpCtx(\"some.id\");\n" +
" Object o = new org.openide.util.HelpCtx(\"some.id\");\n" +
"}\n").
run(HelpCtxHint.class).
assertWarnings();
}

@Test public void constantString() throws Exception {
@Test
public void constantString() throws Exception {
HintTest.create().classpath(cp()).
input("package test;\n" +
"class Test {\n" +
" Object _ = new org.openide.util.HelpCtx(\"some.\" + \"id\");\n" +
" Object o = new org.openide.util.HelpCtx(\"some.\" + \"id\");\n" +
"}\n").
run(HelpCtxHint.class).
assertWarnings();
}

@Ignore // XXX need #209759 to implement check for constants
@Test public void computedString() throws Exception {
@Test
public void computedString() throws Exception {
HintTest.create().classpath(cp()).
input("package test;\n" +
"class Test {\n" +
" Object _ = new org.openide.util.HelpCtx(toString());\n" +
" Object o = new org.openide.util.HelpCtx(toString());\n" +
"}\n").
run(HelpCtxHint.class).
assertWarnings("2:15-2:55:verifier:nonconstant help ID");
}

@Test public void simpleClass() throws Exception {
@Test
public void simpleClass() throws Exception {
HintTest.create().classpath(cp()).
input("package test;\n" +
"class Test {\n" +
" Object _ = new org.openide.util.HelpCtx(Test.class);\n" +
" Object o = new org.openide.util.HelpCtx(Test.class);\n" +
"}\n").
run(HelpCtxHint.class).
findWarning("2:15-2:55:verifier:" + HelpCtx_onClass_warning()).
applyFix(HelpCtx_onClass_fix()).
assertCompilable().
assertOutput("package test;\n" +
"class Test {\n" +
" Object _ = new org.openide.util.HelpCtx(\"test.Test\");\n" +
" Object o = new org.openide.util.HelpCtx(\"test.Test\");\n" +
"}\n");
}

@Test public void className() throws Exception {
@Test
public void className() throws Exception {
HintTest.create().classpath(cp()).
input("package test;\n" +
"class Test {\n" +
" Object _ = new org.openide.util.HelpCtx(Test.class.getName());\n" +
" Object o = new org.openide.util.HelpCtx(Test.class.getName());\n" +
"}\n").
run(HelpCtxHint.class).
findWarning("2:15-2:65:verifier:" + HelpCtx_onClassName_warning()).
applyFix(HelpCtx_onClass_fix()).
assertCompilable().
assertOutput("package test;\n" +
"class Test {\n" +
" Object _ = new org.openide.util.HelpCtx(\"test.Test\");\n" +
" Object o = new org.openide.util.HelpCtx(\"test.Test\");\n" +
"}\n");
}

@Test public void nestedClass() throws Exception {
@Test
public void nestedClass() throws Exception {
HintTest.create().classpath(cp()).
input("package test;\n" +
"class Test {\n" +
" class Nested {\n" +
" Object _ = new org.openide.util.HelpCtx(Nested.class);\n" +
" Object o = new org.openide.util.HelpCtx(Nested.class);\n" +
" }\n" +
"}\n").
run(HelpCtxHint.class).
Expand All @@ -107,17 +113,18 @@ public class HelpCtxHintTest {
assertOutput("package test;\n" +
"class Test {\n" +
" class Nested {\n" +
" Object _ = new org.openide.util.HelpCtx(\"test.Test$Nested\");\n" +
" Object o = new org.openide.util.HelpCtx(\"test.Test$Nested\");\n" +
" }\n" +
"}\n");
}

@Test public void nestedClassName() throws Exception {
@Test
public void nestedClassName() throws Exception {
HintTest.create().classpath(cp()).
input("package test;\n" +
"class Test {\n" +
" class Nested {\n" +
" Object _ = new org.openide.util.HelpCtx(Nested.class.getName());\n" +
" Object o = new org.openide.util.HelpCtx(Nested.class.getName());\n" +
" }\n" +
"}\n").
run(HelpCtxHint.class).
Expand All @@ -127,7 +134,7 @@ public class HelpCtxHintTest {
assertOutput("package test;\n" +
"class Test {\n" +
" class Nested {\n" +
" Object _ = new org.openide.util.HelpCtx(\"test.Test$Nested\");\n" +
" Object o = new org.openide.util.HelpCtx(\"test.Test$Nested\");\n" +
" }\n" +
"}\n");
}
Expand Down
5 changes: 4 additions & 1 deletion apisupport/timers/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
# under the License.

javac.compilerargs=-Xlint:unchecked
javac.source=1.6
javac.source=1.8
test.unit.run.cp.extra=\
${openide.options.dir}/modules/org-openide-awt.jar:\
javadoc.arch=${basedir}/arch.xml

test.config.stable.includes=**/InstanceWatcherTest.class,\
**/TimesCollectorPeerTest.class
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
import java.io.File;
import java.io.IOException;
import javax.swing.JFrame;
import org.netbeans.junit.MockServices;
import org.netbeans.junit.NbTestCase;
import org.netbeans.modules.timers.TimeComponent;
import org.openide.filesystems.FileObject;
import org.openide.filesystems.FileUtil;
import org.openide.filesystems.LocalFileSystem;
Expand Down

0 comments on commit 069f646

Please sign in to comment.