From 39a1dd0a40846af51d29c248c8969a91370c217d Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 19 Sep 2018 18:16:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?REPORT-11403=20=E6=9F=A5=E8=AF=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E5=87=BA=E6=9D=A5=E7=9A=84=E6=A8=AA=E5=90=91=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1=E4=BD=8D=E7=BD=AE=E5=81=8F=E4=B8=8A=E4=BA=86?= =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E4=B8=8B=E7=BA=B5=E5=90=91=E6=BB=9A?= =?UTF-8?q?=E5=8A=A8=E6=9D=A1=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/preview/RobotPreviewPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java index bd13d6aae8..4582d186be 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/preview/RobotPreviewPane.java @@ -77,7 +77,7 @@ public class RobotPreviewPane extends JPanel { }); editorPane.setEditable(false); UIScrollPane jScrollPane = new UIScrollPane(editorPane); - jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 30, 0)); + jScrollPane.getVerticalScrollBar().setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); jScrollPane.setBorder(BorderFactory.createMatteBorder(5, 10, 0, 10, Color.white)); if (((RobotModel) model).isHotItemModel()) { this.setPreferredSize(new Dimension(AlphaFineConstants.RIGHT_WIDTH, AlphaFineConstants.CONTENT_HEIGHT - HOT_TITLE_AREA_HEIGHT)); From 611df1e0ab70d8d78035c35ba8f5070deb335710 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 19 Sep 2018 18:18:27 +0800 Subject: [PATCH 2/4] UT --- .../alphafine/cell/model/ModelTest.java | 77 +++++++++++++ .../component/AlphaFineDialogTest.java | 33 ++++++ .../manager/impl/SearchManegerTest.java | 104 ++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java create mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java create mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java new file mode 100644 index 0000000000..e2ba354d56 --- /dev/null +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java @@ -0,0 +1,77 @@ +package com.fr.design.mainframe.alphafine.cell.model; + +import com.fr.design.mainframe.alphafine.AlphaFineConstants; +import com.fr.design.mainframe.alphafine.CellType; +import com.fr.json.JSONException; +import com.fr.json.JSONObject; +import org.junit.Assert; +import org.junit.Test; + +public class ModelTest { + @Test + public void documentModelTest(){ + DocumentModel documentModel = new DocumentModel("name","content",1); + Assert.assertEquals("name",documentModel.getName()); + Assert.assertEquals("content",documentModel.getContent()); + Assert.assertEquals(1,documentModel.getDocumentId()); + Assert.assertEquals(AlphaFineConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); + Assert.assertEquals(AlphaFineConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); + Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); + Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); + Assert.assertEquals(true, documentModel.hasAction()); + Assert.assertEquals(true, documentModel.isNeedToSendToServer()); + + documentModel.setDescription("test"); + Assert.assertEquals("test", documentModel.getDescription()); + + DocumentModel another = new DocumentModel("another","another",1); + documentModel.doAction(); + Assert.assertTrue(another.equals(documentModel)); + Assert.assertNotNull(documentModel.modelToJson()); + } + + @Test + public void bottomModelTest(){ + BottomModel bottomModel = new BottomModel(); + Assert.assertEquals(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Internet_Forum"), bottomModel.getGoToWeb()); + Assert.assertEquals(CellType.BOTTOM, bottomModel.getType()); + try { + Assert.assertEquals(JSONObject.EMPTY, bottomModel.modelToJson()); + } catch (JSONException e) { + e.printStackTrace(); + } + Assert.assertEquals(true, bottomModel.hasAction()); + bottomModel.doAction(); + + } + + @Test + public void fileModelTest(){ + FileModel fileModel = new FileModel("name", "test\\\\"); + Assert.assertEquals(CellType.FILE, fileModel.getType()); + Assert.assertNotNull(fileModel.modelToJson()); + FileModel anotherFileModel = new FileModel("anotherFileModel", "test\\\\"); + Assert.assertTrue(anotherFileModel.equals(fileModel)); + } + + @Test + public void moreModelTest(){ + MoreModel moreModel = new MoreModel("name"); + Assert.assertTrue(!moreModel.hasAction()); + Assert.assertTrue(!moreModel.isNeedToSendToServer()); + Assert.assertEquals(CellType.MORE, moreModel.getType()); + } + + @Test + public void noResultModelTest(){ + NoResultModel noResultModel = new NoResultModel("test"); + Assert.assertTrue(!noResultModel.hasAction()); + Assert.assertTrue(!noResultModel.isNeedToSendToServer()); + Assert.assertEquals(CellType.NO_RESULT, noResultModel.getType()); + } + + @Test + public void pluginModelTest(){ +// PluginModel pluginModel = new PluginModel("name","content"); + } +} diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java new file mode 100644 index 0000000000..25a555ed8d --- /dev/null +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java @@ -0,0 +1,33 @@ +package com.fr.design.mainframe.alphafine.component; + +import org.junit.Before; +import org.junit.Test; + +public class AlphaFineDialogTest { + +// AlphaFineDialog alphaFineDialog; + + @Before + public void setUp() { +// alphaFineDialog = EasyMock.createMock(AlphaFineDialog.class); + + } + + + @Test + public void doNormalSearchTest() { +// try { +// EasyMock.expect(AlphaFineConfigManager.isALPHALicAvailable()).andReturn(true); +// AlphaFineHelper.showAlphaFineDialog(false); +// Method format = AlphaFineDialog.class.getDeclaredMethod("doNormalSearch", String.class); +// format.setAccessible(true); +// EasyMock.expect(alphaFineDialog.getSegmentationResult()).andReturn(new String[]{"数据集"}); +// format.invoke(alphaFineDialog, "数据集"); +//// EasyMock.replay(alphaFineDialog); +// Assert.assertNotNull(alphaFineDialog.getSegmentationResult()); +// } catch (Exception e) { +// e.printStackTrace(); +// } + + } +} diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java new file mode 100644 index 0000000000..f7a377c53f --- /dev/null +++ b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java @@ -0,0 +1,104 @@ +package com.fr.design.mainframe.alphafine.search.manager.impl; + +import com.fr.design.mainframe.alphafine.AlphaFineHelper; +import com.fr.design.mainframe.alphafine.CellType; +import com.fr.design.mainframe.alphafine.model.SearchResult; +import com.fr.json.JSONObject; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +public class SearchManegerTest { + SimilarSearchManeger similarSearchManeger; + ComplementAdviceManager complementAdviceManager; + DocumentSearchManager documentSearchManager; + PluginSearchManager pluginSearchManager; + RecommendSearchManager recommendSearchManager; + RecentSearchManager recentSearchManager; + ActionSearchManager actionSearchManager; + FileSearchManager fileSearchManager; + SegmentationManager segmentationManager; + + @Before + public void setUp() { + recentSearchManager = RecentSearchManager.getInstance(); + recommendSearchManager = RecommendSearchManager.getInstance(); + similarSearchManeger = SimilarSearchManeger.getInstance(); + complementAdviceManager = ComplementAdviceManager.getInstance(); + documentSearchManager = DocumentSearchManager.getInstance(); + pluginSearchManager = PluginSearchManager.getInstance(); + actionSearchManager = ActionSearchManager.getInstance(); + fileSearchManager = FileSearchManager.getInstance(); + segmentationManager = SegmentationManager.getInstance(); + } + + @Test + public void getSearchResultTest() { + + //断网情况 + SearchResult noConnectList; + noConnectList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(similarSearchManeger).get(1).getName()); + + noConnectList = documentSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(documentSearchManager).get(1).getName()); + + noConnectList = pluginSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(pluginSearchManager).get(1).getName()); + + noConnectList = recommendSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(recommendSearchManager).get(1).getName()); + + //正常搜索情况 + String[][] hotData = HotIssuesManager.getInstance().getHotIssues(); + SearchResult lessModelList; + lessModelList = recentSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertNotNull(lessModelList); + + lessModelList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); + + lessModelList = complementAdviceManager.getAllSearchResult(new String[]{"数据集"}); + Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); + + lessModelList = documentSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(lessModelList.get(1).getType(), CellType.DOCUMENT); + + lessModelList = pluginSearchManager.getLessSearchResult(new String[]{"数据集"}); + Assert.assertEquals(lessModelList.get(1).getType(), CellType.PLUGIN); + + //返回MoreSearchResult + SearchResult moreModelList; + moreModelList = similarSearchManeger.getMoreSearchResult("数据集"); + Assert.assertNotNull(moreModelList); + + moreModelList = documentSearchManager.getMoreSearchResult("数据集"); + Assert.assertNotNull(moreModelList); + + moreModelList = pluginSearchManager.getMoreSearchResult("数据集"); + Assert.assertNotNull(moreModelList); + + moreModelList = recommendSearchManager.getMoreSearchResult("数据集"); + Assert.assertNotNull(moreModelList); + } + + @Test + public void getModelFromCloudTest() { + Assert.assertNotNull(SimilarSearchManeger.getModelFromCloud(new JSONObject())); + Assert.assertNotNull(DocumentSearchManager.getModelFromCloud(new JSONObject())); + Assert.assertNotNull(PluginSearchManager.getModelFromCloud(new JSONObject())); + } + + @Test + public void isNeedSegmentationTest() { + Assert.assertEquals(segmentationManager.isNeedSegmentation("多维数据集"), true); + } + + @Test + public void startSegmentationTest() { + String[] result = {"结果报表", "结果", "报表"}; + Assert.assertEquals(segmentationManager.startSegmentation("结果报表"), result); + + } + +} From 687bc4a92358ee49107a873ed8bfa31d185f059a Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 19 Sep 2018 18:22:18 +0800 Subject: [PATCH 3/4] =?UTF-8?q?UT=E6=9A=82=E6=97=B6=E4=B8=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../alphafine/cell/model/ModelTest.java | 77 ------------- .../component/AlphaFineDialogTest.java | 33 ------ .../manager/impl/SearchManegerTest.java | 104 ------------------ 3 files changed, 214 deletions(-) delete mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java delete mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java delete mode 100644 designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java deleted file mode 100644 index e2ba354d56..0000000000 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/cell/model/ModelTest.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.fr.design.mainframe.alphafine.cell.model; - -import com.fr.design.mainframe.alphafine.AlphaFineConstants; -import com.fr.design.mainframe.alphafine.CellType; -import com.fr.json.JSONException; -import com.fr.json.JSONObject; -import org.junit.Assert; -import org.junit.Test; - -public class ModelTest { - @Test - public void documentModelTest(){ - DocumentModel documentModel = new DocumentModel("name","content",1); - Assert.assertEquals("name",documentModel.getName()); - Assert.assertEquals("content",documentModel.getContent()); - Assert.assertEquals(1,documentModel.getDocumentId()); - Assert.assertEquals(AlphaFineConstants.DOCUMENT_DOC_URL + documentModel.getDocumentId() + ".html", documentModel.getDocumentUrl()); - Assert.assertEquals(AlphaFineConstants.DOCUMENT_INFORMATION_URL + documentModel.getDocumentId(), documentModel.getInformationUrl()); - Assert.assertEquals(documentModel.getStoreInformation(), documentModel.getInformationUrl()); - Assert.assertEquals(CellType.DOCUMENT, documentModel.getType()); - Assert.assertEquals(true, documentModel.hasAction()); - Assert.assertEquals(true, documentModel.isNeedToSendToServer()); - - documentModel.setDescription("test"); - Assert.assertEquals("test", documentModel.getDescription()); - - DocumentModel another = new DocumentModel("another","another",1); - documentModel.doAction(); - Assert.assertTrue(another.equals(documentModel)); - Assert.assertNotNull(documentModel.modelToJson()); - } - - @Test - public void bottomModelTest(){ - BottomModel bottomModel = new BottomModel(); - Assert.assertEquals(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_AlphaFine_Internet_Forum"), bottomModel.getGoToWeb()); - Assert.assertEquals(CellType.BOTTOM, bottomModel.getType()); - try { - Assert.assertEquals(JSONObject.EMPTY, bottomModel.modelToJson()); - } catch (JSONException e) { - e.printStackTrace(); - } - Assert.assertEquals(true, bottomModel.hasAction()); - bottomModel.doAction(); - - } - - @Test - public void fileModelTest(){ - FileModel fileModel = new FileModel("name", "test\\\\"); - Assert.assertEquals(CellType.FILE, fileModel.getType()); - Assert.assertNotNull(fileModel.modelToJson()); - FileModel anotherFileModel = new FileModel("anotherFileModel", "test\\\\"); - Assert.assertTrue(anotherFileModel.equals(fileModel)); - } - - @Test - public void moreModelTest(){ - MoreModel moreModel = new MoreModel("name"); - Assert.assertTrue(!moreModel.hasAction()); - Assert.assertTrue(!moreModel.isNeedToSendToServer()); - Assert.assertEquals(CellType.MORE, moreModel.getType()); - } - - @Test - public void noResultModelTest(){ - NoResultModel noResultModel = new NoResultModel("test"); - Assert.assertTrue(!noResultModel.hasAction()); - Assert.assertTrue(!noResultModel.isNeedToSendToServer()); - Assert.assertEquals(CellType.NO_RESULT, noResultModel.getType()); - } - - @Test - public void pluginModelTest(){ -// PluginModel pluginModel = new PluginModel("name","content"); - } -} diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java deleted file mode 100644 index 25a555ed8d..0000000000 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/component/AlphaFineDialogTest.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.fr.design.mainframe.alphafine.component; - -import org.junit.Before; -import org.junit.Test; - -public class AlphaFineDialogTest { - -// AlphaFineDialog alphaFineDialog; - - @Before - public void setUp() { -// alphaFineDialog = EasyMock.createMock(AlphaFineDialog.class); - - } - - - @Test - public void doNormalSearchTest() { -// try { -// EasyMock.expect(AlphaFineConfigManager.isALPHALicAvailable()).andReturn(true); -// AlphaFineHelper.showAlphaFineDialog(false); -// Method format = AlphaFineDialog.class.getDeclaredMethod("doNormalSearch", String.class); -// format.setAccessible(true); -// EasyMock.expect(alphaFineDialog.getSegmentationResult()).andReturn(new String[]{"数据集"}); -// format.invoke(alphaFineDialog, "数据集"); -//// EasyMock.replay(alphaFineDialog); -// Assert.assertNotNull(alphaFineDialog.getSegmentationResult()); -// } catch (Exception e) { -// e.printStackTrace(); -// } - - } -} diff --git a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java b/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java deleted file mode 100644 index f7a377c53f..0000000000 --- a/designer-realize/src/test/java/com.fr/design/mainframe/alphafine/search/manager/impl/SearchManegerTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.fr.design.mainframe.alphafine.search.manager.impl; - -import com.fr.design.mainframe.alphafine.AlphaFineHelper; -import com.fr.design.mainframe.alphafine.CellType; -import com.fr.design.mainframe.alphafine.model.SearchResult; -import com.fr.json.JSONObject; -import org.junit.Assert; -import org.junit.Before; -import org.junit.Test; - -public class SearchManegerTest { - SimilarSearchManeger similarSearchManeger; - ComplementAdviceManager complementAdviceManager; - DocumentSearchManager documentSearchManager; - PluginSearchManager pluginSearchManager; - RecommendSearchManager recommendSearchManager; - RecentSearchManager recentSearchManager; - ActionSearchManager actionSearchManager; - FileSearchManager fileSearchManager; - SegmentationManager segmentationManager; - - @Before - public void setUp() { - recentSearchManager = RecentSearchManager.getInstance(); - recommendSearchManager = RecommendSearchManager.getInstance(); - similarSearchManeger = SimilarSearchManeger.getInstance(); - complementAdviceManager = ComplementAdviceManager.getInstance(); - documentSearchManager = DocumentSearchManager.getInstance(); - pluginSearchManager = PluginSearchManager.getInstance(); - actionSearchManager = ActionSearchManager.getInstance(); - fileSearchManager = FileSearchManager.getInstance(); - segmentationManager = SegmentationManager.getInstance(); - } - - @Test - public void getSearchResultTest() { - - //断网情况 - SearchResult noConnectList; - noConnectList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(similarSearchManeger).get(1).getName()); - - noConnectList = documentSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(documentSearchManager).get(1).getName()); - - noConnectList = pluginSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(pluginSearchManager).get(1).getName()); - - noConnectList = recommendSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(noConnectList.get(1).getName(), AlphaFineHelper.getNoConnectList(recommendSearchManager).get(1).getName()); - - //正常搜索情况 - String[][] hotData = HotIssuesManager.getInstance().getHotIssues(); - SearchResult lessModelList; - lessModelList = recentSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertNotNull(lessModelList); - - lessModelList = similarSearchManeger.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); - - lessModelList = complementAdviceManager.getAllSearchResult(new String[]{"数据集"}); - Assert.assertEquals(lessModelList.get(1).getType(), CellType.ROBOT); - - lessModelList = documentSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(lessModelList.get(1).getType(), CellType.DOCUMENT); - - lessModelList = pluginSearchManager.getLessSearchResult(new String[]{"数据集"}); - Assert.assertEquals(lessModelList.get(1).getType(), CellType.PLUGIN); - - //返回MoreSearchResult - SearchResult moreModelList; - moreModelList = similarSearchManeger.getMoreSearchResult("数据集"); - Assert.assertNotNull(moreModelList); - - moreModelList = documentSearchManager.getMoreSearchResult("数据集"); - Assert.assertNotNull(moreModelList); - - moreModelList = pluginSearchManager.getMoreSearchResult("数据集"); - Assert.assertNotNull(moreModelList); - - moreModelList = recommendSearchManager.getMoreSearchResult("数据集"); - Assert.assertNotNull(moreModelList); - } - - @Test - public void getModelFromCloudTest() { - Assert.assertNotNull(SimilarSearchManeger.getModelFromCloud(new JSONObject())); - Assert.assertNotNull(DocumentSearchManager.getModelFromCloud(new JSONObject())); - Assert.assertNotNull(PluginSearchManager.getModelFromCloud(new JSONObject())); - } - - @Test - public void isNeedSegmentationTest() { - Assert.assertEquals(segmentationManager.isNeedSegmentation("多维数据集"), true); - } - - @Test - public void startSegmentationTest() { - String[] result = {"结果报表", "结果", "报表"}; - Assert.assertEquals(segmentationManager.startSegmentation("结果报表"), result); - - } - -} From 7452f05304f7da97c6718375a943241e36dc83c4 Mon Sep 17 00:00:00 2001 From: "alex.sung" Date: Wed, 19 Sep 2018 20:34:28 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=8E=9F=E5=85=88=E7=9A=84=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E7=BD=91=E7=BB=9C=E6=96=AD=E5=BC=80=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E7=94=A8swingworker=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C=E5=81=B6=E7=8E=B0=E6=80=A7?= =?UTF-8?q?=E7=9A=84=E4=BC=9A=E5=8D=A1=E4=BD=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/alphafine/AlphaFineHelper.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java index 7b20a44cf2..93e60182c2 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/alphafine/AlphaFineHelper.java @@ -22,9 +22,6 @@ import com.fr.json.JSONException; import com.fr.json.JSONObject; import com.fr.json.JSONUtils; import com.fr.stable.StringUtils; -import com.fr.third.org.apache.http.HttpStatus; -import com.fr.third.org.apache.http.StatusLine; -import com.fr.third.org.apache.http.client.methods.HttpGet; import java.util.List; @@ -159,10 +156,9 @@ public class AlphaFineHelper { * @return */ public static boolean isNetworkOk(){ - HttpGet getHelp = new HttpGet(URL_FOR_TEST_NETWORK); try { - StatusLine statusLine = HttpToolbox.getHttpClient(URL_FOR_TEST_NETWORK).execute(getHelp).getStatusLine(); - return statusLine.getStatusCode() == HttpStatus.SC_OK; + HttpToolbox.get(URL_FOR_TEST_NETWORK); + return true; } catch (Exception ignore) { // 网络异常 return false;