鳥語林-論壇系統自動化測試

文章目錄

  • 一、自動化實施步驟
    • 1.1編寫Web測試用例
    • 1.2 編寫自動化代碼
      • 1.2.1 LoginPageTest
        • 1) 能否正確打開登錄頁面
        • 2) 點擊去注冊能否跳轉注冊頁面
        • 3) 模擬用戶登錄,輸入多組登錄測試用例
      • 1.2.2 RegisterPageTest
        • 1) 能否成功打開注冊頁面
        • 2) 注冊測試用例
        • 3) 點擊去登錄按鈕 測試注冊成功的用例
      • 1.2.3 IndexPageTest
        • 1) 首頁不同帖子簡要內容能否正常顯示
        • 2) 其他板塊下不同帖子簡要內容能否正常顯示
        • 3) 搜索功能
        • 4) 進入帖子詳情頁
      • 1.2.4 MyPostPageTest
        • 1) 登錄狀態下個人帖子列表能否正常顯示
      • 1.2.5 DoPostPageTest
        • 1) 登錄狀態下發布帖子

一、自動化實施步驟

對論壇Web系統開展自動化測試,以不同頁面為維度來編寫測試用例,根據測試用例,結合Selenium來設計自動化代碼。同時采用junit進行單元測試,避免不同測試方法之間造成干擾,影響測試結果。

論壇系統在線訪問鏈接:http://82.156.186.83:8080/index.html

1.1編寫Web測試用例

在這里插入圖片描述

1.2 編寫自動化代碼

在pom.xml文件中導入所需的依賴

<dependencies><!--WebDriverManager是?個開源Java庫,--><dependency><groupId>io.github.bonigarcia</groupId><artifactId>webdrivermanager</artifactId><version>5.8.0</version><scope>test</scope></dependency><!--selenium-java--><dependency><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-java</artifactId><version>4.0.0</version></dependency><!--單元測試--><dependency><groupId>org.junit.jupiter</groupId><artifactId>junit-jupiter-api</artifactId><version>5.10.3</version><scope>test</scope></dependency></dependencies>

提取一些所有頁面測試都需要初始化的屬性到父類ObjTest中

public abstract class ObjTest {public EdgeOptions options;public WebDriver driver;public void init() {//使用驅動管理器-自動初始化對應版本的瀏覽器驅動WebDriverManager.edgedriver().setup();//配置一下選項-允許訪問所有鏈接options = new EdgeOptions();options.addArguments("--remote-allow-origins=*");}}

1.2.1 LoginPageTest

1) 能否正確打開登錄頁面

判斷能否正確打開登錄頁面,以登錄頁面特有的元素是否成功獲取到作為判斷打開登錄頁面的標志

public Boolean openLoginPage() {//1.打開瀏覽器頁面driver.get(loginPageUrl);//2.定位到登錄頁面 - 某些只有登錄頁面特有的元素// 如果能找到這些元素那么就判定成功打開登錄頁面WebElement element = driver.findElement(By.cssSelector("body > div > div > div > div:nth-child(1) > div > div.card.card-md > div > h2"));return element != null && "用戶登錄".equals(element.getText());}
 	@Testvoid openLoginPage() {System.out.println("能否成功打開登錄頁面" + loginTest.openLoginPage());loginTest.close();}

在這里插入圖片描述

2) 點擊去注冊能否跳轉注冊頁面

判斷點擊"去注冊"按鈕能否正確打開登錄頁面,以注冊頁面特有的元素是否存在到作為判斷標志

 /**** 1.打開登錄頁面* 2.選中"去注冊"按鈕* 3.成功跳轉注冊頁面* 4.選中注冊頁面特有的元素來判斷是否成功跳轉到注冊頁面* @return*/public Boolean clickRegisterButon() {driver.get(loginPageUrl);WebElement element = driver.findElement(By.cssSelector("body > div > div > div > div:nth-child(1) > div > div.text-center.text-muted.mt-3 > a"));if (element == null) return false;element.click();WebElement registerHeader = driver.findElement(By.cssSelector("#signUpForm > div > h2"));if (registerHeader == null) return false;return "用戶注冊".equals(registerHeader.getText());}
@Test
void clickRegisterButon() {System.out.println("點擊去注冊按鈕能否成功跳轉注冊頁面:"+ loginTest.clickRegisterButon());loginTest.close();
}

在這里插入圖片描述

3) 模擬用戶登錄,輸入多組登錄測試用例

成功打開登錄頁面以后,在登錄頁面,模擬用戶登錄,輸入用戶名和密碼,模擬輸入設計好的測試,以登錄成功跳轉到首頁為標志例判斷能否登錄成功。

/*** 1.打開登錄頁面* 2.找到用戶名和密碼輸入框* 3.sendKeys 輸入登錄測試用例* 4.找到登錄按鈕并點擊* 5.判斷結果是否與測試用例一致** @param password* @param username* @return*/public Boolean login(String username, String password) throws InterruptedException {driver.get(loginPageUrl);WebElement inputName = driver.findElement(By.cssSelector("#username"));WebElement inputPasw = driver.findElement(By.cssSelector("#password"));if (inputName == null || inputPasw == null) return false;//輸入數據之前清空一下輸入框中的數據,避免之前輸入框中原有的數據對測試造成干擾inputName.clear();inputPasw.clear();inputName.sendKeys(username);inputPasw.sendKeys(password);driver.findElement(By.cssSelector("#submit")).click();Thread.sleep(2000);WebElement element = null;try {element = driver.findElement(By.cssSelector("#nav_board_index > a > span"));} catch (Exception e) {e.printStackTrace();}if (element == null) return false;return "首頁".equals(element.getText());}
 	@Testvoid login() throws InterruptedException {System.out.println("能否成功登錄{testUser,h123,true}:" +loginTest.login("testUser", "h123"));loginTest.driver.navigate().back();System.out.println("能否成功登錄{測試用戶,h123,true}:" +loginTest.login("測試用戶", "h123"));loginTest.driver.navigate().back();System.out.println("能否成功登錄{測試,h123,false}:" +loginTest.login("測試", "h123"));loginTest.driver.navigate().back();System.out.println("能否成功登錄{testUser,123,false}:" +loginTest.login("測試", "h123"));loginTest.close();}

在這里插入圖片描述

測試結果與預期一致

1.2.2 RegisterPageTest

1) 能否成功打開注冊頁面
/*** 1.打開注冊頁面* 2.查找注冊頁面特有元素** @return*/public boolean openRegisterPage() {driver.get(registerPageUrl);WebElement registerHeader = driver.findElement(By.cssSelector("#signUpForm > div > h2"));if (registerHeader == null) return false;return "用戶注冊".equals(registerHeader.getText());}
   @Testvoid openRegisterPage() {System.out.println("能否成功打開注冊頁面:" + registerPageTest.openRegisterPage());}

在這里插入圖片描述

2) 注冊測試用例
 /*** 1.打開注冊頁面* 2.找到四個輸入框* 3.輸入測試用例* ***  1) 對輸入框先調用一下clear方法,防止之前的參數造成測試不準確* 4,點擊注冊按鈕能否成功跳轉到登錄** @param user* @return*/public boolean register(User user) {driver.get(registerPageUrl);WebElement inputUserName = driver.findElement(By.cssSelector("#username"));WebElement inputNickName = driver.findElement(By.cssSelector("#nickname"));WebElement inputPas = driver.findElement(By.cssSelector("#password"));WebElement inputReptedPas = driver.findElement(By.cssSelector("#passwordRepeat"));if (inputUserName == null || inputNickName == null|| inputPas == null || inputReptedPas == null) {return false;}inputUserName.clear();inputNickName.clear();inputPas.clear();inputReptedPas.clear();inputUserName.sendKeys(user.getUsername());inputNickName.sendKeys(user.getNickname());inputPas.sendKeys(user.getPassword());inputReptedPas.sendKeys(user.getRepeatedPas());WebElement registerButton = driver.findElement(By.cssSelector("#submit"));registerButton.click();driver.manage().timeouts().implicitlyWait(Duration.ofMillis(2000));WebElement loginHeader = null;try {loginHeader = driver.findElement(By.cssSelector("body > div > div > div > div:nth-child(1) > div > div.card.card-md > div > h2"));} catch (Exception e) {return false;}if (loginHeader == null) {return false;}return "用戶登錄".equals(loginHeader.getText());}

User

public class User {private String username = "";private String password = "";private String nickname = "";private String repeatedPas = "";public String getUsername() {return username;}public void setUsername(String username) {this.username = username;}public String getPassword() {return password;}public void setPassword(String password) {this.password = password;}public String getNickname() {return nickname;}public void setNickname(String nickname) {this.nickname = nickname;}public String getRepeatedPas() {return repeatedPas;}public void setRepeatedPas(String repeatedPas) {this.repeatedPas = repeatedPas;}@Overridepublic String toString() {return "User{" +"username='" + username + '\'' +", password='" + password + '\'' +", nickname='" + nickname + '\'' +", repeatedPas='" + repeatedPas + '\'' +'}';}
}
 @Testvoid register() throws InterruptedException {User u1Success = new User();u1Success.setUsername("testRegister11");u1Success.setNickname("煜");u1Success.setPassword("123456h");u1Success.setRepeatedPas("123456h");System.out.println(u1Success.toString()+ registerPageTest.register(u1Success));User u2 = new User();System.out.println(u2.toString()+ registerPageTest.register(u2));User u3 = new User();u3.setNickname("昵稱");u3.setPassword("123");u3.setRepeatedPas("123");System.out.println(u3.toString()+ registerPageTest.register(u3));User u4 = new User();u4.setUsername("testRegister");u4.setNickname("煜");u4.setPassword("123456h");u4.setRepeatedPas("123");System.out.println(u4.toString()+ registerPageTest.register(u4));registerPageTest.close();}

在這里插入圖片描述

3) 點擊去登錄按鈕 測試注冊成功的用例
 /*** 1.打開注冊頁面* 2.點擊去登陸按鈕* 3.找到輸入框,清空之后在輸入* 4.點擊登錄按鈕,能否成功跳轉到首頁** @param user* @return*/public boolean clickLoginButton(User user) {driver.get(registerPageUrl);WebElement toLoginButton = driver.findElement(By.cssSelector("body > div > div > div > a"));if (toLoginButton == null) return false;toLoginButton.click();WebElement inputName = driver.findElement(By.cssSelector("#username"));WebElement inputPasw = driver.findElement(By.cssSelector("#password"));if (inputName == null || inputPasw == null) return false;inputName.clear();inputPasw.clear();inputName.sendKeys(user.getUsername());inputPasw.sendKeys(user.getPassword());driver.findElement(By.cssSelector("#submit")).click();driver.manage().timeouts().implicitlyWait(Duration.ofMillis(2000));WebElement element = null;try {element = driver.findElement(By.cssSelector("#nav_board_index > a > span"));} catch (Exception e) {}if (element == null) return false;return "首頁".equals(element.getText());}
 @Testvoid clickLoginButton() {User user = new User();user.setUsername("testRegister11");user.setPassword("123456h");System.out.println("點擊去登錄:"+registerPageTest.clickLoginButton(user));registerPageTest.close();}

在這里插入圖片描述

1.2.3 IndexPageTest

1) 首頁不同帖子簡要內容能否正常顯示
 /*** 1.登錄狀態下訪問首頁* 2.查找 不同帖子是否存在=== elements 多個class為row的div標簽是否存在多個** @param user* @return*/public boolean displayDiffPosts(User user) throws InterruptedException {Boolean login = login(user.getUsername(), user.getPassword());if (!login) return false;List<WebElement> elements = driver.findElements(By.cssSelector("#artical-items-body > div"));Thread.sleep(2000);return elements.size() >= 1;}
 @Testvoid displayDiffPosts() throws InterruptedException {User user = new User();user.setUsername("testUser");user.setPassword("h123");System.out.println("登錄狀態下首頁不同帖子能否正常顯示:" +indexPageTest.displayDiffPosts(user));}
2) 其他板塊下不同帖子簡要內容能否正常顯示
 /*** 1.登錄狀態下點擊不同板塊* 2.查看該板塊下的 不同帖子能否正常顯示** @param user* @return* @throws InterruptedException*/public boolean clickDiffBoard(User user) throws InterruptedException {Boolean login = login(user.getUsername(), user.getPassword());if (!login) return false;//隱式等待5秒driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));WebElement boardTitle = driver.findElement(By.cssSelector("#topBoardList > li:nth-child(2) > a > span"));if (boardTitle == null) return false;boardTitle.click();WebElement element = driver.findElement(By.cssSelector("#article_list_board_title"));System.out.println(element.getText());return element != null && element.getText().length() > 0;}
@Testvoid clickDiffBoard() throws InterruptedException {User user = new User();user.setUsername("testUser");user.setPassword("h123");System.out.println("登錄狀態下不同板塊不同帖子能否正常顯示:" +indexPageTest.clickDiffBoard(user));}
3) 搜索功能
 /*** 1.登錄* 2.找到輸入框* 3.輸入關鍵詞* 4.搜索下拉框 能否找到多個結果元素** @param user* @return* @throws InterruptedException*/public boolean search(User user) throws InterruptedException {Boolean login = login(user.getUsername(), user.getPassword());if (!login) return false;//隱式等待5秒driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));WebElement inputSearch = driver.findElement(By.cssSelector("#input-search"));if (inputSearch == null) return false;inputSearch.sendKeys("java");List<WebElement> sarchElements = driver.findElements(By.cssSelector("#search-down>a"));return sarchElements.size() > 1;}
 @Testvoid seachr() throws InterruptedException {User user = new User();user.setUsername("testUser");user.setPassword("h123");System.out.println("登錄狀態下搜索功能能否正常使用:" +indexPageTest.search(user));}
4) 進入帖子詳情頁
 /*** 1.登錄之后點擊帖子正文* 2.跳轉到詳情頁* 3.以詳情頁正文內容 能否查找到 并且正文長度大于0** @param user* @return* @throws InterruptedException*/public boolean intoDetailsPage(User user) throws InterruptedException {Boolean login = login(user.getUsername(), user.getPassword());if (!login) return false;//隱式等待5秒driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));WebElement postContent = driver.findElement(By.cssSelector("#artical-items-body > div:nth-child(1) > div > div.col > div.text-muted.mt-2 > div > div.content"));postContent.click();WebElement detailContent = driver.findElement(By.cssSelector("#details_article_content > p"));return detailContent != null && detailContent.getText().length() > 0;}
  @Testvoid intoDetailsPage() throws InterruptedException {User user = new User();user.setUsername("testUser");user.setPassword("h123");System.out.println("登錄狀態下點擊帖子正文進入帖子詳情頁:" +indexPageTest.intoDetailsPage(user));}

? 在這里插入圖片描述

1.2.4 MyPostPageTest

1) 登錄狀態下個人帖子列表能否正常顯示
package forum;import forum.model.User;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;import java.time.Duration;public class MyPostPageTest extends ObjTest {private final String loginPageUrl = "http://82.156.186.83:8080/sign-in.html";public MyPostPageTest() {init();}private Boolean login(String username, String password) throws InterruptedException {driver.get(loginPageUrl);WebElement inputName = driver.findElement(By.cssSelector("#username"));WebElement inputPasw = driver.findElement(By.cssSelector("#password"));if (inputName == null || inputPasw == null) return false;inputName.clear();inputPasw.clear();inputName.sendKeys(username);inputPasw.sendKeys(password);driver.findElement(By.cssSelector("#submit")).click();Thread.sleep(2000);WebElement element = null;try {element = driver.findElement(By.cssSelector("#nav_board_index > a > span"));} catch (Exception e) {}if (element == null) return false;return "首頁".equals(element.getText());}/*** 1.登錄狀態下進入個人帖子頁面* 2.檢查個人帖子頁面元素是否正常顯示** @param user* @return* @throws InterruptedException*/public boolean displayMyPostPage(User user) throws InterruptedException {Boolean login = login(user.getUsername(), user.getPassword());if (!login) return false;driver.findElement(By.cssSelector("#index_nav_avatar")).click();WebElement element = driver.findElement(By.cssSelector("#index_user_profile"));if (element == null) return false;element.click();//隱式等待5秒driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));WebElement registerTime = driver.findElement(By.cssSelector("#profile_createTime"));if (registerTime == null) return false;return registerTime.getText().length() > 0;}
}
 @Testvoid displayMyPostPage() throws InterruptedException {User user = new User();user.setUsername("testUser");user.setPassword("h123");myPostPageTest.displayMyPostPage(user);}

在這里插入圖片描述

1.2.5 DoPostPageTest

1) 登錄狀態下發布帖子
public boolean doPost(User user, Article article) throws InterruptedException {login(user.getUsername(), user.getPassword());//隱式等待5秒driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(5));driver.findElement(By.cssSelector("#bit-forum-content > div.page-header.d-print-none > div > div > div.col-auto.ms-auto.d-print-none > div > div")).click();WebElement inputTitle = driver.findElement(By.cssSelector("#article_post_title"));inputTitle.sendKeys(article.getTitle());Thread.sleep(3000);WebElement inputContent = driver.findElement(By.cssSelector("#edit-article > div.CodeMirror.cm-s-default.CodeMirror-wrap > div.CodeMirror-scroll > div.CodeMirror-sizer > div > div > div > div.CodeMirror-code > div > pre > span > span"));Actions action = new Actions(driver);action.doubleClick(inputContent).sendKeys(Keys.DELETE).perform();action.sendKeys(article.getContent()).perform();Thread.sleep(5000);driver.findElement(By.cssSelector("#article_post_submit")).click();return true;}
 @Testvoid doPost() throws InterruptedException {User user = new User();user.setUsername("testUser");user.setPassword("h123");Article article = new Article();article.setTitle("ceshititle");article.setContent("secshiContent");doPostPageTest.doPost(user,article);}

發布帖子符合預期

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/web/70430.shtml
繁體地址,請注明出處:http://hk.pswp.cn/web/70430.shtml
英文地址,請注明出處:http://en.pswp.cn/web/70430.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

DeepSeek模型量化

技術背景 大語言模型&#xff08;Large Language Model&#xff0c;LLM&#xff09;&#xff0c;可以通過量化&#xff08;Quantization&#xff09;操作來節約內存/顯存的使用&#xff0c;并且降低了通訊開銷&#xff0c;進而達到加速模型推理的效果。常見的就是把Float16的浮…

本周行情——250222

本周A股行情展望與策略 結合近期盤面特征及市場主線演化&#xff0c;本周A股預計延續結構性分化行情&#xff0c;科技成長與政策催化板塊仍是資金主戰場&#xff0c;但需警惕高標股分歧帶來的波動。以下是具體分析與策略建議&#xff1a; 1. 行情核心驅動因素 主線延續性&…

【JT/T 808協議】808 協議開發筆記 ② ( 終端注冊 | 終端注冊應答 | 字符編碼轉換網站 )

文章目錄 一、消息頭 數據1、消息頭拼接2、消息 ID 字段3、消息體屬性 字段4、終端手機號 字段5、終端流水號 字段 二、消息體 數據三、校驗碼計算四、最終計算結果五、終端注冊應答1、分解終端應答數據2、終端應答 消息體 數據 六、字符編碼轉換網站 一、消息頭 數據 1、消息頭…

使用ezuikit-js封裝一個對接攝像頭的組件

ezuikit-js 是一個基于 JavaScript 的視頻播放庫&#xff0c;主要用于在網頁中嵌入實時視頻流播放功能。它通常用于與支持 RTSP、RTMP、HLS 等協議的攝像頭或視頻流服務器進行交互&#xff0c;提供流暢的視頻播放體驗。 主要功能 多協議支持&#xff1a;支持 RTSP、RTMP、HLS …

一周學會Flask3 Python Web開發-flask3模塊化blueprint配置

鋒哥原創的Flask3 Python Web開發 Flask3視頻教程&#xff1a; 2025版 Flask3 Python web開發 視頻教程(無廢話版) 玩命更新中~_嗶哩嗶哩_bilibili 我們在項目開發的時候&#xff0c;多多少少會劃分幾個或者幾十個業務模塊&#xff0c;如果把這些模塊的視圖方法都寫在app.py…

DSC數字選擇性呼叫

GMDSS Digital Selective Calling WAVECOM Decoder Online Help 12.0.0 VHF Marine GMDSS/DSC Decode & Scicos Simulation Black Cat Systems &#xff08;一&#xff09;DSC調制方式 DSC&#xff08;Digital Selective Calling&#xff0c;數字選擇性呼叫&#xff0…

科普:你的筆記本電腦中有三個IP:127.0.0.1、無線網 IP 和局域網 IP;兩個域名:localhost和host.docker.internal

三個IP 你的筆記本電腦中有三個IP&#xff1a;127.0.0.1、無線網 IP 和局域網 IP。 在不同的場景下&#xff0c;需要選用不同的 IP 地址&#xff0c;如下為各自的特點及適用場景&#xff1a; 127.0.0.1&#xff08;回環地址&#xff09; 特點 127.0.0.1 是一個特殊的 IP 地…

《AI與NLP:開啟元宇宙社交互動新紀元》

在科技飛速發展的當下&#xff0c;元宇宙正從概念逐步走向現實&#xff0c;成為人們關注的焦點。而在元宇宙諸多令人矚目的特性中&#xff0c;社交互動體驗是其核心魅力之一。人工智能&#xff08;AI&#xff09;與自然語言處理&#xff08;NLP&#xff09;技術的迅猛發展&…

量化方法bitsandbytes hqq eetq區別

量化方法bitsandbytes、HQQ&#xff08;Half-Quadratic Quantization&#xff09;和EETQ&#xff08;Efficient and Effective Ternary Quantization&#xff09;在深度學習模型壓縮和加速中各有特點&#xff0c;以下是它們的區別&#xff1a; 1. bitsandbytes 概述: bitsand…

Hutool - Log:自動識別日志實現的日志門面

一、簡介 在 Java 開發中&#xff0c;日志記錄是一項非常重要的功能&#xff0c;它可以幫助開發者在開發和生產環境中監控程序的運行狀態、排查問題。然而&#xff0c;Java 生態系統中有多種日志實現框架&#xff0c;如 Log4j、Logback、JDK 自帶的日志框架等。為了在不同的項…

偽404兼容huawei生效顯示404

根據上述思考&#xff0c;以下是詳細的中文分步說明&#xff1a; --- **步驟 1&#xff1a;獲取目標設備的User-Agent信息** 首先&#xff0c;我們需要收集目標設備的User-Agent字符串&#xff0c;包括&#xff1a; 1. **iPhone設備的User-Agent**&#xff1a; Mozi…

github配置sshkey

使用命令生成sshkey ssh-keygen -t rsa -b 4096 -C "your_emailexample.com" 依此會要求輸入以下信息&#xff0c;可以使用默認值 設置保存密鑰的路徑 設置SSH密鑰密碼&#xff08;備注&#xff1a;空內容表示不設置SSH密鑰密碼&#xff09; 再次確認SSH密鑰密…

深入理解WebSocket接口:如何使用C++實現行情接口

在現代網絡應用中&#xff0c;實時數據傳輸變得越來越重要。通過WebSocket&#xff0c;我們可以建立一個持久連接&#xff0c;讓服務器和客戶端之間進行雙向通信。這種技術不僅可以提供更快的響應速度&#xff0c;還可以減少不必要的網絡流量。本文將詳細介紹如何使用C來實現We…

FFMPEG編碼容錯處理解決辦法之途徑----升級庫文件

在qt開發環境下接收網絡數據&#xff0c;調用ffmpeg解碼播放視頻&#xff0c;出現閃屏現象&#xff0c;具體現象可以使用操作系統自帶的ffplay播放器播放原始視頻流可復現&#xff1b;而使用操作系統自帶的mpv播放器播放視頻則不會出現閃屏&#xff1b;閃屏時會報Could not fin…

什么是超越編程(逾編程)(元編程?)

超越編程(逾編程)(元編程&#xff1f;)(meta-programming) 目錄 1. meta- 的詞源 2. 逾編程(meta-programming) 的直實含義 2.1 定義 2.2 說明 3. 翻譯成“元編程”應該是一種錯誤 1. meta- 的詞源 這是一個源自希臘語的構詞元素&#xff0c;其有三種含義&#xff…

基于Martin的全國基礎底圖實現

概述 前面有文章基于Martin實現MapboxGL自定義底圖分享了Martin的使用&#xff0c;本文使用網絡收集的數據實現了全國基礎數據的收集和基礎底圖。 實現后效果 實現 1. 數據準備 實例中包含如下數據&#xff1a; 邊界線和九段線數據省邊界面數據省會城市點數據市邊界面數據…

新版Tomcat MySQL IDEA 安裝配置過程遇到的問題

一、IDEA閃退 打不開了 IDEA環境變量路徑不對 二、Tomcat 一閃而過 主要是JDK環境變量不對 三、MySQL 重新安裝、是否備份以及默認盤問題 看清楚教程基本沒問題&#xff1a;Windows 安裝配置及卸載MySQL8超詳細保姆級教程_mysql8卸載-CSDN博客

鏈表_兩兩交換鏈表中的節點

鏈表_兩兩交換鏈表中的節點 一、leetcode-24二、題解1.引庫2.代碼 一、leetcode-24 兩兩交換鏈表中的節點 給你一個鏈表&#xff0c;兩兩交換其中相鄰的節點&#xff0c;并返回交換后鏈表的頭節點。你必須在不修改節點內部的值的情況下完成本題&#xff08;即&#xff0c;只能…

DAY08 List接口、Collections接口、Set接口

學習目標 能夠說出List集合特點1.有序2.允許存儲重復的元素3.有帶索引的方法(練習 add,remove,set,get) 能夠使用集合工具類Collections類:static void sort(List<T> list) 根據元素的自然順序 對指定列表按升序進行排序。static <T> void sort(List<T> lis…

Zookeeper(58)如何在Zookeeper中實現分布式鎖?

在 Zookeeper 中實現分布式鎖是一種常見的用例。Zookeeper 提供了強一致性、高可用性的分布式協調服務&#xff0c;使得它非常適合用來實現分布式鎖。以下是詳細的步驟和代碼示例&#xff0c;展示如何在 Zookeeper 中實現分布式鎖。 1. Zookeeper 分布式鎖的基本原理 Zookeep…