Skip to content

Commit

Permalink
Merge pull request apache#2158 from hectorespert/github_windows_action
Browse files Browse the repository at this point in the history
Continuous build in Windows
  • Loading branch information
hectorespert authored Jun 9, 2020
2 parents 9d5fc4a + 272d199 commit fb64095
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 0 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.

name: Apache Netbeans Continuous Integration

on:
push:
pull_request:

jobs:
windows:
name: Windows build
runs-on: windows-2019
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Caching dependencies
uses: actions/cache@v2
with:
path: ~/.hgexternalcache
key: ${{ runner.os }}-${{ hashFiles('**/external/binaries-list') }}
restore-keys: ${{ runner.os }}-

- name: Clean
run: ant clean

- name: Build
run: ant build

- name: Test
run: ant -f platform/core.network test
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 org.netbeans.core.network.utils.hname.win;

import com.sun.jna.Platform;
import org.netbeans.junit.NbTestCase;

/**
*
* @author Hector Espert
*/
public class HostnameUtilsWinTest extends NbTestCase {

public HostnameUtilsWinTest(String name) {
super(name);
}

@Override
public boolean canRun() {
return super.canRun() && Platform.isWindows();
}

public void testGetComputerName() throws Exception {
assertNotNull(HostnameUtilsWin.getComputerName());
}

public void testGetHostName() throws Exception {
assertNotNull(HostnameUtilsWin.getHostName(true));
assertNotNull(HostnameUtilsWin.getHostName(false));
}

}

0 comments on commit fb64095

Please sign in to comment.